synapse-react-client 4.0.38 → 4.0.40
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/SWC.index.js +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.d.ts +6 -2
- package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.js +3 -0
- package/dist/aridhia-queries/useAridhiaQuery.js.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts +2 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +60 -37
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +12 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js +56 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js +38 -30
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +15 -14
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts +11 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts.map +1 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js +37 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js.map +1 -0
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +2 -2
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts +10 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts.map +1 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js +11 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts +3 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.js +6 -0
- package/dist/components/Aridhia/rdcaDapConstants.js.map +1 -0
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js +50 -50
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +29 -6
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts +16 -7
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.js +79 -57
- package/dist/components/DataGrid/columns/DateTimeColumn.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +11 -8
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +18 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +8 -5
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/HasAccess/AccessIcon.d.ts +3 -1
- package/dist/components/HasAccess/AccessIcon.d.ts.map +1 -1
- package/dist/components/HasAccess/AccessIcon.js +11 -1
- package/dist/components/HasAccess/AccessIcon.js.map +1 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts +2 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts.map +1 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js +81 -53
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.d.ts.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.js +3 -2
- package/dist/components/ProjectInfo/ProjectInfo.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.css +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +6 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js +257 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +17 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +106 -0
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +7 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js +100 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +15 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +83 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.css +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts +21 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js +138 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js +17 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +79 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +39 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js +19 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +14 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js +89 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderId.d.ts +2 -0
- package/dist/components/QueryBuilder/queryBuilderId.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderId.js +9 -0
- package/dist/components/QueryBuilder/queryBuilderId.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +24 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +91 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts +58 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js +200 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +3 -2
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +82 -84
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts +11 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js +29 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js +27 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js.map +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +14 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +185 -120
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +1 -0
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +11 -11
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts +7 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +76 -71
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts +3 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +24 -13
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts +23 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts.map +1 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js +29 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js.map +1 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts +6 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +92 -79
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +3 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +9 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/menu/ComplexMenu.js +1 -1
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +4 -0
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts +10 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js +20 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +29 -20
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +16 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js +70 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +47 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +24 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +62 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +18 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +39 -33
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +5 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +65 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +49 -47
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +7 -0
- package/dist/style/components/_query-wrapper-plot-nav.scss +9 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +6 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +17 -2
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/chat/useChat.d.ts.map +1 -1
- package/dist/synapse-queries/chat/useChat.js +2 -4
- package/dist/synapse-queries/chat/useChat.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.d.ts +2 -0
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +5 -3
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +41 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +63 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -0
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts +21 -0
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js +34 -0
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js.map +1 -0
- package/dist/synapse-queries/index.js +190 -180
- package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +0 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/jsonschema/getType.d.ts.map +1 -1
- package/dist/utils/jsonschema/getType.js +4 -1
- package/dist/utils/jsonschema/getType.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.group {
|
|
2
|
+
position: relative;
|
|
3
|
+
padding: 8px 0 8px 16px;
|
|
4
|
+
border-left: 2px solid
|
|
5
|
+
var(--qb-accent-color, var(--synapse-primary-action-color));
|
|
6
|
+
border-radius: 2px 0 0 2px;
|
|
7
|
+
|
|
8
|
+
&.nested {
|
|
9
|
+
margin-top: 4px;
|
|
10
|
+
margin-bottom: 4px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 12px;
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
margin-bottom: 4px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.combinator :global(.MuiToggleButton-root) {
|
|
23
|
+
text-transform: none;
|
|
24
|
+
padding: 2px 12px;
|
|
25
|
+
min-width: 44px;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
border-color: var(--synapse-gray-dark);
|
|
28
|
+
color: var(--synapse-gray-regular);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.combinator :global(.MuiToggleButton-root.Mui-selected) {
|
|
32
|
+
background-color: var(--qb-accent-color, var(--synapse-primary-action-color));
|
|
33
|
+
color: white;
|
|
34
|
+
border-color: var(--qb-accent-color, var(--synapse-primary-action-color));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.combinator :global(.MuiToggleButton-root.Mui-selected:hover) {
|
|
38
|
+
background-color: var(--qb-accent-color, var(--synapse-primary-action-color));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.notToggle {
|
|
42
|
+
text-transform: none;
|
|
43
|
+
padding: 2px 12px;
|
|
44
|
+
border-color: var(--synapse-gray-dark);
|
|
45
|
+
color: var(--synapse-gray-regular);
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
font-size: 13px;
|
|
48
|
+
|
|
49
|
+
&:global(.Mui-selected),
|
|
50
|
+
&:global(.Mui-selected:hover) {
|
|
51
|
+
background-color: var(--synapse-error);
|
|
52
|
+
color: white;
|
|
53
|
+
border-color: var(--synapse-error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.actions {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 4px;
|
|
61
|
+
margin-left: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.actionButton {
|
|
65
|
+
text-transform: none;
|
|
66
|
+
padding: 2px 8px;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
color: var(--synapse-primary-action-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.children {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: 2px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.emptyState {
|
|
79
|
+
padding: 8px 4px;
|
|
80
|
+
color: var(--synapse-gray-deemphasized);
|
|
81
|
+
font-style: italic;
|
|
82
|
+
font-size: 13px;
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._root_x90xm_1{background:var(--synapse-background-color-gray-light);border:1px solid var(--synapse-border-color-gray);border-radius:4px;flex-direction:column;gap:12px;padding:12px;display:flex}._applyRow_x90xm_11{justify-content:flex-end;display:flex}._applyButton_x90xm_16{text-transform:none}._summaryBar_x90xm_20{border:1px solid var(--synapse-border-color-gray);background:#fff;border-radius:4px;flex-direction:column;align-items:stretch;gap:6px;padding:8px 12px;display:flex}._summaryHeader_x90xm_31{justify-content:space-between;align-items:center;gap:12px;display:flex}._summaryLabel_x90xm_38{text-transform:uppercase;letter-spacing:.5px;color:var(--synapse-gray-regular);font-size:11px;font-weight:700}._summaryContent_x90xm_46{word-break:break-word;font-size:14px;line-height:1.5}._summaryModeToggle_x90xm_52{flex-shrink:0}._summaryModeToggle_x90xm_52 .MuiToggleButton-root{text-transform:none;padding:2px 12px;font-size:12px}._sqlPlaceholder_x90xm_61{color:var(--synapse-gray-deemphasized);font-style:italic}._sqlText_x90xm_66{font-family:var(--synapse-font-family-mono,monospace);white-space:pre-wrap;word-break:break-word;color:var(--synapse-gray-1000);font-size:12px;display:block}._sqlError_x90xm_75{color:var(--synapse-error);font-size:13px}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { QBGroup } from './QueryBuilderTypes';
|
|
2
|
+
export type QueryBuilderControlsProps = {
|
|
3
|
+
/** The QB tree. When null, an empty default tree is rendered. */
|
|
4
|
+
tree: QBGroup | null;
|
|
5
|
+
/** Called with the next tree after any dispatched edit. */
|
|
6
|
+
onTreeChange: (next: QBGroup) => void;
|
|
7
|
+
/**
|
|
8
|
+
* When true, the property picker only offers columns that have facet
|
|
9
|
+
* metadata (Cohort Builder mode). Defaults to false.
|
|
10
|
+
*/
|
|
11
|
+
onlyFacetedColumns?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Top-level Query Builder panel. Uses `useQBFacetSourceMetadata()` — must be
|
|
15
|
+
* rendered inside the Suspense boundary that already wraps
|
|
16
|
+
* `QueryVisualizationWrapper` in `QueryWrapperPlotNav`. Facet metadata is
|
|
17
|
+
* pulled from a companion query that strips the QB's own `FilterGroup` out
|
|
18
|
+
* of `additionalFilters` so pill values remain stable while the user builds.
|
|
19
|
+
*/
|
|
20
|
+
export declare function QueryBuilderControls(props: QueryBuilderControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=QueryBuilderControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilderControls.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/QueryBuilderControls.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAe,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAI1D,MAAM,MAAM,yBAAyB,GAAG;IACtC,iEAAiE;IACjE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACpB,2DAA2D;IAC3D,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CA+KpE"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { isFilterGroup as e } from "../../utils/types/IsType.js";
|
|
2
|
+
import { useQueryContext as t } from "../QueryContext/QueryContext.js";
|
|
3
|
+
import "../QueryContext/index.js";
|
|
4
|
+
import { useQueryVisualizationContext as n } from "../QueryVisualizationWrapper/QueryVisualizationContext.js";
|
|
5
|
+
import "../QueryVisualizationWrapper/index.js";
|
|
6
|
+
import { QueryBuilderInternalContextProvider as r } from "./QueryBuilderInternalContext.js";
|
|
7
|
+
import { addChildGroup as i, addConditionToGroup as a, clearGroup as o, defaultQBGroup as s, removeNode as c, updateCondition as l, updateGroup as u } from "./queryBuilderOperations.js";
|
|
8
|
+
import { FilterGroupNode as d } from "./FilterGroupNode.js";
|
|
9
|
+
import { qbNodeToApiFilter as f } from "./queryBuilderTranslation.js";
|
|
10
|
+
import { qbTreeToReadable as p } from "./qbTreeToReadable.js";
|
|
11
|
+
import m from "./QueryBuilderControls.module.js";
|
|
12
|
+
import { useQBCombinedSql as h } from "./useQBCombinedSql.js";
|
|
13
|
+
import { useQBFacetSourceMetadata as g } from "./useQBFacetSourceMetadata.js";
|
|
14
|
+
import { useCallback as _, useMemo as v, useState as y } from "react";
|
|
15
|
+
import { Button as b, ToggleButton as x, ToggleButtonGroup as S } from "@mui/material";
|
|
16
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
17
|
+
//#region src/components/QueryBuilder/QueryBuilderControls.tsx
|
|
18
|
+
function T(T) {
|
|
19
|
+
let { tree: E, onTreeChange: D, onlyFacetedColumns: O = !1 } = T, { columnModels: k, facetResults: A } = g(), { executeQueryRequest: j } = t(), M = E ?? s(), N = _(() => {
|
|
20
|
+
let t = f(M);
|
|
21
|
+
j((n) => {
|
|
22
|
+
let r = (n.query.additionalFilters ?? []).filter((t) => !e(t)), i = t ? [...r, t] : r;
|
|
23
|
+
return {
|
|
24
|
+
...n,
|
|
25
|
+
query: {
|
|
26
|
+
...n.query,
|
|
27
|
+
additionalFilters: i.length > 0 ? i : void 0
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}, [M, j]), { getColumnDisplayName: P } = n(), [F, I] = y("plain-english"), L = _((e) => {
|
|
32
|
+
D(a(M, e, null, null));
|
|
33
|
+
}, [M, D]), R = _((e) => {
|
|
34
|
+
D(i(M, e));
|
|
35
|
+
}, [M, D]), z = _((e) => {
|
|
36
|
+
D(o(M, e));
|
|
37
|
+
}, [M, D]), B = _((e, t) => {
|
|
38
|
+
D(u(M, e, t));
|
|
39
|
+
}, [M, D]), V = _((e) => {
|
|
40
|
+
D(c(M, e));
|
|
41
|
+
}, [M, D]), H = _((e, t) => {
|
|
42
|
+
D(l(M, e, t));
|
|
43
|
+
}, [M, D]), U = _((e) => {
|
|
44
|
+
D(c(M, e));
|
|
45
|
+
}, [M, D]), W = v(() => ({
|
|
46
|
+
columnModels: k,
|
|
47
|
+
facetResults: A,
|
|
48
|
+
onlyFacetedColumns: O,
|
|
49
|
+
getColumnDisplayName: P,
|
|
50
|
+
addConditionAt: L,
|
|
51
|
+
addChildGroupAt: R,
|
|
52
|
+
clearGroupAt: z,
|
|
53
|
+
updateGroupAt: B,
|
|
54
|
+
removeGroupAt: V,
|
|
55
|
+
updateConditionAt: H,
|
|
56
|
+
removeConditionAt: U
|
|
57
|
+
}), [
|
|
58
|
+
k,
|
|
59
|
+
A,
|
|
60
|
+
O,
|
|
61
|
+
P,
|
|
62
|
+
L,
|
|
63
|
+
R,
|
|
64
|
+
z,
|
|
65
|
+
B,
|
|
66
|
+
V,
|
|
67
|
+
H,
|
|
68
|
+
U
|
|
69
|
+
]), G = v(() => p(M, P), [M, P]), { data: K, isPending: q, error: J } = h(F === "sql" ? M : null);
|
|
70
|
+
return /* @__PURE__ */ C(r, {
|
|
71
|
+
value: W,
|
|
72
|
+
children: /* @__PURE__ */ w("div", {
|
|
73
|
+
className: m.root,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ w("div", {
|
|
76
|
+
className: m.summaryBar,
|
|
77
|
+
children: [/* @__PURE__ */ w("div", {
|
|
78
|
+
className: m.summaryHeader,
|
|
79
|
+
children: [/* @__PURE__ */ C("span", {
|
|
80
|
+
className: m.summaryLabel,
|
|
81
|
+
children: "Query Summary"
|
|
82
|
+
}), /* @__PURE__ */ w(S, {
|
|
83
|
+
className: m.summaryModeToggle,
|
|
84
|
+
size: "small",
|
|
85
|
+
exclusive: !0,
|
|
86
|
+
value: F,
|
|
87
|
+
onChange: (e, t) => {
|
|
88
|
+
t != null && I(t);
|
|
89
|
+
},
|
|
90
|
+
"aria-label": "Query summary display mode",
|
|
91
|
+
children: [/* @__PURE__ */ C(x, {
|
|
92
|
+
value: "plain-english",
|
|
93
|
+
"aria-label": "Show summary",
|
|
94
|
+
children: "Summary"
|
|
95
|
+
}), /* @__PURE__ */ C(x, {
|
|
96
|
+
value: "sql",
|
|
97
|
+
"aria-label": "Show SQL",
|
|
98
|
+
children: "SQL"
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
}), /* @__PURE__ */ C("div", {
|
|
102
|
+
className: m.summaryContent,
|
|
103
|
+
"aria-live": "polite",
|
|
104
|
+
"aria-atomic": "true",
|
|
105
|
+
children: F === "plain-english" ? G : J ? /* @__PURE__ */ w("span", {
|
|
106
|
+
className: m.sqlError,
|
|
107
|
+
children: ["Could not load SQL preview: ", J.message]
|
|
108
|
+
}) : q ? /* @__PURE__ */ C("span", {
|
|
109
|
+
className: m.sqlPlaceholder,
|
|
110
|
+
children: "Loading SQL…"
|
|
111
|
+
}) : /* @__PURE__ */ C("code", {
|
|
112
|
+
className: m.sqlText,
|
|
113
|
+
children: K
|
|
114
|
+
})
|
|
115
|
+
})]
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ C(d, {
|
|
118
|
+
group: M,
|
|
119
|
+
isRoot: !0
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ C("div", {
|
|
122
|
+
className: m.applyRow,
|
|
123
|
+
children: /* @__PURE__ */ C(b, {
|
|
124
|
+
variant: "contained",
|
|
125
|
+
color: "primary",
|
|
126
|
+
onClick: N,
|
|
127
|
+
className: m.applyButton,
|
|
128
|
+
children: "Update Results"
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { T as QueryBuilderControls };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=QueryBuilderControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilderControls.js","names":[],"sources":["../../../src/components/QueryBuilder/QueryBuilderControls.tsx"],"sourcesContent":["import { Button, ToggleButton, ToggleButtonGroup } from '@mui/material'\nimport { useCallback, useMemo, useState } from 'react'\nimport { isFilterGroup } from '../../utils/types/IsType'\nimport { useQueryContext } from '../QueryContext'\nimport { useQueryVisualizationContext } from '../QueryVisualizationWrapper'\nimport { FilterGroupNode } from './FilterGroupNode'\nimport { qbNodeToApiFilter } from './queryBuilderTranslation'\nimport { qbTreeToReadable } from './qbTreeToReadable'\nimport { QueryBuilderInternalContextProvider } from './QueryBuilderInternalContext'\nimport styles from './QueryBuilderControls.module.scss'\nimport {\n addChildGroup,\n addConditionToGroup,\n clearGroup,\n defaultQBGroup,\n removeNode,\n updateCondition,\n updateGroup,\n} from './queryBuilderOperations'\nimport { QBCondition, QBGroup } from './QueryBuilderTypes'\nimport { useQBCombinedSql } from './useQBCombinedSql'\nimport { useQBFacetSourceMetadata } from './useQBFacetSourceMetadata'\n\nexport type QueryBuilderControlsProps = {\n /** The QB tree. When null, an empty default tree is rendered. */\n tree: QBGroup | null\n /** Called with the next tree after any dispatched edit. */\n onTreeChange: (next: QBGroup) => void\n /**\n * When true, the property picker only offers columns that have facet\n * metadata (Cohort Builder mode). Defaults to false.\n */\n onlyFacetedColumns?: boolean\n}\n\ntype SummaryMode = 'plain-english' | 'sql'\n\n/**\n * Top-level Query Builder panel. Uses `useQBFacetSourceMetadata()` — must be\n * rendered inside the Suspense boundary that already wraps\n * `QueryVisualizationWrapper` in `QueryWrapperPlotNav`. Facet metadata is\n * pulled from a companion query that strips the QB's own `FilterGroup` out\n * of `additionalFilters` so pill values remain stable while the user builds.\n */\nexport function QueryBuilderControls(props: QueryBuilderControlsProps) {\n const { tree, onTreeChange, onlyFacetedColumns = false } = props\n const { columnModels, facetResults } = useQBFacetSourceMetadata()\n const { executeQueryRequest } = useQueryContext()\n\n const activeTree = tree ?? defaultQBGroup()\n\n const onApply = useCallback(() => {\n const filterGroup = qbNodeToApiFilter(activeTree)\n executeQueryRequest(prev => {\n // Preserve any non-QB additionalFilters (e.g. lockedColumn constraints\n // introduced by portal detail pages) — Update Results only owns the\n // FilterGroup slot.\n const preserved = (prev.query.additionalFilters ?? []).filter(\n f => !isFilterGroup(f),\n )\n const next = filterGroup ? [...preserved, filterGroup] : preserved\n return {\n ...prev,\n query: {\n ...prev.query,\n additionalFilters: next.length > 0 ? next : undefined,\n },\n }\n })\n }, [activeTree, executeQueryRequest])\n\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n const [summaryMode, setSummaryMode] = useState<SummaryMode>('plain-english')\n\n const addConditionAt = useCallback(\n (groupId: string) => {\n onTreeChange(addConditionToGroup(activeTree, groupId, null, null))\n },\n [activeTree, onTreeChange],\n )\n const addChildGroupAt = useCallback(\n (groupId: string) => {\n onTreeChange(addChildGroup(activeTree, groupId))\n },\n [activeTree, onTreeChange],\n )\n const clearGroupAt = useCallback(\n (groupId: string) => {\n onTreeChange(clearGroup(activeTree, groupId))\n },\n [activeTree, onTreeChange],\n )\n const updateGroupAt = useCallback(\n (\n groupId: string,\n patch: Partial<Omit<QBGroup, 'kind' | 'id' | 'children'>>,\n ) => {\n onTreeChange(updateGroup(activeTree, groupId, patch))\n },\n [activeTree, onTreeChange],\n )\n const removeGroupAt = useCallback(\n (groupId: string) => {\n onTreeChange(removeNode(activeTree, groupId))\n },\n [activeTree, onTreeChange],\n )\n const updateConditionAt = useCallback(\n (conditionId: string, patch: Partial<Omit<QBCondition, 'kind' | 'id'>>) => {\n onTreeChange(updateCondition(activeTree, conditionId, patch))\n },\n [activeTree, onTreeChange],\n )\n const removeConditionAt = useCallback(\n (conditionId: string) => {\n onTreeChange(removeNode(activeTree, conditionId))\n },\n [activeTree, onTreeChange],\n )\n\n const contextValue = useMemo(\n () => ({\n columnModels,\n facetResults,\n onlyFacetedColumns,\n getColumnDisplayName,\n addConditionAt,\n addChildGroupAt,\n clearGroupAt,\n updateGroupAt,\n removeGroupAt,\n updateConditionAt,\n removeConditionAt,\n }),\n [\n columnModels,\n facetResults,\n onlyFacetedColumns,\n getColumnDisplayName,\n addConditionAt,\n addChildGroupAt,\n clearGroupAt,\n updateGroupAt,\n removeGroupAt,\n updateConditionAt,\n removeConditionAt,\n ],\n )\n\n const readable = useMemo(\n () => qbTreeToReadable(activeTree, getColumnDisplayName),\n [activeTree, getColumnDisplayName],\n )\n\n const {\n data: combinedSql,\n isPending: isSqlPending,\n error: sqlError,\n } = useQBCombinedSql(summaryMode === 'sql' ? activeTree : null)\n\n return (\n <QueryBuilderInternalContextProvider value={contextValue}>\n <div className={styles.root}>\n <div className={styles.summaryBar}>\n <div className={styles.summaryHeader}>\n <span className={styles.summaryLabel}>Query Summary</span>\n <ToggleButtonGroup\n className={styles.summaryModeToggle}\n size=\"small\"\n exclusive\n value={summaryMode}\n onChange={(_event, next: SummaryMode | null) => {\n if (next != null) setSummaryMode(next)\n }}\n aria-label=\"Query summary display mode\"\n >\n <ToggleButton value=\"plain-english\" aria-label=\"Show summary\">\n Summary\n </ToggleButton>\n <ToggleButton value=\"sql\" aria-label=\"Show SQL\">\n SQL\n </ToggleButton>\n </ToggleButtonGroup>\n </div>\n <div\n className={styles.summaryContent}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {summaryMode === 'plain-english' ? (\n readable\n ) : sqlError ? (\n <span className={styles.sqlError}>\n Could not load SQL preview: {sqlError.message}\n </span>\n ) : isSqlPending ? (\n <span className={styles.sqlPlaceholder}>Loading SQL…</span>\n ) : (\n <code className={styles.sqlText}>{combinedSql}</code>\n )}\n </div>\n </div>\n\n <FilterGroupNode group={activeTree} isRoot />\n\n <div className={styles.applyRow}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={onApply}\n className={styles.applyButton}\n >\n Update Results\n </Button>\n </div>\n </div>\n </QueryBuilderInternalContextProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,SAAgB,EAAqB,GAAkC;CACrE,IAAM,EAAE,SAAM,iBAAc,wBAAqB,OAAU,GACrD,EAAE,iBAAc,oBAAiB,EAAyB,GAC1D,EAAE,2BAAwB,EAAgB,GAE1C,IAAa,KAAQ,EAAe,GAEpC,IAAU,QAAkB;EAChC,IAAM,IAAc,EAAkB,CAAU;EAChD,GAAoB,MAAQ;GAI1B,IAAM,KAAa,EAAK,MAAM,qBAAqB,CAAC,GAAG,QACrD,MAAK,CAAC,EAAc,CAAC,CACvB,GACM,IAAO,IAAc,CAAC,GAAG,GAAW,CAAW,IAAI;GACzD,OAAO;IACL,GAAG;IACH,OAAO;KACL,GAAG,EAAK;KACR,mBAAmB,EAAK,SAAS,IAAI,IAAO,KAAA;IAC9C;GACF;EACF,CAAC;CACH,GAAG,CAAC,GAAY,CAAmB,CAAC,GAE9B,EAAE,4BAAyB,EAA6B,GAExD,CAAC,GAAa,KAAkB,EAAsB,eAAe,GAErE,IAAiB,GACpB,MAAoB;EACnB,EAAa,EAAoB,GAAY,GAAS,MAAM,IAAI,CAAC;CACnE,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAkB,GACrB,MAAoB;EACnB,EAAa,EAAc,GAAY,CAAO,CAAC;CACjD,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAe,GAClB,MAAoB;EACnB,EAAa,EAAW,GAAY,CAAO,CAAC;CAC9C,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAgB,GAElB,GACA,MACG;EACH,EAAa,EAAY,GAAY,GAAS,CAAK,CAAC;CACtD,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAgB,GACnB,MAAoB;EACnB,EAAa,EAAW,GAAY,CAAO,CAAC;CAC9C,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAoB,GACvB,GAAqB,MAAqD;EACzE,EAAa,EAAgB,GAAY,GAAa,CAAK,CAAC;CAC9D,GACA,CAAC,GAAY,CAAY,CAC3B,GACM,IAAoB,GACvB,MAAwB;EACvB,EAAa,EAAW,GAAY,CAAW,CAAC;CAClD,GACA,CAAC,GAAY,CAAY,CAC3B,GAEM,IAAe,SACZ;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF,GAEM,IAAW,QACT,EAAiB,GAAY,CAAoB,GACvD,CAAC,GAAY,CAAoB,CACnC,GAEM,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAAiB,MAAgB,QAAQ,IAAa,IAAI;CAE9D,OACE,kBAAC,GAAD;EAAqC,OAAO;YAC1C,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAvB;IACE,kBAAC,OAAD;KAAK,WAAW,EAAO;eAAvB,CACE,kBAAC,OAAD;MAAK,WAAW,EAAO;gBAAvB,CACE,kBAAC,QAAD;OAAM,WAAW,EAAO;iBAAc;MAAmB,CAAA,GACzD,kBAAC,GAAD;OACE,WAAW,EAAO;OAClB,MAAK;OACL,WAAA;OACA,OAAO;OACP,WAAW,GAAQ,MAA6B;QAC9C,AAAI,KAAQ,QAAM,EAAe,CAAI;OACvC;OACA,cAAW;iBARb,CAUE,kBAAC,GAAD;QAAc,OAAM;QAAgB,cAAW;kBAAe;OAEhD,CAAA,GACd,kBAAC,GAAD;QAAc,OAAM;QAAM,cAAW;kBAAW;OAElC,CAAA,CACG;QAChB;SACL,kBAAC,OAAD;MACE,WAAW,EAAO;MAClB,aAAU;MACV,eAAY;gBAEX,MAAgB,kBACf,IACE,IACF,kBAAC,QAAD;OAAM,WAAW,EAAO;iBAAxB,CAAkC,gCACH,EAAS,OAClC;WACJ,IACF,kBAAC,QAAD;OAAM,WAAW,EAAO;iBAAgB;MAAkB,CAAA,IAE1D,kBAAC,QAAD;OAAM,WAAW,EAAO;iBAAU;MAAkB,CAAA;KAEnD,CAAA,CACF;;IAEL,kBAAC,GAAD;KAAiB,OAAO;KAAY,QAAA;IAAQ,CAAA;IAE5C,kBAAC,OAAD;KAAK,WAAW,EAAO;eACrB,kBAAC,GAAD;MACE,SAAQ;MACR,OAAM;MACN,SAAS;MACT,WAAW,EAAO;gBACnB;KAEO,CAAA;IACL,CAAA;GACF;;CAC8B,CAAA;AAEzC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './QueryBuilderControls.css';var e = {
|
|
2
|
+
root: "_root_x90xm_1",
|
|
3
|
+
applyRow: "_applyRow_x90xm_11",
|
|
4
|
+
applyButton: "_applyButton_x90xm_16",
|
|
5
|
+
summaryBar: "_summaryBar_x90xm_20",
|
|
6
|
+
summaryHeader: "_summaryHeader_x90xm_31",
|
|
7
|
+
summaryLabel: "_summaryLabel_x90xm_38",
|
|
8
|
+
summaryContent: "_summaryContent_x90xm_46",
|
|
9
|
+
summaryModeToggle: "_summaryModeToggle_x90xm_52",
|
|
10
|
+
sqlPlaceholder: "_sqlPlaceholder_x90xm_61",
|
|
11
|
+
sqlText: "_sqlText_x90xm_66",
|
|
12
|
+
sqlError: "_sqlError_x90xm_75"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=QueryBuilderControls.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilderControls.module.js","names":[],"sources":["../../../src/components/QueryBuilder/QueryBuilderControls.module.scss"],"sourcesContent":[".root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n background: var(--synapse-background-color-gray-light);\n border: 1px solid var(--synapse-border-color-gray);\n border-radius: 4px;\n}\n\n.applyRow {\n display: flex;\n justify-content: flex-end;\n}\n\n.applyButton {\n text-transform: none;\n}\n\n.summaryBar {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 6px;\n padding: 8px 12px;\n background: white;\n border: 1px solid var(--synapse-border-color-gray);\n border-radius: 4px;\n}\n\n.summaryHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.summaryLabel {\n font-weight: 700;\n text-transform: uppercase;\n font-size: 11px;\n letter-spacing: 0.5px;\n color: var(--synapse-gray-regular);\n}\n\n.summaryContent {\n font-size: 14px;\n line-height: 1.5;\n word-break: break-word;\n}\n\n.summaryModeToggle {\n flex-shrink: 0;\n\n :global(.MuiToggleButton-root) {\n text-transform: none;\n padding: 2px 12px;\n font-size: 12px;\n }\n}\n\n.sqlPlaceholder {\n color: var(--synapse-gray-deemphasized);\n font-style: italic;\n}\n\n.sqlText {\n display: block;\n font-family: var(--synapse-font-family-mono, monospace);\n font-size: 12px;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--synapse-gray-1000);\n}\n\n.sqlError {\n color: var(--synapse-error);\n font-size: 13px;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
padding: 12px;
|
|
6
|
+
background: var(--synapse-background-color-gray-light);
|
|
7
|
+
border: 1px solid var(--synapse-border-color-gray);
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.applyRow {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.applyButton {
|
|
17
|
+
text-transform: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.summaryBar {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
gap: 6px;
|
|
25
|
+
padding: 8px 12px;
|
|
26
|
+
background: white;
|
|
27
|
+
border: 1px solid var(--synapse-border-color-gray);
|
|
28
|
+
border-radius: 4px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.summaryHeader {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
gap: 12px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.summaryLabel {
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
font-size: 11px;
|
|
42
|
+
letter-spacing: 0.5px;
|
|
43
|
+
color: var(--synapse-gray-regular);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.summaryContent {
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
word-break: break-word;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.summaryModeToggle {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
|
|
55
|
+
:global(.MuiToggleButton-root) {
|
|
56
|
+
text-transform: none;
|
|
57
|
+
padding: 2px 12px;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sqlPlaceholder {
|
|
63
|
+
color: var(--synapse-gray-deemphasized);
|
|
64
|
+
font-style: italic;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sqlText {
|
|
68
|
+
display: block;
|
|
69
|
+
font-family: var(--synapse-font-family-mono, monospace);
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
white-space: pre-wrap;
|
|
72
|
+
word-break: break-word;
|
|
73
|
+
color: var(--synapse-gray-1000);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.sqlError {
|
|
77
|
+
color: var(--synapse-error);
|
|
78
|
+
font-size: 13px;
|
|
79
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ColumnModel, FacetColumnResult } from '@sage-bionetworks/synapse-types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { QBCondition, QBGroup } from './QueryBuilderTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Internal-only context shared between `QueryBuilderControls`,
|
|
6
|
+
* `FilterGroupNode`, and `FilterConditionRow`. Exposes the dispatch surface
|
|
7
|
+
* for tree edits + the query metadata each row needs (column models, facet
|
|
8
|
+
* results, and the Cohort Builder `onlyFacetedColumns` toggle).
|
|
9
|
+
*/
|
|
10
|
+
export type QueryBuilderInternalContextType = {
|
|
11
|
+
/** All columns available in the query (unfiltered by faceting). */
|
|
12
|
+
columnModels: ColumnModel[];
|
|
13
|
+
/** Facet results keyed by column name (used to populate pill choices). */
|
|
14
|
+
facetResults: readonly FacetColumnResult[];
|
|
15
|
+
/**
|
|
16
|
+
* When true, the property picker only offers columns that have facet
|
|
17
|
+
* metadata. Cohort Builder sets this true.
|
|
18
|
+
*/
|
|
19
|
+
onlyFacetedColumns: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the user-facing label for a column — resolves `columnAliases`
|
|
22
|
+
* first, then falls back to `unCamelCase(name)`. Wired from
|
|
23
|
+
* `QueryVisualizationContext.getColumnDisplayName` when available.
|
|
24
|
+
*/
|
|
25
|
+
getColumnDisplayName: (columnName: string) => string;
|
|
26
|
+
addConditionAt: (groupId: string) => void;
|
|
27
|
+
addChildGroupAt: (groupId: string) => void;
|
|
28
|
+
clearGroupAt: (groupId: string) => void;
|
|
29
|
+
updateGroupAt: (groupId: string, patch: Partial<Omit<QBGroup, 'kind' | 'id' | 'children'>>) => void;
|
|
30
|
+
removeGroupAt: (groupId: string) => void;
|
|
31
|
+
updateConditionAt: (conditionId: string, patch: Partial<Omit<QBCondition, 'kind' | 'id'>>) => void;
|
|
32
|
+
removeConditionAt: (conditionId: string) => void;
|
|
33
|
+
};
|
|
34
|
+
export type QueryBuilderInternalContextProviderProps = PropsWithChildren<{
|
|
35
|
+
value: QueryBuilderInternalContextType;
|
|
36
|
+
}>;
|
|
37
|
+
export declare function QueryBuilderInternalContextProvider(props: QueryBuilderInternalContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function useQueryBuilderInternalContext(): QueryBuilderInternalContextType;
|
|
39
|
+
//# sourceMappingURL=QueryBuilderInternalContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilderInternalContext.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/QueryBuilderInternalContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,EAAiB,iBAAiB,EAAc,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,mEAAmE;IACnE,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,0EAA0E;IAC1E,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC1C;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAA;IAC3B;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;IAGpD,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,KACtD,IAAI,CAAA;IACT,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAGxC,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,KAC7C,IAAI,CAAA;IACT,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD,CAAA;AAKD,MAAM,MAAM,wCAAwC,GAAG,iBAAiB,CAAC;IACvE,KAAK,EAAE,+BAA+B,CAAA;CACvC,CAAC,CAAA;AAEF,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,wCAAwC,2CAOhD;AAED,wBAAgB,8BAA8B,IAAI,+BAA+B,CAQhF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/QueryBuilder/QueryBuilderInternalContext.tsx
|
|
4
|
+
var r = e(null);
|
|
5
|
+
function i(e) {
|
|
6
|
+
return /* @__PURE__ */ n(r.Provider, {
|
|
7
|
+
value: e.value,
|
|
8
|
+
children: e.children
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function a() {
|
|
12
|
+
let e = t(r);
|
|
13
|
+
if (e == null) throw Error("QueryBuilderInternalContext missing — must be rendered inside QueryBuilderControls");
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as QueryBuilderInternalContextProvider, a as useQueryBuilderInternalContext };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=QueryBuilderInternalContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilderInternalContext.js","names":[],"sources":["../../../src/components/QueryBuilder/QueryBuilderInternalContext.tsx"],"sourcesContent":["import { ColumnModel, FacetColumnResult } from '@sage-bionetworks/synapse-types'\nimport { createContext, PropsWithChildren, useContext } from 'react'\nimport { QBCondition, QBGroup } from './QueryBuilderTypes'\n\n/**\n * Internal-only context shared between `QueryBuilderControls`,\n * `FilterGroupNode`, and `FilterConditionRow`. Exposes the dispatch surface\n * for tree edits + the query metadata each row needs (column models, facet\n * results, and the Cohort Builder `onlyFacetedColumns` toggle).\n */\nexport type QueryBuilderInternalContextType = {\n /** All columns available in the query (unfiltered by faceting). */\n columnModels: ColumnModel[]\n /** Facet results keyed by column name (used to populate pill choices). */\n facetResults: readonly FacetColumnResult[]\n /**\n * When true, the property picker only offers columns that have facet\n * metadata. Cohort Builder sets this true.\n */\n onlyFacetedColumns: boolean\n /**\n * Returns the user-facing label for a column — resolves `columnAliases`\n * first, then falls back to `unCamelCase(name)`. Wired from\n * `QueryVisualizationContext.getColumnDisplayName` when available.\n */\n getColumnDisplayName: (columnName: string) => string\n\n // -- Group operations --\n addConditionAt: (groupId: string) => void\n addChildGroupAt: (groupId: string) => void\n clearGroupAt: (groupId: string) => void\n updateGroupAt: (\n groupId: string,\n patch: Partial<Omit<QBGroup, 'kind' | 'id' | 'children'>>,\n ) => void\n removeGroupAt: (groupId: string) => void\n\n // -- Condition operations --\n updateConditionAt: (\n conditionId: string,\n patch: Partial<Omit<QBCondition, 'kind' | 'id'>>,\n ) => void\n removeConditionAt: (conditionId: string) => void\n}\n\nconst QueryBuilderInternalContext =\n createContext<QueryBuilderInternalContextType | null>(null)\n\nexport type QueryBuilderInternalContextProviderProps = PropsWithChildren<{\n value: QueryBuilderInternalContextType\n}>\n\nexport function QueryBuilderInternalContextProvider(\n props: QueryBuilderInternalContextProviderProps,\n) {\n return (\n <QueryBuilderInternalContext.Provider value={props.value}>\n {props.children}\n </QueryBuilderInternalContext.Provider>\n )\n}\n\nexport function useQueryBuilderInternalContext(): QueryBuilderInternalContextType {\n const context = useContext(QueryBuilderInternalContext)\n if (context == null) {\n throw new Error(\n 'QueryBuilderInternalContext missing — must be rendered inside QueryBuilderControls',\n )\n }\n return context\n}\n"],"mappings":";;;AA6CA,IAAM,IACJ,EAAsD,IAAI;AAM5D,SAAgB,EACd,GACA;CACA,OACE,kBAAC,EAA4B,UAA7B;EAAsC,OAAO,EAAM;YAChD,EAAM;CAC6B,CAAA;AAE1C;AAEA,SAAgB,IAAkE;CAChF,IAAM,IAAU,EAAW,CAA2B;CACtD,IAAI,KAAW,MACb,MAAU,MACR,oFACF;CAEF,OAAO;AACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { QBGroup } from './QueryBuilderTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Render a QB tree as a plain-English React node with the AND / OR / NOT
|
|
5
|
+
* connectives styled inline. Used by the QB's Reads-As summary bar.
|
|
6
|
+
*
|
|
7
|
+
* Rules (per the design's plain-English summary spec):
|
|
8
|
+
* - The root group reads without outer parentheses.
|
|
9
|
+
* - Nested groups retain parentheses.
|
|
10
|
+
* - Excluded (NOT) groups are always parenthesized and prefixed with NOT.
|
|
11
|
+
* - Incomplete conditions render as `(unset)`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function qbTreeToReadable(root: QBGroup, getColumnDisplayName?: (columnName: string) => string): ReactNode;
|
|
14
|
+
//# sourceMappingURL=qbTreeToReadable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qbTreeToReadable.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/qbTreeToReadable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAA0B,OAAO,EAAU,MAAM,qBAAqB,CAAA;AAG7E;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,EACb,oBAAoB,GAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAqB,GAClE,SAAS,CAIX"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { labelForFacetValue as e, labelForOp as t } from "./queryBuilderMetadata.js";
|
|
2
|
+
import { isQBGroup as n } from "./QueryBuilderTypes.js";
|
|
3
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/QueryBuilder/qbTreeToReadable.tsx
|
|
5
|
+
function o(e, t = (e) => e) {
|
|
6
|
+
return s(e, !0, t) ?? /* @__PURE__ */ i("span", { children: "(no filters)" });
|
|
7
|
+
}
|
|
8
|
+
function s(e, t, r) {
|
|
9
|
+
return n(e) ? c(e, t, r) : l(e, r);
|
|
10
|
+
}
|
|
11
|
+
function c(e, t, n) {
|
|
12
|
+
let o = e.children.map((e, t) => ({
|
|
13
|
+
key: e.id,
|
|
14
|
+
node: s(e, !1, n),
|
|
15
|
+
index: t
|
|
16
|
+
})).filter((e) => e.node != null);
|
|
17
|
+
if (o.length === 0) return null;
|
|
18
|
+
let c = e.combinator, l = /* @__PURE__ */ i("span", { children: o.map((e, t) => /* @__PURE__ */ a("span", { children: [t > 0 && /* @__PURE__ */ a(r, { children: [
|
|
19
|
+
" ",
|
|
20
|
+
/* @__PURE__ */ i(d, { combinator: c }),
|
|
21
|
+
" "
|
|
22
|
+
] }), e.node] }, e.key)) });
|
|
23
|
+
return e.not ? /* @__PURE__ */ a("span", { children: [
|
|
24
|
+
/* @__PURE__ */ i(f, {}),
|
|
25
|
+
" (",
|
|
26
|
+
l,
|
|
27
|
+
")"
|
|
28
|
+
] }) : t ? l : /* @__PURE__ */ a("span", { children: [
|
|
29
|
+
"(",
|
|
30
|
+
l,
|
|
31
|
+
")"
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
function l(e, n) {
|
|
35
|
+
let r = u(e);
|
|
36
|
+
if (e.columnName == null && r == null) return null;
|
|
37
|
+
let o = e.columnName ? n(e.columnName) : "(unset)";
|
|
38
|
+
return r == null ? /* @__PURE__ */ a("span", { children: [/* @__PURE__ */ i("strong", { children: o }), " (unset)"] }) : /* @__PURE__ */ a("span", { children: [
|
|
39
|
+
/* @__PURE__ */ i("strong", { children: o }),
|
|
40
|
+
" ",
|
|
41
|
+
t(e.op),
|
|
42
|
+
" ",
|
|
43
|
+
r
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
function u(t) {
|
|
47
|
+
let { op: n, values: r, rangeMin: i, rangeMax: a, text: o } = t;
|
|
48
|
+
switch (n) {
|
|
49
|
+
case "has_value":
|
|
50
|
+
case "no_value": return "";
|
|
51
|
+
case "is_any_of":
|
|
52
|
+
case "is_all_of": return r.length === 0 ? null : r.map(e).join(", ");
|
|
53
|
+
case "equal":
|
|
54
|
+
case "not_equal": return r.length === 0 ? null : e(r[0]);
|
|
55
|
+
case "between": return !i || !a ? null : `${i} and ${a}`;
|
|
56
|
+
case "gt":
|
|
57
|
+
case "gte": return i || null;
|
|
58
|
+
case "lt":
|
|
59
|
+
case "lte": return a || null;
|
|
60
|
+
case "contains":
|
|
61
|
+
case "starts_with":
|
|
62
|
+
case "ends_with":
|
|
63
|
+
case "is_exactly": return o ? `"${o}"` : null;
|
|
64
|
+
default: return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function d({ combinator: e }) {
|
|
68
|
+
return /* @__PURE__ */ i("span", {
|
|
69
|
+
style: {
|
|
70
|
+
color: e === "OR" ? "var(--synapse-warning)" : "var(--synapse-primary-action-color)",
|
|
71
|
+
fontWeight: 700
|
|
72
|
+
},
|
|
73
|
+
"aria-hidden": "false",
|
|
74
|
+
children: e
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function f() {
|
|
78
|
+
return /* @__PURE__ */ i("span", {
|
|
79
|
+
style: {
|
|
80
|
+
color: "var(--synapse-error)",
|
|
81
|
+
fontWeight: 700
|
|
82
|
+
},
|
|
83
|
+
children: "NOT"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { o as qbTreeToReadable };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=qbTreeToReadable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qbTreeToReadable.js","names":[],"sources":["../../../src/components/QueryBuilder/qbTreeToReadable.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { isQBGroup, QBCondition, QBGroup, QBNode } from './QueryBuilderTypes'\nimport { labelForFacetValue, labelForOp } from './queryBuilderMetadata'\n\n/**\n * Render a QB tree as a plain-English React node with the AND / OR / NOT\n * connectives styled inline. Used by the QB's Reads-As summary bar.\n *\n * Rules (per the design's plain-English summary spec):\n * - The root group reads without outer parentheses.\n * - Nested groups retain parentheses.\n * - Excluded (NOT) groups are always parenthesized and prefixed with NOT.\n * - Incomplete conditions render as `(unset)`.\n */\nexport function qbTreeToReadable(\n root: QBGroup,\n getColumnDisplayName: (columnName: string) => string = name => name,\n): ReactNode {\n const rendered = renderNode(root, true, getColumnDisplayName)\n if (rendered == null) return <span>(no filters)</span>\n return rendered\n}\n\nfunction renderNode(\n node: QBNode,\n isRoot: boolean,\n getColumnDisplayName: (columnName: string) => string,\n): ReactNode | null {\n if (isQBGroup(node)) return renderGroup(node, isRoot, getColumnDisplayName)\n return renderCondition(node, getColumnDisplayName)\n}\n\nfunction renderGroup(\n group: QBGroup,\n isRoot: boolean,\n getColumnDisplayName: (columnName: string) => string,\n): ReactNode | null {\n const parts = group.children\n .map((child, index) => ({\n key: child.id,\n node: renderNode(child, false, getColumnDisplayName),\n index,\n }))\n .filter(part => part.node != null)\n\n if (parts.length === 0) return null\n\n const combinator = group.combinator\n const inner = parts.map((part, index) => (\n <span key={part.key}>\n {index > 0 && (\n <>\n {' '}\n <ConnectiveSpan combinator={combinator} />{' '}\n </>\n )}\n {part.node}\n </span>\n ))\n\n const body = <span>{inner}</span>\n\n if (group.not) {\n return (\n <span>\n <NotSpan /> ({body})\n </span>\n )\n }\n if (isRoot) return body\n return <span>({body})</span>\n}\n\nfunction renderCondition(\n condition: QBCondition,\n getColumnDisplayName: (columnName: string) => string,\n): ReactNode | null {\n const valueSummary = summarizeConditionValue(condition)\n // Skip fully-blank rows so they don't clutter the summary bar. A row is\n // fully blank when the user hasn't picked a column AND hasn't entered any\n // value yet — that's an in-progress row we don't want to narrate.\n if (condition.columnName == null && valueSummary == null) return null\n const columnName = condition.columnName\n ? getColumnDisplayName(condition.columnName)\n : '(unset)'\n if (valueSummary == null) {\n return (\n <span>\n <strong>{columnName}</strong> (unset)\n </span>\n )\n }\n return (\n <span>\n <strong>{columnName}</strong> {labelForOp(condition.op)} {valueSummary}\n </span>\n )\n}\n\nfunction summarizeConditionValue(condition: QBCondition): string | null {\n const { op, values, rangeMin, rangeMax, text } = condition\n switch (op) {\n case 'has_value':\n case 'no_value':\n return ''\n case 'is_any_of':\n case 'is_all_of':\n return values.length === 0\n ? null\n : values.map(labelForFacetValue).join(', ')\n case 'equal':\n case 'not_equal':\n return values.length === 0 ? null : labelForFacetValue(values[0])\n case 'between':\n if (!rangeMin || !rangeMax) return null\n return `${rangeMin} and ${rangeMax}`\n case 'gt':\n case 'gte':\n return rangeMin ? rangeMin : null\n case 'lt':\n case 'lte':\n return rangeMax ? rangeMax : null\n case 'contains':\n case 'starts_with':\n case 'ends_with':\n case 'is_exactly':\n return text ? `\"${text}\"` : null\n default:\n op satisfies never\n return null\n }\n}\n\nfunction ConnectiveSpan({ combinator }: { combinator: 'AND' | 'OR' }) {\n const color =\n combinator === 'OR'\n ? 'var(--synapse-warning)'\n : 'var(--synapse-primary-action-color)'\n return (\n <span style={{ color, fontWeight: 700 }} aria-hidden=\"false\">\n {combinator}\n </span>\n )\n}\n\nfunction NotSpan() {\n return (\n <span style={{ color: 'var(--synapse-error)', fontWeight: 700 }}>NOT</span>\n )\n}\n"],"mappings":";;;;AAcA,SAAgB,EACd,GACA,KAAuD,MAAQ,GACpD;CAGX,OAFiB,EAAW,GAAM,IAAM,CACpC,KAAyB,kBAAC,QAAD,EAAA,UAAM,eAAkB,CAAA;AAEvD;AAEA,SAAS,EACP,GACA,GACA,GACkB;CAElB,OADI,EAAU,CAAI,IAAU,EAAY,GAAM,GAAQ,CAAoB,IACnE,EAAgB,GAAM,CAAoB;AACnD;AAEA,SAAS,EACP,GACA,GACA,GACkB;CAClB,IAAM,IAAQ,EAAM,SACjB,KAAK,GAAO,OAAW;EACtB,KAAK,EAAM;EACX,MAAM,EAAW,GAAO,IAAO,CAAoB;EACnD;CACF,EAAE,EACD,QAAO,MAAQ,EAAK,QAAQ,IAAI;CAEnC,IAAI,EAAM,WAAW,GAAG,OAAO;CAE/B,IAAM,IAAa,EAAM,YAanB,IAAO,kBAAC,QAAD,EAAA,UAZC,EAAM,KAAK,GAAM,MAC7B,kBAAC,QAAD,EAAA,UAAA,CACG,IAAQ,KACP,kBAAA,GAAA,EAAA,UAAA;EACG;EACD,kBAAC,GAAD,EAA4B,cAAa,CAAA;EAAE;CAC3C,EAAA,CAAA,GAEH,EAAK,IACF,EAAA,GARK,EAAK,GAQV,CAGY,EAAY,CAAA;CAUhC,OARI,EAAM,MAEN,kBAAC,QAAD,EAAA,UAAA;EACE,kBAAC,GAAD,CAAU,CAAA;EAAC;EAAG;EAAK;CACf,EAAA,CAAA,IAGN,IAAe,IACZ,kBAAC,QAAD,EAAA,UAAA;EAAM;EAAE;EAAK;CAAO,EAAA,CAAA;AAC7B;AAEA,SAAS,EACP,GACA,GACkB;CAClB,IAAM,IAAe,EAAwB,CAAS;CAItD,IAAI,EAAU,cAAc,QAAQ,KAAgB,MAAM,OAAO;CACjE,IAAM,IAAa,EAAU,aACzB,EAAqB,EAAU,UAAU,IACzC;CAQJ,OAPI,KAAgB,OAEhB,kBAAC,QAAD,EAAA,UAAA,CACE,kBAAC,UAAD,EAAA,UAAS,EAAmB,CAAA,GAAC,UACzB,EAAA,CAAA,IAIR,kBAAC,QAAD,EAAA,UAAA;EACE,kBAAC,UAAD,EAAA,UAAS,EAAmB,CAAA;EAAC;EAAE,EAAW,EAAU,EAAE;EAAE;EAAE;CACtD,EAAA,CAAA;AAEV;AAEA,SAAS,EAAwB,GAAuC;CACtE,IAAM,EAAE,OAAI,WAAQ,aAAU,aAAU,YAAS;CACjD,QAAQ,GAAR;EACE,KAAK;EACL,KAAK,YACH,OAAO;EACT,KAAK;EACL,KAAK,aACH,OAAO,EAAO,WAAW,IACrB,OACA,EAAO,IAAI,CAAkB,EAAE,KAAK,IAAI;EAC9C,KAAK;EACL,KAAK,aACH,OAAO,EAAO,WAAW,IAAI,OAAO,EAAmB,EAAO,EAAE;EAClE,KAAK,WAEH,OADI,CAAC,KAAY,CAAC,IAAiB,OAC5B,GAAG,EAAS,OAAO;EAC5B,KAAK;EACL,KAAK,OACH,OAAO,KAAsB;EAC/B,KAAK;EACL,KAAK,OACH,OAAO,KAAsB;EAC/B,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,cACH,OAAO,IAAO,IAAI,EAAK,KAAK;EAC9B,SAEE,OAAO;CACX;AACF;AAEA,SAAS,EAAe,EAAE,iBAA4C;CAKpE,OACE,kBAAC,QAAD;EAAM,OAAO;GAAE,OAJf,MAAe,OACX,2BACA;GAEkB,YAAY;EAAI;EAAG,eAAY;YAClD;CACG,CAAA;AAEV;AAEA,SAAS,IAAU;CACjB,OACE,kBAAC,QAAD;EAAM,OAAO;GAAE,OAAO;GAAwB,YAAY;EAAI;YAAG;CAAS,CAAA;AAE9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryBuilderId.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/queryBuilderId.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,IAAI,MAAM,CAUpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/components/QueryBuilder/queryBuilderId.ts
|
|
2
|
+
var e = 0;
|
|
3
|
+
function t() {
|
|
4
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (e += 1, `qb-${e}`);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as newQBNodeId };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=queryBuilderId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryBuilderId.js","names":[],"sources":["../../../src/components/QueryBuilder/queryBuilderId.ts"],"sourcesContent":["let idCounter = 0\n\nexport function newQBNodeId(): string {\n if (\n typeof crypto !== 'undefined' &&\n typeof crypto.randomUUID === 'function'\n ) {\n return crypto.randomUUID()\n }\n // Monotonic counter is sufficient — QB ids are client-only React keys, not secrets.\n idCounter += 1\n return `qb-${idCounter}`\n}\n"],"mappings":";AAAA,IAAI,IAAY;AAEhB,SAAgB,IAAsB;CASpC,OAPE,OAAO,SAAW,OAClB,OAAO,OAAO,cAAe,aAEtB,OAAO,WAAW,KAG3B,KAAa,GACN,MAAM;AACf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QBConditionOp } from './QueryBuilderTypes';
|
|
2
|
+
/** Categorization of columns for the QB UI. Not a synapse-types concept. */
|
|
3
|
+
export type QBColumnKind = 'enum' | 'list' | 'range' | 'boolean' | 'text' | 'unknown';
|
|
4
|
+
/**
|
|
5
|
+
* Classify a column into a QB kind based on its `ColumnTypeEnum` string and
|
|
6
|
+
* whether the column has a facet in the query result. `hasFacet` distinguishes
|
|
7
|
+
* a faceted single-value column (`enum`) from a plain single-value column
|
|
8
|
+
* (`text`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function classifyColumn(columnType: string | null, hasFacet: boolean): QBColumnKind;
|
|
11
|
+
/**
|
|
12
|
+
* Ordered list of operators offered for a given column kind. Order controls
|
|
13
|
+
* the operator picker dropdown ordering.
|
|
14
|
+
*/
|
|
15
|
+
export declare function availableOpsForKind(kind: QBColumnKind): QBConditionOp[];
|
|
16
|
+
/** Human-readable label for an operator, shown in the operator picker. */
|
|
17
|
+
export declare function labelForOp(op: QBConditionOp): string;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the user-facing label for a raw facet value. Backend sentinels like
|
|
20
|
+
* `VALUE_NOT_SET` display as `Not Assigned`; every other value renders as-is.
|
|
21
|
+
* The underlying value stored on the QB condition is unchanged.
|
|
22
|
+
*/
|
|
23
|
+
export declare function labelForFacetValue(value: string): string;
|
|
24
|
+
//# sourceMappingURL=queryBuilderMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryBuilderMetadata.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/queryBuilderMetadata.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,CAAA;AAEb;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,EAAE,OAAO,GAChB,YAAY,CA4Bd;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,EAAE,CAoCvE;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,CAoCpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
|