@gen3/frontend 0.12.32 → 0.12.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/dts/components/Providers/Gen3Provider.d.ts +8 -8
  2. package/dist/dts/components/tailwindComponents.js +2 -2
  3. package/dist/dts/features/Analysis/AnalysisCardCompact.js +1 -1
  4. package/dist/dts/features/Analysis/AnalysisCardCompact.js.map +1 -1
  5. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +16 -16
  6. package/dist/dts/features/ClinicalDataAnalysis/CategoricalBinningModal.js +1 -1
  7. package/dist/dts/features/ClinicalDataAnalysis/CategoricalBinningModal.js.map +1 -1
  8. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js +2 -2
  9. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +1 -1
  10. package/dist/dts/features/CohortDiscovery/CohortDiscovery.js +1 -1
  11. package/dist/dts/features/CohortDiscovery/CohortDiscovery.js.map +1 -1
  12. package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +8 -8
  13. package/dist/dts/features/Crosswalk/CrosswalkPanel.js +1 -1
  14. package/dist/dts/features/Crosswalk/CrosswalkPanel.js.map +1 -1
  15. package/dist/dts/features/Dictionary/PropertiesTable.js +1 -1
  16. package/dist/dts/features/Dictionary/PropertiesTable.js.map +1 -1
  17. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js +1 -1
  18. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js.map +1 -1
  19. package/dist/dts/features/Discovery/DiscoveryTable/DiscoveryTable.d.ts.map +1 -1
  20. package/dist/dts/features/Discovery/DiscoveryTable/DiscoveryTable.js +2 -2
  21. package/dist/dts/features/Discovery/DiscoveryTable/DiscoveryTable.js.map +1 -1
  22. package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.js +1 -1
  23. package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.js.map +1 -1
  24. package/dist/dts/features/Study/StudyDetails/RendererFactory.d.ts.map +1 -1
  25. package/dist/dts/features/Study/StudyDetails/RendererFactory.js +2 -1
  26. package/dist/dts/features/Study/StudyDetails/RendererFactory.js.map +1 -1
  27. package/dist/dts/features/Study/StudyDetails/StudyDetails.d.ts +1 -1
  28. package/dist/dts/features/Study/StudyDetails/StudyDetails.d.ts.map +1 -1
  29. package/dist/dts/features/Study/StudyDetails/StudyDetails.js +2 -5
  30. package/dist/dts/features/Study/StudyDetails/StudyDetails.js.map +1 -1
  31. package/dist/dts/features/Study/StudyDetails/StudyDetailsPanel.d.ts.map +1 -1
  32. package/dist/dts/features/Study/StudyDetails/StudyDetailsPanel.js +2 -1
  33. package/dist/dts/features/Study/StudyDetails/StudyDetailsPanel.js.map +1 -1
  34. package/dist/dts/features/Study/StudyDetails/StudyGroup.d.ts.map +1 -1
  35. package/dist/dts/features/Study/StudyDetails/StudyGroup.js +1 -1
  36. package/dist/dts/features/Study/StudyDetails/StudyGroup.js.map +1 -1
  37. package/dist/dts/features/Study/StudyDetails/StudyItems.d.ts +17 -0
  38. package/dist/dts/features/Study/StudyDetails/StudyItems.d.ts.map +1 -1
  39. package/dist/dts/features/Study/StudyDetails/StudyItems.js +32 -6
  40. package/dist/dts/features/Study/StudyDetails/StudyItems.js.map +1 -1
  41. package/dist/dts/features/Study/types.d.ts +3 -2
  42. package/dist/dts/features/Study/types.d.ts.map +1 -1
  43. package/dist/dts/features/Study/types.js.map +1 -1
  44. package/dist/dts/features/Theme/ColorTheme.js +47 -47
  45. package/dist/dts/features/Theme/ColorTheme.js.map +1 -1
  46. package/dist/dts/features/Workspace/StatusAndControls.js +2 -2
  47. package/dist/dts/features/Workspace/StatusAndControls.js.map +1 -1
  48. package/dist/dts/utils/labels.d.ts +1 -2
  49. package/dist/dts/utils/labels.d.ts.map +1 -1
  50. package/dist/dts/utils/labels.js +3 -4
  51. package/dist/dts/utils/labels.js.map +1 -1
  52. package/dist/dts/utils/tests/labels.test.d.ts +2 -0
  53. package/dist/dts/utils/tests/labels.test.d.ts.map +1 -0
  54. package/dist/dts/utils/tests/labels.test.js +29 -0
  55. package/dist/dts/utils/tests/labels.test.js.map +1 -0
  56. package/dist/index/cjs/QueryPanel-drXE9Jc1.js +24 -0
  57. package/dist/index/cjs/QueryPanel-drXE9Jc1.js.map +1 -0
  58. package/dist/index/cjs/index-BL3Vrwc2.js +36891 -0
  59. package/dist/index/cjs/index-BL3Vrwc2.js.map +1 -0
  60. package/dist/index/cjs/index.js +2 -2
  61. package/dist/index/esm/QueryPanel-DfTwy5_m.js +22 -0
  62. package/dist/index/esm/QueryPanel-DfTwy5_m.js.map +1 -0
  63. package/dist/index/esm/index-Di7EHbDk.js +36644 -0
  64. package/dist/index/esm/index-Di7EHbDk.js.map +1 -0
  65. package/dist/index/esm/index.js +2 -2
  66. package/dist/index.d.ts +9 -8
  67. package/dist/pages/cjs/CohortBuilder-DbvPeQJG.js +491 -0
  68. package/dist/pages/cjs/CohortBuilder-DbvPeQJG.js.map +1 -0
  69. package/dist/pages/cjs/index-CcjID1Qk.js +27945 -0
  70. package/dist/pages/cjs/index-CcjID1Qk.js.map +1 -0
  71. package/dist/pages/cjs/index.js +2 -2
  72. package/dist/pages/esm/CohortBuilder-sLIEgDf7.js +488 -0
  73. package/dist/pages/esm/CohortBuilder-sLIEgDf7.js.map +1 -0
  74. package/dist/pages/esm/index-BQ62DeS4.js +27862 -0
  75. package/dist/pages/esm/index-BQ62DeS4.js.map +1 -0
  76. package/dist/pages/esm/index.js +2 -2
  77. package/dist/pages.d.ts +1 -0
  78. package/package.json +4 -5
