@databiosphere/findable-ui 29.0.2 → 31.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 (283) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +35 -0
  3. package/lib/common/categories/config/types.d.ts +28 -0
  4. package/lib/common/categories/config/utils.d.ts +31 -0
  5. package/lib/common/categories/config/utils.js +29 -0
  6. package/lib/common/categories/models/range/typeGuards.d.ts +14 -0
  7. package/lib/common/categories/models/range/typeGuards.js +18 -0
  8. package/lib/common/categories/models/range/types.d.ts +15 -0
  9. package/lib/common/categories/models/range/types.js +1 -0
  10. package/lib/common/categories/models/range/utils.d.ts +23 -0
  11. package/lib/common/categories/models/range/utils.js +41 -0
  12. package/lib/common/categories/models/select/utils.d.ts +8 -0
  13. package/lib/common/categories/models/select/utils.js +16 -0
  14. package/lib/common/categories/models/types.d.ts +6 -0
  15. package/lib/common/categories/models/types.js +1 -0
  16. package/lib/common/categories/views/common/types.d.ts +10 -0
  17. package/lib/common/categories/views/common/types.js +1 -0
  18. package/lib/common/categories/views/range/typeGuards.d.ts +8 -0
  19. package/lib/common/categories/views/range/typeGuards.js +8 -0
  20. package/lib/common/categories/views/range/types.d.ts +19 -0
  21. package/lib/common/categories/views/range/types.js +1 -0
  22. package/lib/common/categories/views/range/utils.d.ts +12 -0
  23. package/lib/common/categories/views/range/utils.js +24 -0
  24. package/lib/common/categories/views/select/typeGuards.d.ts +8 -0
  25. package/lib/common/categories/views/select/typeGuards.js +8 -0
  26. package/lib/common/categories/views/select/types.d.ts +7 -0
  27. package/lib/common/categories/views/select/types.js +1 -0
  28. package/lib/common/categories/views/types.d.ts +13 -0
  29. package/lib/common/categories/views/types.js +8 -0
  30. package/lib/common/entities.d.ts +8 -23
  31. package/lib/components/DataDictionary/components/Entities/entities.d.ts +3 -1
  32. package/lib/components/DataDictionary/components/Entities/entities.js +1 -1
  33. package/lib/components/DataDictionary/components/Entities/types.d.ts +5 -5
  34. package/lib/components/DataDictionary/components/Entity/entity.d.ts +3 -1
  35. package/lib/components/DataDictionary/components/Entity/entity.js +6 -6
  36. package/lib/components/DataDictionary/components/Entity/types.d.ts +5 -5
  37. package/lib/components/DataDictionary/components/Outline/utils.d.ts +3 -2
  38. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +3 -2
  39. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.js +6 -2
  40. package/lib/components/DataDictionary/components/Table/components/BasicCell/utils.d.ts +9 -0
  41. package/lib/components/DataDictionary/components/Table/components/BasicCell/utils.js +12 -0
  42. package/lib/components/DataDictionary/components/Table/hook.d.ts +3 -3
  43. package/lib/components/DataDictionary/components/Table/hook.js +3 -1
  44. package/lib/components/DataDictionary/components/Table/options/core/constants.d.ts +2 -3
  45. package/lib/components/DataDictionary/components/Table/options/hook.d.ts +2 -2
  46. package/lib/components/DataDictionary/components/Table/options/sorting/constants.d.ts +2 -3
  47. package/lib/components/DataDictionary/components/Table/table.d.ts +2 -1
  48. package/lib/components/DataDictionary/components/Table/table.js +1 -1
  49. package/lib/components/DataDictionary/components/Table/types.d.ts +3 -4
  50. package/lib/components/DataDictionary/dataDictionary.d.ts +3 -1
  51. package/lib/components/DataDictionary/dataDictionary.styles.js +2 -3
  52. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +3 -1
  53. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +5 -5
  54. package/lib/components/Filter/components/Filter/filter.d.ts +2 -2
  55. package/lib/components/Filter/components/Filter/filter.js +11 -3
  56. package/lib/components/Filter/components/Filter/stories/args.d.ts +5 -0
  57. package/lib/components/Filter/components/Filter/stories/args.js +19 -0
  58. package/lib/components/Filter/components/Filter/stories/filter.stories.d.ts +8 -0
  59. package/lib/components/Filter/components/Filter/stories/filter.stories.js +21 -0
  60. package/lib/components/Filter/components/FilterMenu/filterMenu.js +2 -2
  61. package/lib/components/Filter/components/FilterMenu/filterMenu.styles.d.ts +1 -1
  62. package/lib/components/Filter/components/FilterMenu/filterMenu.styles.js +1 -1
  63. package/lib/components/Filter/components/FilterRange/constants.d.ts +0 -2
  64. package/lib/components/Filter/components/FilterRange/constants.js +0 -5
  65. package/lib/components/Filter/components/FilterRange/filterRange.d.ts +1 -1
  66. package/lib/components/Filter/components/FilterRange/filterRange.js +50 -21
  67. package/lib/components/Filter/components/FilterRange/filterRange.styles.js +58 -10
  68. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.d.ts +5 -0
  69. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.js +5 -0
  70. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.d.ts +2 -2
  71. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.js +32 -7
  72. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.d.ts +6 -0
  73. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.js +50 -0
  74. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.d.ts +26 -3
  75. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.js +6 -1
  76. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.d.ts +15 -0
  77. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.js +25 -0
  78. package/lib/components/Filter/components/FilterRange/stories/args.d.ts +3 -0
  79. package/lib/components/Filter/components/FilterRange/stories/args.js +13 -0
  80. package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.js +2 -2
  81. package/lib/components/Filter/components/FilterRange/types.d.ts +10 -6
  82. package/lib/components/Filter/components/FilterRange/types.js +1 -6
  83. package/lib/components/Filter/components/FilterRange/utils.d.ts +8 -0
  84. package/lib/components/Filter/components/FilterRange/utils.js +15 -0
  85. package/lib/components/Filter/components/FilterTag/stories/args.d.ts +5 -0
  86. package/lib/components/Filter/components/FilterTag/stories/args.js +17 -0
  87. package/lib/components/Filter/components/FilterTag/stories/filterTag.stories.d.ts +8 -0
  88. package/lib/components/Filter/components/FilterTag/stories/filterTag.stories.js +21 -0
  89. package/lib/components/Filter/components/FilterTag/utils.d.ts +10 -0
  90. package/lib/components/Filter/components/FilterTag/utils.js +40 -0
  91. package/lib/components/Filter/components/Filters/filters.d.ts +2 -2
  92. package/lib/components/Filter/components/Filters/filters.js +15 -8
  93. package/lib/components/Filter/components/Filters/stories/args.d.ts +3 -0
  94. package/lib/components/Filter/components/Filters/stories/args.js +15 -0
  95. package/lib/components/Filter/components/Filters/stories/constants.d.ts +22 -0
  96. package/lib/components/Filter/components/Filters/stories/constants.js +134 -0
  97. package/lib/components/Filter/components/Filters/stories/filters.stories.d.ts +6 -0
  98. package/lib/components/Filter/components/Filters/stories/filters.stories.js +15 -0
  99. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.d.ts +1 -1
  100. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.js +5 -5
  101. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.js +2 -1
  102. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.d.ts +3 -2
  103. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +6 -4
  104. package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +2 -1
  105. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +2 -0
  106. package/lib/components/Index/table/hook.js +4 -0
  107. package/lib/components/MarkdownRenderer/components/Anchor/anchor.d.ts +19 -0
  108. package/lib/components/MarkdownRenderer/components/Anchor/anchor.js +21 -0
  109. package/lib/components/MarkdownRenderer/components/Table/table.d.ts +3 -0
  110. package/lib/components/MarkdownRenderer/components/Table/table.js +5 -0
  111. package/lib/components/MarkdownRenderer/components/Table/table.styles.d.ts +4 -0
  112. package/lib/components/MarkdownRenderer/components/Table/table.styles.js +40 -0
  113. package/lib/components/MarkdownRenderer/constants.d.ts +2 -0
  114. package/lib/components/MarkdownRenderer/constants.js +6 -0
  115. package/lib/components/MarkdownRenderer/markdownRenderer.d.ts +2 -0
  116. package/lib/components/MarkdownRenderer/markdownRenderer.js +45 -0
  117. package/lib/components/MarkdownRenderer/markdownRenderer.styles.d.ts +4 -0
  118. package/lib/components/MarkdownRenderer/markdownRenderer.styles.js +13 -0
  119. package/lib/components/MarkdownRenderer/types.d.ts +6 -0
  120. package/lib/components/MarkdownRenderer/types.js +1 -0
  121. package/lib/components/Table/columnDef/accessorFn/typeGuards.d.ts +9 -0
  122. package/lib/components/Table/columnDef/accessorFn/typeGuards.js +10 -0
  123. package/lib/components/Table/common/utils.d.ts +2 -2
  124. package/lib/components/Table/common/utils.js +28 -13
  125. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.d.ts +4 -0
  126. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.js +8 -0
  127. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.d.ts +4 -0
  128. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.js +21 -0
  129. package/lib/components/Table/components/TableCell/components/LinkCell/stories/args.d.ts +6 -0
  130. package/lib/components/Table/components/TableCell/components/LinkCell/stories/args.js +27 -0
  131. package/lib/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.d.ts +9 -0
  132. package/lib/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.js +18 -0
  133. package/lib/components/Table/components/TableCell/components/LinkCell/stories/types.d.ts +3 -0
  134. package/lib/components/Table/components/TableCell/components/LinkCell/stories/types.js +1 -0
  135. package/lib/components/Table/components/TableCell/components/LinkCell/utils.d.ts +22 -0
  136. package/lib/components/Table/components/TableCell/components/LinkCell/utils.js +45 -0
  137. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.d.ts +4 -0
  138. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.js +13 -0
  139. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.d.ts +3 -0
  140. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.js +30 -0
  141. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.d.ts +4 -0
  142. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.js +10 -0
  143. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.d.ts +5 -0
  144. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.js +9 -0
  145. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.d.ts +7 -0
  146. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.js +25 -0
  147. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
  148. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
  149. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
  150. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
  151. package/lib/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.d.ts +8 -0
  152. package/lib/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.js +46 -0
  153. package/lib/components/common/Link/typeGuards.d.ts +13 -0
  154. package/lib/components/common/Link/typeGuards.js +21 -0
  155. package/lib/config/entities.d.ts +2 -11
  156. package/lib/hooks/useCategoryFilter.d.ts +8 -13
  157. package/lib/hooks/useCategoryFilter.js +31 -28
  158. package/lib/providers/exploreState/entities.d.ts +5 -3
  159. package/lib/providers/exploreState/payloads/entities.d.ts +6 -2
  160. package/lib/providers/exploreState.d.ts +3 -2
  161. package/lib/providers/exploreState.js +1 -1
  162. package/lib/styles/common/mui/typography.js +1 -0
  163. package/lib/tests/utils.d.ts +24 -0
  164. package/lib/tests/utils.js +34 -0
  165. package/lib/theme/common/components.js +19 -1
  166. package/lib/views/ExploreView/exploreView.js +10 -8
  167. package/package.json +7 -1
  168. package/src/common/categories/config/types.ts +42 -0
  169. package/src/common/categories/config/utils.ts +47 -0
  170. package/src/common/categories/models/range/typeGuards.ts +24 -0
  171. package/src/common/categories/models/range/types.ts +17 -0
  172. package/src/common/categories/models/range/utils.ts +51 -0
  173. package/src/common/categories/models/select/utils.ts +23 -0
  174. package/src/common/categories/models/types.ts +7 -0
  175. package/src/common/categories/views/common/types.ts +11 -0
  176. package/src/common/categories/views/range/typeGuards.ts +13 -0
  177. package/src/common/categories/views/range/types.ts +21 -0
  178. package/src/common/categories/views/range/utils.ts +35 -0
  179. package/src/common/categories/views/select/typeGuards.ts +13 -0
  180. package/src/common/categories/views/select/types.ts +8 -0
  181. package/src/common/categories/views/types.ts +15 -0
  182. package/src/common/entities.ts +8 -26
  183. package/src/components/DataDictionary/components/Entities/entities.tsx +7 -5
  184. package/src/components/DataDictionary/components/Entities/types.ts +5 -9
  185. package/src/components/DataDictionary/components/Entity/entity.tsx +9 -7
  186. package/src/components/DataDictionary/components/Entity/types.ts +5 -9
  187. package/src/components/DataDictionary/components/Outline/utils.ts +5 -2
  188. package/src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx +12 -4
  189. package/src/components/DataDictionary/components/Table/components/BasicCell/utils.ts +13 -0
  190. package/src/components/DataDictionary/components/Table/hook.ts +16 -8
  191. package/src/components/DataDictionary/components/Table/options/core/constants.ts +2 -3
  192. package/src/components/DataDictionary/components/Table/options/hook.ts +3 -3
  193. package/src/components/DataDictionary/components/Table/options/sorting/constants.ts +2 -6
  194. package/src/components/DataDictionary/components/Table/table.tsx +4 -1
  195. package/src/components/DataDictionary/components/Table/types.ts +3 -4
  196. package/src/components/DataDictionary/dataDictionary.styles.ts +2 -3
  197. package/src/components/DataDictionary/dataDictionary.tsx +4 -2
  198. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +9 -2
  199. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +5 -9
  200. package/src/components/Filter/components/Filter/filter.tsx +38 -13
  201. package/src/components/Filter/components/Filter/stories/args.ts +24 -0
  202. package/src/components/Filter/components/Filter/stories/filter.stories.tsx +32 -0
  203. package/src/components/Filter/components/FilterMenu/filterMenu.styles.ts +1 -1
  204. package/src/components/Filter/components/FilterMenu/filterMenu.tsx +7 -3
  205. package/src/components/Filter/components/FilterRange/constants.ts +0 -7
  206. package/src/components/Filter/components/FilterRange/filterRange.styles.ts +58 -14
  207. package/src/components/Filter/components/FilterRange/filterRange.tsx +112 -40
  208. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.ts +5 -0
  209. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.ts +51 -10
  210. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.ts +60 -0
  211. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/types.ts +34 -3
  212. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.ts +32 -0
  213. package/src/components/Filter/components/FilterRange/stories/args.ts +16 -0
  214. package/src/components/Filter/components/FilterRange/stories/filterRange.stories.tsx +2 -2
  215. package/src/components/Filter/components/FilterRange/types.ts +12 -6
  216. package/src/components/Filter/components/FilterRange/utils.ts +16 -0
  217. package/src/components/Filter/components/FilterTag/stories/args.ts +22 -0
  218. package/src/components/Filter/components/FilterTag/stories/filterTag.stories.tsx +32 -0
  219. package/src/components/Filter/components/FilterTag/utils.ts +57 -0
  220. package/src/components/Filter/components/Filters/filters.tsx +21 -12
  221. package/src/components/Filter/components/Filters/stories/args.ts +24 -0
  222. package/src/components/Filter/components/Filters/stories/constants.ts +151 -0
  223. package/src/components/Filter/components/Filters/stories/filters.stories.tsx +24 -0
  224. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.tsx +32 -29
  225. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.tsx +9 -1
  226. package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +12 -6
  227. package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +2 -1
  228. package/src/components/Index/components/EntitiesView/components/ChartView/utils.ts +2 -0
  229. package/src/components/Index/table/hook.ts +4 -0
  230. package/src/components/MarkdownRenderer/components/Anchor/anchor.tsx +34 -0
  231. package/src/components/MarkdownRenderer/components/Table/table.styles.ts +41 -0
  232. package/src/components/MarkdownRenderer/components/Table/table.tsx +13 -0
  233. package/src/components/MarkdownRenderer/constants.ts +8 -0
  234. package/src/components/MarkdownRenderer/markdownRenderer.styles.ts +16 -0
  235. package/src/components/MarkdownRenderer/markdownRenderer.tsx +62 -0
  236. package/src/components/MarkdownRenderer/types.ts +7 -0
  237. package/src/components/Table/columnDef/accessorFn/typeGuards.ts +15 -0
  238. package/src/components/Table/common/utils.ts +37 -16
  239. package/src/components/Table/components/TableCell/components/ChipCell/chipCell.tsx +16 -0
  240. package/src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx +64 -0
  241. package/src/components/Table/components/TableCell/components/LinkCell/stories/args.ts +35 -0
  242. package/src/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.tsx +32 -0
  243. package/src/components/Table/components/TableCell/components/LinkCell/stories/types.ts +4 -0
  244. package/src/components/Table/components/TableCell/components/LinkCell/utils.ts +59 -0
  245. package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.ts +31 -0
  246. package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.tsx +29 -0
  247. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/args.ts +17 -0
  248. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/constants.ts +11 -0
  249. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.tsx +37 -0
  250. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/types.ts +4 -0
  251. package/src/components/Table/components/TableCell/components/MarkdownCell/types.ts +3 -0
  252. package/src/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.ts +64 -0
  253. package/src/components/common/Link/typeGuards.ts +35 -0
  254. package/src/config/entities.ts +1 -14
  255. package/src/hooks/useCategoryFilter.ts +56 -53
  256. package/src/providers/exploreState/entities.ts +3 -3
  257. package/src/providers/exploreState/initializer/utils.ts +1 -1
  258. package/src/providers/exploreState/payloads/entities.ts +5 -2
  259. package/src/providers/exploreState.tsx +5 -3
  260. package/src/styles/common/mui/typography.ts +1 -0
  261. package/src/tests/utils.ts +44 -0
  262. package/src/theme/common/components.ts +19 -1
  263. package/src/views/ExploreView/exploreView.tsx +17 -22
  264. package/tests/filter.test.tsx +100 -0
  265. package/tests/filterRange.test.tsx +331 -46
  266. package/tests/filters.test.tsx +61 -0
  267. package/tests/getFacetedMinMaxValues.test.ts +166 -0
  268. package/tests/linkCell.test.tsx +89 -0
  269. package/tests/markdownCell.test.tsx +53 -0
  270. package/types/data-explorer-ui.d.ts +2 -0
  271. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +0 -3
  272. package/lib/components/Filter/components/Filter/filter.stories.d.ts +0 -25
  273. package/lib/components/Filter/components/Filter/filter.stories.js +0 -42
  274. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +0 -16
  275. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +0 -17
  276. package/lib/components/Filter/components/Filters/filters.stories.d.ts +0 -6
  277. package/lib/components/Filter/components/Filters/filters.stories.js +0 -91
  278. package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +0 -7
  279. package/src/components/Filter/components/Filter/filter.stories.tsx +0 -52
  280. package/src/components/Filter/components/FilterTag/filterTag.stories.tsx +0 -23
  281. package/src/components/Filter/components/Filters/filters.stories.tsx +0 -101
  282. package/tests/filterRangeMock.test.tsx +0 -38
  283. /package/lib/{components/DataDictionary/components/Table/components/BasicCell → common/categories/config}/types.js +0 -0
