@databiosphere/findable-ui 35.2.0 → 37.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 (374) 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/DownloadCurlCommand/downloadCurlCommand.d.ts +2 -1
  57. package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +3 -1
  58. package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +2 -1
  59. package/lib/components/Export/components/ExportToTerra/exportToTerra.js +3 -1
  60. package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +2 -1
  61. package/lib/components/Export/components/ManifestDownload/manifestDownload.js +3 -1
  62. package/lib/components/Filter/components/FilterCountChip/filterCountChip.d.ts +2 -0
  63. package/lib/components/Filter/components/FilterCountChip/filterCountChip.js +8 -0
  64. package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.d.ts +3 -0
  65. package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.js +18 -0
  66. package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.d.ts +6 -0
  67. package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.js +6 -0
  68. package/lib/components/Filter/components/FilterCountChip/types.d.ts +5 -0
  69. package/lib/components/Filter/components/FilterCountChip/types.js +1 -0
  70. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
  71. package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
  72. package/lib/components/Table/columnDef/globalFilter/constants.d.ts +2 -0
  73. package/lib/components/Table/columnDef/globalFilter/constants.js +4 -0
  74. package/lib/components/Table/columnDef/globalFilter/filterFn.d.ts +13 -0
  75. package/lib/components/Table/columnDef/globalFilter/filterFn.js +24 -0
  76. package/lib/components/Table/columnDef/globalFilter/types.d.ts +4 -0
  77. package/lib/components/Table/columnDef/globalFilter/types.js +1 -0
  78. package/lib/components/Table/columnDef/globalFilter/utils.d.ts +23 -0
  79. package/lib/components/Table/columnDef/globalFilter/utils.js +57 -0
  80. package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.d.ts +2 -1
  81. package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.d.ts +3 -0
  82. package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.js +25 -0
  83. package/lib/components/Table/components/TableCell/components/RankedCell/utils.d.ts +30 -0
  84. package/lib/components/Table/components/TableCell/components/RankedCell/utils.js +64 -0
  85. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +9 -5
  86. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.d.ts +9 -0
  87. package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.js +20 -1
  88. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.d.ts +3 -0
  89. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.js +9 -0
  90. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.d.ts +5 -0
  91. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.js +24 -0
  92. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.d.ts +3 -0
  93. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.js +10 -0
  94. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.d.ts +6 -0
  95. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.js +17 -0
  96. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.d.ts +6 -0
  97. package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.js +1 -0
  98. package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.d.ts +2 -1
  99. package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +6 -0
  100. package/lib/components/Table/components/TableFeatures/ColumnFilter/types.d.ts +3 -2
  101. package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.d.ts +2 -0
  102. package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.js +6 -0
  103. package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.d.ts +3 -0
  104. package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.js +10 -0
  105. package/lib/components/Table/components/TableFeatures/GlobalFilter/types.d.ts +6 -0
  106. package/lib/components/Table/components/TableFeatures/GlobalFilter/types.js +1 -0
  107. package/lib/components/Table/coreOptions/state/pagination/constants.d.ts +2 -0
  108. package/lib/components/Table/coreOptions/state/pagination/constants.js +6 -0
  109. package/lib/components/Table/coreOptions/state/pagination/utils.d.ts +9 -0
  110. package/lib/components/Table/coreOptions/state/pagination/utils.js +18 -0
  111. package/lib/components/common/AnchorLink/anchorLink.js +4 -2
  112. package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +1 -1
  113. package/lib/components/common/AnchorLink/anchorLink.styles.js +1 -1
  114. package/lib/components/common/CustomIcon/components/SearchIcon/searchIcon.d.ts +2 -2
  115. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.d.ts +2 -0
  116. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.js +13 -0
  117. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.d.ts +5 -0
  118. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.js +11 -0
  119. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.d.ts +3 -0
  120. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.js +10 -0
  121. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.d.ts +4 -0
  122. package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.js +1 -0
  123. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.d.ts +2 -0
  124. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.js +5 -0
  125. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.d.ts +1 -0
  126. package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.js +9 -0
  127. package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.d.ts +2 -0
  128. package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.js +5 -0
  129. package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.d.ts +5 -0
  130. package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.js +5 -0
  131. package/lib/components/common/OutlinedInput/outlinedInput.styles.d.ts +7 -0
  132. package/lib/components/common/OutlinedInput/outlinedInput.styles.js +18 -0
  133. package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.js +2 -2
  134. package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.js +3 -3
  135. package/lib/hooks/stateSyncManager/types.d.ts +1 -1
  136. package/lib/hooks/useFileManifest/useFileManifestFileCount.d.ts +10 -0
  137. package/lib/hooks/useFileManifest/useFileManifestFileCount.js +44 -0
  138. package/lib/hooks/useRequestManifest/utils.d.ts +21 -14
  139. package/lib/hooks/useRequestManifest/utils.js +33 -21
  140. package/lib/mocks/useRequestFileManifest.mocks.js +2 -0
  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/providers/fileManifestState/constants.js +1 -0
  214. package/lib/providers/fileManifestState.d.ts +16 -1
  215. package/lib/providers/fileManifestState.js +6 -0
  216. package/lib/styles/common/mui/iconButton.d.ts +11 -0
  217. package/lib/styles/common/mui/iconButton.js +29 -0
  218. package/lib/styles/common/mui/inputAdornment.d.ts +9 -0
  219. package/lib/styles/common/mui/inputAdornment.js +13 -0
  220. package/lib/styles/common/mui/outlinedInput.d.ts +7 -0
  221. package/lib/styles/common/mui/outlinedInput.js +7 -0
  222. package/lib/theme/common/components.js +122 -16
  223. package/lib/theme/components/muiButtonGroup.js +4 -0
  224. package/lib/theme/components/muiTableCell.js +6 -0
  225. package/lib/utils/parseJsonQueryParam.d.ts +14 -0
  226. package/lib/utils/parseJsonQueryParam.js +25 -0
  227. package/lib/utils/stateToUrlQuery.d.ts +15 -0
  228. package/lib/utils/stateToUrlQuery.js +35 -0
  229. package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -2
  230. package/lib/views/DataDictionaryView/dataDictionaryView.js +16 -2
  231. package/lib/views/DataDictionaryView/types.d.ts +4 -0
  232. package/lib/views/DataDictionaryView/types.js +1 -0
  233. package/lib/views/DataDictionaryView/utils.d.ts +12 -0
  234. package/lib/views/DataDictionaryView/utils.js +17 -0
  235. package/lib/views/ExploreView/utils.d.ts +1 -1
  236. package/lib/views/ExploreView/utils.js +1 -1
  237. package/package.json +2 -1
  238. package/src/common/entities.ts +2 -3
  239. package/src/components/DataDictionary/components/Entities/constants.ts +9 -3
  240. package/src/components/DataDictionary/components/Entities/entities.styles.ts +6 -0
  241. package/src/components/DataDictionary/components/Entities/entities.tsx +7 -2
  242. package/src/components/DataDictionary/components/Entity/entity.styles.ts +1 -10
  243. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.ts +8 -0
  244. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +33 -0
  245. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.ts +8 -0
  246. package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.ts +8 -0
  247. package/src/components/DataDictionary/components/Filters/filters.styles.ts +3 -3
  248. package/src/components/DataDictionary/components/Filters/filters.tsx +2 -0
  249. package/src/components/DataDictionary/components/Filters/stories/constants.ts +18 -0
  250. package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +15 -3
  251. package/src/components/DataDictionary/components/Filters/stories/hook.ts +8 -0
  252. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +1 -5
  253. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx +13 -7
  254. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/types.ts +4 -2
  255. package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +4 -1
  256. package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx +13 -7
  257. package/src/components/DataDictionary/components/Table/hook.ts +10 -6
  258. package/src/components/DataDictionary/components/Table/options/columnFilters/constants.ts +2 -1
  259. package/src/components/DataDictionary/components/Table/options/columnFilters/hook.ts +13 -12
  260. package/src/components/DataDictionary/components/Table/options/globalFilter/constants.ts +14 -0
  261. package/src/components/DataDictionary/components/Table/options/globalFilter/hook.ts +28 -0
  262. package/src/components/DataDictionary/components/Table/options/hook.ts +9 -11
  263. package/src/components/DataDictionary/components/Table/options/pagination/constants.ts +6 -0
  264. package/src/components/DataDictionary/dataDictionary.tsx +45 -16
  265. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.ts +38 -0
  266. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/types.ts +8 -0
  267. package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.ts +8 -0
  268. package/src/components/DataDictionary/hooks/UseMeasureFilters/hook.ts +27 -0
  269. package/src/components/DataDictionary/hooks/UseMeasureFilters/types.ts +6 -0
  270. package/src/components/DataDictionary/types.ts +1 -0
  271. package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +4 -0
  272. package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +4 -0
  273. package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +4 -0
  274. package/src/components/Filter/components/FilterCountChip/filterCountChip.styles.ts +19 -0
  275. package/src/components/Filter/components/FilterCountChip/filterCountChip.tsx +21 -0
  276. package/src/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.tsx +12 -0
  277. package/src/components/Filter/components/FilterCountChip/types.ts +6 -0
  278. package/src/components/Table/columnDef/globalFilter/constants.ts +5 -0
  279. package/src/components/Table/columnDef/globalFilter/filterFn.ts +34 -0
  280. package/src/components/Table/columnDef/globalFilter/types.ts +5 -0
  281. package/src/components/Table/columnDef/globalFilter/utils.ts +74 -0
  282. package/src/components/Table/components/TableCell/components/CodeCell/codeCell.tsx +5 -2
  283. package/src/components/Table/components/TableCell/components/RankedCell/rankedCell.tsx +50 -0
  284. package/src/components/Table/components/TableCell/components/RankedCell/utils.ts +85 -0
  285. package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts +26 -1
  286. package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +11 -5
  287. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.ts +25 -0
  288. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.tsx +31 -0
  289. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.ts +13 -0
  290. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.tsx +26 -0
  291. package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.ts +9 -0
  292. package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +8 -1
  293. package/src/components/Table/components/TableFeatures/ColumnFilter/types.ts +3 -2
  294. package/src/components/Table/components/TableFeatures/GlobalFilter/constants.ts +8 -0
  295. package/src/components/Table/components/TableFeatures/GlobalFilter/globalFilter.tsx +33 -0
  296. package/src/components/Table/components/TableFeatures/GlobalFilter/types.ts +9 -0
  297. package/src/components/Table/coreOptions/state/pagination/constants.ts +8 -0
  298. package/src/components/Table/coreOptions/state/pagination/utils.ts +21 -0
  299. package/src/components/common/AnchorLink/anchorLink.styles.ts +1 -1
  300. package/src/components/common/AnchorLink/anchorLink.tsx +9 -3
  301. package/src/components/common/CustomIcon/components/SearchIcon/searchIcon.tsx +2 -3
  302. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.ts +12 -0
  303. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.tsx +21 -0
  304. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.ts +13 -0
  305. package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.ts +4 -0
  306. package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.ts +7 -0
  307. package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.tsx +13 -0
  308. package/src/components/common/OutlinedInput/components/InputAdornment/components/constants.ts +7 -0
  309. package/src/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.ts +6 -0
  310. package/src/components/common/OutlinedInput/outlinedInput.styles.ts +24 -0
  311. package/src/hooks/stateSyncManager/hooks/UseMetaCommands/hook.ts +2 -2
  312. package/src/hooks/stateSyncManager/hooks/UseStateSync/hook.ts +3 -3
  313. package/src/hooks/stateSyncManager/types.ts +1 -1
  314. package/src/hooks/useFileManifest/useFileManifestFileCount.ts +65 -0
  315. package/src/hooks/useRequestManifest/utils.ts +37 -24
  316. package/src/mocks/useRequestFileManifest.mocks.ts +2 -0
  317. package/src/providers/dataDictionary/context.ts +6 -0
  318. package/src/providers/dataDictionary/hook.ts +11 -0
  319. package/src/providers/dataDictionary/types.ts +6 -0
  320. package/src/providers/dataDictionaryState/actions/clearMeta/action.ts +18 -0
  321. package/src/providers/dataDictionaryState/actions/clearMeta/dispatch.ts +13 -0
  322. package/src/providers/dataDictionaryState/actions/clearMeta/types.ts +8 -0
  323. package/src/providers/dataDictionaryState/actions/stateToUrl/action.ts +20 -0
  324. package/src/providers/dataDictionaryState/actions/stateToUrl/dispatch.ts +14 -0
  325. package/src/providers/dataDictionaryState/actions/stateToUrl/types.ts +15 -0
  326. package/src/providers/dataDictionaryState/actions/types.ts +20 -0
  327. package/src/providers/dataDictionaryState/actions/updateColumnFilters/action.ts +24 -0
  328. package/src/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.ts +16 -0
  329. package/src/providers/dataDictionaryState/actions/updateColumnFilters/types.ts +12 -0
  330. package/src/providers/dataDictionaryState/actions/updateColumnFilters/utils.ts +41 -0
  331. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/action.ts +25 -0
  332. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.ts +16 -0
  333. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/types.ts +12 -0
  334. package/src/providers/dataDictionaryState/actions/updateGlobalFilter/utils.ts +50 -0
  335. package/src/providers/dataDictionaryState/actions/urlToState/action.ts +28 -0
  336. package/src/providers/dataDictionaryState/actions/urlToState/dispatch.ts +14 -0
  337. package/src/providers/dataDictionaryState/actions/urlToState/types.ts +11 -0
  338. package/src/providers/dataDictionaryState/context.ts +9 -0
  339. package/src/providers/dataDictionaryState/dictionaries/constants.ts +4 -0
  340. package/src/providers/dataDictionaryState/dictionaries/state.ts +45 -0
  341. package/src/providers/dataDictionaryState/dictionaries/types.ts +11 -0
  342. package/src/providers/dataDictionaryState/dictionaries/utils.ts +25 -0
  343. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.ts +14 -0
  344. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.ts +5 -0
  345. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.ts +17 -0
  346. package/src/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.ts +11 -0
  347. package/src/providers/dataDictionaryState/initializer/constants.ts +6 -0
  348. package/src/providers/dataDictionaryState/initializer/initializer.ts +22 -0
  349. package/src/providers/dataDictionaryState/initializer/utils.ts +39 -0
  350. package/src/providers/dataDictionaryState/provider.tsx +16 -0
  351. package/src/providers/dataDictionaryState/reducer.ts +42 -0
  352. package/src/providers/dataDictionaryState/types.ts +18 -0
  353. package/src/providers/fileManifestState/constants.ts +1 -0
  354. package/src/providers/fileManifestState.tsx +23 -0
  355. package/src/styles/common/mui/iconButton.ts +40 -0
  356. package/src/styles/common/mui/inputAdornment.ts +22 -0
  357. package/src/styles/common/mui/outlinedInput.ts +14 -0
  358. package/src/theme/common/components.ts +122 -16
  359. package/src/theme/components/muiButtonGroup.ts +4 -0
  360. package/src/theme/components/muiTableCell.ts +6 -0
  361. package/src/utils/parseJsonQueryParam.ts +27 -0
  362. package/src/utils/stateToUrlQuery.ts +40 -0
  363. package/src/views/DataDictionaryView/dataDictionaryView.tsx +29 -3
  364. package/src/views/DataDictionaryView/types.ts +5 -0
  365. package/src/views/DataDictionaryView/utils.ts +23 -0
  366. package/src/views/ExploreView/utils.ts +1 -1
  367. package/tests/buildRequestFilters.test.ts +5 -13
  368. package/tests/useRequestManifest.test.ts +10 -0
  369. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +0 -4
  370. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +0 -36
  371. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +0 -8
  372. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +0 -51
  373. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +0 -9
  374. /package/lib/components/DataDictionary/{hooks/UseDataDictionary → components/Filters/components/ColumnFilterTags}/types.js +0 -0
