@databiosphere/findable-ui 35.1.0 → 36.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 (367) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +27 -0
  3. package/lib/common/entities.d.ts +2 -3
  4. package/lib/components/DataDictionary/components/Entities/constants.d.ts +3 -1
  5. package/lib/components/DataDictionary/components/Entities/constants.js +6 -2
  6. package/lib/components/DataDictionary/components/Entities/entities.js +6 -2
  7. package/lib/components/DataDictionary/components/Entities/entities.styles.d.ts +3 -0
  8. package/lib/components/DataDictionary/components/Entities/entities.styles.js +5 -0
  9. package/lib/components/DataDictionary/components/Entity/entity.styles.js +1 -8
  10. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.d.ts +4 -0
  11. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.js +15 -0
  12. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.d.ts +7 -0
  13. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.js +7 -0
  14. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.d.ts +2 -0
  15. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.js +6 -0
  16. package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.d.ts +6 -0
  17. package/lib/components/DataDictionary/components/Filters/filters.js +2 -0
  18. package/lib/components/DataDictionary/components/Filters/filters.styles.js +3 -3
  19. package/lib/components/DataDictionary/components/Filters/stories/constants.d.ts +1 -0
  20. package/lib/components/DataDictionary/components/Filters/stories/constants.js +16 -0
  21. package/lib/components/DataDictionary/components/Filters/stories/filters.stories.js +11 -3
  22. package/lib/components/DataDictionary/components/Filters/stories/hook.d.ts +4 -0
  23. package/lib/components/DataDictionary/components/Filters/stories/hook.js +4 -0
  24. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.d.ts +2 -1
  25. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.js +4 -4
  26. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +1 -4
  27. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/types.d.ts +4 -2
  28. package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.d.ts +2 -1
  29. package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.js +4 -4
  30. package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.js +4 -1
  31. package/lib/components/DataDictionary/components/Table/hook.d.ts +2 -2
  32. package/lib/components/DataDictionary/components/Table/hook.js +8 -4
  33. package/lib/components/DataDictionary/components/Table/options/columnFilters/constants.js +2 -1
  34. package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.d.ts +2 -5
  35. package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.js +8 -6
  36. package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.d.ts +2 -0
  37. package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.js +5 -0
  38. package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.d.ts +3 -0
  39. package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.js +16 -0
  40. package/lib/components/DataDictionary/components/Table/options/hook.js +7 -5
  41. package/lib/components/DataDictionary/components/Table/options/pagination/constants.d.ts +2 -0
  42. package/lib/components/DataDictionary/components/Table/options/pagination/constants.js +3 -0
  43. package/lib/components/DataDictionary/dataDictionary.d.ts +1 -1
  44. package/lib/components/DataDictionary/dataDictionary.js +31 -12
  45. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.d.ts +4 -0
  46. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.js +27 -0
  47. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.d.ts +7 -0
  48. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.js +1 -0
  49. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.d.ts +6 -0
  50. package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.js +8 -0
  51. package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.d.ts +2 -0
  52. package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.js +17 -0
  53. package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.d.ts +7 -0
  54. package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.js +1 -0
  55. package/lib/components/DataDictionary/types.d.ts +1 -0
  56. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +21 -29
  57. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestSpreadsheet/fileManifestSpreadsheet.js +21 -36
  58. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.d.ts +2 -0
  59. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.js +22 -0
  60. package/lib/components/Filter/components/FilterCountChip/filterCountChip.d.ts +2 -0
  61. package/lib/components/Filter/components/FilterCountChip/filterCountChip.js +8 -0
  62. package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.d.ts +3 -0
  63. package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.js +18 -0
  64. package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.d.ts +6 -0
  65. package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.js +6 -0
  66. package/lib/components/Filter/components/FilterCountChip/types.d.ts +5 -0
  67. package/lib/components/Filter/components/FilterCountChip/types.js +1 -0
  68. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
  69. package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
  70. package/lib/components/Table/columnDef/globalFilter/constants.d.ts +2 -0
  71. package/lib/components/Table/columnDef/globalFilter/constants.js +4 -0
  72. package/lib/components/Table/columnDef/globalFilter/filterFn.d.ts +13 -0
  73. package/lib/components/Table/columnDef/globalFilter/filterFn.js +24 -0
  74. package/lib/components/Table/columnDef/globalFilter/types.d.ts +4 -0
  75. package/lib/components/Table/columnDef/globalFilter/types.js +1 -0
  76. package/lib/components/Table/columnDef/globalFilter/utils.d.ts +23 -0
  77. package/lib/components/Table/columnDef/globalFilter/utils.js +57 -0
  78. package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.d.ts +3 -0
  79. package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.js +9 -0
  80. package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.styles.d.ts +5 -0
  81. package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.styles.js +15 -0
  82. package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.d.ts +3 -0
  83. package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.js +25 -0
  84. package/lib/components/Table/components/TableCell/components/RankedCell/utils.d.ts +30 -0
  85. package/lib/components/Table/components/TableCell/components/RankedCell/utils.js +64 -0
  86. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +9 -5
  87. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.d.ts +9 -0
  88. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.js +20 -1
  89. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.d.ts +3 -0
  90. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.js +9 -0
  91. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.d.ts +5 -0
  92. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.js +24 -0
  93. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.d.ts +3 -0
  94. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.js +10 -0
  95. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.d.ts +6 -0
  96. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.js +17 -0
  97. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.d.ts +6 -0
  98. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.js +1 -0
  99. package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.d.ts +2 -1
  100. package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +6 -0
  101. package/lib/components/Table/components/TableFeatures/ColumnFilter/types.d.ts +3 -2
  102. package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.d.ts +2 -0
  103. package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.js +6 -0
  104. package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.d.ts +3 -0
  105. package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.js +10 -0
  106. package/lib/components/Table/components/TableFeatures/GlobalFilter/types.d.ts +6 -0
  107. package/lib/components/Table/components/TableFeatures/GlobalFilter/types.js +1 -0
  108. package/lib/components/Table/coreOptions/state/pagination/constants.d.ts +2 -0
  109. package/lib/components/Table/coreOptions/state/pagination/constants.js +6 -0
  110. package/lib/components/Table/coreOptions/state/pagination/utils.d.ts +9 -0
  111. package/lib/components/Table/coreOptions/state/pagination/utils.js +18 -0
  112. package/lib/components/common/AnchorLink/anchorLink.js +4 -2
  113. package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +1 -1
  114. package/lib/components/common/AnchorLink/anchorLink.styles.js +1 -1
  115. package/lib/components/common/CustomIcon/components/SearchIcon/searchIcon.d.ts +2 -2
  116. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.d.ts +2 -0
  117. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.js +13 -0
  118. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.d.ts +5 -0
  119. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.js +11 -0
  120. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.d.ts +3 -0
  121. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.js +10 -0
  122. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.d.ts +4 -0
  123. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.js +1 -0
  124. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.d.ts +2 -0
  125. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.js +5 -0
  126. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.d.ts +1 -0
  127. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.js +9 -0
  128. package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.d.ts +2 -0
  129. package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.js +5 -0
  130. package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.d.ts +5 -0
  131. package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.js +5 -0
  132. package/lib/components/common/OutlinedInput/outlinedInput.styles.d.ts +7 -0
  133. package/lib/components/common/OutlinedInput/outlinedInput.styles.js +18 -0
  134. package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.js +2 -2
  135. package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.js +3 -3
  136. package/lib/hooks/stateSyncManager/types.d.ts +1 -1
  137. package/lib/hooks/useFileManifest/useFileManifestDownload.d.ts +2 -2
  138. package/lib/hooks/useFileManifest/useFileManifestDownload.js +3 -10
  139. package/lib/hooks/useFileManifest/useFileManifestSpreadsheet.d.ts +5 -4
  140. package/lib/hooks/useFileManifest/useFileManifestSpreadsheet.js +24 -20
  141. package/lib/providers/dataDictionary/context.d.ts +2 -0
  142. package/lib/providers/dataDictionary/context.js +4 -0
  143. package/lib/providers/dataDictionary/hook.d.ts +6 -0
  144. package/lib/providers/dataDictionary/hook.js +9 -0
  145. package/lib/providers/dataDictionary/types.d.ts +3 -0
  146. package/lib/providers/dataDictionary/types.js +1 -0
  147. package/lib/providers/dataDictionaryState/actions/clearMeta/action.d.ts +9 -0
  148. package/lib/providers/dataDictionaryState/actions/clearMeta/action.js +12 -0
  149. package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.d.ts +6 -0
  150. package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.js +11 -0
  151. package/lib/providers/dataDictionaryState/actions/clearMeta/types.d.ts +6 -0
  152. package/lib/providers/dataDictionaryState/actions/clearMeta/types.js +1 -0
  153. package/lib/providers/dataDictionaryState/actions/stateToUrl/action.d.ts +9 -0
  154. package/lib/providers/dataDictionaryState/actions/stateToUrl/action.js +14 -0
  155. package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.d.ts +7 -0
  156. package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.js +12 -0
  157. package/lib/providers/dataDictionaryState/actions/stateToUrl/types.d.ts +12 -0
  158. package/lib/providers/dataDictionaryState/actions/stateToUrl/types.js +5 -0
  159. package/lib/providers/dataDictionaryState/actions/types.d.ts +13 -0
  160. package/lib/providers/dataDictionaryState/actions/types.js +8 -0
  161. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.d.ts +9 -0
  162. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.js +18 -0
  163. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.d.ts +7 -0
  164. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.js +12 -0
  165. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.d.ts +10 -0
  166. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.js +1 -0
  167. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.d.ts +11 -0
  168. package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.js +27 -0
  169. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.d.ts +9 -0
  170. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.js +19 -0
  171. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.d.ts +7 -0
  172. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.js +12 -0
  173. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.d.ts +10 -0
  174. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.js +1 -0
  175. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.d.ts +17 -0
  176. package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.js +36 -0
  177. package/lib/providers/dataDictionaryState/actions/urlToState/action.d.ts +9 -0
  178. package/lib/providers/dataDictionaryState/actions/urlToState/action.js +20 -0
  179. package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.d.ts +7 -0
  180. package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.js +12 -0
  181. package/lib/providers/dataDictionaryState/actions/urlToState/types.d.ts +9 -0
  182. package/lib/providers/dataDictionaryState/actions/urlToState/types.js +1 -0
  183. package/lib/providers/dataDictionaryState/context.d.ts +2 -0
  184. package/lib/providers/dataDictionaryState/context.js +6 -0
  185. package/lib/providers/dataDictionaryState/dictionaries/constants.d.ts +4 -0
  186. package/lib/providers/dataDictionaryState/dictionaries/constants.js +4 -0
  187. package/lib/providers/dataDictionaryState/dictionaries/state.d.ts +11 -0
  188. package/lib/providers/dataDictionaryState/dictionaries/state.js +29 -0
  189. package/lib/providers/dataDictionaryState/dictionaries/types.d.ts +9 -0
  190. package/lib/providers/dataDictionaryState/dictionaries/types.js +1 -0
  191. package/lib/providers/dataDictionaryState/dictionaries/utils.d.ts +14 -0
  192. package/lib/providers/dataDictionaryState/dictionaries/utils.js +20 -0
  193. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.d.ts +2 -0
  194. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.js +6 -0
  195. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.d.ts +4 -0
  196. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.js +1 -0
  197. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.d.ts +2 -0
  198. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.js +9 -0
  199. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.d.ts +6 -0
  200. package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.js +9 -0
  201. package/lib/providers/dataDictionaryState/initializer/constants.d.ts +2 -0
  202. package/lib/providers/dataDictionaryState/initializer/constants.js +4 -0
  203. package/lib/providers/dataDictionaryState/initializer/initializer.d.ts +9 -0
  204. package/lib/providers/dataDictionaryState/initializer/initializer.js +17 -0
  205. package/lib/providers/dataDictionaryState/initializer/utils.d.ts +8 -0
  206. package/lib/providers/dataDictionaryState/initializer/utils.js +29 -0
  207. package/lib/providers/dataDictionaryState/provider.d.ts +4 -0
  208. package/lib/providers/dataDictionaryState/provider.js +7 -0
  209. package/lib/providers/dataDictionaryState/reducer.d.ts +9 -0
  210. package/lib/providers/dataDictionaryState/reducer.js +34 -0
  211. package/lib/providers/dataDictionaryState/types.d.ts +15 -0
  212. package/lib/providers/dataDictionaryState/types.js +1 -0
  213. package/lib/styles/common/mui/iconButton.d.ts +11 -0
  214. package/lib/styles/common/mui/iconButton.js +29 -0
  215. package/lib/styles/common/mui/inputAdornment.d.ts +9 -0
  216. package/lib/styles/common/mui/inputAdornment.js +13 -0
  217. package/lib/styles/common/mui/outlinedInput.d.ts +7 -0
  218. package/lib/styles/common/mui/outlinedInput.js +7 -0
  219. package/lib/theme/common/components.js +122 -16
  220. package/lib/theme/components/muiButtonGroup.js +4 -0
  221. package/lib/theme/components/muiTableCell.js +6 -0
  222. package/lib/utils/parseJsonQueryParam.d.ts +14 -0
  223. package/lib/utils/parseJsonQueryParam.js +25 -0
  224. package/lib/utils/stateToUrlQuery.d.ts +15 -0
  225. package/lib/utils/stateToUrlQuery.js +35 -0
  226. package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -2
  227. package/lib/views/DataDictionaryView/dataDictionaryView.js +16 -2
  228. package/lib/views/DataDictionaryView/types.d.ts +4 -0
  229. package/lib/views/DataDictionaryView/types.js +1 -0
  230. package/lib/views/DataDictionaryView/utils.d.ts +12 -0
  231. package/lib/views/DataDictionaryView/utils.js +17 -0
  232. package/lib/views/ExploreView/utils.d.ts +1 -1
  233. package/lib/views/ExploreView/utils.js +1 -1
  234. package/package.json +2 -1
  235. package/src/common/entities.ts +2 -3
  236. package/src/components/DataDictionary/components/Entities/constants.ts +9 -3
  237. package/src/components/DataDictionary/components/Entities/entities.styles.ts +6 -0
  238. package/src/components/DataDictionary/components/Entities/entities.tsx +7 -2
  239. package/src/components/DataDictionary/components/Entity/entity.styles.ts +1 -10
  240. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.ts +8 -0
  241. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +33 -0
  242. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.ts +8 -0
  243. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.ts +8 -0
  244. package/src/components/DataDictionary/components/Filters/filters.styles.ts +3 -3
  245. package/src/components/DataDictionary/components/Filters/filters.tsx +2 -0
  246. package/src/components/DataDictionary/components/Filters/stories/constants.ts +18 -0
  247. package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +15 -3
  248. package/src/components/DataDictionary/components/Filters/stories/hook.ts +8 -0
  249. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +1 -5
  250. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx +13 -7
  251. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/types.ts +4 -2
  252. package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +4 -1
  253. package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx +13 -7
  254. package/src/components/DataDictionary/components/Table/hook.ts +10 -6
  255. package/src/components/DataDictionary/components/Table/options/columnFilters/constants.ts +2 -1
  256. package/src/components/DataDictionary/components/Table/options/columnFilters/hook.ts +13 -12
  257. package/src/components/DataDictionary/components/Table/options/globalFilter/constants.ts +14 -0
  258. package/src/components/DataDictionary/components/Table/options/globalFilter/hook.ts +28 -0
  259. package/src/components/DataDictionary/components/Table/options/hook.ts +9 -11
  260. package/src/components/DataDictionary/components/Table/options/pagination/constants.ts +6 -0
  261. package/src/components/DataDictionary/dataDictionary.tsx +45 -16
  262. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.ts +38 -0
  263. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/types.ts +8 -0
  264. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.ts +8 -0
  265. package/src/components/DataDictionary/hooks/UseMeasureFilters/hook.ts +27 -0
  266. package/src/components/DataDictionary/hooks/UseMeasureFilters/types.ts +6 -0
  267. package/src/components/DataDictionary/types.ts +1 -0
  268. package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.tsx +43 -71
  269. package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestSpreadsheet/fileManifestSpreadsheet.tsx +52 -74
  270. package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.ts +24 -0
  271. package/src/components/Filter/components/FilterCountChip/filterCountChip.styles.ts +19 -0
  272. package/src/components/Filter/components/FilterCountChip/filterCountChip.tsx +21 -0
  273. package/src/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.tsx +12 -0
  274. package/src/components/Filter/components/FilterCountChip/types.ts +6 -0
  275. package/src/components/Table/columnDef/globalFilter/constants.ts +5 -0
  276. package/src/components/Table/columnDef/globalFilter/filterFn.ts +34 -0
  277. package/src/components/Table/columnDef/globalFilter/types.ts +5 -0
  278. package/src/components/Table/columnDef/globalFilter/utils.ts +74 -0
  279. package/src/components/Table/components/TableCell/components/CodeCell/codeCell.styles.ts +16 -0
  280. package/src/components/Table/components/TableCell/components/CodeCell/codeCell.tsx +21 -0
  281. package/src/components/Table/components/TableCell/components/RankedCell/rankedCell.tsx +50 -0
  282. package/src/components/Table/components/TableCell/components/RankedCell/utils.ts +85 -0
  283. package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts +26 -1
  284. package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +11 -5
  285. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.ts +25 -0
  286. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.tsx +31 -0
  287. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.ts +13 -0
  288. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.tsx +26 -0
  289. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.ts +9 -0
  290. package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +8 -1
  291. package/src/components/Table/components/TableFeatures/ColumnFilter/types.ts +3 -2
  292. package/src/components/Table/components/TableFeatures/GlobalFilter/constants.ts +8 -0
  293. package/src/components/Table/components/TableFeatures/GlobalFilter/globalFilter.tsx +33 -0
  294. package/src/components/Table/components/TableFeatures/GlobalFilter/types.ts +9 -0
  295. package/src/components/Table/coreOptions/state/pagination/constants.ts +8 -0
  296. package/src/components/Table/coreOptions/state/pagination/utils.ts +21 -0
  297. package/src/components/common/AnchorLink/anchorLink.styles.ts +1 -1
  298. package/src/components/common/AnchorLink/anchorLink.tsx +9 -3
  299. package/src/components/common/CustomIcon/components/SearchIcon/searchIcon.tsx +2 -3
  300. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.ts +12 -0
  301. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.tsx +21 -0
  302. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.ts +13 -0
  303. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.ts +4 -0
  304. package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.ts +7 -0
  305. package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.tsx +13 -0
  306. package/src/components/common/OutlinedInput/components/InputAdornment/components/constants.ts +7 -0
  307. package/src/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.ts +6 -0
  308. package/src/components/common/OutlinedInput/outlinedInput.styles.ts +24 -0
  309. package/src/hooks/stateSyncManager/hooks/UseMetaCommands/hook.ts +2 -2
  310. package/src/hooks/stateSyncManager/hooks/UseStateSync/hook.ts +3 -3
  311. package/src/hooks/stateSyncManager/types.ts +1 -1
  312. package/src/hooks/useFileManifest/useFileManifestDownload.ts +9 -16
  313. package/src/hooks/useFileManifest/useFileManifestSpreadsheet.ts +41 -26
  314. package/src/providers/dataDictionary/context.ts +6 -0
  315. package/src/providers/dataDictionary/hook.ts +11 -0
  316. package/src/providers/dataDictionary/types.ts +6 -0
  317. package/src/providers/dataDictionaryState/actions/clearMeta/action.ts +18 -0
  318. package/src/providers/dataDictionaryState/actions/clearMeta/dispatch.ts +13 -0
  319. package/src/providers/dataDictionaryState/actions/clearMeta/types.ts +8 -0
  320. package/src/providers/dataDictionaryState/actions/stateToUrl/action.ts +20 -0
  321. package/src/providers/dataDictionaryState/actions/stateToUrl/dispatch.ts +14 -0
  322. package/src/providers/dataDictionaryState/actions/stateToUrl/types.ts +15 -0
  323. package/src/providers/dataDictionaryState/actions/types.ts +20 -0
  324. package/src/providers/dataDictionaryState/actions/updateColumnFilters/action.ts +24 -0
  325. package/src/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.ts +16 -0
  326. package/src/providers/dataDictionaryState/actions/updateColumnFilters/types.ts +12 -0
  327. package/src/providers/dataDictionaryState/actions/updateColumnFilters/utils.ts +41 -0
  328. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/action.ts +25 -0
  329. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.ts +16 -0
  330. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/types.ts +12 -0
  331. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/utils.ts +50 -0
  332. package/src/providers/dataDictionaryState/actions/urlToState/action.ts +28 -0
  333. package/src/providers/dataDictionaryState/actions/urlToState/dispatch.ts +14 -0
  334. package/src/providers/dataDictionaryState/actions/urlToState/types.ts +11 -0
  335. package/src/providers/dataDictionaryState/context.ts +9 -0
  336. package/src/providers/dataDictionaryState/dictionaries/constants.ts +4 -0
  337. package/src/providers/dataDictionaryState/dictionaries/state.ts +45 -0
  338. package/src/providers/dataDictionaryState/dictionaries/types.ts +11 -0
  339. package/src/providers/dataDictionaryState/dictionaries/utils.ts +25 -0
  340. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.ts +14 -0
  341. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.ts +5 -0
  342. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.ts +17 -0
  343. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.ts +11 -0
  344. package/src/providers/dataDictionaryState/initializer/constants.ts +6 -0
  345. package/src/providers/dataDictionaryState/initializer/initializer.ts +22 -0
  346. package/src/providers/dataDictionaryState/initializer/utils.ts +39 -0
  347. package/src/providers/dataDictionaryState/provider.tsx +16 -0
  348. package/src/providers/dataDictionaryState/reducer.ts +42 -0
  349. package/src/providers/dataDictionaryState/types.ts +18 -0
  350. package/src/styles/common/mui/iconButton.ts +40 -0
  351. package/src/styles/common/mui/inputAdornment.ts +22 -0
  352. package/src/styles/common/mui/outlinedInput.ts +14 -0
  353. package/src/theme/common/components.ts +122 -16
  354. package/src/theme/components/muiButtonGroup.ts +4 -0
  355. package/src/theme/components/muiTableCell.ts +6 -0
  356. package/src/utils/parseJsonQueryParam.ts +27 -0
  357. package/src/utils/stateToUrlQuery.ts +40 -0
  358. package/src/views/DataDictionaryView/dataDictionaryView.tsx +29 -3
  359. package/src/views/DataDictionaryView/types.ts +5 -0
  360. package/src/views/DataDictionaryView/utils.ts +23 -0
  361. package/src/views/ExploreView/utils.ts +1 -1
  362. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +0 -4
  363. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +0 -36
  364. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +0 -8
  365. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +0 -51
  366. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +0 -9
  367. /package/lib/components/DataDictionary/{hooks/UseDataDictionary → components/Filters/components/ColumnFilterTags}/types.js +0 -0