@@ -46,9 +46,10 @@ export const ExploreView = (props) => {
46
46
  * @param selectedCategoryValue - The value to set or clear.
47
47
  * @param selected - Indication of whether the selected value is being set or cleared.
48
48
  * @param categorySection - Name of group the category is in.
49
+ * @param viewKind - View kind.
49
50
  * @param searchTerm - Search term used to find the value.
50
51
  */
51
- const onFilterChange = (fromSearchAll, categoryKey, selectedCategoryValue, selected, categorySection, searchTerm) => {
52
+ const onFilterChange = (fromSearchAll, categoryKey, selectedCategoryValue, selected, categorySection, viewKind, searchTerm) => {
52
53
  const dispatchType = categoryKey === SELECT_CATEGORY_KEY.SAVED_FILTERS
53
54
  ? ExploreActionKind.ApplySavedFilter
54
55
  : ExploreActionKind.UpdateFilter;
@@ -57,6 +58,7 @@ export const ExploreView = (props) => {
57
58
  categoryKey,
58
59
  selected,
59
60
  selectedValue: selectedCategoryValue,
61
+ viewKind,
60
62
  },
61
63
  type: dispatchType,
62
64
  });
@@ -107,25 +109,25 @@ export const ExploreView = (props) => {
107
109
  };
108
110
  /**
109
111
  * Builds the category views into category views grouped by the given category group configuration.
110
- * @param selectCategoryViews - View models of categories to display.
112
+ * @param categoryViews - View models of categories to display.
111
113
  * @param categoryGroups - Category groups.
112
114
  * @returns category filters.
113
115
  */
114
- function buildCategoryFilters(selectCategoryViews, categoryGroups) {
116
+ function buildCategoryFilters(categoryViews, categoryGroups) {
115
117
  if (!categoryGroups) {
116
- return [{ categoryViews: selectCategoryViews }];
118
+ return [{ categoryViews }];
117
119
  }
118
120
  return categoryGroups.reduce((accGroups, { categoryConfigs, label }) => {
119
121
  // Grab the category views for the configured grouped categories.
120
- const categoryViews = categoryConfigs.reduce((accViews, { key: categoryKey }) => {
121
- const categoryView = selectCategoryViews.find(({ key }) => key === categoryKey);
122
+ const views = categoryConfigs.reduce((accViews, { key: categoryKey }) => {
123
+ const categoryView = categoryViews.find(({ key }) => key === categoryKey);
122
124
  if (categoryView) {
123
125
  accViews.push(categoryView);
124
126
  }
125
127
  return accViews;
126
128
  }, []);
127
- if (categoryViews.length > 0) {
128
- accGroups.push({ categoryViews, label });
129
+ if (views.length > 0) {
130
+ accGroups.push({ categoryViews: views, label });
129
131
  }
130
132
  return accGroups;
131
133
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "29.0.2",
3
+ "version": "31.0.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -24,6 +24,7 @@
24
24
  "devDependencies": {
25
25
  "@commitlint/cli": "^17.4.2",
26
26
  "@commitlint/config-conventional": "^17.4.2",
27
+ "@emotion/jest": "^11.13.0",
27
28
  "@mui/types": "^7.4.0",
28
29
  "@next/eslint-plugin-next": "^14.2.28",
29
30
  "@storybook/addon-actions": "^8.6.4",
@@ -61,6 +62,11 @@
61
62
  "jest-fetch-mock": "^3.0.3",
62
63
  "prettier": "^2.8.3",
63
64
  "prettier-plugin-organize-imports": "^3.2.2",
65
+ "rehype-raw": "^7.0.0",
66
+ "rehype-react": "^8.0.0",
67
+ "rehype-sanitize": "^6.0.0",
68
+ "remark-gfm": "^4.0.1",
69
+ "remark-rehype": "^11.1.2",
64
70
  "storybook": "^8.6.4",
65
71
  "ts-jest": "^29.2.5",
66
72
  "typescript": "^5.5.4"
@@ -0,0 +1,42 @@
1
+ import {
2
+ CategoryKey,
3
+ DataDictionaryAnnotation,
4
+ SelectCategoryValueView,
5
+ } from "../../entities";
6
+ import { RangeViewKind } from "../views/range/types";
7
+ import { SelectViewKind } from "../views/select/types";
8
+
9
+ /**
10
+ * Category config.
11
+ */
12
+ export type CategoryConfig = RangeCategoryConfig | SelectCategoryConfig;
13
+
14
+ /**
15
+ * Common category config.
16
+ */
17
+ export interface CommonCategoryConfig {
18
+ annotation?: DataDictionaryAnnotation;
19
+ key: CategoryKey;
20
+ label: string; // human readable label
21
+ }
22
+
23
+ /**
24
+ * Range category config.
25
+ */
26
+ export interface RangeCategoryConfig
27
+ extends CommonCategoryConfig,
28
+ RangeViewKind {
29
+ unit?: string; // e.g. "kg"
30
+ }
31
+
32
+ /**
33
+ * Select category config.
34
+ */
35
+ export interface SelectCategoryConfig
36
+ extends CommonCategoryConfig,
37
+ SelectViewKind {
38
+ enableChartView?: boolean;
39
+ mapSelectCategoryValue?: (
40
+ selectCategoryValue: SelectCategoryValueView
41
+ ) => SelectCategoryValueView;
42
+ }
@@ -0,0 +1,47 @@
1
+ import { Category } from "../models/types";
2
+ import { VIEW_KIND } from "../views/types";
3
+ import { CategoryConfig } from "./types";
4
+
5
+ /**
6
+ * Returns the category config for the given category config key and view kind.
7
+ * @param viewKind - View kind.
8
+ * @param key - Category config key.
9
+ * @param configs - Category configs.
10
+ * @returns category config.
11
+ */
12
+ export function findCategoryConfig<V extends VIEW_KIND>(
13
+ viewKind: V,
14
+ key: Category["key"],
15
+ configs: CategoryConfig[]
16
+ ): Extract<CategoryConfig, { viewKind: V }> | undefined {
17
+ return configs.find(
18
+ (c): c is Extract<CategoryConfig, { viewKind: V }> =>
19
+ c.viewKind === viewKind && c.key === key
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Returns the range category config for the given category config key.
25
+ * @param key - Category config key.
26
+ * @param configs - Category configs.
27
+ * @returns category config.
28
+ */
29
+ export function findRangeCategoryConfig(
30
+ key: Category["key"],
31
+ configs: CategoryConfig[]
32
+ ): Extract<CategoryConfig, { viewKind: VIEW_KIND.RANGE }> | undefined {
33
+ return findCategoryConfig(VIEW_KIND.RANGE, key, configs);
34
+ }
35
+
36
+ /**
37
+ * Returns the select category config for the given category config key.
38
+ * @param key - Category config key.
39
+ * @param configs - Category configs.
40
+ * @returns category config.
41
+ */
42
+ export function findSelectCategoryConfig(
43
+ key: Category["key"],
44
+ configs: CategoryConfig[]
45
+ ): Extract<CategoryConfig, { viewKind?: VIEW_KIND.SELECT }> | undefined {
46
+ return findCategoryConfig(VIEW_KIND.SELECT, key, configs);
47
+ }
@@ -0,0 +1,24 @@
1
+ import { Category } from "../types";
2
+ import { RangeCategory, SelectedRange } from "./types";
3
+
4
+ /**
5
+ * Determine if category is a range category.
6
+ * @param category - Category to check if range category.
7
+ * @returns true if category is a range category.
8
+ */
9
+ export function isRangeCategory(category: Category): category is RangeCategory {
10
+ return "max" in category && "min" in category;
11
+ }
12
+
13
+ /**
14
+ * Determine if value is a selected range.
15
+ * @param value - Value to check if selected range.
16
+ * @returns true if value is a selected range.
17
+ */
18
+ export function isSelectedRange(value: unknown): value is SelectedRange {
19
+ return (
20
+ Array.isArray(value) &&
21
+ value.length === 2 &&
22
+ value.every((v) => v === null || typeof v === "number")
23
+ );
24
+ }
@@ -0,0 +1,17 @@
1
+ import { CategoryKey } from "../../../entities";
2
+
3
+ /**
4
+ * Internal filter model of a range category.
5
+ */
6
+ export interface RangeCategory {
7
+ key: CategoryKey;
8
+ max: number;
9
+ min: number;
10
+ selectedMax: SelectedRange[1];
11
+ selectedMin: SelectedRange[0];
12
+ }
13
+
14
+ /**
15
+ * Min and max values selected in range category.
16
+ */
17
+ export type SelectedRange = [number | null, number | null];
@@ -0,0 +1,51 @@
1
+ import { CategoryValueKey, SelectedFilter } from "../../../entities";
2
+ import { isSelectedRange } from "./typeGuards";
3
+ import { SelectedRange } from "./types";
4
+
5
+ /**
6
+ * Asserts that the given value is a selected range.
7
+ * Throws an error if the value is not a selected range.
8
+ * @param value - Value to assert is a selected range.
9
+ */
10
+ export function assertIsRange(value: unknown): asserts value is SelectedRange {
11
+ if (!isSelectedRange(value)) {
12
+ throw new Error("Value is not SelectedRange");
13
+ }
14
+ }
15
+
16
+ /**
17
+ * Build the next filter state for the given range category.
18
+ * @param nextCategorySelectedFilter - Next filter state for the range category.
19
+ * @param selectedValue - Selected value for the range category.
20
+ * @param selected - Whether the category value is selected.
21
+ */
22
+ export function buildNextRangeFilterState(
23
+ nextCategorySelectedFilter: SelectedFilter,
24
+ selectedValue: CategoryValueKey,
25
+ selected: boolean
26
+ ): void {
27
+ if (selected) {
28
+ // Assert that the selected value is a range.
29
+ assertIsRange(selectedValue);
30
+ // Set the selected range.
31
+ nextCategorySelectedFilter.value = selectedValue;
32
+ } else {
33
+ // Remove the selected range.
34
+ nextCategorySelectedFilter.value = [];
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Get the selected values for the given category, if any.
40
+ * Handles type checking for selected range.
41
+ * Falls back to empty array if no selected values or invalid type (should never happen).
42
+ * @param categorySelectedFilter - Current filter state for a category.
43
+ * @returns The selected filter (i.e. the set of selected values) for the given category.
44
+ */
45
+ export function getRangeSelectedValue(
46
+ categorySelectedFilter?: SelectedFilter
47
+ ): SelectedRange {
48
+ return isSelectedRange(categorySelectedFilter?.value)
49
+ ? categorySelectedFilter?.value
50
+ : [null, null];
51
+ }
@@ -0,0 +1,23 @@
1
+ import { CategoryValueKey, SelectedFilter } from "../../../entities";
2
+
3
+ /**
4
+ * Build the next filter state for the given select category.
5
+ * @param nextCategorySelectedFilter - Next filter state for the select category.
6
+ * @param selectedValue - Selected value for the select category.
7
+ * @param selected - Whether the category value is selected.
8
+ */
9
+ export function buildNextSelectFilterState(
10
+ nextCategorySelectedFilter: SelectedFilter,
11
+ selectedValue: CategoryValueKey,
12
+ selected: boolean
13
+ ): void {
14
+ if (selected) {
15
+ // Set the selected value.
16
+ nextCategorySelectedFilter.value.push(selectedValue);
17
+ } else {
18
+ // Remove the selected value from the selected set of values.
19
+ nextCategorySelectedFilter.value = nextCategorySelectedFilter.value.filter(
20
+ (value: CategoryValueKey) => value !== selectedValue
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ import { SelectCategory } from "../../entities";
2
+ import { RangeCategory } from "./range/types";
3
+
4
+ /**
5
+ * Internal filter model of a category.
6
+ */
7
+ export type Category = SelectCategory | RangeCategory;
@@ -0,0 +1,11 @@
1
+ import { CategoryKey, DataDictionaryAnnotation } from "../../../entities";
2
+
3
+ /**
4
+ * Common properties for category views.
5
+ */
6
+ export interface BaseCategoryView {
7
+ annotation?: DataDictionaryAnnotation;
8
+ isDisabled?: boolean;
9
+ key: CategoryKey;
10
+ label: string;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { CategoryView } from "../types";
2
+ import { RangeCategoryView } from "./types";
3
+
4
+ /**
5
+ * Returns true if the category view is a range category view.
6
+ * @param view - Category view.
7
+ * @returns true if the category view is a range category view.
8
+ */
9
+ export function isRangeCategoryView(
10
+ view: CategoryView
11
+ ): view is RangeCategoryView {
12
+ return "max" in view && "min" in view;
13
+ }
@@ -0,0 +1,21 @@
1
+ import { SelectedRange } from "../../models/range/types";
2
+ import { BaseCategoryView } from "../common/types";
3
+ import { VIEW_KIND } from "../types";
4
+
5
+ /**
6
+ * View model of range category.
7
+ */
8
+ export interface RangeCategoryView extends BaseCategoryView {
9
+ max: number;
10
+ min: number;
11
+ selectedMax: SelectedRange[1];
12
+ selectedMin: SelectedRange[0];
13
+ unit?: string;
14
+ }
15
+
16
+ /**
17
+ * Model of range category view kind.
18
+ */
19
+ export interface RangeViewKind {
20
+ viewKind: VIEW_KIND.RANGE;
21
+ }
@@ -0,0 +1,35 @@
1
+ import { SelectedFilter } from "../../../entities";
2
+ import { CategoryConfig } from "../../config/types";
3
+ import { findRangeCategoryConfig } from "../../config/utils";
4
+ import { RangeCategory } from "../../models/range/types";
5
+ import { getRangeSelectedValue } from "../../models/range/utils";
6
+ import { RangeCategoryView } from "../../views/range/types";
7
+
8
+ /**
9
+ * Build the view-specific model of the given range category.
10
+ * @param category - The range category to build a view model of.
11
+ * @param categoryConfigs - Category configs indicating accept list as well as label configuration.
12
+ * @param categorySelectedFilter - Current filter state for a category.
13
+ * @returns Full built range category view, ready for display.
14
+ */
15
+ export function buildRangeCategoryView(
16
+ category: RangeCategory,
17
+ categoryConfigs: CategoryConfig[],
18
+ categorySelectedFilter?: SelectedFilter
19
+ ): RangeCategoryView {
20
+ const categoryConfig = findRangeCategoryConfig(category.key, categoryConfigs);
21
+ const [selectedMin, selectedMax] = getRangeSelectedValue(
22
+ categorySelectedFilter
23
+ );
24
+ return {
25
+ annotation: categoryConfig?.annotation,
26
+ isDisabled: false,
27
+ key: category.key,
28
+ label: categoryConfig?.label || category.key,
29
+ max: category.max,
30
+ min: category.min,
31
+ selectedMax,
32
+ selectedMin,
33
+ unit: categoryConfig?.unit,
34
+ };
35
+ }
@@ -0,0 +1,13 @@
1
+ import { SelectCategoryView } from "../../../entities";
2
+ import { CategoryView } from "../types";
3
+
4
+ /**
5
+ * Returns true if the category view is a select category view.
6
+ * @param view - Category view.
7
+ * @returns true if the category view is a select category view.
8
+ */
9
+ export function isSelectCategoryView(
10
+ view: CategoryView
11
+ ): view is SelectCategoryView {
12
+ return "values" in view;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { VIEW_KIND } from "../types";
2
+
3
+ /**
4
+ * Model of select category view kind.
5
+ */
6
+ export interface SelectViewKind {
7
+ viewKind?: VIEW_KIND.SELECT;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { SelectCategoryView } from "../../entities";
2
+ import { RangeCategoryView } from "./range/types";
3
+
4
+ /**
5
+ * Possible category view model types.
6
+ */
7
+ export type CategoryView = RangeCategoryView | SelectCategoryView;
8
+
9
+ /**
10
+ * Category view kind.
11
+ */
12
+ export enum VIEW_KIND {
13
+ RANGE = "RANGE",
14
+ SELECT = "SELECT",
15
+ }
@@ -1,4 +1,4 @@
1
- import { ColumnDef } from "@tanstack/react-table";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
2
2
 
3
3
  /**
4
4
  * Model of a value of a metadata class.
@@ -18,11 +18,6 @@ export interface Attribute {
18
18
  values?: string; // Free text description of attribute values
19
19
  }
20
20
 
21
- /**
22
- * Model of attribute key types; used mostly when building data dictionary column definitions.
23
- */
24
- export type AttributeValueTypes = string | boolean;
25
-
26
21
  /**
27
22
  * Filterable metadata keys.
28
23
  */
@@ -40,8 +35,8 @@ export interface CategoryTag {
40
35
  /**
41
36
  * Model of a metadata class, to be specified manually or built from LinkML schema.
42
37
  */
43
- export interface Class {
44
- attributes: Attribute[];
38
+ export interface Class<T extends RowData = Attribute> {
39
+ attributes: T[];
45
40
  description: string;
46
41
  name: string; // Programmatic name or key (e.g. cell, sample)
47
42
  title: string; // Display name
@@ -61,37 +56,24 @@ export type DataDictionaryPrefix = Record<string, string>;
61
56
  /**
62
57
  * Model of a metadata dictionary containing a set of classes and their definitions.
63
58
  */
64
- export interface DataDictionary {
59
+ export interface DataDictionary<T extends RowData = Attribute> {
65
60
  annotations?: {
66
61
  [key in keyof DataDictionaryPrefix]: string; // Prefix to title e.g. "cxg": "CELLxGENE"
67
62
  };
68
- classes: Class[];
63
+ classes: Class<T>[];
69
64
  description?: string; // Free text description of data dictionary
70
65
  name: string; // Programmatic name or key (e.g. tier1, hca)
71
66
  prefixes?: DataDictionaryPrefix;
72
67
  title: string; // Display name
73
68
  }
74
69
 
75
- /**
76
- * Display model of a data dictionary column.
77
- */
78
- export interface DataDictionaryColumnDef {
79
- attributeDisplayName: string;
80
- attributeSlotName: string;
81
- // Adding width here for now; possibly revisit separating column def and UI.
82
- width: {
83
- max: string;
84
- min: string;
85
- };
86
- }
87
-
88
70
  /**
89
71
  * Configuration of data dictionary; contains schema definition (that is, the actual data
90
72
  * dictionary) as well as column def for displaying the data dictionary.
91
73
  */
92
- export interface DataDictionaryConfig {
93
- columnDefs: ColumnDef<Attribute, AttributeValueTypes>[];
94
- dataDictionary: DataDictionary;
74
+ export interface DataDictionaryConfig<T extends RowData = Attribute> {
75
+ columnDefs: ColumnDef<T, T[keyof T]>[];
76
+ dataDictionary: DataDictionary<T>;
95
77
  }
96
78
 
97
79
  /**
@@ -1,20 +1,22 @@
1
1
  import { Grid } from "@mui/material";
2
+ import { RowData } from "@tanstack/react-table";
2
3
  import React from "react";
4
+ import { Attribute } from "../../../../common/entities";
3
5
  import { Entity } from "../Entity/entity";
4
6
  import { GRID_PROPS } from "./constants";
5
7
  import { ClassesProps } from "./types";
6
8
 
7
- export const Entities = ({
9
+ export const Entities = <T extends RowData = Attribute>({
8
10
  classes,
9
11
  columnDefs,
10
12
  spacing,
11
- }: ClassesProps): JSX.Element => {
13
+ }: ClassesProps<T>): JSX.Element => {
12
14
  return (
13
15
  <Grid {...GRID_PROPS}>
14
- {classes.map((classData) => (
16
+ {classes.map((cls) => (
15
17
  <Entity
16
- key={classData.name}
17
- class={classData}
18
+ key={cls.name}
19
+ class={cls}
18
20
  columnDefs={columnDefs}
19
21
  spacing={spacing}
20
22
  />
@@ -1,13 +1,9 @@
1
- import { ColumnDef } from "@tanstack/react-table";
2
- import {
3
- Attribute,
4
- AttributeValueTypes,
5
- Class,
6
- } from "../../../../common/entities";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
2
+ import { Attribute, Class } from "../../../../common/entities";
7
3
  import { LayoutSpacing } from "../../hooks/UseLayoutSpacing/types";
8
4
 
9
- export interface ClassesProps {
10
- classes: Class[];
11
- columnDefs: ColumnDef<Attribute, AttributeValueTypes>[];
5
+ export interface ClassesProps<T extends RowData = Attribute> {
6
+ classes: Class<T>[];
7
+ columnDefs: ColumnDef<T, T[keyof T]>[];
12
8
  spacing?: LayoutSpacing;
13
9
  }
@@ -1,5 +1,7 @@
1
1
  import { Grid, Typography } from "@mui/material";
2
+ import { RowData } from "@tanstack/react-table";
2
3
  import React from "react";
4
+ import { Attribute } from "../../../../common/entities";
3
5
  import { TYPOGRAPHY_PROPS } from "../../../../styles/common/mui/typography";
4
6
  import { AnchorLink } from "../../../common/AnchorLink/anchorLink";
5
7
  import { useTable } from "../Table/hook";
@@ -8,29 +10,29 @@ import { GRID_PROPS } from "./constants";
8
10
  import { StyledTypography } from "./entity.styles";
9
11
  import { EntityProps } from "./types";
10
12
 
11
- export const Entity = ({
12
- class: classData,
13
+ export const Entity = <T extends RowData = Attribute>({
14
+ class: cls,
13
15
  columnDefs,
14
16
  spacing,
15
- }: EntityProps): JSX.Element => {
16
- const table = useTable(classData.attributes, columnDefs);
17
+ }: EntityProps<T>): JSX.Element => {
18
+ const table = useTable<T>(cls.attributes, columnDefs);
17
19
  return (
18
20
  <Grid {...GRID_PROPS} rowGap={4}>
19
21
  <Grid {...GRID_PROPS} rowGap={1}>
20
22
  <StyledTypography
21
23
  component="h3"
22
- id={classData.name}
24
+ id={cls.name}
23
25
  variant={TYPOGRAPHY_PROPS.VARIANT.TEXT_HEADING_SMALL}
24
26
  {...spacing}
25
27
  >
26
- {classData.title} <AnchorLink anchorLink={classData.name} />
28
+ {cls.title} <AnchorLink anchorLink={cls.name} />
27
29
  </StyledTypography>
28
30
  <Typography
29
31
  color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
30
32
  component="div"
31
33
  variant={TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_400_2_LINES}
32
34
  >
33
- {classData.description}
35
+ {cls.description}
34
36
  </Typography>
35
37
  </Grid>
36
38
  <Table table={table} />
@@ -1,13 +1,9 @@
1
- import { ColumnDef } from "@tanstack/react-table";
2
- import {
3
- Attribute,
4
- AttributeValueTypes,
5
- Class,
6
- } from "../../../../common/entities";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
2
+ import { Attribute, Class } from "../../../../common/entities";
7
3
  import { LayoutSpacing } from "../../hooks/UseLayoutSpacing/types";
8
4
 
9
- export interface EntityProps {
10
- class: Class;
11
- columnDefs: ColumnDef<Attribute, AttributeValueTypes>[];
5
+ export interface EntityProps<T extends RowData = Attribute> {
6
+ class: Class<T>;
7
+ columnDefs: ColumnDef<T, T[keyof T]>[];
12
8
  spacing?: LayoutSpacing;
13
9
  }
@@ -1,4 +1,5 @@
1
- import { Class } from "../../../../common/entities";
1
+ import { RowData } from "@tanstack/react-table";
2
+ import { Attribute, Class } from "../../../../common/entities";
2
3
  import { OutlineItem } from "../../../Layout/components/Outline/types";
3
4
 
4
5
  /**
@@ -6,7 +7,9 @@ import { OutlineItem } from "../../../Layout/components/Outline/types";
6
7
  * @param classes - Class entities.
7
8
  * @returns Outline items.
8
9
  */
9
- export function buildClassesOutline(classes: Class[]): OutlineItem[] {
10
+ export function buildClassesOutline<T extends RowData = Attribute>(
11
+ classes: Class<T>[]
12
+ ): OutlineItem[] {
10
13
  return classes.map(({ name, title }) => {
11
14
  return {
12
15
  depth: 2,
@@ -1,12 +1,20 @@
1
1
  import { Typography } from "@mui/material";
2
- import React from "react";
2
+ import { CellContext, RowData } from "@tanstack/react-table";
3
+ import React, { ReactNode } from "react";
3
4
  import { TYPOGRAPHY_PROPS } from "../../../../../../styles/common/mui/typography";
4
- import { BasicCellProps } from "./types";
5
+ import { parseValue } from "./utils";
5
6
 
6
- export const BasicCell = ({ getValue }: BasicCellProps): JSX.Element => {
7
+ export const BasicCell = <
8
+ T extends RowData,
9
+ TValue extends ReactNode = ReactNode
10
+ >({
11
+ getValue,
12
+ }: CellContext<T, TValue>): JSX.Element | null => {
13
+ const value = getValue();
14
+ if (value === undefined || value === null) return null;
7
15
  return (
8
16
  <Typography variant={TYPOGRAPHY_PROPS.VARIANT.INHERIT}>
9
- {getValue()}
17
+ {parseValue(value)}
10
18
  </Typography>
11
19
  );
12
20
  };