@@ -0,0 +1,44 @@
1
+ import { useEffect, useState } from "react";
2
+ import { FileManifestActionKind } from "../../providers/fileManifestState";
3
+ import { useCatalog } from "../useCatalog";
4
+ import { useFileManifestState } from "../useFileManifestState";
5
+ import { useFetchSummary } from "./useFetchSummary";
6
+ /**
7
+ * Fetches the latest file count from the summary endpoint, excluding filters
8
+ * that match the provided species and file facet names, and updates the file manifest state.
9
+ *
10
+ * @param initialFilters - The initial set of filters to apply.
11
+ * @param speciesFacetName - The facet name representing species to exclude from the summary request.
12
+ * @param fileFacetName - The facet name representing file type to exclude from the summary request.
13
+ */
14
+ export const useFileManifestFileCount = (initialFilters, speciesFacetName, fileFacetName) => {
15
+ // Initial file manifest filter.
16
+ const [initFilters] = useState(() => initialFilters);
17
+ // File manifest dispatch.
18
+ const { fileManifestDispatch } = useFileManifestState();
19
+ // Determine catalog.
20
+ const catalog = useCatalog(); // catalog should be defined.
21
+ // Get filters required for fetching the summary.
22
+ const filters = excludeFacetsFromFilters(initFilters, [
23
+ speciesFacetName,
24
+ fileFacetName,
25
+ ]);
26
+ // Fetch file count from summary.
27
+ const { summary: { fileCount } = {} } = useFetchSummary(filters, catalog, true);
28
+ useEffect(() => {
29
+ fileManifestDispatch({
30
+ payload: { fileCount },
31
+ type: FileManifestActionKind.UpdateFileCount,
32
+ });
33
+ }, [fileCount, fileManifestDispatch]);
34
+ };
35
+ /**
36
+ * Returns a new filters array with the specified facet names excluded.
37
+ *
38
+ * @param filters - The list of filters to process.
39
+ * @param facetNames - The facet names to exclude from the filters.
40
+ * @returns The filters array excluding any filters matching the provided facet names.
41
+ */
42
+ function excludeFacetsFromFilters(filters, facetNames) {
43
+ return (filters || []).filter(({ categoryKey }) => !facetNames.includes(categoryKey));
44
+ }
@@ -4,18 +4,21 @@ import { FormFacet } from "../../components/Export/common/entities";
4
4
  import { FileManifestState } from "../../providers/fileManifestState";