@@ -1,4 +1,4 @@
1
- export { A as AISearchPageGetServerSideProps, a as AccessLevel, b as AccordionPanel, c as ActionBar, d as ActionButton, e as AdminAuthZPageGetServerSideProps, f as AiSearch, g as AiSearchPage, h as AnalysisCenter, i as AnalysisCenterWithSections, j as AnalysisEditorPage, k as AnalysisEditorPageGetServerSideProps, l as AnalysisPage, m as AnalysisPageGetServerSideProps, n as AuthzPage, B as BAD_DATA_MESSAGE, o as Banner, p as BaseModal, C as CardContainer, q as Charts, r as ClinicalDataAnalysisPage, s as ClinicalDataAnalysisServerSideProps, t as CohortActionButton, u as CohortBuilder, v as CohortDropdownActionButton, w as CohortManager, x as CohortManagerAndExpression, y as CollapsableCharts, z as CollapsableSidebar, D as ColorThemePage, E as ColorThemePageGetServerSideProps, F as ContentSource, G as CountsValue, H as CreateCredentialsAPIKeyModal, I as CrosswalkPage, J as CrosswalkPageGetServerSideProps, K as Custom403Page, L as Custom404Page, M as DAYS_IN_YEAR, N as DEFAULT_MAXIMUM, O as DEFAULT_MINIMUM, P as DEFAULT_VISIBLE_ITEMS, Q as DataDictionaryPage, R as DataLibraryPage, S as DataLibraryPageGetServerSideProps, T as DefaultAuthorizedRoutesConfig, U as DictionaryPageGetServerSideProps, V as DictionaryWithContext, W as DiscoveryCellRendererFactory, X as DiscoveryConfigProvider, Y as DiscoveryIndexPanel, Z as DiscoveryPage, _ as DiscoveryPageGetServerSideProps, $ as DownloadButton, a0 as DownloadsPanel, a1 as DropdownButton, a2 as DropdownPanel, a3 as DropdownWithIcon, a4 as EmptyTableMessage, a5 as EnumFacet, a6 as EnumFacetChart, a7 as ErrorCard, a8 as ExactValueFacet, a9 as ExplorerPage, aa as ExplorerPageGetServerSideProps, ab as ExplorerPageGetServerSidePropsForConfigId, ac as ExplorerTable, ad as ExplorerTableCellRendererFactory, ae as ExplorerTableDetailsPanelFactory, af as FacetControlsHeader, ag as FacetExpander, ah as FacetSelector, ai as FacetSortPanel, aj as FacetTabs, ak as FiltersPanel, al as FirstTimeModal, am as Footer, an as Gen3Button, ao as Gen3ButtonReverse, ap as Gen3Link, aq as Gen3ModalsProvider, ar as Gen3Provider, as as GqlQueryEditor, at as Header, au as HoverLink, av as IconButton, aw as JSONObjectDownloadButton, ax as LandingPage, ay as LandingPageGetServerSideProps, az as LoginButton, aA as LoginPage, aB as LoginPageGetServerSideProps, aC as LoginPanel, aD as LoginProvidersPanel, aE as MessageCard, aF as MessagePage, aG as MetadataDictionary, aH as MinutesToMilliseconds, aI as MultiSelectValueFacet, aJ as NavPageLayout, aK as NavigationBar, aL as NavigationButton, aM as NoAccessModal, aN as NotebookLitePage, aO as NotebookLitePageGetStaticProps, aP as Profile, aQ as ProfilePage, aR as ProfilePageGetServerSideProps, aS as ProfileProvider, aT as ProtectedContent, aU as ProtectedContentUI, aV as QueryExpression, aW as QueryExpressionContext, aX as QueryExpressionSection, aY as QueryPage, aZ as QueryPageGetServerSideProps, a_ as RangeFacet, a$ as ReactECharts, b0 as Repository, b1 as RepositoryPage, b2 as RepositoryPageGetServerSideProps, b3 as ResourcesFilters, b4 as SPECIAL_CASE_FIELDS, b5 as SegmentedControl, b6 as SessionExpiredModal, b7 as SinglePageStudyDetailsPanel, b8 as StaticNotebookIFrame, b9 as StudyDetailsPanel, ba as StudyGroup, bb as StudyGroupPanel, bc as StudyProvider, bd as SubmissionPage, be as SubmissionPageGetServerSideProps, bf as TabbedCohortBuilder, bg as TabbedCohortBuilderPage, bh as TabbedCohortBuilderPageGetServerSideProps, bi as TabbedPanel, bj as TableXPositionContext, bk as TagCloud, bl as TailwindConfig, bm as TopBar, bn as UploadJSONButton, bo as User, bp as WarningCard, bq as Workspace, br as WorkspaceNoAccessPage, bs as WorkspaceNoAccessPageServerSideProps, bt as WorkspacePage, bu as WorkspacePageGetServerSideProps, bv as accessibleFieldName, bw as addIntersectionToIncludes, bx as addUnion, by as analysisApiCohortDiscovery, bz as capitalize, bA as classifyFacets, bB as compareKeysAscending, bC as compareKeysDescending, bD as computeRowSpan, bE as convertMinutesToMilliseconds, bF as convertPathsToTree, bG as convertSecondsToMilliseconds, bH as convertToStringArray, bI as createCSSVariables, bJ as createLabelFromHistogramData, bK as createMantineTheme, bL as credentialsLogin, bM as credentialsLogout, bN as extractObjectKey, bO as extractRangeValues, bP as filterAggregationsDataKeys, bQ as focusStyles, bR as gen3Modals, bS as getAllFieldsFromFilterConfigs, bT as getByPath, bU as getCurrentUnixTimestamp, bV as getFormattedTimestamp, bW as getHighResolutionTimestamp, bX as getNavPageLayoutPropsFromConfig, bY as getParamsValueAsString, bZ as getTagInfo, b_ as hasOwnProperty, b$ as isArrayOfString, c0 as isEnumFacetResponse, c1 as isHeaderMetadata, c2 as isPropertyKey, c3 as isTextTransform, c4 as isTimeGreaterThan, c5 as itemsInCart, c6 as mapFacetSortToSortType, c7 as measureExecutionTime, c8 as processBucketData, c9 as processDefinedRangeData, ca as processLabel, cb as processRangeData, cc as processRangeKeyLabel, cd as registerCohortBuilderDefaultPreviewRenderers, ce as registerCohortDiscoveryApp, cf as registerCohortSimilarityApp, cg as registerDefaultDiscoveryDataLoaders, ch as registerDiscoveryDefaultCellRenderers, ci as registerDownloadButtonAction, cj as registerExplorerDefaultCellRenderers, ck as registerIGVApp, cl as registerMetadataSchemaApp, cm as removeIntersectionFromEnum, cn as removeKey, co as removeMultipleSlashes, cp as removeUnion, cq as resourcePathFromProjectID, cr as sessionLogout, cs as sessionToken, ct as stripTrailingSlash, cu as toDisplayName, cv as truncateString, cw as unixTimeToString, cx as updateFacetEnum, cy as useClearFilters, cz as useDiscoveryContext, cA as useExtractEnumFilterValues, cB as useExtractRangeFilterValues, cC as useFieldNameToLabel, cD as useGetFacetFilters, cE as useGuppyActionButton, cF as useUpdateFilters, cG as useUpdateFiltersFlat, cH as userHasMethodForServiceOnResource, cI as validateObjectHasRequiredFields } from './index-DxDRynQA.js';
1
+ export { A as AISearchPageGetServerSideProps, a as AccessLevel, b as AccordionPanel, c as ActionBar, d as ActionButton, e as AdminAuthZPageGetServerSideProps, f as AiSearch, g as AiSearchPage, h as AnalysisCenter, i as AnalysisCenterWithSections, j as AnalysisEditorPage, k as AnalysisEditorPageGetServerSideProps, l as AnalysisPage, m as AnalysisPageGetServerSideProps, n as AuthzPage, B as BAD_DATA_MESSAGE, o as Banner, p as BaseModal, C as CardContainer, q as Charts, r as ClinicalDataAnalysisPage, s as ClinicalDataAnalysisServerSideProps, t as CohortActionButton, u as CohortBuilder, v as CohortDropdownActionButton, w as CohortManager, x as CohortManagerAndExpression, y as CollapsableCharts, z as CollapsableSidebar, D as ColorThemePage, E as ColorThemePageGetServerSideProps, F as ContentSource, G as CountsValue, H as CreateCredentialsAPIKeyModal, I as CrosswalkPage, J as CrosswalkPageGetServerSideProps, K as Custom403Page, L as Custom404Page, M as DAYS_IN_YEAR, N as DEFAULT_MAXIMUM, O as DEFAULT_MINIMUM, P as DEFAULT_VISIBLE_ITEMS, Q as DataDictionaryPage, R as DataLibraryPage, S as DataLibraryPageGetServerSideProps, T as DefaultAuthorizedRoutesConfig, U as DictionaryPageGetServerSideProps, V as DictionaryWithContext, W as DiscoveryCellRendererFactory, X as DiscoveryConfigProvider, Y as DiscoveryIndexPanel, Z as DiscoveryPage, _ as DiscoveryPageGetServerSideProps, $ as DownloadButton, a0 as DownloadsPanel, a1 as DropdownButton, a2 as DropdownPanel, a3 as DropdownWithIcon, a4 as EmptyTableMessage, a5 as EnumFacet, a6 as EnumFacetChart, a7 as ErrorCard, a8 as ExactValueFacet, a9 as ExplorerPage, aa as ExplorerPageGetServerSideProps, ab as ExplorerPageGetServerSidePropsForConfigId, ac as ExplorerTable, ad as ExplorerTableCellRendererFactory, ae as ExplorerTableDetailsPanelFactory, af as FacetControlsHeader, ag as FacetExpander, ah as FacetSelector, ai as FacetSortPanel, aj as FacetTabs, ak as FiltersPanel, al as FirstTimeModal, am as Footer, an as Gen3Button, ao as Gen3ButtonReverse, ap as Gen3Link, aq as Gen3ModalsProvider, ar as Gen3Provider, as as GqlQueryEditor, at as Header, au as HoverLink, av as IconButton, aw as JSONObjectDownloadButton, ax as LandingPage, ay as LandingPageGetServerSideProps, az as LoginButton, aA as LoginPage, aB as LoginPageGetServerSideProps, aC as LoginPanel, aD as LoginProvidersPanel, aE as MessageCard, aF as MessagePage, aG as MetadataDictionary, aH as MinutesToMilliseconds, aI as MultiSelectValueFacet, aJ as NavPageLayout, aK as NavigationBar, aL as NavigationButton, aM as NoAccessModal, aN as NotebookLitePage, aO as NotebookLitePageGetStaticProps, aP as Profile, aQ as ProfilePage, aR as ProfilePageGetServerSideProps, aS as ProfileProvider, aT as ProtectedContent, aU as ProtectedContentUI, aV as QueryExpression, aW as QueryExpressionContext, aX as QueryExpressionSection, aY as QueryPage, aZ as QueryPageGetServerSideProps, a_ as RangeFacet, a$ as ReactECharts, b0 as Repository, b1 as RepositoryPage, b2 as RepositoryPageGetServerSideProps, b3 as ResourcesFilters, b4 as SPECIAL_CASE_FIELDS, b5 as SegmentedControl, b6 as SessionExpiredModal, b7 as SinglePageStudyDetailsPanel, b8 as StaticNotebookIFrame, b9 as StudyDetailsPanel, ba as StudyGroup, bb as StudyGroupPanel, bc as StudyProvider, bd as SubmissionPage, be as SubmissionPageGetServerSideProps, bf as TabbedCohortBuilder, bg as TabbedCohortBuilderPage, bh as TabbedCohortBuilderPageGetServerSideProps, bi as TabbedPanel, bj as TableXPositionContext, bk as TagCloud, bl as TailwindConfig, bm as TopBar, bn as UploadJSONButton, bo as User, bp as WarningCard, bq as Workspace, br as WorkspaceNoAccessPage, bs as WorkspaceNoAccessPageServerSideProps, bt as WorkspacePage, bu as WorkspacePageGetServerSideProps, bv as accessibleFieldName, bw as addIntersectionToIncludes, bx as addUnion, by as analysisApiCohortDiscovery, bz as capitalize, bA as classifyFacets, bB as compareKeysAscending, bC as compareKeysDescending, bD as computeRowSpan, bE as convertMinutesToMilliseconds, bF as convertPathsToTree, bG as convertSecondsToMilliseconds, bH as convertToStringArray, bI as createCSSVariables, bJ as createLabelFromHistogramData, bK as createMantineTheme, bL as credentialsLogin, bM as credentialsLogout, bN as extractObjectKey, bO as extractRangeValues, bP as filterAggregationsDataKeys, bQ as focusStyles, bR as gen3Modals, bS as getAllFieldsFromFilterConfigs, bT as getByPath, bU as getCurrentUnixTimestamp, bV as getFormattedTimestamp, bW as getHighResolutionTimestamp, bX as getNavPageLayoutPropsFromConfig, bY as getParamsValueAsString, bZ as getTagInfo, b_ as hasOwnProperty, b$ as isArrayOfString, c0 as isEnumFacetResponse, c1 as isHeaderMetadata, c2 as isPropertyKey, c3 as isTextTransform, c4 as isTimeGreaterThan, c5 as itemsInCart, c6 as mapFacetSortToSortType, c7 as measureExecutionTime, c8 as processBucketData, c9 as processDefinedRangeData, ca as processLabel, cb as processRangeData, cc as processRangeKeyLabel, cd as registerCohortBuilderDefaultPreviewRenderers, ce as registerCohortDiscoveryApp, cf as registerCohortSimilarityApp, cg as registerDefaultDiscoveryDataLoaders, ch as registerDiscoveryDefaultCellRenderers, ci as registerDownloadButtonAction, cj as registerExplorerDefaultCellRenderers, ck as registerIGVApp, cl as registerMetadataSchemaApp, cm as removeIntersectionFromEnum, cn as removeKey, co as removeMultipleSlashes, cp as removeUnion, cq as resourcePathFromProjectID, cr as sessionLogout, cs as sessionToken, ct as stripTrailingSlash, cu as toDisplayName, cv as truncateString, cw as unixTimeToString, cx as updateFacetEnum, cy as useClearFilters, cz as useDiscoveryContext, cA as useExtractEnumFilterValues, cB as useExtractRangeFilterValues, cC as useFieldNameToLabel, cD as useGetFacetFilters, cE as useGuppyActionButton, cF as useUpdateFilters, cG as useUpdateFiltersFlat, cH as userHasMethodForServiceOnResource, cI as validateObjectHasRequiredFields } from './index-Di7EHbDk.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@mantine/core';
@@ -52,7 +52,7 @@ import '@dnd-kit/core';
52
52
  import '@dnd-kit/sortable';