@@ -1,18 +1,12 @@
1
- import {
2
- ButtonBase,
3
- TableBody,
4
- TableCell,
5
- TableRow,
6
- Tooltip,
7
- } from "@mui/material";
1
+ import { Button, TableBody, TableCell, TableRow, Tooltip } from "@mui/material";
8
2
  import copy from "copy-to-clipboard";
9
- import React, { useRef } from "react";
3
+ import React from "react";
10
4
  import { Filters } from "../../../../../../../../common/entities";
11
5
  import { useDownloadStatus } from "../../../../../../../../hooks/useDownloadStatus";
12
6
  import { useFileManifestDownload } from "../../../../../../../../hooks/useFileManifest/useFileManifestDownload";
13
7
  import { useLoginGuard } from "../../../../../../../../providers/loginGuard/hook";
8
+ import { BUTTON_PROPS } from "../../../../../../../common/Button/constants";
14
9
  import { ButtonGroup } from "../../../../../../../common/ButtonGroup/buttonGroup";
15
- import { ButtonGroupButton } from "../../../../../../../common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
16
10
  import {
17
11
  ContentCopyIconSmall,
18
12
  DownloadIconSmall,
@@ -26,6 +20,7 @@ import {
26
20
  LOADING_PANEL_STYLE,
27
21
  } from "../../../../../../../Loading/loading";
28
22
  import { GridTable } from "../../../../../../../Table/common/gridTable.styles";
23
+ import { TOOLTIP_PROPS } from "../../constants";
29
24
  import {
30
25
  SectionTitle,
31
26
  TableContainer,
@@ -38,87 +33,64 @@ export interface FileManifestDownloadProps {
38
33
  export const FileManifestDownload = ({
39
34
  filters,
40
35
  }: FileManifestDownloadProps): JSX.Element => {
41
- const downloadRef = useRef<HTMLAnchorElement>(null);
42
36
  const { disabled, message } = useDownloadStatus();
43
- const { fileName, isIdle, isLoading, manifestURL } = useFileManifestDownload(
44
- filters,
45
- disabled
46
- );
47
- const isInProgress = (isIdle || isLoading) && !disabled;
48
- const isReady = Boolean(manifestURL) || disabled;
37
+ const { fileName, isIdle, isLoading, manifestURL, requestManifest } =
38
+ useFileManifestDownload(filters);
49
39
 
50
40
  // Prompt user for login before download and copy, if required.
51
41
  const { requireLogin } = useLoginGuard();
52
42
 
53
- // Copies file manifest.
54
- const copyManifestURL = (url?: string): void => {
55
- if (!url) return;
56
- copy(url);
57
- };
58
-
59
- // Downloads file manifest.
60
- const downloadManifestURL = (): void => {
61
- downloadRef.current?.click();
62
- };
63
-
64
43
  return (
65
44
  <FluidPaper>
66
45
  <GridPaper>
67
46
  <SectionTitle>File Manifest</SectionTitle>
68
47
  <TableContainer>
69
48
  <Loading
70
- loading={isInProgress}
49
+ loading={isLoading}
71
50
  panelStyle={LOADING_PANEL_STYLE.INHERIT}
72
51
  />
73
- <GridTable gridTemplateColumns={isReady ? "auto 1fr" : "1fr"}>
52
+ <GridTable gridTemplateColumns="auto 1fr">
74
53
  <TableBody>
75
54
  <TableRow>
76
- {isInProgress ? (
77
- <TableCell />
78
- ) : isReady ? (
55
+ {isIdle || isLoading ? (
56
+ <TableCell>
57
+ <Tooltip {...TOOLTIP_PROPS} title={message}>
58
+ <span>
59
+ <Button
60
+ {...BUTTON_PROPS.PRIMARY_CONTAINED}
61
+ disabled={disabled || isLoading}
62
+ onClick={() => requireLogin(requestManifest)}
63
+ >
64
+ Request link
65
+ </Button>
66
+ </span>
67
+ </Tooltip>
68
+ </TableCell>
69
+ ) : (
79
70
  <>
71
+ {manifestURL && (
72
+ <TableCell>
73
+ <ButtonGroup
74
+ Buttons={[
75
+ <Button key="download" download href={manifestURL}>
76
+ <DownloadIconSmall />
77
+ </Button>,
78
+ <Button
79
+ key="copy"
80
+ onClick={() => copy(manifestURL)}
81
+ >
82
+ <ContentCopyIconSmall />
83
+ </Button>,
84
+ ]}
85
+ />
86
+ </TableCell>
87
+ )}
80
88
  <TableCell>
81
- <ButtonBase
82
- disabled={disabled}
83
- href={manifestURL ?? ""}
84
- ref={downloadRef}
85
- sx={{ display: "none" }}
86
- />
87
- <Tooltip arrow title={message}>
88
- <span>
89
- <ButtonGroup
90
- Buttons={[
91
- <ButtonGroupButton
92
- key="download"
93
- action="Download file manifest"
94
- disabled={disabled}
95
- label={<DownloadIconSmall />}
96
- onClick={() =>
97
- requireLogin(downloadManifestURL)
98
- }
99
- />,
100
- <ButtonGroupButton
101
- key="copy"
102
- action="Copy file manifest"
103
- disabled={disabled}
104
- label={<ContentCopyIconSmall />}
105
- onClick={() =>
106
- requireLogin((): void =>
107
- copyManifestURL(manifestURL)
108
- )
109
- }
110
- />,
111
- ]}
112
- />
113
- </span>
114
- </Tooltip>
89
+ {manifestURL
90
+ ? fileName
91
+ : "The manifest is not available for this project."}
115
92
  </TableCell>
116
- <TableCell>{fileName}</TableCell>
117
93
  </>
118
- ) : (
119
- <TableCell>
120
- The manifest is not available for this project.
121
- </TableCell>
122
94
  )}
123
95
  </TableRow>
124
96
  </TableBody>
@@ -1,18 +1,11 @@
1
- import {
2
- ButtonBase,
3
- TableBody,
4
- TableCell,
5
- TableRow,
6
- Tooltip,
7
- } from "@mui/material";
1
+ import { Button, TableBody, TableCell, TableRow, Tooltip } from "@mui/material";
8
2
  import copy from "copy-to-clipboard";
9
- import React, { useEffect, useRef } from "react";
3
+ import React from "react";
10
4
  import { Filters } from "../../../../../../../../common/entities";
11
5
  import { useDownloadStatus } from "../../../../../../../../hooks/useDownloadStatus";
12
6
  import { useFileManifestSpreadsheet } from "../../../../../../../../hooks/useFileManifest/useFileManifestSpreadsheet";
13
- import { useRequestFileLocation } from "../../../../../../../../hooks/useRequestFileLocation";
7
+ import { BUTTON_PROPS } from "../../../../../../../common/Button/constants";
14
8
  import { ButtonGroup } from "../../../../../../../common/ButtonGroup/buttonGroup";
15
- import { ButtonGroupButton } from "../../../../../../../common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
16
9
  import {
17
10
  ContentCopyIconSmall,
18
11
  DownloadIconSmall,
@@ -26,6 +19,7 @@ import {
26
19
  LOADING_PANEL_STYLE,
27
20
  } from "../../../../../../../Loading/loading";
28
21
  import { GridTable } from "../../../../../../../Table/common/gridTable.styles";
22
+ import { TOOLTIP_PROPS } from "../../constants";
29
23
  import {
30
24
  SectionTitle,
31
25
  TableContainer,
@@ -38,30 +32,14 @@ export interface FileManifestSpreadsheetProps {
38
32
  export const FileManifestSpreadsheet = ({
39
33
  filters,
40
34
  }: FileManifestSpreadsheetProps): JSX.Element => {
41
- const downloadRef = useRef<HTMLAnchorElement>(null);
42
35
  const { disabled, message } = useDownloadStatus();
43
- const { exists, fileName, fileUrl } =
44
- useFileManifestSpreadsheet(filters, disabled) || {};
45
- const { data, isLoading, run } = useRequestFileLocation(fileUrl);
46
- const spreadsheetURL = data?.location;
47
- const isInProgress = (exists === undefined || isLoading) && !disabled;
48
- const isReady = Boolean(spreadsheetURL) || disabled;
49
-
50
- // Copies metadata spreadsheet.
51
- const copyMetadataURL = (url?: string): void => {
52
- if (!url) return;
53
- copy(url);
54
- };
55
-
56
- // Downloads metadata spreadsheet.
57
- const downloadMetadataURL = (): void => {
58
- downloadRef.current?.click();
59
- };
60
-
61
- // Requests metadata spreadsheet.
62
- useEffect(() => {
63
- run();
64
- }, [fileUrl, run]);
36
+ const {
37
+ fileName,
38
+ isIdle = false,
39
+ isLoading = false,
40
+ requestManifest,
41
+ spreadsheetUrl,
42
+ } = useFileManifestSpreadsheet(filters) || {};
65
43
 
66
44
  return (
67
45
  <FluidPaper>
@@ -69,55 +47,55 @@ export const FileManifestSpreadsheet = ({
69
47
  <SectionTitle>Metadata</SectionTitle>
70
48
  <TableContainer>
71
49
  <Loading
72
- loading={isInProgress}
50
+ loading={isLoading}
73
51
  panelStyle={LOADING_PANEL_STYLE.INHERIT}
74
52
  />
75
- <GridTable gridTemplateColumns={isReady ? "auto 1fr" : "1fr"}>
53
+ <GridTable gridTemplateColumns="auto 1fr">
76
54
  <TableBody>
77
55
  <TableRow>
78
- {isInProgress ? (
79
- <TableCell />
80
- ) : isReady ? (
56
+ {isIdle || isLoading ? (
57
+ <TableCell>
58
+ <Tooltip {...TOOLTIP_PROPS} title={message}>
59
+ <span>
60
+ <Button
61
+ {...BUTTON_PROPS.PRIMARY_CONTAINED}
62
+ disabled={disabled || isLoading}
63
+ onClick={() => requestManifest?.()}
64
+ >
65
+ Request link
66
+ </Button>
67
+ </span>
68
+ </Tooltip>
69
+ </TableCell>
70
+ ) : (
81
71
  <>
72
+ {spreadsheetUrl && (
73
+ <TableCell>
74
+ <ButtonGroup
75
+ Buttons={[
76
+ <Button
77
+ key="download"
78
+ download
79
+ href={spreadsheetUrl}
80
+ >
81
+ <DownloadIconSmall />
82
+ </Button>,
83
+ <Button
84
+ key="copy"
85
+ onClick={() => copy(spreadsheetUrl)}
86
+ >
87
+ <ContentCopyIconSmall />
88
+ </Button>,
89
+ ]}
90
+ />
91
+ </TableCell>
92
+ )}
82
93
  <TableCell>
83
- <ButtonBase
84
- disabled={disabled}
85
- download
86
- href={spreadsheetURL ?? ""}
87
- ref={downloadRef}
88
- sx={{ display: "none" }}
89
- />
90
- <Tooltip arrow title={message}>
91
- <span>
92
- <ButtonGroup
93
- Buttons={[
94
- <ButtonGroupButton
95
- key="download"
96
- action="Download metadata spreadsheet"
97
- disabled={disabled}
98
- label={<DownloadIconSmall />}
99
- onClick={downloadMetadataURL}
100
- />,
101
- <ButtonGroupButton
102
- key="copy"
103
- action="Copy metadata spreadsheet"
104
- disabled={disabled}
105
- label={<ContentCopyIconSmall />}
106
- onClick={(): void =>
107
- copyMetadataURL(spreadsheetURL)
108
- }
109
- />,
110
- ]}
111
- />
112
- </span>
113
- </Tooltip>
94
+ {spreadsheetUrl
95
+ ? fileName
96
+ : "The metadata is not available for this project."}
114
97
  </TableCell>
115
- <TableCell>{fileName}</TableCell>
116
98
  </>
117
- ) : (
118
- <TableCell>
119
- The metadata is not available for this project.
120
- </TableCell>
121
99
  )}
122
100
  </TableRow>
123
101
  </TableBody>
@@ -0,0 +1,24 @@
1
+ import { TooltipProps } from "@mui/material";
2
+
3
+ export const TOOLTIP_PROPS: Partial<TooltipProps> = {
4
+ arrow: true,
5
+ slotProps: {
6
+ popper: {
7
+ modifiers: [
8
+ {
9
+ name: "offset",
10
+ options: {
11
+ offset: [0, -4],
12
+ },
13
+ },
14
+ {
15
+ name: "preventOverflow",
16
+ options: { padding: 8 },
17
+ },
18
+ ],
19
+ },
20
+ tooltip: {
21
+ sx: { maxWidth: "none" },
22
+ },
23
+ },
24
+ };
@@ -0,0 +1,19 @@
1
+ import { Chip, styled } from "@mui/material";
2
+
3
+ export const StyledChip = styled(Chip)`
4
+ align-items: center;
5
+ border-radius: 10px;
6
+ flex: none;
7
+ gap: 0;
8
+ height: 16px;
9
+ justify-content: center;
10
+ min-width: 16px;
11
+ padding: 0 4px;
12
+
13
+ .MuiChip-label {
14
+ font-size: 9px;
15
+ font-weight: 600;
16
+ line-height: 16px;
17
+ padding: 0;
18
+ }
19
+ `;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { CHIP_PROPS } from "../../../../styles/common/mui/chip";
3
+ import { StyledChip } from "./filterCountChip.styles";
4
+ import { FilterCountChipProps } from "./types";
5
+
6
+ export const FilterCountChip = ({
7
+ className,
8
+ count,
9
+ ...props /* MuiChipProps */
10
+ }: FilterCountChipProps): JSX.Element | null => {
11
+ if (!count) return null;
12
+ return (
13
+ <StyledChip
14
+ className={className}
15
+ color={CHIP_PROPS.COLOR.PRIMARY}
16
+ label={String(count)}
17
+ variant={CHIP_PROPS.VARIANT.FILLED}
18
+ {...props}
19
+ />
20
+ );
21
+ };
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { FilterCountChip } from "../filterCountChip";
3
+
4
+ const meta: Meta<typeof FilterCountChip> = {
5
+ component: FilterCountChip,
6
+ };
7
+
8
+ export default meta;
9
+
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const DEFAULT: Story = { args: { count: 1, onDelete: undefined } };
@@ -0,0 +1,6 @@
1
+ import { ChipProps } from "@mui/material";
2
+ import { BaseComponentProps } from "../../../types";
3
+
4
+ export interface FilterCountChipProps extends BaseComponentProps, ChipProps {
5
+ count?: number | string;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { rankings, RankItemOptions } from "@tanstack/match-sorter-utils";
2
+
3
+ export const RANK_ITEM_OPTIONS: RankItemOptions = {
4
+ threshold: rankings.CONTAINS,
5
+ };
@@ -0,0 +1,34 @@
1
+ import { FilterMeta, Row, RowData } from "@tanstack/react-table";
2
+ import { parseSearchTerms, rankColumnValue, rankRowColumns } from "./utils";
3
+
4
+ /**
5
+ * Fuzzy matches a column against search terms.
6
+ * A true value is returned if the column's value passes the ranking threshold.
7
+ * Normally, TanStack global filtering will not process remaining row columns if a match is found.
8
+ * This function ranks other row columns for highlighting purposes.
9
+ * @param row - Row.
10
+ * @param columnId - Column identifier.
11
+ * @param value - Search term.
12
+ * @param addMeta - Function to add filter metadata.
13
+ * @returns Whether the row passed the filter.
14
+ */
15
+ export function fuzzy<T extends RowData>(
16
+ row: Row<T>,
17
+ columnId: string,
18
+ value: unknown,
19
+ addMeta: (meta: FilterMeta) => void
20
+ ): boolean {
21
+ // Split the search term into terms.
22
+ const terms = parseSearchTerms(value);
23
+
24
+ // Rank the column value.
25
+ const passed = rankColumnValue(row, columnId, terms);
26
+
27
+ // Add the filter metadata.
28
+ addMeta({ passed });
29
+
30
+ // Rank other columns for highlighting purposes (TanStack global filtering will not process remaining columns if a match is found).
31
+ if (passed) rankRowColumns(row, columnId, terms);
32
+
33
+ return passed;
34
+ }
@@ -0,0 +1,5 @@
1
+ import { FilterMeta } from "@tanstack/react-table";
2
+
3
+ export interface ColumnFilterMeta extends FilterMeta {
4
+ passed?: boolean;
5
+ }
@@ -0,0 +1,74 @@
1
+ import { rankItem } from "@tanstack/match-sorter-utils";
2
+ import { Row, RowData } from "@tanstack/react-table";
3
+ import { RANK_ITEM_OPTIONS } from "./constants";
4
+
5
+ /**
6
+ * Parses a search term into an array of terms.
7
+ * @param value - Search term.
8
+ * @returns Array of terms.
9
+ */
10
+ export function parseSearchTerms(value: unknown): string[] {
11
+ return String(value ?? "")
12
+ .toLowerCase()
13
+ .trim()
14
+ .split(/\s+/)
15
+ .filter(Boolean);
16
+ }
17
+
18
+ /**
19
+ * Ranks a column's value against search terms.
20
+ * @param row - Row to rank.
21
+ * @param columnId - Column identifier.
22
+ * @param terms - Search terms to match against.
23
+ * @returns Whether the value passed.
24
+ */
25
+ export function rankColumnValue<T extends RowData>(
26
+ row: Row<T>,
27
+ columnId: string,
28
+ terms: string[]
29
+ ): boolean {
30
+ // Get the column value.
31
+ const columnValue = row.getValue(columnId);
32
+
33
+ // Return false if the column value is undefined or null.
34
+ if (columnValue === undefined || columnValue === null) return false;
35
+
36
+ // Check if each term matches the column value.
37
+ // Ranking from CASE_SENSITIVE_EQUAL to CONTAINS (excludes `ACRONYM`, `MATCHES` threshold).
38
+ const rankings = terms.map((term) =>
39
+ rankItem(String(columnValue), term, RANK_ITEM_OPTIONS)
40
+ );
41
+
42
+ return rankings.every(({ passed }) => passed);
43
+ }
44
+
45
+ /**
46
+ * Ranks a row's columns against search terms.
47
+ * Processes columns that are searchable and have not already been processed.
48
+ * @param row - Row to rank.
49
+ * @param columnId - Column identifier.
50
+ * @param terms - Search terms to match against.
51
+ */
52
+ export function rankRowColumns<T extends RowData>(
53
+ row: Row<T>,
54
+ columnId: string,
55
+ terms: string[]
56
+ ): void {
57
+ const columnFiltersMeta = row.columnFiltersMeta;
58
+
59
+ // Process other columns.
60
+ for (const { column } of row.getAllCells()) {
61
+ // Column is not searchable.
62
+ if (!column.getCanGlobalFilter()) continue;
63
+
64
+ // Column has already been processed.
65
+ if (column.id === columnId) continue;
66
+ if (column.id in columnFiltersMeta) continue;
67
+
68
+ // Rank the column value.
69
+ const passed = rankColumnValue(row, column.id, terms);
70
+
71
+ // Add the filter metadata.
72
+ row.columnFiltersMeta[column.id] = { passed };
73
+ }
74
+ }
@@ -0,0 +1,16 @@
1
+ import styled from "@emotion/styled";
2
+ import { Chip } from "@mui/material";
3
+ import { PALETTE } from "../../../../../../styles/common/constants/palette";
4
+
5
+ export const StyledChip = styled(Chip)`
6
+ border-radius: 4px;
7
+ box-shadow: 0 0 0 2px ${PALETTE.COMMON_WHITE};
8
+ height: auto;
9
+ justify-self: flex-start;
10
+ min-width: 0;
11
+
12
+ .MuiChip-label {
13
+ padding: 2px 8px;
14
+ white-space: normal;
15
+ }
16
+ `;
@@ -0,0 +1,21 @@
1
+ import { CellContext, RowData } from "@tanstack/react-table";
2
+ import React from "react";
3
+ import { CHIP_PROPS } from "../../../../../../styles/common/mui/chip";
4
+ import { BaseComponentProps } from "../../../../../types";
5
+ import { StyledChip } from "./codeCell.styles";
6
+
7
+ export const CodeCell = <T extends RowData, TValue extends string = string>({
8
+ className,
9
+ getValue,
10
+ }: BaseComponentProps & CellContext<T, TValue>): JSX.Element | null => {
11
+ const value = getValue();
12
+ if (!value) return null;
13
+ return (
14
+ <StyledChip
15
+ className={className}
16
+ color={CHIP_PROPS.COLOR.DEFAULT}
17
+ label={value}
18
+ size={CHIP_PROPS.SIZE.SMALL}
19
+ />
20
+ );
21
+ };
@@ -0,0 +1,50 @@
1
+ import { CellContext, RowData } from "@tanstack/react-table";
2
+ import React, { Fragment } from "react";
3
+ import { BaseComponentProps } from "../../../../../types";
4
+ import { getTokens, getTokensRegex, isRankedCell } from "./utils";
5
+
6
+ export const RankedCell = <
7
+ T extends RowData,
8
+ TValue = string | undefined | null
9
+ >({
10
+ className,
11
+ column,
12
+ getValue,
13
+ row,
14
+ table,
15
+ }: BaseComponentProps & CellContext<T, TValue>): JSX.Element | null => {
16
+ // Get the cell value.
17
+ const value = getValue();
18
+
19
+ // If the cell value is undefined or null, return null.
20
+ if (value === undefined || value === null) return null;
21
+
22
+ // Convert the cell value to a string.
23
+ const stringValue = String(value);
24
+
25
+ // Check if the cell is ranked.
26
+ const isRanked = isRankedCell(table, row, column.id);
27
+
28
+ // Return the unranked cell, as-is.
29
+ if (!isRanked) return <Fragment>{stringValue}</Fragment>;
30
+
31
+ // Tokenise the current global filter.
32
+ const tokens = getTokens(table);
33
+
34
+ // If there are no tokens, return the value as-is.
35
+ if (tokens.length === 0) return <Fragment>{stringValue}</Fragment>;
36
+
37
+ // Create regex pattern.
38
+ const regex = getTokensRegex(tokens);
39
+
40
+ // Return the ranked cell, with highlighting.
41
+ return (
42
+ <span className={className}>
43
+ {stringValue.split(regex).map((part, i) => (
44
+ <Fragment key={i}>
45
+ {part.match(regex) ? <mark>{part}</mark> : part}
46
+ </Fragment>
47
+ ))}
48
+ </span>
49
+ );
50
+ };