5
5
  import { UseRequestManifest } from "./types";
6
6
  /**
7
- * Returns true if all form facets have all their terms selected.
8
- * @param formFacet - Form related file facets.
9
- * @returns true if all form facets have all their terms selected.
7
+ * Determines whether all files are selected by comparing the file count to the summary file count.
8
+ *
9
+ * @param state - The file manifest state object.
10
+ * @returns True if all files are selected; otherwise, false.
10
11
  */
11
- export declare function areAllFormFilterTermsSelected(formFacet: FormFacet): boolean;
12
+ export declare function areAllFilesSelected(state: FileManifestState): boolean;
12
13
  /**
13
- * Generates the filters for a request URL based on the file manifest state.
14
- * - **all form facets have all their terms selected** - returns filters from state without form filters.
15
- * - **at least one form facet has an unselected term** - returns filters from state.
16
- * @param state - File manifest state.
17
- * @param formFacet - Form related file facets.
18
- * @returns filters for the request URL.
14
+ * Builds the filters object for a request URL based on the file manifest state and form facets.
15
+ *
16
+ * - If all files are selected, returns filters from state excluding fully selected form filters.
17
+ * - If only some files are selected, returns the current filters from state.
18
+ *
19
+ * @param state - The file manifest state object.
20
+ * @param formFacet - The form-related file facets.
21
+ * @returns The filters to use for the request URL.
19
22
  */
