@gen3/frontend 0.12.5 → 0.12.6
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.
- package/LICENSE +201 -0
- package/dist/dts/components/Buttons/types.d.ts +8 -0
- package/dist/dts/components/Buttons/types.d.ts.map +1 -0
- package/dist/dts/components/Buttons/types.js +2 -0
- package/dist/dts/components/Buttons/types.js.map +1 -0
- package/dist/dts/components/Modals/Gen3ModalsProvider.d.ts.map +1 -1
- package/dist/dts/components/Modals/Gen3ModalsProvider.js +3 -1
- package/dist/dts/components/Modals/Gen3ModalsProvider.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts +8 -8
- package/dist/dts/components/charts/Charts.d.ts +2 -1
- package/dist/dts/components/charts/Charts.d.ts.map +1 -1
- package/dist/dts/components/charts/Charts.js +9 -4
- package/dist/dts/components/charts/Charts.js.map +1 -1
- package/dist/dts/components/counts/CountsValue.d.ts.map +1 -1
- package/dist/dts/components/counts/CountsValue.js +2 -2
- package/dist/dts/components/counts/CountsValue.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +22 -22
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/DownloadsPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/DownloadsPanel.js +10 -3
- package/dist/dts/features/CohortBuilder/DownloadsPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.d.ts +15 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js +12 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.d.ts +4 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.js +24 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js +2 -6
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.d.ts +4 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.js +114 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.d.ts +30 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.js +266 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.d.ts +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js +3 -3
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.d.ts +22 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.js +134 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js +9 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts +2 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js +3 -3
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js.map +1 -1
- package/dist/dts/features/CohortBuilder/types.d.ts +2 -2
- package/dist/dts/features/CohortBuilder/types.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/types.js.map +1 -1
- package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +6 -6
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.d.ts +3 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.js +116 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js +1 -33
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.d.ts +11 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.js +34 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/registeredActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/registeredActions.js +7 -0
- package/dist/dts/features/DataLibrary/selection/registeredActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.d.ts +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.js +2 -1
- package/dist/dts/features/DataLibrary/selection/utils.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts +8 -2
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js +9 -188
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts +10 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.js +6 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.d.ts +13 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.d.ts.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.js +237 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.js.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.d.ts +12 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.d.ts.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.js +198 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.js.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/types.d.ts +2 -2
- package/dist/dts/features/Discovery/ActionBar/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/types.d.ts +6 -3
- package/dist/dts/features/Discovery/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/types.js.map +1 -1
- package/dist/dts/features/Navigation/utils.d.ts.map +1 -1
- package/dist/dts/features/Navigation/utils.js +8 -4
- package/dist/dts/features/Navigation/utils.js.map +1 -1
- package/dist/index/cjs/QueryPanel-0oWY4_bU.js +24 -0
- package/dist/index/cjs/QueryPanel-0oWY4_bU.js.map +1 -0
- package/dist/index/cjs/QueryPanel-BDpa5AF0.js +24 -0
- package/dist/index/cjs/QueryPanel-BDpa5AF0.js.map +1 -0
- package/dist/index/cjs/index-D6FVEslG.js +30960 -0
- package/dist/index/cjs/index-D6FVEslG.js.map +1 -0
- package/dist/index/cjs/index-DSN6t20M.js +30863 -0
- package/dist/index/cjs/index-DSN6t20M.js.map +1 -0
- package/dist/index/cjs/index.js +1 -1
- package/dist/index/esm/QueryPanel-CnvKsYkj.js +22 -0
- package/dist/index/esm/QueryPanel-CnvKsYkj.js.map +1 -0
- package/dist/index/esm/QueryPanel-Dvq7CfjD.js +22 -0
- package/dist/index/esm/QueryPanel-Dvq7CfjD.js.map +1 -0
- package/dist/index/esm/index-DQY_pJZO.js +30716 -0
- package/dist/index/esm/index-DQY_pJZO.js.map +1 -0
- package/dist/index/esm/index-MRux14YB.js +30619 -0
- package/dist/index/esm/index-MRux14YB.js.map +1 -0
- package/dist/index/esm/index.js +1 -1
- package/dist/index.d.ts +19 -14
- package/dist/pages/cjs/CohortBuilder-BpJ7kZVF.js +483 -0
- package/dist/pages/cjs/CohortBuilder-BpJ7kZVF.js.map +1 -0
- package/dist/pages/cjs/CohortBuilder-DzSGSYij.js +483 -0
- package/dist/pages/cjs/CohortBuilder-DzSGSYij.js.map +1 -0
- package/dist/pages/cjs/index-B5KUPWI2.js +22693 -0
- package/dist/pages/cjs/index-B5KUPWI2.js.map +1 -0
- package/dist/pages/cjs/index-wZupPU4_.js +22596 -0
- package/dist/pages/cjs/index-wZupPU4_.js.map +1 -0
- package/dist/pages/cjs/index.js +1 -1
- package/dist/pages/esm/CohortBuilder-B-gUDoXF.js +480 -0
- package/dist/pages/esm/CohortBuilder-B-gUDoXF.js.map +1 -0
- package/dist/pages/esm/CohortBuilder-Ct3QYo5t.js +480 -0
- package/dist/pages/esm/CohortBuilder-Ct3QYo5t.js.map +1 -0
- package/dist/pages/esm/index-Bp58gp7c.js +22611 -0
- package/dist/pages/esm/index-Bp58gp7c.js.map +1 -0
- package/dist/pages/esm/index-CoPGeYzL.js +22514 -0
- package/dist/pages/esm/index-CoPGeYzL.js.map +1 -0
- package/dist/pages/esm/index.js +1 -1
- package/dist/pages.d.ts +6 -3
- package/package.json +3 -3
package/dist/index/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Y as AISearchPageGetServerSideProps, cD as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cB as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, cm as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cC as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, cv as convertMinutesToMilliseconds, ch as convertPathsToTree, cw as convertSecondsToMilliseconds, b3 as convertToStringArray, ce as create10ColorAccessibleContrast, cd as create10ColorPallet, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cu as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ck as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cf as getCurrentUnixTimestamp, cx as getFormattedTimestamp, cA as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, ct as getParamsValueAsString, bQ as getTagInfo, cs as hasOwnProperty, cp as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cr as isPropertyKey, cq as isTextTransform, cy as isTimeGreaterThan, cE as itemsInCart, b8 as mapFacetSortToSortType, cz as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, ci as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cl as stripTrailingSlash, co as toCountsString, cn as toDisplayName, aC as truncateString, cg as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, cj as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-
|
|
1
|
+
export { Y as AISearchPageGetServerSideProps, cD as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cB as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, cm as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cC as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, cv as convertMinutesToMilliseconds, ch as convertPathsToTree, cw as convertSecondsToMilliseconds, b3 as convertToStringArray, ce as create10ColorAccessibleContrast, cd as create10ColorPallet, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cu as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ck as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cf as getCurrentUnixTimestamp, cx as getFormattedTimestamp, cA as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, ct as getParamsValueAsString, bQ as getTagInfo, cs as hasOwnProperty, cp as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cr as isPropertyKey, cq as isTextTransform, cy as isTimeGreaterThan, cE as itemsInCart, b8 as mapFacetSortToSortType, cz as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, ci as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cl as stripTrailingSlash, co as toCountsString, cn as toDisplayName, aC as truncateString, cg as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, cj as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-DQY_pJZO.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@mantine/core';
|
package/dist/index.d.ts
CHANGED
|
@@ -515,11 +515,12 @@ interface ChartsProps {
|
|
|
515
515
|
data: AggregationsData;
|
|
516
516
|
isSuccess: boolean;
|
|
517
517
|
isError?: boolean;
|
|
518
|
+
isFetching?: boolean;
|
|
518
519
|
numCols?: number;
|
|
519
520
|
style?: 'tile' | 'box';
|
|
520
521
|
showLegends?: boolean;
|
|
521
522
|
}
|
|
522
|
-
declare const Charts: ({ charts, data, counts,
|
|
523
|
+
declare const Charts: ({ charts, data, counts, isError, isFetching, numCols, style, showLegends, }: ChartsProps) => react_jsx_runtime.JSX.Element | null;
|
|
523
524
|
//# sourceMappingURL=Charts.d.ts.map
|
|
524
525
|
|
|
525
526
|
interface ChartsPanelProps {
|
|
@@ -1197,7 +1198,7 @@ interface CohortBuilderConfiguration extends Gen3AppConfigData {
|
|
|
1197
1198
|
interface CohortBuilderProps extends Omit<CohortBuilderConfiguration, 'sharedFilters'> {
|
|
1198
1199
|
sharedFiltersMap: SharedFieldMapping | null;
|
|
1199
1200
|
}
|
|
1200
|
-
type ActionButtonWithArgsFunction = (params: Record<string, any>, done?: () => void, onError?: (error: Error) => void, onAbort?: () => void, signal?: AbortSignal) => Promise<void>;
|
|
1201
|
+
type ActionButtonWithArgsFunction = (params: Record<string, any>, done?: () => void, onError?: (error: Error) => void, onAbort?: () => void, signal?: AbortSignal, onCompleted?: (data: any) => void) => Promise<void>;
|
|
1201
1202
|
interface GuppyActionButtonProps {
|
|
1202
1203
|
disabled?: boolean;
|
|
1203
1204
|
inactiveText: string;
|
|
@@ -1638,14 +1639,17 @@ interface DiscoveryPageTitle {
|
|
|
1638
1639
|
enabled: boolean;
|
|
1639
1640
|
text: string;
|
|
1640
1641
|
}
|
|
1641
|
-
interface
|
|
1642
|
-
type: 'manifest' | 'zip' | 'download' | 'link' | 'externalLink' | 'addToDataLibrary';
|
|
1642
|
+
interface ActionButtonConfig {
|
|
1643
1643
|
label?: string;
|
|
1644
1644
|
icon?: string;
|
|
1645
1645
|
requiresLogin?: boolean;
|
|
1646
1646
|
tooltip?: string;
|
|
1647
1647
|
disabled?: boolean;
|
|
1648
1648
|
}
|
|
1649
|
+
type ActionButtonType = 'manifest' | 'zip' | 'download' | 'link' | 'externalLink' | 'addToDataLibrary';
|
|
1650
|
+
interface ExportSelectionActionButton extends ActionButtonConfig {
|
|
1651
|
+
type: ActionButtonType;
|
|
1652
|
+
}
|
|
1649
1653
|
interface SearchBar {
|
|
1650
1654
|
enabled: boolean;
|
|
1651
1655
|
inputSubtitle: string;
|
|
@@ -1661,7 +1665,7 @@ interface SearchConfig {
|
|
|
1661
1665
|
tagSearchDropdown?: TagSearchDropdown;
|
|
1662
1666
|
}
|
|
1663
1667
|
interface ExportFromDiscoveryActions {
|
|
1664
|
-
buttons:
|
|
1668
|
+
buttons: ExportSelectionActionButton[];
|
|
1665
1669
|
enabled?: boolean;
|
|
1666
1670
|
verifyExternalLogins?: boolean;
|
|
1667
1671
|
dataLibraryStoreMode?: DataLibraryStoreMode;
|
|
@@ -2027,8 +2031,9 @@ declare const TabbedCohortBuilder: ({ index, tabsConfiguration, indexPrefix, fie
|
|
|
2027
2031
|
|
|
2028
2032
|
interface GuppyDownloadActionHookProps extends Pick<GuppyActionButtonProps, 'Modal403' | 'Modal400' | 'done' | 'customErrorMessage' | 'hideNotification' | 'actionFunction' | 'actionArgs'> {
|
|
2029
2033
|
setIsActive?: (active: boolean) => void;
|
|
2034
|
+
onCompleted?: (args?: unknown) => void;
|
|
2030
2035
|
}
|
|
2031
|
-
declare const useGuppyActionButton: ({ Modal403, Modal400, done, customErrorMessage, hideNotification, actionFunction, actionArgs, setIsActive, }: GuppyDownloadActionHookProps) => {
|
|
2036
|
+
declare const useGuppyActionButton: ({ Modal403, Modal400, done, customErrorMessage, hideNotification, actionFunction, actionArgs, setIsActive, onCompleted, }: GuppyDownloadActionHookProps) => {
|
|
2032
2037
|
handleClick: () => Promise<void>;
|
|
2033
2038
|
icon: react_jsx_runtime.JSX.Element;
|
|
2034
2039
|
active: boolean;
|
|
@@ -2573,7 +2578,7 @@ interface Gen3ProviderProps {
|
|
|
2573
2578
|
defaultNotificationPosition?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
|
|
2574
2579
|
}
|
|
2575
2580
|
declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStringArray>) => {
|
|
2576
|
-
focusRing?: "
|
|
2581
|
+
focusRing?: "auto" | "always" | "never" | undefined;
|
|
2577
2582
|
scale?: number | undefined;
|
|
2578
2583
|
fontSmoothing?: boolean | undefined;
|
|
2579
2584
|
white?: string | undefined;
|
|
@@ -2608,7 +2613,7 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
|
|
|
2608
2613
|
headings?: {
|
|
2609
2614
|
fontFamily?: string | undefined;
|
|
2610
2615
|
fontWeight?: string | undefined;
|
|
2611
|
-
textWrap?: "wrap" | "
|
|
2616
|
+
textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
|
|
2612
2617
|
sizes?: {
|
|
2613
2618
|
h1?: {
|
|
2614
2619
|
fontSize?: string | undefined;
|
|
@@ -2645,8 +2650,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
|
|
|
2645
2650
|
radius?: {
|
|
2646
2651
|
[x: string & {}]: string | undefined;
|
|
2647
2652
|
sm?: string | undefined;
|
|
2648
|
-
xs?: string | undefined;
|
|
2649
2653
|
md?: string | undefined;
|
|
2654
|
+
xs?: string | undefined;
|
|
2650
2655
|
lg?: string | undefined;
|
|
2651
2656
|
xl?: string | undefined;
|
|
2652
2657
|
} | undefined;
|
|
@@ -2655,40 +2660,40 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
|
|
|
2655
2660
|
[x: number]: string | undefined;
|
|
2656
2661
|
[x: string & {}]: string | undefined;
|
|
2657
2662
|
sm?: string | undefined;
|
|
2658
|
-
xs?: string | undefined;
|
|
2659
2663
|
md?: string | undefined;
|
|
2664
|
+
xs?: string | undefined;
|
|
2660
2665
|
lg?: string | undefined;
|
|
2661
2666
|
xl?: string | undefined;
|
|
2662
2667
|
} | undefined;
|
|
2663
2668
|
fontSizes?: {
|
|
2664
2669
|
[x: string & {}]: string | undefined;
|
|
2665
2670
|
sm?: string | undefined;
|
|
2666
|
-
xs?: string | undefined;
|
|
2667
2671
|
md?: string | undefined;
|
|
2672
|
+
xs?: string | undefined;
|
|
2668
2673
|
lg?: string | undefined;
|
|
2669
2674
|
xl?: string | undefined;
|
|
2670
2675
|
} | undefined;
|
|
2671
2676
|
lineHeights?: {
|
|
2672
2677
|
[x: string & {}]: string | undefined;
|
|
2673
2678
|
sm?: string | undefined;
|
|
2674
|
-
xs?: string | undefined;
|
|
2675
2679
|
md?: string | undefined;
|
|
2680
|
+
xs?: string | undefined;
|
|
2676
2681
|
lg?: string | undefined;
|
|
2677
2682
|
xl?: string | undefined;
|
|
2678
2683
|
} | undefined;
|
|
2679
2684
|
breakpoints?: {
|
|
2680
2685
|
[x: string & {}]: string | undefined;
|
|
2681
2686
|
sm?: string | undefined;
|
|
2682
|
-
xs?: string | undefined;
|
|
2683
2687
|
md?: string | undefined;
|
|
2688
|
+
xs?: string | undefined;
|
|
2684
2689
|
lg?: string | undefined;
|
|
2685
2690
|
xl?: string | undefined;
|
|
2686
2691
|
} | undefined;
|
|
2687
2692
|
shadows?: {
|
|
2688
2693
|
[x: string & {}]: string | undefined;
|
|
2689
2694
|
sm?: string | undefined;
|
|
2690
|
-
xs?: string | undefined;
|
|
2691
2695
|
md?: string | undefined;
|
|
2696
|
+
xs?: string | undefined;
|
|
2692
2697
|
lg?: string | undefined;
|
|
2693
2698
|
xl?: string | undefined;
|
|
2694
2699
|
} | undefined;
|
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var useDeepCompare = require('use-deep-compare');
|
|
6
|
+
var core$1 = require('@mantine/core');
|
|
7
|
+
var lodash = require('lodash');
|
|
8
|
+
var core = require('@gen3/core');
|
|
9
|
+
var index = require('./index-wZupPU4_.js');
|
|
10
|
+
require('echarts');
|
|
11
|
+
var hooks = require('@mantine/hooks');
|
|
12
|
+
require('victory');
|
|
13
|
+
require('react-icons/bs');
|
|
14
|
+
require('react-icons/io');
|
|
15
|
+
require('@mantine/form');
|
|
16
|
+
require('react-icons/md');
|
|
17
|
+
require('react-icons/ri');
|
|
18
|
+
require('react-icons/fa');
|
|
19
|
+
require('react-icons/pi');
|
|
20
|
+
require('@iconify-icon/react');
|
|
21
|
+
require('@mantine/modals');
|
|
22
|
+
require('tailwind-merge');
|
|
23
|
+
require('next/head');
|
|
24
|
+
require('next/link');
|
|
25
|
+
require('next/image');
|
|
26
|
+
require('next/router');
|
|
27
|
+
require('next/navigation');
|
|
28
|
+
require('cookies-next');
|
|
29
|
+
require('swr');
|
|
30
|
+
require('jose');
|
|
31
|
+
require('cookie');
|
|
32
|
+
require('@gen3/core/server');
|
|
33
|
+
require('@mantine/notifications');
|
|
34
|
+
require('tinycolor2');
|
|
35
|
+
require('react-markdown');
|
|
36
|
+
require('react-icons/ai');
|
|
37
|
+
require('remark-gfm');
|
|
38
|
+
require('fs');
|
|
39
|
+
require('path');
|
|
40
|
+
require('mantine-react-table');
|
|
41
|
+
require('react-icons/ti');
|
|
42
|
+
require('react-icons/fi');
|
|
43
|
+
require('react-minisearch');
|
|
44
|
+
require('minisearch');
|
|
45
|
+
require('file-saver');
|
|
46
|
+
require('tailwind-styled-components');
|
|
47
|
+
require('jsonpath-plus');
|
|
48
|
+
require('react-dom');
|
|
49
|
+
require('lodash/uniq');
|
|
50
|
+
require('lodash/sum');
|
|
51
|
+
require('react-icons/lu');
|
|
52
|
+
require('next/dynamic');
|
|
53
|
+
require('react-cookie');
|
|
54
|
+
require('default-composer');
|
|
55
|
+
require('filesize');
|
|
56
|
+
require('@dnd-kit/core');
|
|
57
|
+
require('@dnd-kit/sortable');
|
|
58
|
+
require('@dnd-kit/utilities');
|
|
59
|
+
require('@dnd-kit/modifiers');
|
|
60
|
+
require('universal-cookie');
|
|
61
|
+
|
|
62
|
+
const EmptyData = {};
|
|
63
|
+
/**
|
|
64
|
+
* CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
|
|
65
|
+
* It integrates with data services and facilitates visualization, filtering, and analysis tasks.
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} props The properties required to configure the CohortPanel component.
|
|
68
|
+
* @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
|
|
69
|
+
* @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
|
|
70
|
+
* @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
|
|
71
|
+
* @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
|
|
72
|
+
* @param {Object} props.table Reference to the table configuration or component for displaying data.
|
|
73
|
+
* @param {string} props.tabTitle Title for the filter tab section.
|
|
74
|
+
* @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
|
|
75
|
+
* @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
|
|
76
|
+
* @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
|
|
77
|
+
* @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
|
|
78
|
+
*
|
|
79
|
+
* @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
|
|
80
|
+
* summary charts, cohort manager, and data display components.
|
|
81
|
+
*/ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
|
|
82
|
+
const isSm = hooks.useMediaQuery('(min-width: 639px)');
|
|
83
|
+
const isMd = hooks.useMediaQuery('(min-width: 1373px)');
|
|
84
|
+
const isXl = hooks.useMediaQuery('(min-width: 1600px)');
|
|
85
|
+
const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
|
|
86
|
+
const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
|
|
87
|
+
const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
|
|
88
|
+
dropdowns
|
|
89
|
+
]);
|
|
90
|
+
const defaultButtons = React.useMemo(()=>buttons ?? [], [
|
|
91
|
+
buttons
|
|
92
|
+
]);
|
|
93
|
+
const numCols = React.useMemo(()=>{
|
|
94
|
+
if (isSm) return 1;
|
|
95
|
+
if (isMd) return 2;
|
|
96
|
+
if (isXl) return 4;
|
|
97
|
+
return 3;
|
|
98
|
+
}, [
|
|
99
|
+
isSm,
|
|
100
|
+
isMd,
|
|
101
|
+
isXl
|
|
102
|
+
]);
|
|
103
|
+
const index$1 = guppyConfig.dataType;
|
|
104
|
+
const indexPrefix = guppyConfig?.indexPrefix ?? '';
|
|
105
|
+
const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
|
|
106
|
+
filters?.tabs
|
|
107
|
+
]);
|
|
108
|
+
const coreDispatch = core.useCoreDispatch();
|
|
109
|
+
const [facetDefinitions, setFacetDefinitions] = React.useState({});
|
|
110
|
+
const [summaryCharts, setSummaryCharts] = React.useState({});
|
|
111
|
+
const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
|
|
112
|
+
const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
|
|
113
|
+
const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
|
|
114
|
+
const toggleAllFiltersExpanded = (expand)=>{
|
|
115
|
+
coreDispatch(core.toggleCohortBuilderAllFilters({
|
|
116
|
+
expand,
|
|
117
|
+
index: index$1
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
const clearAllFilters = React.useCallback(()=>{
|
|
121
|
+
coreDispatch(core.clearCohortFilters({
|
|
122
|
+
index: index$1
|
|
123
|
+
}));
|
|
124
|
+
}, [
|
|
125
|
+
coreDispatch,
|
|
126
|
+
index$1
|
|
127
|
+
]);
|
|
128
|
+
const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
|
|
129
|
+
type: index$1,
|
|
130
|
+
fields: fields,
|
|
131
|
+
filters: cohortFilters,
|
|
132
|
+
accessibility: accessLevel,
|
|
133
|
+
queryId: cohortId,
|
|
134
|
+
indexPrefix: indexPrefix
|
|
135
|
+
});
|
|
136
|
+
const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
|
|
137
|
+
...Object.keys(chartsSection?.charts ?? {}),
|
|
138
|
+
...Object.keys(charts)
|
|
139
|
+
], [
|
|
140
|
+
chartsSection?.charts,
|
|
141
|
+
charts
|
|
142
|
+
]);
|
|
143
|
+
const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
|
|
144
|
+
type: index$1,
|
|
145
|
+
fields: chartKeys,
|
|
146
|
+
filters: cohortFilters,
|
|
147
|
+
accessibility: accessLevel,
|
|
148
|
+
filterSelf: true,
|
|
149
|
+
queryId: cohortId,
|
|
150
|
+
indexPrefix: indexPrefix
|
|
151
|
+
}, {
|
|
152
|
+
skip: chartKeys.length === 0
|
|
153
|
+
});
|
|
154
|
+
const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
|
|
155
|
+
if (isChartSuccess && chartData) {
|
|
156
|
+
const cleanedData = {};
|
|
157
|
+
const totalCount = chartData._totalCount[0]?.count;
|
|
158
|
+
Object.keys(summaryCharts).forEach((key)=>{
|
|
159
|
+
if (!(key in chartData)) {
|
|
160
|
+
return;
|
|
161
|
+
} // handle missing key in data
|
|
162
|
+
// remove empty keys
|
|
163
|
+
cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
|
|
164
|
+
const facetDef = facetDefinitions?.[key];
|
|
165
|
+
if (facetDef?.excludeValues) {
|
|
166
|
+
cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
|
|
167
|
+
}
|
|
168
|
+
if (cleanedData[key].length === 0 && totalCount) {
|
|
169
|
+
// if no keys adds back no data
|
|
170
|
+
cleanedData[key] = [
|
|
171
|
+
{
|
|
172
|
+
key: 'no data',
|
|
173
|
+
count: totalCount
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return cleanedData;
|
|
179
|
+
}
|
|
180
|
+
return chartData;
|
|
181
|
+
}, [
|
|
182
|
+
chartData,
|
|
183
|
+
isChartSuccess,
|
|
184
|
+
summaryCharts
|
|
185
|
+
]);
|
|
186
|
+
const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
|
|
187
|
+
let filters = undefined;
|
|
188
|
+
let combineMode = 'or';
|
|
189
|
+
if (field in cohortFilters.root) {
|
|
190
|
+
if (core.isIntersection(cohortFilters.root[field])) {
|
|
191
|
+
const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
|
|
192
|
+
if (intersectionFilters) {
|
|
193
|
+
filters = core.extractEnumFilterValue(intersectionFilters);
|
|
194
|
+
combineMode = 'and';
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
filters = core.extractEnumFilterValue(cohortFilters.root[field]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
data: index.processBucketData(data?.[field]),
|
|
202
|
+
enumFilters: filters,
|
|
203
|
+
combineMode: combineMode,
|
|
204
|
+
isSuccess: isSuccess
|
|
205
|
+
};
|
|
206
|
+
}, [
|
|
207
|
+
cohortFilters.root,
|
|
208
|
+
data,
|
|
209
|
+
isSuccess
|
|
210
|
+
]);
|
|
211
|
+
const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
|
|
212
|
+
return {
|
|
213
|
+
data: index.processRangeData(data?.[field]),
|
|
214
|
+
filters: index.extractRangeValues(cohortFilters.root[field]),
|
|
215
|
+
isSuccess: isSuccess
|
|
216
|
+
};
|
|
217
|
+
}, [
|
|
218
|
+
data,
|
|
219
|
+
cohortFilters.root,
|
|
220
|
+
isSuccess
|
|
221
|
+
]);
|
|
222
|
+
// Set up the hooks for the facet components to use based on the required index
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
|
|
226
|
+
return {
|
|
227
|
+
// TODO: see if there a better way to do this
|
|
228
|
+
enum: {
|
|
229
|
+
useGetFacetData: getEnumFacetData,
|
|
230
|
+
useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
|
|
231
|
+
useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
|
|
232
|
+
useClearFilter: lodash.partial(index.useClearFilters, index$1),
|
|
233
|
+
useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
|
|
234
|
+
useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
|
|
235
|
+
useGetCombineMode: lodash.partial(index.useCohortFilterCombineState, index$1),
|
|
236
|
+
useSetCombineMode: lodash.partial(index.useSetCohortFilterCombineState, index$1),
|
|
237
|
+
useFieldNameToTitle: index.useFieldNameToTitle,
|
|
238
|
+
useTotalCounts: undefined
|
|
239
|
+
},
|
|
240
|
+
exact: {
|
|
241
|
+
useGetFacetData: getEnumFacetData,
|
|
242
|
+
useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
|
|
243
|
+
useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
|
|
244
|
+
useClearFilter: lodash.partial(index.useClearFilters, index$1),
|
|
245
|
+
useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
|
|
246
|
+
useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
|
|
247
|
+
useFieldNameToTitle: index.useFieldNameToTitle,
|
|
248
|
+
useTotalCounts: undefined
|
|
249
|
+
},
|
|
250
|
+
multiselect: {
|
|
251
|
+
useGetFacetData: getEnumFacetData,
|
|
252
|
+
useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
|
|
253
|
+
useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
|
|
254
|
+
useClearFilter: lodash.partial(index.useClearFilters, index$1),
|
|
255
|
+
useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
|
|
256
|
+
useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
|
|
257
|
+
useFieldNameToTitle: index.useFieldNameToTitle,
|
|
258
|
+
useTotalCounts: undefined
|
|
259
|
+
},
|
|
260
|
+
range: {
|
|
261
|
+
useGetFacetData: getRangeFacetData,
|
|
262
|
+
useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
|
|
263
|
+
useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
|
|
264
|
+
useClearFilter: lodash.partial(index.useClearFilters, index$1),
|
|
265
|
+
useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
|
|
266
|
+
useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
|
|
267
|
+
useFieldNameToTitle: index.useFieldNameToTitle,
|
|
268
|
+
useTotalCounts: undefined
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}, [
|
|
272
|
+
getEnumFacetData,
|
|
273
|
+
getRangeFacetData,
|
|
274
|
+
index$1
|
|
275
|
+
]);
|
|
276
|
+
// Set the facet definitions based on the data only the first time the data is loaded
|
|
277
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
278
|
+
if (isSuccess && Object.keys(facetDefinitions).length === 0) {
|
|
279
|
+
const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
|
|
280
|
+
return {
|
|
281
|
+
...tab.fieldsConfig,
|
|
282
|
+
...acc
|
|
283
|
+
};
|
|
284
|
+
}, {});
|
|
285
|
+
const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
|
|
286
|
+
setFacetDefinitions(facetDefs);
|
|
287
|
+
// setup summary charts since nested fields can be listed by the split field name
|
|
288
|
+
const chartDefinitions = chartsSection?.charts ?? charts;
|
|
289
|
+
const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
|
|
290
|
+
let chartField = field;
|
|
291
|
+
if (facetDefs?.[field] === undefined) {
|
|
292
|
+
const res = Object.values(facetDefs).filter((def)=>{
|
|
293
|
+
return def.dataField === field;
|
|
294
|
+
});
|
|
295
|
+
if (res.length > 0) {
|
|
296
|
+
chartField = res[0].field;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
...acc,
|
|
301
|
+
[chartField]: chartDefinitions[field]
|
|
302
|
+
};
|
|
303
|
+
}, {});
|
|
304
|
+
setSummaryCharts(summaryCharts);
|
|
305
|
+
}
|
|
306
|
+
}, [
|
|
307
|
+
isSuccess,
|
|
308
|
+
data,
|
|
309
|
+
facetDefinitions,
|
|
310
|
+
index$1,
|
|
311
|
+
guppyConfig.fieldMapping,
|
|
312
|
+
charts,
|
|
313
|
+
chartsSection
|
|
314
|
+
]);
|
|
315
|
+
const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
|
|
316
|
+
type: index$1,
|
|
317
|
+
filters: cohortFilters,
|
|
318
|
+
accessibility: accessLevel,
|
|
319
|
+
queryId: cohortId
|
|
320
|
+
});
|
|
321
|
+
if (isCountsError || isAggsQueryError) {
|
|
322
|
+
return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
|
|
323
|
+
message: "Unable to fetch data from server"
|
|
324
|
+
}); // TODO: replace with configurable message
|
|
325
|
+
}
|
|
326
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
327
|
+
className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
|
|
328
|
+
children: [
|
|
329
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
|
|
330
|
+
index: index$1
|
|
331
|
+
}),
|
|
332
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
333
|
+
className: "flex w-full",
|
|
334
|
+
children: [
|
|
335
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
336
|
+
id: "cohort-builder-filters",
|
|
337
|
+
className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
|
|
338
|
+
children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
|
|
339
|
+
filters: filters,
|
|
340
|
+
tabTitle: tabTitle,
|
|
341
|
+
facetDefinitions: facetDefinitions,
|
|
342
|
+
facetDataHooks: facetDataHooks,
|
|
343
|
+
onAccessChange: setAccessLevel,
|
|
344
|
+
accessLevel: accessLevel,
|
|
345
|
+
showAccessLevel: showAccessLevel,
|
|
346
|
+
allFiltersCollapsed: allFiltersCollapsed,
|
|
347
|
+
toggleAllFiltersExpanded: toggleAllFiltersExpanded,
|
|
348
|
+
clearAllFilters: clearAllFilters
|
|
349
|
+
})
|
|
350
|
+
}),
|
|
351
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
352
|
+
id: "cohort-builder-content",
|
|
353
|
+
className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
|
|
354
|
+
children: [
|
|
355
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
356
|
+
className: "flex justify-between mb-2 ml-2",
|
|
357
|
+
children: [
|
|
358
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
|
|
359
|
+
dropdowns: defaultDropdowns,
|
|
360
|
+
buttons: defaultButtons,
|
|
361
|
+
loginForDownload: loginForDownload,
|
|
362
|
+
index: index$1,
|
|
363
|
+
totalCount: counts ?? 0,
|
|
364
|
+
fields: table?.fields ?? [],
|
|
365
|
+
filter: cohortFilters
|
|
366
|
+
}),
|
|
367
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
|
|
368
|
+
label: guppyConfig?.nodeCountTitle || index.toDisplayName(index$1),
|
|
369
|
+
configuration: guppyConfig?.nodeCountConfiguration,
|
|
370
|
+
counts: counts,
|
|
371
|
+
isFetching: isCountsFetching,
|
|
372
|
+
isError: isCountsError
|
|
373
|
+
})
|
|
374
|
+
]
|
|
375
|
+
}),
|
|
376
|
+
chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
|
|
377
|
+
config: {
|
|
378
|
+
...chartsSection,
|
|
379
|
+
charts: summaryCharts
|
|
380
|
+
},
|
|
381
|
+
data: cleanChartData ?? EmptyData,
|
|
382
|
+
isSuccess: isChartSuccess,
|
|
383
|
+
isFetching: isChartFetching,
|
|
384
|
+
isError: isChartError
|
|
385
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
|
|
386
|
+
charts: summaryCharts,
|
|
387
|
+
data: cleanChartData ?? EmptyData,
|
|
388
|
+
counts: counts,
|
|
389
|
+
isSuccess: isChartSuccess,
|
|
390
|
+
isError: isChartError,
|
|
391
|
+
numCols: numCols
|
|
392
|
+
}),
|
|
393
|
+
table?.enabled && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
394
|
+
className: "mt-2 flex flex-col",
|
|
395
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
|
|
396
|
+
index: index$1,
|
|
397
|
+
tableConfig: table,
|
|
398
|
+
accessibility: accessLevel
|
|
399
|
+
})
|
|
400
|
+
})
|
|
401
|
+
]
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const TabsLayoutToComponentProp = (tabsLayout)=>{
|
|
410
|
+
if (!tabsLayout) {
|
|
411
|
+
return 'flex-start';
|
|
412
|
+
}
|
|
413
|
+
switch(tabsLayout){
|
|
414
|
+
case 'left':
|
|
415
|
+
{
|
|
416
|
+
return 'flex-start';
|
|
417
|
+
}
|
|
418
|
+
case 'right':
|
|
419
|
+
{
|
|
420
|
+
return 'flex-end';
|
|
421
|
+
}
|
|
422
|
+
case 'center':
|
|
423
|
+
{
|
|
424
|
+
return 'center';
|
|
425
|
+
}
|
|
426
|
+
default:
|
|
427
|
+
{
|
|
428
|
+
return 'flex-start';
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const useGetCurrentCohort = ()=>{
|
|
434
|
+
return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
|
|
435
|
+
};
|
|
436
|
+
const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true })=>{
|
|
437
|
+
const dispatch = core.useCoreDispatch();
|
|
438
|
+
dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
|
|
439
|
+
const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
|
|
440
|
+
explorerConfig
|
|
441
|
+
]);
|
|
442
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
443
|
+
className: "flex flex-col w-full mt-2",
|
|
444
|
+
children: [
|
|
445
|
+
enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
|
|
446
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
|
|
447
|
+
color: "primary.5",
|
|
448
|
+
variant: explorerConfig[0]?.tabType,
|
|
449
|
+
keepMounted: true,
|
|
450
|
+
defaultValue: explorerConfig[0].tabTitle,
|
|
451
|
+
children: [
|
|
452
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
|
|
453
|
+
className: "w-full",
|
|
454
|
+
justify: TabsLayoutToComponentProp(tabsLayout),
|
|
455
|
+
children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
|
|
456
|
+
value: panelConfig.tabTitle,
|
|
457
|
+
children: panelConfig.tabTitle
|
|
458
|
+
}, `${panelConfig.tabTitle}-tabList`))
|
|
459
|
+
}),
|
|
460
|
+
configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
|
|
461
|
+
value: panelConfig.tabTitle,
|
|
462
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
|
|
463
|
+
guppyConfig: panelConfig.guppyConfig,
|
|
464
|
+
chartsSection: panelConfig?.chartsSection,
|
|
465
|
+
charts: panelConfig?.charts,
|
|
466
|
+
filters: panelConfig.filters,
|
|
467
|
+
tabTitle: panelConfig.tabTitle,
|
|
468
|
+
table: panelConfig.table,
|
|
469
|
+
dropdowns: panelConfig.dropdowns,
|
|
470
|
+
buttons: panelConfig.buttons,
|
|
471
|
+
loginForDownload: panelConfig.loginForDownload,
|
|
472
|
+
sharedFiltersMap: panelConfig.sharedFiltersMap
|
|
473
|
+
}, `${panelConfig.tabTitle}-CohortPanel`)
|
|
474
|
+
}, `${panelConfig.tabTitle}-tabPanel`))
|
|
475
|
+
]
|
|
476
|
+
})
|
|
477
|
+
]
|
|
478
|
+
});
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
exports.default = CohortBuilder;
|
|
482
|
+
exports.useGetCurrentCohort = useGetCurrentCohort;
|
|
483
|
+
//# sourceMappingURL=CohortBuilder-BpJ7kZVF.js.map
|