53
53
  import '@dnd-kit/utilities';
54
54
  import '@dnd-kit/modifiers';
55
- import 'typescript-pluralize';
55
+ import '@theothergothamdev/pluralize-ts';
56
56
  import 'universal-cookie';
57
57
  import 'graphiql';
58
58
  import '@tanstack/react-table';
package/dist/index.d.ts CHANGED
@@ -938,6 +938,7 @@ declare const validateObjectHasRequiredFields: (obj: any, requiredFields: string
938
938
  interface StudyDetailsField {
939
939
  name: string;
940
940
  field: string;
941
+ label?: string;
941
942
  contentType?: string;
942
943
  includeLabel?: boolean;
943
944
  includeIfNotAvailable?: boolean;
@@ -2634,6 +2635,7 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2634
2635
  black?: string | undefined;
2635
2636
  colors?: {
2636
2637
  [x: string & {}]: _mantine_core.MantineColorsTuple | undefined;
2638
+ green?: _mantine_core.MantineColorsTuple | undefined;
2637
2639
  dark?: _mantine_core.MantineColorsTuple | undefined;
2638
2640
  gray?: _mantine_core.MantineColorsTuple | undefined;
2639
2641
  red?: _mantine_core.MantineColorsTuple | undefined;
@@ -2643,7 +2645,6 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2643
2645
  indigo?: _mantine_core.MantineColorsTuple | undefined;
2644
2646
  blue?: _mantine_core.MantineColorsTuple | undefined;
2645
2647
  cyan?: _mantine_core.MantineColorsTuple | undefined;
2646
- green?: _mantine_core.MantineColorsTuple | undefined;
2647
2648
  lime?: _mantine_core.MantineColorsTuple | undefined;
2648
2649
  yellow?: _mantine_core.MantineColorsTuple | undefined;
2649
2650
  orange?: _mantine_core.MantineColorsTuple | undefined;
@@ -2662,7 +2663,7 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2662
2663
  headings?: {
2663
2664
  fontFamily?: string | undefined;
2664
2665
  fontWeight?: string | undefined;
2665
- textWrap?: "wrap" | "nowrap" | "balance" | "stable" | "pretty" | undefined;
2666
+ textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
2666
2667
  sizes?: {
2667
2668
  h1?: {
2668
2669
  fontSize?: string | undefined;
@@ -2698,8 +2699,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2698
2699
  } | undefined;
2699
2700
  radius?: {
2700
2701
  [x: string & {}]: string | undefined;
2701
- sm?: string | undefined;
2702
2702
  xs?: string | undefined;
2703
+ sm?: string | undefined;
2703
2704
  md?: string | undefined;
2704
2705
  lg?: string | undefined;
2705
2706
  xl?: string | undefined;
@@ -2708,40 +2709,40 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2708
2709
  spacing?: {
2709
2710
  [x: number]: string | undefined;
2710
2711
  [x: string & {}]: string | undefined;
2711
- sm?: string | undefined;
2712
2712
  xs?: string | undefined;
2713
+ sm?: string | undefined;
2713
2714
  md?: string | undefined;
2714
2715
  lg?: string | undefined;
2715
2716
  xl?: string | undefined;
2716
2717
  } | undefined;
2717
2718
  fontSizes?: {
2718
2719
  [x: string & {}]: string | undefined;
2719
- sm?: string | undefined;
2720
2720
  xs?: string | undefined;
2721
+ sm?: string | undefined;
2721
2722
  md?: string | undefined;
2722
2723
  lg?: string | undefined;
2723
2724
  xl?: string | undefined;
2724
2725
  } | undefined;
2725
2726
  lineHeights?: {
2726
2727
  [x: string & {}]: string | undefined;
2727
- sm?: string | undefined;
2728
2728
  xs?: string | undefined;
2729
+ sm?: string | undefined;
2729
2730
  md?: string | undefined;
2730
2731
  lg?: string | undefined;
2731
2732
  xl?: string | undefined;
2732
2733
  } | undefined;
2733
2734
  breakpoints?: {
2734
2735
  [x: string & {}]: string | undefined;
2735
- sm?: string | undefined;
2736
2736
  xs?: string | undefined;
2737
+ sm?: string | undefined;
2737
2738
  md?: string | undefined;
2738
2739
  lg?: string | undefined;
2739
2740
  xl?: string | undefined;
2740
2741
  } | undefined;
2741
2742
  shadows?: {
2742
2743
  [x: string & {}]: string | undefined;
2743
- sm?: string | undefined;
2744
2744
  xs?: string | undefined;
2745
+ sm?: string | undefined;
2745
2746
  md?: string | undefined;
2746
2747
  lg?: string | undefined;
2747
2748
  xl?: string | undefined;
@@ -0,0 +1,491 @@
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-CcjID1Qk.js');
10
+ var hooks = require('@mantine/hooks');
11
+ require('victory');
12
+ require('react-icons/bs');
13
+ require('react-icons/io');
14
+ require('@mantine/form');
15
+ require('react-icons/md');
16
+ require('react-icons/ri');
17
+ require('react-icons/fa');
18
+ require('react-icons/pi');
19
+ require('@iconify-icon/react');
20
+ require('@mantine/modals');
21
+ require('tailwind-merge');
22
+ require('next/head');
23
+ require('next/link');
24
+ require('next/image');
25
+ require('next/router');
26
+ require('next/navigation');
27
+ require('cookies-next');
28
+ require('swr');
29
+ require('jose');
30
+ require('cookie');
31
+ require('@gen3/core/server');
32
+ require('@mantine/notifications');
33
+ require('react-markdown');
34
+ require('react-icons/ai');
35
+ require('remark-gfm');
36
+ require('fs');
37
+ require('path');
38
+ require('mantine-react-table');
39
+ require('react-icons/ti');
40
+ require('react-icons/fi');
41
+ require('react-minisearch');
42
+ require('minisearch');
43
+ require('echarts');
44
+ require('file-saver');
45
+ require('tailwind-styled-components');
46
+ require('jsonpath-plus');
47
+ require('react-dom');
48
+ require('lodash/uniq');
49
+ require('lodash/sum');
50
+ require('react-icons/lu');
51
+ require('@tanstack/react-table');
52
+ require('@theothergothamdev/pluralize-ts');
53
+ require('next/dynamic');
54
+ require('rehype-sanitize');
55
+ require('react-cookie');
56
+ require('default-composer');
57
+ require('filesize');
58
+ require('@dnd-kit/core');
59
+ require('@dnd-kit/sortable');
60
+ require('@dnd-kit/utilities');
61
+ require('@dnd-kit/modifiers');
62
+ require('universal-cookie');
63
+
64
+ const toDisplayName = (field)=>{
65
+ const parsed = field.split('.');
66
+ const fieldName = parsed.at(-1);
67
+ if (!fieldName) return 'NotSet';
68
+ return fieldName.split('_').map((w)=>_.capitalize(w)).join(' ');
69
+ };
70
+
71
+ const EmptyData = {};
72
+ /**
73
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
74
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
75
+ *
76
+ * @param {Object} props The properties required to configure the CohortPanel component.
77
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
78
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
79
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
80
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
81
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
82
+ * @param {string} props.tabTitle Title for the filter tab section.
83
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
84
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
85
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
86
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
87
+ *
88
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
89
+ * summary charts, cohort manager, and data display components.
90
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
91
+ const isSm = hooks.useMediaQuery('(min-width: 639px)');
92
+ const isMd = hooks.useMediaQuery('(min-width: 1373px)');
93
+ const isXl = hooks.useMediaQuery('(min-width: 1600px)');
94
+ const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
95
+ const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
96
+ const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
97
+ dropdowns
98
+ ]);
99
+ const defaultButtons = React.useMemo(()=>buttons ?? [], [
100
+ buttons
101
+ ]);
102
+ const numCols = React.useMemo(()=>{
103
+ if (isSm) return 1;
104
+ if (isMd) return 2;
105
+ if (isXl) return 4;
106
+ return 3;
107
+ }, [
108
+ isSm,
109
+ isMd,
110
+ isXl
111
+ ]);
112
+ const index$1 = guppyConfig.dataType;
113
+ const indexPrefix = guppyConfig?.indexPrefix ?? '';
114
+ const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
115
+ filters?.tabs
116
+ ]);
117
+ const coreDispatch = core.useCoreDispatch();
118
+ const [facetDefinitions, setFacetDefinitions] = React.useState({});
119
+ const [summaryCharts, setSummaryCharts] = React.useState({});
120
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
121
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
122
+ const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
123
+ const toggleAllFiltersExpanded = (expand)=>{
124
+ coreDispatch(core.toggleCohortBuilderAllFilters({
125
+ expand,
126
+ index: index$1
127
+ }));
128
+ };
129
+ const clearAllFilters = React.useCallback(()=>{
130
+ coreDispatch(core.clearCohortFilters({
131
+ index: index$1
132
+ }));
133
+ }, [
134
+ coreDispatch,
135
+ index$1
136
+ ]);
137
+ const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
138
+ type: index$1,
139
+ fields: fields,
140
+ filters: cohortFilters,
141
+ accessibility: accessLevel,
142
+ queryId: cohortId,
143
+ indexPrefix: indexPrefix
144
+ });
145
+ const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
146
+ ...Object.keys(chartsSection?.charts ?? {}),
147
+ ...Object.keys(charts)
148
+ ], [
149
+ chartsSection?.charts,
150
+ charts
151
+ ]);
152
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
153
+ type: index$1,
154
+ fields: chartKeys,
155
+ filters: cohortFilters,
156
+ accessibility: accessLevel,
157
+ filterSelf: true,
158
+ queryId: cohortId,
159
+ indexPrefix: indexPrefix
160
+ }, {
161
+ skip: chartKeys.length === 0
162
+ });
163
+ const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
164
+ if (isChartSuccess && chartData) {
165
+ const cleanedData = {};
166
+ const totalCount = chartData._totalCount[0]?.count;
167
+ Object.keys(summaryCharts).forEach((key)=>{
168
+ if (!(key in chartData)) {
169
+ return;
170
+ } // handle missing key in data
171
+ // remove empty keys
172
+ cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
173
+ const facetDef = facetDefinitions?.[key];
174
+ if (facetDef?.excludeValues) {
175
+ cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
176
+ }
177
+ if (cleanedData[key].length === 0 && totalCount) {
178
+ // if no keys adds back no data
179
+ cleanedData[key] = [
180
+ {
181
+ key: 'no data',
182
+ count: totalCount
183
+ }
184
+ ];
185
+ }
186
+ });
187
+ return cleanedData;
188
+ }
189
+ return chartData;
190
+ }, [
191
+ chartData,
192
+ isChartSuccess,
193
+ summaryCharts
194
+ ]);
195
+ const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
196
+ let filters = undefined;
197
+ let combineMode = 'or';
198
+ if (field in cohortFilters.root) {
199
+ if (core.isIntersection(cohortFilters.root[field])) {
200
+ const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
201
+ if (intersectionFilters) {
202
+ filters = core.extractEnumFilterValue(intersectionFilters);
203
+ combineMode = 'and';
204
+ }
205
+ } else {
206
+ filters = core.extractEnumFilterValue(cohortFilters.root[field]);
207
+ }
208
+ }
209
+ return {
210
+ data: index.processBucketData(data?.[field]),
211
+ enumFilters: filters,
212
+ combineMode: combineMode,
213
+ isSuccess: isSuccess
214
+ };
215
+ }, [
216
+ cohortFilters.root,
217
+ data,
218
+ isSuccess
219
+ ]);
220
+ const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
221
+ return {
222
+ data: index.processRangeData(data?.[field]),
223
+ filters: index.extractRangeValues(cohortFilters.root[field]),
224
+ isSuccess: isSuccess
225
+ };
226
+ }, [
227
+ data,
228
+ cohortFilters.root,
229
+ isSuccess
230
+ ]);
231
+ // Set up the hooks for the facet components to use based on the required index
232
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
233
+ // @ts-ignore
234
+ const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
235
+ return {
236
+ // TODO: see if there a better way to do this
237
+ enum: {
238
+ useGetFacetData: getEnumFacetData,
239
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
240
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
241
+ useClearFilter: _.partial(index.useClearFilters, index$1),
242
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
243
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
244
+ useGetCombineMode: _.partial(index.useCohortFilterCombineState, index$1),
245
+ useSetCombineMode: _.partial(index.useSetCohortFilterCombineState, index$1),
246
+ useFieldNameToLabel: index.useFieldNameToLabel,
247
+ useTotalCounts: undefined
248
+ },
249
+ exact: {
250
+ useGetFacetData: getEnumFacetData,
251
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
252
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
253
+ useClearFilter: _.partial(index.useClearFilters, index$1),
254
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
255
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
256
+ useFieldNameToLabel: index.useFieldNameToLabel,
257
+ useTotalCounts: undefined
258
+ },
259
+ multiselect: {
260
+ useGetFacetData: getEnumFacetData,
261
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
262
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
263
+ useClearFilter: _.partial(index.useClearFilters, index$1),
264
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
265
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
266
+ useFieldNameToLabel: index.useFieldNameToLabel,
267
+ useTotalCounts: undefined
268
+ },
269
+ range: {
270
+ useGetFacetData: getRangeFacetData,
271
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
272
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
273
+ useClearFilter: _.partial(index.useClearFilters, index$1),
274
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
275
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
276
+ useFieldNameToLabel: index.useFieldNameToLabel,
277
+ useTotalCounts: undefined
278
+ }
279
+ };
280
+ }, [
281
+ getEnumFacetData,
282
+ getRangeFacetData,
283
+ index$1
284
+ ]);
285
+ // Set the facet definitions based on the data only the first time the data is loaded
286
+ useDeepCompare.useDeepCompareEffect(()=>{
287
+ if (isSuccess && Object.keys(facetDefinitions).length === 0) {
288
+ const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
289
+ return {
290
+ ...tab.fieldsConfig,
291
+ ...acc
292
+ };
293
+ }, {});
294
+ const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
295
+ setFacetDefinitions(facetDefs);
296
+ // setup summary charts since nested fields can be listed by the split field name
297
+ const chartDefinitions = chartsSection?.charts ?? charts;
298
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
299
+ let chartField = field;
300
+ if (facetDefs?.[field] === undefined) {
301
+ const res = Object.values(facetDefs).filter((def)=>{
302
+ return def.dataField === field;
303
+ });
304
+ if (res.length > 0) {
305
+ chartField = res[0].field;
306
+ }
307
+ }
308
+ return {
309
+ ...acc,
310
+ [chartField]: chartDefinitions[field]
311
+ };
312
+ }, {});
313
+ setSummaryCharts(summaryCharts);
314
+ }
315
+ }, [
316
+ isSuccess,
317
+ data,
318
+ facetDefinitions,
319
+ index$1,
320
+ guppyConfig.fieldMapping,
321
+ charts,
322
+ chartsSection
323
+ ]);
324
+ const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
325
+ type: index$1,
326
+ filters: cohortFilters,
327
+ accessibility: accessLevel,
328
+ queryId: cohortId
329
+ });
330
+ if (isCountsError || isAggsQueryError) {
331
+ return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
332
+ message: "Unable to fetch data from server"
333
+ }); // TODO: replace with configurable message
334
+ }
335
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
336
+ className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
337
+ children: [
338
+ /*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
339
+ index: index$1
340
+ }),
341
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
342
+ className: "flex w-full",
343
+ children: [
344
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
345
+ id: "cohort-builder-filters",
346
+ className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
347
+ children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
348
+ filters: filters,
349
+ tabTitle: tabTitle,
350
+ facetDefinitions: facetDefinitions,
351
+ facetDataHooks: facetDataHooks,
352
+ onAccessChange: setAccessLevel,
353
+ accessLevel: accessLevel,
354
+ showAccessLevel: showAccessLevel,
355
+ allFiltersCollapsed: allFiltersCollapsed,
356
+ toggleAllFiltersExpanded: toggleAllFiltersExpanded,
357
+ clearAllFilters: clearAllFilters
358
+ })
359
+ }),
360
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
361
+ id: "cohort-builder-content",
362
+ className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
363
+ children: [
364
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
365
+ className: "flex justify-between mb-2 ml-2",
366
+ children: [
367
+ /*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
368
+ dropdowns: defaultDropdowns,
369
+ buttons: defaultButtons,
370
+ loginForDownload: loginForDownload,
371
+ index: index$1,
372
+ totalCount: counts ?? 0,
373
+ fields: table?.fields ?? [],
374
+ filter: cohortFilters
375
+ }),
376
+ /*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
377
+ label: guppyConfig?.nodeCountTitle || toDisplayName(index$1),
378
+ counts: counts,
379
+ isFetching: isCountsFetching,
380
+ isError: isCountsError
381
+ })
382
+ ]
383
+ }),
384
+ chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
385
+ config: {
386
+ ...chartsSection,
387
+ charts: summaryCharts
388
+ },
389
+ data: cleanChartData ?? EmptyData,
390
+ isSuccess: isChartSuccess,
391
+ isFetching: isChartFetching,
392
+ isError: isChartError
393
+ }) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
394
+ charts: summaryCharts,
395
+ data: cleanChartData ?? EmptyData,
396
+ counts: counts,
397
+ isSuccess: isChartSuccess,
398
+ isError: isChartError,
399
+ numCols: numCols
400
+ }),
401
+ table?.enabled && /*#__PURE__*/ jsxRuntime.jsx("div", {
402
+ className: "mt-2 flex flex-col",
403
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
404
+ index: index$1,
405
+ tableConfig: table,
406
+ accessibility: accessLevel
407
+ })
408
+ })
409
+ ]
410
+ })
411
+ ]
412
+ })
413
+ ]
414
+ });
415
+ };
416
+
417
+ const TabsLayoutToComponentProp = (tabsLayout)=>{
418
+ if (!tabsLayout) {
419
+ return 'flex-start';
420
+ }
421
+ switch(tabsLayout){
422
+ case 'left':
423
+ {
424
+ return 'flex-start';
425
+ }
426
+ case 'right':
427
+ {
428
+ return 'flex-end';
429
+ }
430
+ case 'center':
431
+ {
432
+ return 'center';
433
+ }
434
+ default:
435
+ {
436
+ return 'flex-start';
437
+ }
438
+ }
439
+ };
440
+
441
+ const useGetCurrentCohort = ()=>{
442
+ return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
443
+ };
444
+ const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true, activeTab })=>{
445
+ const dispatch = core.useCoreDispatch();
446
+ dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
447
+ const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
448
+ explorerConfig
449
+ ]);
450
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
451
+ className: "flex flex-col w-full mt-2",
452
+ children: [
453
+ enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
454
+ /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
455
+ color: "primary.5",
456
+ variant: explorerConfig[0]?.tabType,
457
+ keepMounted: true,
458
+ defaultValue: activeTab ?? explorerConfig[0].tabTitle,
459
+ children: [
460
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
461
+ className: "w-full",
462
+ justify: TabsLayoutToComponentProp(tabsLayout),
463
+ children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
464
+ value: panelConfig.tabTitle,
465
+ children: panelConfig.tabTitle
466
+ }, `${panelConfig.tabTitle}-tabList`))
467
+ }),
468
+ configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
469
+ value: panelConfig.tabTitle,
470
+ children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
471
+ guppyConfig: panelConfig.guppyConfig,
472
+ chartsSection: panelConfig?.chartsSection,
473
+ charts: panelConfig?.charts,
474
+ filters: panelConfig.filters,
475
+ tabTitle: panelConfig.tabTitle,
476
+ table: panelConfig.table,
477
+ dropdowns: panelConfig.dropdowns,
478
+ buttons: panelConfig.buttons,
479
+ loginForDownload: panelConfig.loginForDownload,
480
+ sharedFiltersMap: panelConfig.sharedFiltersMap
481
+ }, `${panelConfig.tabTitle}-CohortPanel`)
482
+ }, `${panelConfig.tabTitle}-tabPanel`))
483
+ ]
484
+ })
485
+ ]
486
+ });
487
+ };
488
+
489
+ exports.default = CohortBuilder;
490
+ exports.useGetCurrentCohort = useGetCurrentCohort;
491
+ //# sourceMappingURL=CohortBuilder-DbvPeQJG.js.map