20
23
  export declare function buildRequestFilters(state: FileManifestState, formFacet: FormFacet): Filters;
21
24
  /**
@@ -42,11 +45,15 @@ export declare function excludeFullySelectedFormFilters(state: FileManifestState
42
45
  */
43
46
  export declare function isCatalogReady(catalog: string | undefined): boolean;
44
47
  /**
45
- * Returns true if the file manifest state is ready for a request.
46
- * A file manifest state is considered ready if it is both enabled (`isEnabled` is `true`)
47
- * and not currently loading (`isLoading` is `false`).
48
+ * Determines if the file manifest state is ready to be used in a request.
49
+ *
50
+ * The state is considered ready when:
51
+ * - isEnabled is true
52
+ * - fileCount is defined
53
+ * - isLoading is false
54
+ *
48
55
  * @param fileManifestState - File manifest state.
49
- * @returns true if the file manifest state is ready for a request.
56
+ * @returns true if the file manifest state is ready.
50
57
  */
51
58
  export declare function isFileManifestStateReady(fileManifestState: FileManifestState): boolean;
52
59
  /**
@@ -2,29 +2,35 @@ import { AZUL_PARAM, MANIFEST_DOWNLOAD_FORMAT, } from "../../apis/azul/common/en
2
2
  import { transformFilters } from "../../apis/azul/common/filterTransformer";
3
3
  import { REQUEST_MANIFEST } from "./constants";
4
4
  /**
5
- * Returns true if all form facets have all their terms selected.
6
- * @param formFacet - Form related file facets.
7
- * @returns true if all form facets have all their terms selected.
5
+ * Determines whether all files are selected by comparing the file count to the summary file count.
6
+ *
7
+ * @param state - The file manifest state object.
8
+ * @returns True if all files are selected; otherwise, false.
8
9
  */
