@gen3/frontend 0.12.58 → 0.12.60
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/dist/dts/api/auth/sessionToken.d.ts.map +1 -1
- package/dist/dts/api/auth/sessionToken.js +8 -1
- package/dist/dts/api/auth/sessionToken.js.map +1 -1
- package/dist/dts/api/auth/tests/sessionToken.unit.test.js +8 -0
- package/dist/dts/api/auth/tests/sessionToken.unit.test.js.map +1 -1
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.js +1 -1
- package/dist/dts/index.js.map +1 -1
- package/dist/dts/lib/session/session.d.ts.map +1 -1
- package/dist/dts/lib/session/session.js +143 -16
- package/dist/dts/lib/session/session.js.map +1 -1
- package/dist/dts/lib/session/tests/session.unit.test.js +23 -19
- package/dist/dts/lib/session/tests/session.unit.test.js.map +1 -1
- package/dist/dts/lib/session/types.d.ts +7 -0
- package/dist/dts/lib/session/types.d.ts.map +1 -1
- package/dist/index/cjs/QueryPanel-BwIcgyTi.js +43 -0
- package/dist/index/cjs/QueryPanel-BwIcgyTi.js.map +1 -0
- package/dist/index/cjs/QueryPanel-DQ8KpL3R.js +43 -0
- package/dist/index/cjs/QueryPanel-DQ8KpL3R.js.map +1 -0
- package/dist/index/cjs/index-DGj9a1Zu.js +41970 -0
- package/dist/index/cjs/index-DGj9a1Zu.js.map +1 -0
- package/dist/index/cjs/index-Di8LEo7-.js +41970 -0
- package/dist/index/cjs/index-Di8LEo7-.js.map +1 -0
- package/dist/index/cjs/index.js +1 -1
- package/dist/index/esm/QueryPanel-2gCmq1rt.js +37 -0
- package/dist/index/esm/QueryPanel-2gCmq1rt.js.map +1 -0
- package/dist/index/esm/QueryPanel-KVo-8hDP.js +37 -0
- package/dist/index/esm/QueryPanel-KVo-8hDP.js.map +1 -0
- package/dist/index/esm/index-C1DxNyiu.js +41683 -0
- package/dist/index/esm/index-C1DxNyiu.js.map +1 -0
- package/dist/index/esm/index-DrBCmUeR.js +41683 -0
- package/dist/index/esm/index-DrBCmUeR.js.map +1 -0
- package/dist/index/esm/index.js +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/pages/cjs/CohortBuilder-rnF1-3cH.js +576 -0
- package/dist/pages/cjs/CohortBuilder-rnF1-3cH.js.map +1 -0
- package/dist/pages/cjs/QueryPanel-X7Tup_5n.js +43 -0
- package/dist/pages/cjs/QueryPanel-X7Tup_5n.js.map +1 -0
- package/dist/pages/cjs/index-C1PAwqq-.js +32363 -0
- package/dist/pages/cjs/index-C1PAwqq-.js.map +1 -0
- package/dist/pages/cjs/index.js +1 -1
- package/dist/pages/esm/CohortBuilder-CJzS3nJj.js +573 -0
- package/dist/pages/esm/CohortBuilder-CJzS3nJj.js.map +1 -0
- package/dist/pages/esm/QueryPanel-DLih5nrl.js +37 -0
- package/dist/pages/esm/QueryPanel-DLih5nrl.js.map +1 -0
- package/dist/pages/esm/index-CN67ZTi4.js +32253 -0
- package/dist/pages/esm/index-CN67ZTi4.js.map +1 -0
- package/dist/pages/esm/index.js +1 -1
- package/dist/server/cjs/server.js +8 -1
- package/dist/server/cjs/server.js.map +1 -1
- package/dist/server/esm/server.js +8 -1
- package/dist/server/esm/server.js.map +1 -1
- package/package.json +5 -5
package/dist/index/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ACTIVITY_CHANNEL, a as AISearchPageGetServerSideProps, b as AccessLevel, c as AccordionPanel, d as ActionBar, e as ActionButton, f as AdminAuthZPageGetServerSideProps, g as AiSearch, h as AiSearchPage, i as AnalysisCenter, j as AnalysisCenterWithSections, k as AnalysisEditorPage, l as AnalysisEditorPageGetServerSideProps, m as AnalysisPage, n as AnalysisPageGetServerSideProps, o as AnalysisWithCloseButton, p as AuthzPage, B as BAD_DATA_MESSAGE, q as Banner, r as BaseModal, C as CardContainer, s as Charts, t as ClinicalDataAnalysisPage, u as ClinicalDataAnalysisServerSideProps, v as CohortActionButton, w as CohortBuilder, x as CohortDropdownActionButton, y as CohortManager, z as CohortManagerAndExpression, D as CollapsableCharts, E as CollapsableSidebar, F as ColorThemePage, G as ColorThemePageGetServerSideProps, H as ContentSource, I as CountsValue, J as CreateCredentialsAPIKeyModal, K as CrosswalkPage, L as CrosswalkPageGetServerSideProps, M as Custom403Page, N as Custom403PageGetServerSideProps, O as Custom404Page, P as Custom404PageGetServerSideProps, Q as DAYS_IN_YEAR, R as DEFAULT_MAXIMUM, S as DEFAULT_MINIMUM, T as DEFAULT_VISIBLE_ITEMS, U as DataDictionaryPage, V as DataLibraryPage, W as DataLibraryPageGetServerSideProps, X as DefaultAuthorizedRoutesConfig, Y as DictionaryPageGetServerSideProps, Z as DictionaryWithContext, _ as DiscoveryCellRendererFactory, $ as DiscoveryConfigProvider, a0 as DiscoveryIndexPanel, a1 as DiscoveryPage, a2 as DiscoveryPageGetServerSideProps, a3 as DownloadButton, a4 as DownloadsPanel, a5 as DropdownButton, a6 as DropdownPanel, a7 as DropdownWithIcon, a8 as EmptyTableMessage, a9 as EnumFacet, aa as EnumFacetChart, ab as ErrorCard, ac as ExactValueFacet, ad as ExplorerPage, ae as ExplorerPageGetServerSideProps, af as ExplorerPageGetServerSidePropsForConfigId, ag as ExplorerTable, ah as ExplorerTableCellRendererFactory, ai as ExplorerTableDetailsPanelFactory, aj as FacetControlsHeader, ak as FacetExpander, al as FacetSelector, am as FacetSortPanel, an as FacetTabs, ao as FileSummary, ap as FiltersPanel, aq as FirstTimeModal, ar as FixedNavPageLayout, as as Footer, at as Gen3Button, au as Gen3ButtonReverse, av as Gen3Link, aw as Gen3ModalsProvider, ax as Gen3Provider, ay as GqlQueryEditor, az as Header, aA as HoverLink, aB as IconButton, aC as InfoRolloverButton, aD as JSONObjectDownloadButton, aE as LandingPage, aF as LandingPageGetServerSideProps, aG as LoginButton, aH as LoginPage, aI as LoginPageGetServerSideProps, aJ as LoginPanel, aK as LoginProvidersPanel, aL as MessageCard, aM as MessagePage, aN as MetadataDictionary, aO as MultiSelectValueFacet, aP as NavPageLayout, aQ as NavigationBar, aR as NavigationButton, aS as NavigationRail, aT as NoAccessModal, aU as NotebookLitePage, aV as NotebookLitePageGetStaticProps, aW as OverflowTooltippedLabel, aX as PanelErrorBoundary, aY as Profile, aZ as ProfilePage, a_ as ProfilePageGetServerSideProps, a$ as ProfileProvider, b0 as ProtectedContent, b1 as ProtectedContentUI, b2 as ProtectedOverlay, b3 as QueryExpression, b4 as QueryExpressionContext, b5 as QueryExpressionSection, b6 as QueryPage, b7 as QueryPageGetServerSideProps, b8 as RangeFacet, b9 as ReactECharts, ba as Repository, bb as RepositoryPage, bc as RepositoryPageGetServerSideProps, bd as ResourcesFilters, be as SPECIAL_CASE_FIELDS, bf as SegmentedControl, bg as SessionExpiredModal, bh as SinglePageStudyDetailsPanel, bi as StaticNotebookIFrame, bj as StudyDetailsPanel, bk as StudyGroup, bl as StudyGroupPanel, bm as StudyProvider, bn as SubmissionPage, bo as SubmissionPageGetServerSideProps, bp as TabbedCohortBuilder, bq as TabbedCohortBuilderPage, br as TabbedCohortBuilderPageGetServerSideProps, bs as TabbedPanel, bt as TableXPositionContext, bu as TagCloud, bv as TailwindConfig, bw as TopBar, bx as UploadJSONButton, by as User, bz as WarningCard, bA as Workspace, bB as WorkspaceNoAccessPage, bC as WorkspaceNoAccessPageServerSideProps, bD as WorkspacePage, bE as WorkspacePageGetServerSideProps, bF as accessibleFieldName, bG as addIntersectionToIncludes, bH as addUnion, bI as analysisApiCohortDiscovery, bJ as capitalize, bK as classifyFacets, bL as compareKeysAscending, bM as compareKeysDescending, bN as computeRowSpan, bO as convertMinutesToMilliseconds, bP as convertPathsToTree, bQ as convertSecondsToMilliseconds, bR as convertToStringArray, bS as createCSSVariables, bT as createLabelFromHistogramData, bU as createMantineTheme, bV as credentialsLogin, bW as credentialsLogout, bX as extractObjectKey, bY as extractRangeValues, bZ as filterAggregationsDataKeys, b_ as focusStyles, b$ as gen3Modals, c0 as getAllFieldsFromFilterConfigs, c1 as getByPath, c2 as getCurrentUnixTimestamp, c3 as getFormattedTimestamp, c4 as getHighResolutionTimestamp, c5 as getNavPageLayoutPropsFromConfig, c6 as getParamsValueAsString, c7 as getTagInfo, c8 as hasOwnProperty, c9 as isArrayOfString, ca as isEnumFacetResponse, cb as isHeaderMetadata, cc as isPropertyKey, cd as isTextTransform, ce as isTimeGreaterThan, cf as itemsInCart, cg as mapFacetSortToSortType, ch as measureExecutionTime, ci as mergeDefaultTailwindClassnames, cj as minutesToMilliseconds, ck as processBucketData, cl as processDefinedRangeData, cm as processLabel, cn as processRangeData, co as processRangeKeyLabel, cp as registerCohortBuilderDefaultPreviewRenderers, cq as registerCohortDiscoveryApp, cr as registerCohortSimilarityApp, cs as registerDefaultDiscoveryDataLoaders, ct as registerDiscoveryDefaultCellRenderers, cu as registerDownloadButtonAction, cv as registerExplorerDefaultCellRenderers, cw as registerIGVApp, cx as registerMetadataSchemaApp, cy as removeIntersectionFromEnum, cz as removeKey, cA as removeMultipleSlashes, cB as removeUnion, cC as resourcePathFromProjectID, cD as sessionLogout, cE as sessionToken, cF as stripTrailingSlash, cG as toDisplayName, cH as truncateString, cI as typographyPlugin, cJ as unixTimeToString, cK as updateFacetEnum, cL as useClearFilters, cM as useDiscoveryContext, cN as useExtractEnumFilterValues, cO as useExtractRangeFilterValues, cP as useFieldNameToLabel, cQ as useGetFacetFilters, cR as useGuppyActionButton, cS as useUpdateFilters, cT as useUpdateFiltersFlat, cU as userHasMethodForServiceOnResource, cV as validateObjectHasRequiredFields, cW as withBasePath } from './index-
|
|
1
|
+
export { A as ACTIVITY_CHANNEL, a as AISearchPageGetServerSideProps, b as AccessLevel, c as AccordionPanel, d as ActionBar, e as ActionButton, f as AdminAuthZPageGetServerSideProps, g as AiSearch, h as AiSearchPage, i as AnalysisCenter, j as AnalysisCenterWithSections, k as AnalysisEditorPage, l as AnalysisEditorPageGetServerSideProps, m as AnalysisPage, n as AnalysisPageGetServerSideProps, o as AnalysisWithCloseButton, p as AuthzPage, B as BAD_DATA_MESSAGE, q as Banner, r as BaseModal, C as CardContainer, s as Charts, t as ClinicalDataAnalysisPage, u as ClinicalDataAnalysisServerSideProps, v as CohortActionButton, w as CohortBuilder, x as CohortDropdownActionButton, y as CohortManager, z as CohortManagerAndExpression, D as CollapsableCharts, E as CollapsableSidebar, F as ColorThemePage, G as ColorThemePageGetServerSideProps, H as ContentSource, I as CountsValue, J as CreateCredentialsAPIKeyModal, K as CrosswalkPage, L as CrosswalkPageGetServerSideProps, M as Custom403Page, N as Custom403PageGetServerSideProps, O as Custom404Page, P as Custom404PageGetServerSideProps, Q as DAYS_IN_YEAR, R as DEFAULT_MAXIMUM, S as DEFAULT_MINIMUM, T as DEFAULT_VISIBLE_ITEMS, U as DataDictionaryPage, V as DataLibraryPage, W as DataLibraryPageGetServerSideProps, X as DefaultAuthorizedRoutesConfig, Y as DictionaryPageGetServerSideProps, Z as DictionaryWithContext, _ as DiscoveryCellRendererFactory, $ as DiscoveryConfigProvider, a0 as DiscoveryIndexPanel, a1 as DiscoveryPage, a2 as DiscoveryPageGetServerSideProps, a3 as DownloadButton, a4 as DownloadsPanel, a5 as DropdownButton, a6 as DropdownPanel, a7 as DropdownWithIcon, a8 as EmptyTableMessage, a9 as EnumFacet, aa as EnumFacetChart, ab as ErrorCard, ac as ExactValueFacet, ad as ExplorerPage, ae as ExplorerPageGetServerSideProps, af as ExplorerPageGetServerSidePropsForConfigId, ag as ExplorerTable, ah as ExplorerTableCellRendererFactory, ai as ExplorerTableDetailsPanelFactory, aj as FacetControlsHeader, ak as FacetExpander, al as FacetSelector, am as FacetSortPanel, an as FacetTabs, ao as FileSummary, ap as FiltersPanel, aq as FirstTimeModal, ar as FixedNavPageLayout, as as Footer, at as Gen3Button, au as Gen3ButtonReverse, av as Gen3Link, aw as Gen3ModalsProvider, ax as Gen3Provider, ay as GqlQueryEditor, az as Header, aA as HoverLink, aB as IconButton, aC as InfoRolloverButton, aD as JSONObjectDownloadButton, aE as LandingPage, aF as LandingPageGetServerSideProps, aG as LoginButton, aH as LoginPage, aI as LoginPageGetServerSideProps, aJ as LoginPanel, aK as LoginProvidersPanel, aL as MessageCard, aM as MessagePage, aN as MetadataDictionary, aO as MultiSelectValueFacet, aP as NavPageLayout, aQ as NavigationBar, aR as NavigationButton, aS as NavigationRail, aT as NoAccessModal, aU as NotebookLitePage, aV as NotebookLitePageGetStaticProps, aW as OverflowTooltippedLabel, aX as PanelErrorBoundary, aY as Profile, aZ as ProfilePage, a_ as ProfilePageGetServerSideProps, a$ as ProfileProvider, b0 as ProtectedContent, b1 as ProtectedContentUI, b2 as ProtectedOverlay, b3 as QueryExpression, b4 as QueryExpressionContext, b5 as QueryExpressionSection, b6 as QueryPage, b7 as QueryPageGetServerSideProps, b8 as RangeFacet, b9 as ReactECharts, ba as Repository, bb as RepositoryPage, bc as RepositoryPageGetServerSideProps, bd as ResourcesFilters, be as SPECIAL_CASE_FIELDS, bf as SegmentedControl, bg as SessionExpiredModal, bh as SinglePageStudyDetailsPanel, bi as StaticNotebookIFrame, bj as StudyDetailsPanel, bk as StudyGroup, bl as StudyGroupPanel, bm as StudyProvider, bn as SubmissionPage, bo as SubmissionPageGetServerSideProps, bp as TabbedCohortBuilder, bq as TabbedCohortBuilderPage, br as TabbedCohortBuilderPageGetServerSideProps, bs as TabbedPanel, bt as TableXPositionContext, bu as TagCloud, bv as TailwindConfig, bw as TopBar, bx as UploadJSONButton, by as User, bz as WarningCard, bA as Workspace, bB as WorkspaceNoAccessPage, bC as WorkspaceNoAccessPageServerSideProps, bD as WorkspacePage, bE as WorkspacePageGetServerSideProps, bF as accessibleFieldName, bG as addIntersectionToIncludes, bH as addUnion, bI as analysisApiCohortDiscovery, bJ as capitalize, bK as classifyFacets, bL as compareKeysAscending, bM as compareKeysDescending, bN as computeRowSpan, bO as convertMinutesToMilliseconds, bP as convertPathsToTree, bQ as convertSecondsToMilliseconds, bR as convertToStringArray, bS as createCSSVariables, bT as createLabelFromHistogramData, bU as createMantineTheme, bV as credentialsLogin, bW as credentialsLogout, bX as extractObjectKey, bY as extractRangeValues, bZ as filterAggregationsDataKeys, b_ as focusStyles, b$ as gen3Modals, c0 as getAllFieldsFromFilterConfigs, c1 as getByPath, c2 as getCurrentUnixTimestamp, c3 as getFormattedTimestamp, c4 as getHighResolutionTimestamp, c5 as getNavPageLayoutPropsFromConfig, c6 as getParamsValueAsString, c7 as getTagInfo, c8 as hasOwnProperty, c9 as isArrayOfString, ca as isEnumFacetResponse, cb as isHeaderMetadata, cc as isPropertyKey, cd as isTextTransform, ce as isTimeGreaterThan, cf as itemsInCart, cg as mapFacetSortToSortType, ch as measureExecutionTime, ci as mergeDefaultTailwindClassnames, cj as minutesToMilliseconds, ck as processBucketData, cl as processDefinedRangeData, cm as processLabel, cn as processRangeData, co as processRangeKeyLabel, cp as registerCohortBuilderDefaultPreviewRenderers, cq as registerCohortDiscoveryApp, cr as registerCohortSimilarityApp, cs as registerDefaultDiscoveryDataLoaders, ct as registerDiscoveryDefaultCellRenderers, cu as registerDownloadButtonAction, cv as registerExplorerDefaultCellRenderers, cw as registerIGVApp, cx as registerMetadataSchemaApp, cy as removeIntersectionFromEnum, cz as removeKey, cA as removeMultipleSlashes, cB as removeUnion, cC as resourcePathFromProjectID, cD as sessionLogout, cE as sessionToken, cF as stripTrailingSlash, cG as toDisplayName, cH as truncateString, cI as typographyPlugin, cJ as unixTimeToString, cK as updateFacetEnum, cL as useClearFilters, cM as useDiscoveryContext, cN as useExtractEnumFilterValues, cO as useExtractRangeFilterValues, cP as useFieldNameToLabel, cQ as useGetFacetFilters, cR as useGuppyActionButton, cS as useUpdateFilters, cT as useUpdateFiltersFlat, cU as userHasMethodForServiceOnResource, cV as validateObjectHasRequiredFields, cW as withBasePath } from './index-DrBCmUeR.js';
|
|
2
2
|
import '@gen3/core';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactElement, PropsWithChildren, ComponentType, JSX as JSX$1, ReactNode, Dispatch, SetStateAction, CSSProperties, FC, RefObject
|
|
2
|
+
import React__default, { ReactElement, PropsWithChildren, ComponentType, JSX as JSX$1, ReactNode, Dispatch, SetStateAction, Component, CSSProperties, FC, RefObject } from 'react';
|
|
3
3
|
import { JSONObject, FacetDefinition, Modals, ServiceAndMethod, CartItem, HistogramDataArray, DataLibraryStoreMode, ExportDatasetFields, HistogramData, AggregationsData, EnumFilterValue, Accessibility, RawDataAndTotalCountsParams, useGetRawDataAndTotalCountsQuery, FacetSortType as FacetSortType$1, Operation, CombineMode, NumericFromTo, DataFetchingResult, IndexAndField, SharedFieldMapping, FilterSet, RemoteSupportConfiguration, CohortItem, FileItem, Includes, Intersection, OperatorWithFieldAndArrayOfOperands, FacetType } from '@gen3/core';
|
|
4
4
|
import * as _mantine_core from '@mantine/core';
|
|
5
5
|
import { ButtonProps, BoxProps, FloatingPosition, SegmentedControlProps as SegmentedControlProps$1, TitleOrder, ButtonVariant, TooltipProps } from '@mantine/core';
|
|
@@ -782,6 +782,20 @@ interface JsonFileSaverProps {
|
|
|
782
782
|
}
|
|
783
783
|
declare const JSONObjectDownloadButton: React__default.FC<JsonFileSaverProps>;
|
|
784
784
|
|
|
785
|
+
declare class PanelErrorBoundary extends Component<{
|
|
786
|
+
children: React__default.ReactNode;
|
|
787
|
+
}, {
|
|
788
|
+
error: Error | null;
|
|
789
|
+
}> {
|
|
790
|
+
state: {
|
|
791
|
+
error: Error | null;
|
|
792
|
+
};
|
|
793
|
+
static getDerivedStateFromError(error: Error): {
|
|
794
|
+
error: Error;
|
|
795
|
+
};
|
|
796
|
+
render(): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
797
|
+
}
|
|
798
|
+
|
|
785
799
|
interface CountsValueProps {
|
|
786
800
|
label: string;
|
|
787
801
|
counts?: number;
|
|
@@ -2927,20 +2941,6 @@ declare const DEFAULT_TOOLTIP_CLASSNAMES: {
|
|
|
2927
2941
|
};
|
|
2928
2942
|
declare const OverflowTooltippedLabel: ({ children, label, className, color, noTruncate, }: OverflowTooltippedLabelProps) => JSX$1.Element;
|
|
2929
2943
|
|
|
2930
|
-
declare class PanelErrorBoundary extends Component<{
|
|
2931
|
-
children: React__default.ReactNode;
|
|
2932
|
-
}, {
|
|
2933
|
-
error: Error | null;
|
|
2934
|
-
}> {
|
|
2935
|
-
state: {
|
|
2936
|
-
error: Error | null;
|
|
2937
|
-
};
|
|
2938
|
-
static getDerivedStateFromError(error: Error): {
|
|
2939
|
-
error: Error;
|
|
2940
|
-
};
|
|
2941
|
-
render(): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
2944
|
type NavigationRailItem = {
|
|
2945
2945
|
label: string;
|
|
2946
2946
|
tooltip?: string;
|
|
@@ -0,0 +1,576 @@
|
|
|
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 _ = require('lodash');
|
|
8
|
+
var core = require('@gen3/core');
|
|
9
|
+
var index = require('./index-C1PAwqq-.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/navigation');
|
|
24
|
+
require('next/image');
|
|
25
|
+
require('next/router');
|
|
26
|
+
require('next/link');
|
|
27
|
+
require('swr');
|
|
28
|
+
require('cookies-next');
|
|
29
|
+
require('jose');
|
|
30
|
+
require('@gen3/core/server');
|
|
31
|
+
require('cookie');
|
|
32
|
+
require('@mantine/notifications');
|
|
33
|
+
require('react-markdown');
|
|
34
|
+
require('react-icons/ai');
|
|
35
|
+
require('next/head');
|
|
36
|
+
require('remark-gfm');
|
|
37
|
+
require('rehype-sanitize');
|
|
38
|
+
require('fs');
|
|
39
|
+
require('path');
|
|
40
|
+
require('tailwind-styled-components');
|
|
41
|
+
require('file-saver');
|
|
42
|
+
require('@tanstack/react-table');
|
|
43
|
+
require('mantine-react-table-open');
|
|
44
|
+
require('react-icons/ti');
|
|
45
|
+
require('react-icons/fi');
|
|
46
|
+
require('@theothergothamdev/pluralize-ts');
|
|
47
|
+
require('jsonpath-plus');
|
|
48
|
+
require('redux-persist/integration/react');
|
|
49
|
+
require('redux-persist');
|
|
50
|
+
require('redux');
|
|
51
|
+
require('@reduxjs/toolkit');
|
|
52
|
+
require('redux-persist/lib/storage/createWebStorage');
|
|
53
|
+
require('filesize');
|
|
54
|
+
require('react-icons/lu');
|
|
55
|
+
require('react-dom');
|
|
56
|
+
require('react-minisearch');
|
|
57
|
+
require('minisearch');
|
|
58
|
+
require('lodash/uniq');
|
|
59
|
+
require('lodash/sum');
|
|
60
|
+
require('react-icons/fa6');
|
|
61
|
+
require('@dnd-kit/core');
|
|
62
|
+
require('@dnd-kit/sortable');
|
|
63
|
+
require('@dnd-kit/utilities');
|
|
64
|
+
require('@dnd-kit/modifiers');
|
|
65
|
+
require('universal-cookie');
|
|
66
|
+
require('next/dist/client/router');
|
|
67
|
+
require('react-cookie');
|
|
68
|
+
require('default-composer');
|
|
69
|
+
require('next/dynamic');
|
|
70
|
+
require('yaml');
|
|
71
|
+
require('@hello-pangea/dnd');
|
|
72
|
+
require('tailwindcss/plugin');
|
|
73
|
+
require('tailwindcss/colors');
|
|
74
|
+
require('postcss-selector-parser');
|
|
75
|
+
require('@tabler/icons-react');
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Hook that sets up an event bus for components to subscribe to and fire off events
|
|
79
|
+
* when an active Sower job is completed.
|
|
80
|
+
*/ const useSowerJobEventBus = ()=>{
|
|
81
|
+
const [listeners, setListeners] = React.useState({});
|
|
82
|
+
const [pollers, setPollers] = React.useState(new Set());
|
|
83
|
+
const [trigger, statusResult] = core.useLazyGetMultipleSowerJobStatusQuery({
|
|
84
|
+
pollingInterval: 10000,
|
|
85
|
+
skipPollingIfUnfocused: true
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Function for component to subscribe to sower job updates
|
|
89
|
+
* @param listenerKey unique key for component
|
|
90
|
+
* @param newPollers list of jobs to poll the status of
|
|
91
|
+
* @param callback function to call when a job completes
|
|
92
|
+
*/ const on = (listenerKey, newPollers, callback)=>{
|
|
93
|
+
setListeners({
|
|
94
|
+
...listeners,
|
|
95
|
+
[listenerKey]: callback
|
|
96
|
+
});
|
|
97
|
+
setPollers(new Set([
|
|
98
|
+
...pollers,
|
|
99
|
+
...newPollers
|
|
100
|
+
]));
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Function for component to unsubscribe to updates
|
|
104
|
+
* @param listenerKey unique key for component
|
|
105
|
+
*/ const off = (listenerKey)=>{
|
|
106
|
+
setListeners(Object.fromEntries(Object.entries(listeners).filter(([key])=>key === listenerKey)));
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Function to update the jobs that are polling
|
|
110
|
+
* @param job new job to add to pollers
|
|
111
|
+
*/ const update = (job)=>{
|
|
112
|
+
setPollers(new Set([
|
|
113
|
+
...pollers,
|
|
114
|
+
job
|
|
115
|
+
]));
|
|
116
|
+
};
|
|
117
|
+
React.useEffect(()=>{
|
|
118
|
+
void trigger(Array.from(pollers));
|
|
119
|
+
}, [
|
|
120
|
+
pollers
|
|
121
|
+
]);
|
|
122
|
+
React.useEffect(()=>{
|
|
123
|
+
if (statusResult.isSuccess) {
|
|
124
|
+
Object.entries(statusResult.currentData || {}).map(([job, response])=>{
|
|
125
|
+
if (response.status === 'Completed') {
|
|
126
|
+
Object.values(listeners).forEach((callback)=>callback(job));
|
|
127
|
+
// Remove job from pollers after it has completed
|
|
128
|
+
setPollers(new Set([
|
|
129
|
+
...pollers
|
|
130
|
+
].filter((poller)=>poller !== job)));
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}, [
|
|
135
|
+
statusResult
|
|
136
|
+
]);
|
|
137
|
+
return {
|
|
138
|
+
on,
|
|
139
|
+
off,
|
|
140
|
+
update
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const EmptyData = {};
|
|
145
|
+
/**
|
|
146
|
+
* CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
|
|
147
|
+
* It integrates with data services and facilitates visualization, filtering, and analysis tasks.
|
|
148
|
+
*
|
|
149
|
+
* @param {Object} props The properties required to configure the CohortPanel component.
|
|
150
|
+
* @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
|
|
151
|
+
* @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
|
|
152
|
+
* @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
|
|
153
|
+
* @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
|
|
154
|
+
* @param {Object} props.table Reference to the table configuration or component for displaying data.
|
|
155
|
+
* @param {string} props.tabTitle Title for the filter tab section.
|
|
156
|
+
* @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
|
|
157
|
+
* @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
|
|
158
|
+
* @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
|
|
159
|
+
* @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
|
|
160
|
+
*
|
|
161
|
+
* @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
|
|
162
|
+
* summary charts, cohort manager, and data display components.
|
|
163
|
+
*/ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
|
|
164
|
+
const isSm = hooks.useMediaQuery('(min-width: 639px)');
|
|
165
|
+
const isMd = hooks.useMediaQuery('(min-width: 1373px)');
|
|
166
|
+
const isXl = hooks.useMediaQuery('(min-width: 1600px)');
|
|
167
|
+
const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
|
|
168
|
+
const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
|
|
169
|
+
const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
|
|
170
|
+
dropdowns
|
|
171
|
+
]);
|
|
172
|
+
const defaultButtons = React.useMemo(()=>buttons ?? [], [
|
|
173
|
+
buttons
|
|
174
|
+
]);
|
|
175
|
+
const numCols = React.useMemo(()=>{
|
|
176
|
+
if (isSm) return 1;
|
|
177
|
+
if (isMd) return 2;
|
|
178
|
+
if (isXl) return 4;
|
|
179
|
+
return 3;
|
|
180
|
+
}, [
|
|
181
|
+
isSm,
|
|
182
|
+
isMd,
|
|
183
|
+
isXl
|
|
184
|
+
]);
|
|
185
|
+
const index$1 = guppyConfig.dataType;
|
|
186
|
+
const indexPrefix = guppyConfig?.indexPrefix ?? '';
|
|
187
|
+
const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
|
|
188
|
+
filters?.tabs
|
|
189
|
+
]);
|
|
190
|
+
const coreDispatch = core.useCoreDispatch();
|
|
191
|
+
const [facetDefinitions, setFacetDefinitions] = React.useState({});
|
|
192
|
+
const [summaryCharts, setSummaryCharts] = React.useState({});
|
|
193
|
+
const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
|
|
194
|
+
const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
|
|
195
|
+
const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
|
|
196
|
+
const toggleAllFiltersExpanded = (expand)=>{
|
|
197
|
+
coreDispatch(core.toggleCohortBuilderAllFilters({
|
|
198
|
+
expand,
|
|
199
|
+
index: index$1
|
|
200
|
+
}));
|
|
201
|
+
};
|
|
202
|
+
const clearAllFilters = React.useCallback(()=>{
|
|
203
|
+
coreDispatch(core.clearCohortFilters({
|
|
204
|
+
index: index$1
|
|
205
|
+
}));
|
|
206
|
+
}, [
|
|
207
|
+
coreDispatch,
|
|
208
|
+
index$1
|
|
209
|
+
]);
|
|
210
|
+
const { data, isSuccess, isError: isAggsQueryError } = core.useGetAggsQuery({
|
|
211
|
+
type: index$1,
|
|
212
|
+
fields: fields,
|
|
213
|
+
filters: cohortFilters,
|
|
214
|
+
accessibility: accessLevel,
|
|
215
|
+
queryId: cohortId,
|
|
216
|
+
indexPrefix: indexPrefix
|
|
217
|
+
});
|
|
218
|
+
const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
|
|
219
|
+
...Object.keys(chartsSection?.charts ?? {}),
|
|
220
|
+
...Object.keys(charts)
|
|
221
|
+
], [
|
|
222
|
+
chartsSection?.charts,
|
|
223
|
+
charts
|
|
224
|
+
]);
|
|
225
|
+
const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
|
|
226
|
+
type: index$1,
|
|
227
|
+
fields: chartKeys,
|
|
228
|
+
filters: cohortFilters,
|
|
229
|
+
accessibility: accessLevel,
|
|
230
|
+
filterSelf: true,
|
|
231
|
+
queryId: cohortId,
|
|
232
|
+
indexPrefix: indexPrefix
|
|
233
|
+
}, {
|
|
234
|
+
skip: chartKeys.length === 0
|
|
235
|
+
});
|
|
236
|
+
const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
|
|
237
|
+
if (isChartSuccess && chartData) {
|
|
238
|
+
const cleanedData = {};
|
|
239
|
+
const totalCount = chartData._totalCount[0]?.count;
|
|
240
|
+
Object.keys(summaryCharts).forEach((key)=>{
|
|
241
|
+
if (!(key in chartData)) {
|
|
242
|
+
return;
|
|
243
|
+
} // handle missing key in data
|
|
244
|
+
// remove empty keys
|
|
245
|
+
cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
|
|
246
|
+
const facetDef = facetDefinitions?.[key];
|
|
247
|
+
if (facetDef?.excludeValues) {
|
|
248
|
+
cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
|
|
249
|
+
}
|
|
250
|
+
if (cleanedData[key].length === 0 && totalCount) {
|
|
251
|
+
// if no keys adds back no data
|
|
252
|
+
cleanedData[key] = [
|
|
253
|
+
{
|
|
254
|
+
key: 'no data',
|
|
255
|
+
count: totalCount
|
|
256
|
+
}
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return cleanedData;
|
|
261
|
+
}
|
|
262
|
+
return chartData;
|
|
263
|
+
}, [
|
|
264
|
+
chartData,
|
|
265
|
+
isChartSuccess,
|
|
266
|
+
summaryCharts
|
|
267
|
+
]);
|
|
268
|
+
const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
|
|
269
|
+
let filters = undefined;
|
|
270
|
+
let combineMode = 'or';
|
|
271
|
+
if (field in cohortFilters.root) {
|
|
272
|
+
if (core.isIntersection(cohortFilters.root[field])) {
|
|
273
|
+
const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
|
|
274
|
+
if (intersectionFilters) {
|
|
275
|
+
filters = core.extractEnumFilterValue(intersectionFilters);
|
|
276
|
+
combineMode = 'and';
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
filters = core.extractEnumFilterValue(cohortFilters.root[field]);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
data: index.processBucketData(data?.[field]),
|
|
284
|
+
enumFilters: filters,
|
|
285
|
+
combineMode: combineMode,
|
|
286
|
+
isSuccess: isSuccess
|
|
287
|
+
};
|
|
288
|
+
}, [
|
|
289
|
+
cohortFilters.root,
|
|
290
|
+
data,
|
|
291
|
+
isSuccess
|
|
292
|
+
]);
|
|
293
|
+
const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
|
|
294
|
+
return {
|
|
295
|
+
data: index.processRangeData(data?.[field]),
|
|
296
|
+
filters: index.extractRangeValues(cohortFilters.root[field]),
|
|
297
|
+
isSuccess: isSuccess
|
|
298
|
+
};
|
|
299
|
+
}, [
|
|
300
|
+
data,
|
|
301
|
+
cohortFilters.root,
|
|
302
|
+
isSuccess
|
|
303
|
+
]);
|
|
304
|
+
// Set up the hooks for the facet components to use based on the required index
|
|
305
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
306
|
+
// @ts-ignore
|
|
307
|
+
const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
|
|
308
|
+
return {
|
|
309
|
+
// TODO: see if there a better way to do this
|
|
310
|
+
enum: {
|
|
311
|
+
useGetFacetData: getEnumFacetData,
|
|
312
|
+
useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
|
|
313
|
+
useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
|
|
314
|
+
useClearFilter: _.partial(index.useClearFilters, index$1),
|
|
315
|
+
useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
|
|
316
|
+
useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
|
|
317
|
+
useGetCombineMode: _.partial(index.useCohortFilterCombineState, index$1),
|
|
318
|
+
useSetCombineMode: _.partial(index.useSetCohortFilterCombineState, index$1),
|
|
319
|
+
useFieldNameToLabel: index.useFieldNameToLabel,
|
|
320
|
+
useTotalCounts: undefined
|
|
321
|
+
},
|
|
322
|
+
exact: {
|
|
323
|
+
useGetFacetData: getEnumFacetData,
|
|
324
|
+
useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
|
|
325
|
+
useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
|
|
326
|
+
useClearFilter: _.partial(index.useClearFilters, index$1),
|
|
327
|
+
useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
|
|
328
|
+
useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
|
|
329
|
+
useFieldNameToLabel: index.useFieldNameToLabel,
|
|
330
|
+
useTotalCounts: undefined
|
|
331
|
+
},
|
|
332
|
+
multiselect: {
|
|
333
|
+
useGetFacetData: getEnumFacetData,
|
|
334
|
+
useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
|
|
335
|
+
useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
|
|
336
|
+
useClearFilter: _.partial(index.useClearFilters, index$1),
|
|
337
|
+
useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
|
|
338
|
+
useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
|
|
339
|
+
useFieldNameToLabel: index.useFieldNameToLabel,
|
|
340
|
+
useTotalCounts: undefined
|
|
341
|
+
},
|
|
342
|
+
range: {
|
|
343
|
+
useGetFacetData: getRangeFacetData,
|
|
344
|
+
useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
|
|
345
|
+
useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
|
|
346
|
+
useClearFilter: _.partial(index.useClearFilters, index$1),
|
|
347
|
+
useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
|
|
348
|
+
useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
|
|
349
|
+
useFieldNameToLabel: index.useFieldNameToLabel,
|
|
350
|
+
useTotalCounts: undefined
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
}, [
|
|
354
|
+
getEnumFacetData,
|
|
355
|
+
getRangeFacetData,
|
|
356
|
+
index$1
|
|
357
|
+
]);
|
|
358
|
+
// Set the facet definitions based on the data only the first time the data is loaded
|
|
359
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
360
|
+
if (isSuccess && Object.keys(facetDefinitions).length === 0) {
|
|
361
|
+
const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
|
|
362
|
+
return {
|
|
363
|
+
...tab.fieldsConfig,
|
|
364
|
+
...acc
|
|
365
|
+
};
|
|
366
|
+
}, {});
|
|
367
|
+
const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
|
|
368
|
+
setFacetDefinitions(facetDefs);
|
|
369
|
+
// setup summary charts since nested fields can be listed by the split field name
|
|
370
|
+
const chartDefinitions = chartsSection?.charts ?? charts;
|
|
371
|
+
const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
|
|
372
|
+
let chartField = field;
|
|
373
|
+
if (facetDefs?.[field] === undefined) {
|
|
374
|
+
const res = Object.values(facetDefs).filter((def)=>{
|
|
375
|
+
return def.dataField === field;
|
|
376
|
+
});
|
|
377
|
+
if (res.length > 0) {
|
|
378
|
+
chartField = res[0].field;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
...acc,
|
|
383
|
+
[chartField]: chartDefinitions[field]
|
|
384
|
+
};
|
|
385
|
+
}, {});
|
|
386
|
+
setSummaryCharts(summaryCharts);
|
|
387
|
+
}
|
|
388
|
+
}, [
|
|
389
|
+
isSuccess,
|
|
390
|
+
data,
|
|
391
|
+
facetDefinitions,
|
|
392
|
+
index$1,
|
|
393
|
+
guppyConfig.fieldMapping,
|
|
394
|
+
charts,
|
|
395
|
+
chartsSection
|
|
396
|
+
]);
|
|
397
|
+
const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
|
|
398
|
+
type: index$1,
|
|
399
|
+
filters: cohortFilters,
|
|
400
|
+
accessibility: accessLevel,
|
|
401
|
+
queryId: cohortId
|
|
402
|
+
});
|
|
403
|
+
// oxlint-disable-next-line no-unused-vars
|
|
404
|
+
const [submitJob, result] = core.useSubmitSowerJobMutation();
|
|
405
|
+
const { update } = useSowerJobEventBus();
|
|
406
|
+
React.useEffect(()=>{
|
|
407
|
+
if (result?.data) {
|
|
408
|
+
update(result.data?.uid);
|
|
409
|
+
}
|
|
410
|
+
}, [
|
|
411
|
+
result
|
|
412
|
+
]);
|
|
413
|
+
if (isCountsError || isAggsQueryError) {
|
|
414
|
+
return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
|
|
415
|
+
message: "Unable to fetch data from server"
|
|
416
|
+
}); // TODO: replace with configurable message
|
|
417
|
+
}
|
|
418
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
419
|
+
className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
|
|
420
|
+
children: [
|
|
421
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
|
|
422
|
+
index: index$1
|
|
423
|
+
}),
|
|
424
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
425
|
+
className: "flex w-full",
|
|
426
|
+
children: [
|
|
427
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
428
|
+
id: "cohort-builder-filters",
|
|
429
|
+
className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
|
|
430
|
+
children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
|
|
431
|
+
filters: filters,
|
|
432
|
+
tabTitle: tabTitle,
|
|
433
|
+
facetDefinitions: facetDefinitions,
|
|
434
|
+
facetDataHooks: facetDataHooks,
|
|
435
|
+
onAccessChange: setAccessLevel,
|
|
436
|
+
accessLevel: accessLevel,
|
|
437
|
+
showAccessLevel: showAccessLevel,
|
|
438
|
+
allFiltersCollapsed: allFiltersCollapsed,
|
|
439
|
+
toggleAllFiltersExpanded: toggleAllFiltersExpanded,
|
|
440
|
+
clearAllFilters: clearAllFilters
|
|
441
|
+
})
|
|
442
|
+
}),
|
|
443
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
444
|
+
id: "cohort-builder-content",
|
|
445
|
+
className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
|
|
446
|
+
children: [
|
|
447
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
448
|
+
className: "flex justify-between mb-2 ml-2",
|
|
449
|
+
children: [
|
|
450
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
|
|
451
|
+
dropdowns: defaultDropdowns,
|
|
452
|
+
buttons: defaultButtons,
|
|
453
|
+
loginForDownload: loginForDownload,
|
|
454
|
+
index: index$1,
|
|
455
|
+
totalCount: counts ?? 0,
|
|
456
|
+
fields: table?.fields ?? [],
|
|
457
|
+
filter: cohortFilters
|
|
458
|
+
}),
|
|
459
|
+
/*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
|
|
460
|
+
label: guppyConfig?.nodeCountTitle || index.toDisplayName(index$1),
|
|
461
|
+
counts: counts,
|
|
462
|
+
isFetching: isCountsFetching,
|
|
463
|
+
isError: isCountsError
|
|
464
|
+
})
|
|
465
|
+
]
|
|
466
|
+
}),
|
|
467
|
+
chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
|
|
468
|
+
config: {
|
|
469
|
+
...chartsSection,
|
|
470
|
+
charts: summaryCharts
|
|
471
|
+
},
|
|
472
|
+
data: cleanChartData ?? EmptyData,
|
|
473
|
+
isSuccess: isChartSuccess,
|
|
474
|
+
isFetching: isChartFetching,
|
|
475
|
+
isError: isChartError
|
|
476
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
|
|
477
|
+
charts: summaryCharts,
|
|
478
|
+
data: cleanChartData ?? EmptyData,
|
|
479
|
+
counts: counts,
|
|
480
|
+
isSuccess: isChartSuccess,
|
|
481
|
+
isError: isChartError,
|
|
482
|
+
numCols: numCols
|
|
483
|
+
}),
|
|
484
|
+
table?.enabled && /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
485
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
486
|
+
className: "mt-2 flex flex-col",
|
|
487
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
|
|
488
|
+
index: index$1,
|
|
489
|
+
tableConfig: table,
|
|
490
|
+
accessibility: accessLevel
|
|
491
|
+
})
|
|
492
|
+
})
|
|
493
|
+
})
|
|
494
|
+
]
|
|
495
|
+
})
|
|
496
|
+
]
|
|
497
|
+
})
|
|
498
|
+
]
|
|
499
|
+
});
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
const TabsLayoutToComponentProp = (tabsLayout)=>{
|
|
503
|
+
if (!tabsLayout) {
|
|
504
|
+
return 'flex-start';
|
|
505
|
+
}
|
|
506
|
+
switch(tabsLayout){
|
|
507
|
+
case 'left':
|
|
508
|
+
{
|
|
509
|
+
return 'flex-start';
|
|
510
|
+
}
|
|
511
|
+
case 'right':
|
|
512
|
+
{
|
|
513
|
+
return 'flex-end';
|
|
514
|
+
}
|
|
515
|
+
case 'center':
|
|
516
|
+
{
|
|
517
|
+
return 'center';
|
|
518
|
+
}
|
|
519
|
+
default:
|
|
520
|
+
{
|
|
521
|
+
return 'flex-start';
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
const useGetCurrentCohort = ()=>{
|
|
527
|
+
return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
|
|
528
|
+
};
|
|
529
|
+
const CohortBuilder = ({ explorerConfig, sharedFiltersMap, tabsLayout = 'left', enableCohortManager = true, activeTab })=>{
|
|
530
|
+
const dispatch = core.useCoreDispatch();
|
|
531
|
+
dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
|
|
532
|
+
const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
|
|
533
|
+
explorerConfig
|
|
534
|
+
]);
|
|
535
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
536
|
+
className: "flex flex-col w-full mt-2",
|
|
537
|
+
children: [
|
|
538
|
+
enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
|
|
539
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
|
|
540
|
+
color: "primary.5",
|
|
541
|
+
variant: explorerConfig[0]?.tabType,
|
|
542
|
+
keepMounted: true,
|
|
543
|
+
defaultValue: activeTab ?? explorerConfig[0].tabTitle,
|
|
544
|
+
children: [
|
|
545
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
|
|
546
|
+
className: "w-full",
|
|
547
|
+
justify: TabsLayoutToComponentProp(tabsLayout),
|
|
548
|
+
children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
|
|
549
|
+
value: panelConfig.tabTitle,
|
|
550
|
+
children: panelConfig.tabTitle
|
|
551
|
+
}, `${panelConfig.tabTitle}-tabList`))
|
|
552
|
+
}),
|
|
553
|
+
configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
|
|
554
|
+
value: panelConfig.tabTitle,
|
|
555
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
|
|
556
|
+
guppyConfig: panelConfig.guppyConfig,
|
|
557
|
+
chartsSection: panelConfig?.chartsSection,
|
|
558
|
+
charts: panelConfig?.charts,
|
|
559
|
+
filters: panelConfig.filters,
|
|
560
|
+
tabTitle: panelConfig.tabTitle,
|
|
561
|
+
table: panelConfig.table,
|
|
562
|
+
dropdowns: panelConfig.dropdowns,
|
|
563
|
+
buttons: panelConfig.buttons,
|
|
564
|
+
loginForDownload: panelConfig.loginForDownload,
|
|
565
|
+
sharedFiltersMap: panelConfig.sharedFiltersMap
|
|
566
|
+
}, `${panelConfig.tabTitle}-CohortPanel`)
|
|
567
|
+
}, `${panelConfig.tabTitle}-tabPanel`))
|
|
568
|
+
]
|
|
569
|
+
})
|
|
570
|
+
]
|
|
571
|
+
});
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
exports.default = CohortBuilder;
|
|
575
|
+
exports.useGetCurrentCohort = useGetCurrentCohort;
|
|
576
|
+
//# sourceMappingURL=CohortBuilder-rnF1-3cH.js.map
|