9
- export function areAllFormFilterTermsSelected(formFacet) {
10
- return Object.values(formFacet)
11
- .filter(Boolean)
12
- .every(({ selectedTermCount, termCount }) => selectedTermCount === termCount);
10
+ export function areAllFilesSelected(state) {
11
+ const { fileCount, summary } = state;
12
+ // Return false if file count or summary file count is undefined.
13
+ if (fileCount === undefined || summary?.fileCount === undefined)
14
+ return false;
15
+ // Return true if file count equals summary file count.
16
+ return fileCount === summary.fileCount;
13
17
  }
14
18
  /**
15
- * Generates the filters for a request URL based on the file manifest state.
16
- * - **all form facets have all their terms selected** - returns filters from state without form filters.
17
- * - **at least one form facet has an unselected term** - returns filters from state.
18
- * @param state - File manifest state.
19
- * @param formFacet - Form related file facets.
20
- * @returns filters for the request URL.
19
+ * Builds the filters object for a request URL based on the file manifest state and form facets.
20
+ *
21
+ * - If all files are selected, returns filters from state excluding fully selected form filters.
22
+ * - If only some files are selected, returns the current filters from state.
23
+ *
24
+ * @param state - The file manifest state object.
25
+ * @param formFacet - The form-related file facets.
26
+ * @returns The filters to use for the request URL.
21
27
  */
22
28
  export function buildRequestFilters(state, formFacet) {
23
- // Form terms are fully selected; return filters excluding form filters.
24
- if (areAllFormFilterTermsSelected(formFacet)) {
29
+ // Return filters from state excluding form filters if all files are selected.
30
+ if (areAllFilesSelected(state)) {
25
31
  return excludeFullySelectedFormFilters(state, formFacet);
26
32
  }
27
- // Form terms are partially selected; return filters.
33
+ // Return current filters from state.
28
34
  return state.filters;
29
35
  }
30
36
  /**
@@ -84,14 +90,20 @@ export function isCatalogReady(catalog) {
84
90
  return typeof catalog === "string";
85
91
  }
86
92
  /**
87
- * Returns true if the file manifest state is ready for a request.
88
- * A file manifest state is considered ready if it is both enabled (`isEnabled` is `true`)
89
- * and not currently loading (`isLoading` is `false`).
93
+ * Determines if the file manifest state is ready to be used in a request.
94
+ *
95
+ * The state is considered ready when:
96
+ * - isEnabled is true
97
+ * - fileCount is defined
98
+ * - isLoading is false
99
+ *
90
100
  * @param fileManifestState - File manifest state.
91
- * @returns true if the file manifest state is ready for a request.
101
+ * @returns true if the file manifest state is ready.
92
102
  */
93
103
  export function isFileManifestStateReady(fileManifestState) {
94
- return fileManifestState.isEnabled && !fileManifestState.isLoading;
104
+ return (fileManifestState.isEnabled &&
105
+ fileManifestState.fileCount !== undefined &&
106
+ !fileManifestState.isLoading);
95
107
  }
96
108
  /**
97
109
  * Checks if the file manifest format is ready for use.
@@ -59,9 +59,11 @@ export const FILTERS = {
59
59
  FORM_SUBSET: [FILTER_FILES_SUBSET, FILTER_OTHER, FILTER_SPECIES],
60
60
  };
61
61
  export const FILE_MANIFEST_STATE = {
62
+ fileCount: 10,
62
63
  filters: FILTERS.FORM_INITIAL_SET,
63
64
  isEnabled: true,
64
65
  isLoading: false,
66
+ summary: { fileCount: 10 },
65
67
  };
66
68
  export const FORM_FACET = {
67
69
  COMPLETE_SET: {
@@ -0,0 +1,2 @@
1
+ import { DataDictionaryContextProps } from "./types";
2
+ export declare const DataDictionaryContext: import("react").Context<DataDictionaryContextProps>;
@@ -0,0 +1,4 @@
1
+ import { createContext } from "react";
2
+ export const DataDictionaryContext = createContext({
3
+ dictionary: "",
4
+ });
@@ -0,0 +1,6 @@
1
+ import { DataDictionaryContextProps } from "./types";
2
+ /**
3
+ * Returns data dictionary context.
4
+ * @returns data dictionary context.
5
+ */
6
+ export declare const useDataDictionary: () => DataDictionaryContextProps;
@@ -0,0 +1,9 @@
1
+ import { useContext } from "react";
2
+ import { DataDictionaryContext } from "./context";
3
+ /**
4
+ * Returns data dictionary context.
5
+ * @returns data dictionary context.
6
+ */
7
+ export const useDataDictionary = () => {
8
+ return useContext(DataDictionaryContext);
9
+ };
@@ -0,0 +1,3 @@
1
+ export interface DataDictionaryContextProps {
2
+ dictionary: string;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { ClearMetaPayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "clear meta" action.
5
+ * @param state - Data Dictionary State.
6
+ * @param payload - Payload.
7
+ * @returns data dictionary state.
8
+ */
9
+ export declare function clearMetaAction(state: DataDictionaryState, payload: ClearMetaPayload): DataDictionaryState;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Reducer function to handle the "clear meta" action.
3
+ * @param state - Data Dictionary State.
4
+ * @param payload - Payload.
5
+ * @returns data dictionary state.
6
+ */
7
+ export function clearMetaAction(state, payload) {
8
+ return {
9
+ ...state,
10
+ meta: payload,
11
+ };
12
+ }
@@ -0,0 +1,6 @@
1
+ import { ClearMetaAction } from "./types";
2
+ /**
3
+ * Action creator for clearing meta in the state.
4
+ * @returns Action with payload and action type.
5
+ */
6
+ export declare function clearMeta(): ClearMetaAction;
@@ -0,0 +1,11 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ /**
3
+ * Action creator for clearing meta in the state.
4
+ * @returns Action with payload and action type.
5
+ */
6
+ export function clearMeta() {
7
+ return {
8
+ payload: null,
9
+ type: DataDictionaryActionKind.ClearMeta,
10
+ };
11
+ }
@@ -0,0 +1,6 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ export type ClearMetaAction = {
3
+ payload: ClearMetaPayload;
4
+ type: DataDictionaryActionKind.ClearMeta;
5
+ };
6
+ export type ClearMetaPayload = null;
@@ -0,0 +1,9 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { StateToUrlPayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "state >> URL sync" action.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns state.
8
+ */
9
+ export declare function stateToUrlAction(state: DataDictionaryState, payload: StateToUrlPayload): DataDictionaryState;
@@ -0,0 +1,14 @@
1
+ import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
2
+ import { ROUTER_METHOD } from "./types";
3
+ /**
4
+ * Reducer function to handle the "state >> URL sync" action.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns state.
8
+ */
9
+ export function stateToUrlAction(state, payload) {
10
+ const command = payload.method === ROUTER_METHOD.PUSH
11
+ ? META_COMMAND.STATE_TO_URL_PUSH
12
+ : META_COMMAND.STATE_TO_URL_REPLACE;
13
+ return { ...state, meta: { command } };
14
+ }
@@ -0,0 +1,7 @@
1
+ import { StateToUrlAction, StateToUrlPayload } from "./types";
2
+ /**
3
+ * Action creator for state >> URL sync.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export declare function stateToUrl(payload: StateToUrlPayload): StateToUrlAction;
@@ -0,0 +1,12 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ /**
3
+ * Action creator for state >> URL sync.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export function stateToUrl(payload) {
8
+ return {
9
+ payload,
10
+ type: DataDictionaryActionKind.StateToUrl,
11
+ };
12
+ }
@@ -0,0 +1,12 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ export declare enum ROUTER_METHOD {
3
+ PUSH = "push",
4
+ REPLACE = "replace"
5
+ }
6
+ export type StateToUrlAction = {
7
+ payload: StateToUrlPayload;
8
+ type: DataDictionaryActionKind.StateToUrl;
9
+ };
10
+ export type StateToUrlPayload = {
11
+ method: ROUTER_METHOD;
12
+ };
@@ -0,0 +1,5 @@
1
+ export var ROUTER_METHOD;
2
+ (function (ROUTER_METHOD) {
3
+ ROUTER_METHOD["PUSH"] = "push";
4
+ ROUTER_METHOD["REPLACE"] = "replace";
5
+ })(ROUTER_METHOD || (ROUTER_METHOD = {}));
@@ -0,0 +1,13 @@
1
+ import { ClearMetaAction } from "./clearMeta/types";
2
+ import { StateToUrlAction } from "./stateToUrl/types";
3
+ import { UpdateColumnFiltersAction } from "./updateColumnFilters/types";
4
+ import { UpdateGlobalFilterAction } from "./updateGlobalFilter/types";
5
+ import { UrlToStateAction } from "./urlToState/types";
6
+ export type DataDictionaryAction = ClearMetaAction | StateToUrlAction | UpdateColumnFiltersAction | UpdateGlobalFilterAction | UrlToStateAction;
7
+ export declare enum DataDictionaryActionKind {
8
+ ClearMeta = "CLEAR_META",
9
+ StateToUrl = "STATE_TO_URL",
10
+ UpdateColumnFilters = "UPDATE_COLUMN_FILTERS",
11
+ UpdateGlobalFilter = "UPDATE_GLOBAL_FILTER",
12
+ UrlToState = "URL_TO_STATE"
13
+ }
@@ -0,0 +1,8 @@
1
+ export var DataDictionaryActionKind;
2
+ (function (DataDictionaryActionKind) {
3
+ DataDictionaryActionKind["ClearMeta"] = "CLEAR_META";
4
+ DataDictionaryActionKind["StateToUrl"] = "STATE_TO_URL";
5
+ DataDictionaryActionKind["UpdateColumnFilters"] = "UPDATE_COLUMN_FILTERS";
6
+ DataDictionaryActionKind["UpdateGlobalFilter"] = "UPDATE_GLOBAL_FILTER";
7
+ DataDictionaryActionKind["UrlToState"] = "URL_TO_STATE";
8
+ })(DataDictionaryActionKind || (DataDictionaryActionKind = {}));
@@ -0,0 +1,9 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { UpdateColumnFiltersPayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "update column filters" action.
5
+ * @param state - Data dictionary state.
6
+ * @param payload - Payload.
7
+ * @returns data dictionary state.
8
+ */
9
+ export declare function updateColumnFiltersAction(state: DataDictionaryState, payload: UpdateColumnFiltersPayload): DataDictionaryState;
@@ -0,0 +1,18 @@
1
+ import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
2
+ import { buildNextDictionaries } from "../../dictionaries/state";
3
+ import { buildNextColumnFilters } from "./utils";
4
+ /**
5
+ * Reducer function to handle the "update column filters" action.
6
+ * @param state - Data dictionary state.
7
+ * @param payload - Payload.
8
+ * @returns data dictionary state.
9
+ */
10
+ export function updateColumnFiltersAction(state, payload) {
11
+ return {
12
+ ...state,
13
+ dictionaries: buildNextDictionaries(state, payload.dictionary, {
14
+ columnFilters: buildNextColumnFilters(state, payload),
15
+ }),
16
+ meta: { command: META_COMMAND.STATE_TO_URL_PUSH },
17
+ };
18
+ }
@@ -0,0 +1,7 @@
1
+ import { UpdateColumnFiltersAction, UpdateColumnFiltersPayload } from "./types";
2
+ /**
3
+ * Action creator for updating column filters in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export declare function updateColumnFilters(payload: UpdateColumnFiltersPayload): UpdateColumnFiltersAction;
@@ -0,0 +1,12 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ /**
3
+ * Action creator for updating column filters in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export function updateColumnFilters(payload) {
8
+ return {
9
+ payload,
10
+ type: DataDictionaryActionKind.UpdateColumnFilters,
11
+ };
12
+ }
@@ -0,0 +1,10 @@
1
+ import { ColumnFiltersState, Updater } from "@tanstack/react-table";
2
+ import { DataDictionaryActionKind } from "../types";
3
+ export type UpdateColumnFiltersAction = {
4
+ payload: UpdateColumnFiltersPayload;
5
+ type: DataDictionaryActionKind.UpdateColumnFilters;
6
+ };
7
+ export interface UpdateColumnFiltersPayload {
8
+ dictionary: string;
9
+ updaterOrValue: Updater<ColumnFiltersState>;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { ColumnFiltersState } from "@tanstack/react-table";
2
+ import { DataDictionaryState } from "../../types";
3
+ import { UpdateColumnFiltersPayload } from "./types";
4
+ /**
5
+ * Builds the next column filters state for the current dictionary.
6
+ * Uses TanStack updater to update the column filters state.
7
+ * @param state - State.
8
+ * @param payload - Payload.
9
+ * @returns column filters state.
10
+ */
11
+ export declare function buildNextColumnFilters(state: DataDictionaryState, payload: UpdateColumnFiltersPayload): ColumnFiltersState;
@@ -0,0 +1,27 @@
1
+ import { functionalUpdate } from "@tanstack/react-table";
2
+ /**
3
+ * Builds the next column filters state for the current dictionary.
4
+ * Uses TanStack updater to update the column filters state.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns column filters state.
8
+ */
9
+ export function buildNextColumnFilters(state, payload) {
10
+ return functionalUpdate(payload.updaterOrValue, getOldColumnFilters(state, payload));
11
+ }
12
+ /**
13
+ * Retrieves the current "old" column filters state.
14
+ * @param state - State.
15
+ * @param payload - Payload.
16
+ * @returns old column filters state.
17
+ */
18
+ function getOldColumnFilters(state, payload) {
19
+ // Grab the dictionary.
20
+ const dictionary = state.dictionaries[payload.dictionary];
21
+ // If the dictionary is not found, return an empty array.
22
+ if (!dictionary)
23
+ return [];
24
+ // Grab column filters from dictionary state.
25
+ const { columnFilters = [] } = dictionary.state;
26
+ return columnFilters;
27
+ }
@@ -0,0 +1,9 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { UpdateGlobalFilterPayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "update global filter" action.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns state.
8
+ */
9
+ export declare function updateGlobalFilterAction(state: DataDictionaryState, payload: UpdateGlobalFilterPayload): DataDictionaryState;
@@ -0,0 +1,19 @@
1
+ import { buildNextDictionaries } from "../../dictionaries/state";
2
+ import { buildNextGlobalFilter, buildNextMeta } from "./utils";
3
+ /**
4
+ * Reducer function to handle the "update global filter" action.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns state.
8
+ */
9
+ export function updateGlobalFilterAction(state, payload) {
10
+ const globalFilter = buildNextGlobalFilter(payload);
11
+ const meta = buildNextMeta(state, payload, globalFilter);
12
+ return {
13
+ ...state,
14
+ dictionaries: buildNextDictionaries(state, payload.dictionary, {
15
+ globalFilter,
16
+ }),
17
+ meta,
18
+ };
19
+ }
@@ -0,0 +1,7 @@
1
+ import { UpdateGlobalFilterAction, UpdateGlobalFilterPayload } from "./types";
2
+ /**
3
+ * Action creator for updating global filter in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export declare function updateGlobalFilter(payload: UpdateGlobalFilterPayload): UpdateGlobalFilterAction;
@@ -0,0 +1,12 @@
1
+ import { DataDictionaryActionKind } from "../types";
2
+ /**
3
+ * Action creator for updating global filter in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export function updateGlobalFilter(payload) {
8
+ return {
9
+ payload,
10
+ type: DataDictionaryActionKind.UpdateGlobalFilter,
11
+ };
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Updater } from "@tanstack/react-table";
2
+ import { DataDictionaryActionKind } from "../types";
3
+ export type UpdateGlobalFilterAction = {
4
+ payload: UpdateGlobalFilterPayload;
5
+ type: DataDictionaryActionKind.UpdateGlobalFilter;
6
+ };
7
+ export interface UpdateGlobalFilterPayload {
8
+ dictionary: string;
9
+ updaterOrValue: Updater<string | undefined>;
10
+ }
@@ -0,0 +1,17 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { UpdateGlobalFilterPayload } from "./types";
3
+ /**
4
+ * Builds the next global filter state for the current dictionary.
5
+ * Uses TanStack updater to update the global filter state.
6
+ * @param payload - Payload.
7
+ * @returns global filter state.
8
+ */
9
+ export declare function buildNextGlobalFilter(payload: UpdateGlobalFilterPayload): string | undefined;
10
+ /**
11
+ * Builds the next meta state for the current dictionary.
12
+ * @param state - State.
13
+ * @param payload - Payload.
14
+ * @param nextGlobalFilter - Next global filter.
15
+ * @returns meta state.
16
+ */
17
+ export declare function buildNextMeta(state: DataDictionaryState, payload: UpdateGlobalFilterPayload, nextGlobalFilter: string | undefined): DataDictionaryState["meta"];
@@ -0,0 +1,36 @@
1
+ import { functionalUpdate } from "@tanstack/react-table";
2
+ import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
3
+ /**
4
+ * Builds the next global filter state for the current dictionary.
5
+ * Uses TanStack updater to update the global filter state.
6
+ * @param payload - Payload.
7
+ * @returns global filter state.
8
+ */
9
+ export function buildNextGlobalFilter(payload) {
10
+ return functionalUpdate(payload.updaterOrValue, undefined) || undefined;
11
+ }
12
+ /**
13
+ * Builds the next meta state for the current dictionary.
14
+ * @param state - State.
15
+ * @param payload - Payload.
16
+ * @param nextGlobalFilter - Next global filter.
17
+ * @returns meta state.
18
+ */
19
+ export function buildNextMeta(state, payload, nextGlobalFilter) {
20
+ const currentGlobalFilter = getCurrentGlobalFilter(state, payload);
21
+ // Use PUSH method with adding or removing the global filter.
22
+ if (currentGlobalFilter === undefined || nextGlobalFilter === undefined) {
23
+ return { command: META_COMMAND.STATE_TO_URL_PUSH };
24
+ }
25
+ // Use REPLACE method with edits to the global filter.
26
+ return { command: META_COMMAND.STATE_TO_URL_REPLACE };
27
+ }
28
+ /**
29
+ * Returns the current global filter for the current dictionary.
30
+ * @param state - State.
31
+ * @param payload - Payload.
32
+ * @returns global filter.
33
+ */
34
+ function getCurrentGlobalFilter(state, payload) {
35
+ return state.dictionaries[payload.dictionary].state.globalFilter;
36
+ }
@@ -0,0 +1,9 @@
1
+ import { DataDictionaryState } from "../../types";
2
+ import { UrlToStatePayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "URL >> state sync" action.
5
+ * @param state - State.
6
+ * @param payload - Payload.
7
+ * @returns state.
8
+ */
9
+ export declare function urlToStateAction(state: DataDictionaryState, payload: UrlToStatePayload): DataDictionaryState;