synapse-react-client 2.1.23 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containers/CardContainer.d.ts +0 -8
- package/dist/containers/CardContainer.js +13 -23
- package/dist/containers/CardContainer.js.map +1 -1
- package/dist/containers/CardContainerLogic.d.ts +3 -76
- package/dist/containers/CardContainerLogic.js +29 -150
- package/dist/containers/CardContainerLogic.js.map +1 -1
- package/dist/containers/FullTextSearch.d.ts +1 -5
- package/dist/containers/FullTextSearch.js +9 -9
- package/dist/containers/FullTextSearch.js.map +1 -1
- package/dist/containers/QueryCount.js.map +1 -1
- package/dist/containers/QueryVisualizationWrapper.d.ts +48 -0
- package/dist/containers/QueryVisualizationWrapper.js +81 -0
- package/dist/containers/QueryVisualizationWrapper.js.map +1 -0
- package/dist/containers/QueryWrapper.d.ts +55 -145
- package/dist/containers/QueryWrapper.js +206 -263
- package/dist/containers/QueryWrapper.js.map +1 -1
- package/dist/containers/QueryWrapperErrorBanner.d.ts +5 -0
- package/dist/containers/QueryWrapperErrorBanner.js +16 -0
- package/dist/containers/QueryWrapperErrorBanner.js.map +1 -0
- package/dist/containers/SearchV2.d.ts +6 -2
- package/dist/containers/SearchV2.js +11 -11
- package/dist/containers/SearchV2.js.map +1 -1
- package/dist/containers/SqlEditor.d.ts +1 -5
- package/dist/containers/SqlEditor.js +8 -7
- package/dist/containers/SqlEditor.js.map +1 -1
- package/dist/containers/TotalQueryResults.d.ts +3 -6
- package/dist/containers/TotalQueryResults.js +42 -58
- package/dist/containers/TotalQueryResults.js.map +1 -1
- package/dist/containers/download_list/DownloadConfirmation.d.ts +0 -5
- package/dist/containers/download_list/DownloadConfirmation.js +16 -18
- package/dist/containers/download_list/DownloadConfirmation.js.map +1 -1
- package/dist/containers/home_page/featured-data/FacetPlotsCard.d.ts +1 -4
- package/dist/containers/home_page/featured-data/FacetPlotsCard.js +11 -8
- package/dist/containers/home_page/featured-data/FacetPlotsCard.js.map +1 -1
- package/dist/containers/home_page/featured-data/QueryPerFacetPlotsCard.d.ts +1 -1
- package/dist/containers/home_page/featured-data/QueryPerFacetPlotsCard.js +8 -9
- package/dist/containers/home_page/featured-data/QueryPerFacetPlotsCard.js.map +1 -1
- package/dist/containers/home_page/featured-data/SingleQueryFacetPlotsCards.d.ts +1 -1
- package/dist/containers/home_page/featured-data/SingleQueryFacetPlotsCards.js +10 -11
- package/dist/containers/home_page/featured-data/SingleQueryFacetPlotsCards.js.map +1 -1
- package/dist/containers/query_wrapper_plot_nav/FilterAndView.d.ts +2 -4
- package/dist/containers/query_wrapper_plot_nav/FilterAndView.js +12 -5
- package/dist/containers/query_wrapper_plot_nav/FilterAndView.js.map +1 -1
- package/dist/containers/query_wrapper_plot_nav/QueryFilterToggleButton.d.ts +1 -2
- package/dist/containers/query_wrapper_plot_nav/QueryFilterToggleButton.js +9 -10
- package/dist/containers/query_wrapper_plot_nav/QueryFilterToggleButton.js.map +1 -1
- package/dist/containers/query_wrapper_plot_nav/QueryWrapperPlotNav.d.ts +4 -4
- package/dist/containers/query_wrapper_plot_nav/QueryWrapperPlotNav.js +53 -35
- package/dist/containers/query_wrapper_plot_nav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/containers/synapse_form_wrapper/SynapseFormWrapper.js +1 -1
- package/dist/containers/synapse_form_wrapper/SynapseFormWrapper.js.map +1 -1
- package/dist/containers/table/StandaloneQueryWrapper.d.ts +4 -6
- package/dist/containers/table/StandaloneQueryWrapper.js +29 -19
- package/dist/containers/table/StandaloneQueryWrapper.js.map +1 -1
- package/dist/containers/table/SynapseTable.d.ts +12 -13
- package/dist/containers/table/SynapseTable.js +100 -136
- package/dist/containers/table/SynapseTable.js.map +1 -1
- package/dist/containers/table/TopLevelControls.d.ts +1 -4
- package/dist/containers/table/TopLevelControls.js +27 -43
- package/dist/containers/table/TopLevelControls.js.map +1 -1
- package/dist/containers/table/table-top/ColumnSelection.d.ts +1 -1
- package/dist/containers/table/table-top/ColumnSelection.js +3 -5
- package/dist/containers/table/table-top/ColumnSelection.js.map +1 -1
- package/dist/containers/table/table-top/DownloadOptions.d.ts +0 -2
- package/dist/containers/table/table-top/DownloadOptions.js +7 -6
- package/dist/containers/table/table-top/DownloadOptions.js.map +1 -1
- package/dist/containers/widgets/facet-nav/FacetNav.d.ts +1 -3
- package/dist/containers/widgets/facet-nav/FacetNav.js +14 -10
- package/dist/containers/widgets/facet-nav/FacetNav.js.map +1 -1
- package/dist/containers/widgets/facet-nav/FacetNavPanel.d.ts +5 -8
- package/dist/containers/widgets/facet-nav/FacetNavPanel.js +15 -12
- package/dist/containers/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/containers/widgets/query-filter/EnumFacetFilter.d.ts +3 -3
- package/dist/containers/widgets/query-filter/EnumFacetFilter.js +2 -2
- package/dist/containers/widgets/query-filter/EnumFacetFilter.js.map +1 -1
- package/dist/containers/widgets/query-filter/QueryFilter.d.ts +7 -12
- package/dist/containers/widgets/query-filter/QueryFilter.js +12 -9
- package/dist/containers/widgets/query-filter/QueryFilter.js.map +1 -1
- package/dist/containers/widgets/query-filter/RangeFacetFilter.d.ts +4 -4
- package/dist/containers/widgets/query-filter/RangeFacetFilter.js +4 -4
- package/dist/containers/widgets/query-filter/RangeFacetFilter.js.map +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/umd/synapse-react-client.development.js +2700 -2533
- package/dist/umd/synapse-react-client.development.js.map +3 -3
- package/dist/umd/synapse-react-client.production.min.js +89 -89
- package/dist/utils/APIConstants.js +1 -1
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/SynapseClient.d.ts +47 -20
- package/dist/utils/SynapseClient.js +275 -209
- package/dist/utils/SynapseClient.js.map +1 -1
- package/dist/utils/SynapseConstants.d.ts +1 -0
- package/dist/utils/SynapseConstants.js +3 -2
- package/dist/utils/SynapseConstants.js.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.d.ts +13 -1
- package/dist/utils/functions/EntityTypeUtils.js +25 -1
- package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
- package/dist/utils/functions/queryUtils.d.ts +2 -2
- package/dist/utils/functions/queryUtils.js +22 -5
- package/dist/utils/functions/queryUtils.js.map +1 -1
- package/dist/utils/functions/sqlFunctions.js +1 -1
- package/dist/utils/functions/sqlFunctions.js.map +1 -1
- package/dist/utils/functions/unCamelCase.d.ts +1 -1
- package/dist/utils/functions/unCamelCase.js.map +1 -1
- package/dist/utils/hooks/SynapseAPI/useGetQueryResultBundle.d.ts +4 -3
- package/dist/utils/hooks/SynapseAPI/useGetQueryResultBundle.js +67 -1
- package/dist/utils/hooks/SynapseAPI/useGetQueryResultBundle.js.map +1 -1
- package/dist/utils/synapseTypes/Table/AsynchronousJobStatus.d.ts +5 -4
- package/dist/utils/synapseTypes/Table/EntityView.d.ts +8 -0
- package/dist/utils/synapseTypes/Table/EntityView.js +9 -0
- package/dist/utils/synapseTypes/Table/EntityView.js.map +1 -1
- package/dist/utils/synapseTypes/Table/FacetColumnRequest.d.ts +1 -1
- package/dist/utils/synapseTypes/Table/FacetColumnResult.d.ts +10 -10
- package/dist/utils/synapseTypes/Table/QueryResultBundle.d.ts +1 -0
- package/package.json +42 -37
- package/dist/containers/StackedBarChart.d.ts +0 -63
- package/dist/containers/StackedBarChart.js +0 -229
- package/dist/containers/StackedBarChart.js.map +0 -1
- package/dist/utils/functions/facetUtils.d.ts +0 -20
- package/dist/utils/functions/facetUtils.js +0 -37
- package/dist/utils/functions/facetUtils.js.map +0 -1
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListManifestResponse.d.ts +0 -4
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListManifestResponse.js +0 -3
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListManifestResponse.js.map +0 -1
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.d.ts +0 -5
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.js +0 -3
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.js.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryVisualizationWrapper = exports.QueryVisualizationContextConsumer = exports.useQueryVisualizationContext = exports.QueryVisualizationContextProvider = exports.QueryVisualizationContext = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
var QueryWrapper_1 = require("./QueryWrapper");
|
|
7
|
+
/**
|
|
8
|
+
* This must be exported to use the context in class components.
|
|
9
|
+
*/
|
|
10
|
+
exports.QueryVisualizationContext = (0, react_1.createContext)(undefined);
|
|
11
|
+
/**
|
|
12
|
+
* Provides fields and functions related to visualizing a Synapse table query. For actual query data, see QueryContextProvider.
|
|
13
|
+
*/
|
|
14
|
+
var QueryVisualizationContextProvider = function (_a) {
|
|
15
|
+
var children = _a.children, queryVisualizationContext = _a.queryVisualizationContext;
|
|
16
|
+
return (react_1.default.createElement(exports.QueryVisualizationContext.Provider, { value: queryVisualizationContext }, children));
|
|
17
|
+
};
|
|
18
|
+
exports.QueryVisualizationContextProvider = QueryVisualizationContextProvider;
|
|
19
|
+
function useQueryVisualizationContext() {
|
|
20
|
+
var context = (0, react_1.useContext)(exports.QueryVisualizationContext);
|
|
21
|
+
if (context === undefined) {
|
|
22
|
+
throw new Error('useQueryVisualizationContext must be used within a QueryWrapper');
|
|
23
|
+
}
|
|
24
|
+
return context;
|
|
25
|
+
}
|
|
26
|
+
exports.useQueryVisualizationContext = useQueryVisualizationContext;
|
|
27
|
+
exports.QueryVisualizationContextConsumer = exports.QueryVisualizationContext.Consumer;
|
|
28
|
+
/**
|
|
29
|
+
* QueryVisualizationWrapper manages UI state for components that query tables in Synapse. That state can be accessed
|
|
30
|
+
* or updated using QueryVisualizationContext. A QueryVisualizationWrapper must be used within a QueryWrapper.
|
|
31
|
+
*/
|
|
32
|
+
function QueryVisualizationWrapper(props) {
|
|
33
|
+
var _a;
|
|
34
|
+
var _b = (0, QueryWrapper_1.useQueryContext)(), data = _b.data, getLastQueryRequest = _b.getLastQueryRequest, isFacetsAvailable = _b.isFacetsAvailable, isLoadingNewBundle = _b.isLoadingNewBundle;
|
|
35
|
+
var _c = (0, react_1.useState)({
|
|
36
|
+
showColumnFilter: true,
|
|
37
|
+
showFacetFilter: true,
|
|
38
|
+
showFacetVisualization: (_a = props.defaultShowFacetVisualization) !== null && _a !== void 0 ? _a : true,
|
|
39
|
+
showSearchBar: false,
|
|
40
|
+
showDownloadConfirmation: false,
|
|
41
|
+
showColumnSelectDropdown: false,
|
|
42
|
+
showSqlEditor: false,
|
|
43
|
+
}), topLevelControlsState = _c[0], setTopLevelControlsState = _c[1];
|
|
44
|
+
(0, react_1.useEffect)(function () {
|
|
45
|
+
if (!isFacetsAvailable) {
|
|
46
|
+
setTopLevelControlsState(function (state) { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, state), { showFacetFilter: false, showFacetVisualization: false })); });
|
|
47
|
+
}
|
|
48
|
+
}, [isFacetsAvailable]);
|
|
49
|
+
(0, react_1.useEffect)(function () {
|
|
50
|
+
if (isLoadingNewBundle) {
|
|
51
|
+
setSelectedRowIndices([]);
|
|
52
|
+
}
|
|
53
|
+
}, [isLoadingNewBundle]);
|
|
54
|
+
var _d = (0, react_1.useState)([]), isColumnSelected = _d[0], setIsColumnSelected = _d[1];
|
|
55
|
+
var _e = (0, react_1.useState)([]), selectedRowIndices = _e[0], setSelectedRowIndices = _e[1];
|
|
56
|
+
var lastQueryRequest = getLastQueryRequest();
|
|
57
|
+
var selectColumns = data === null || data === void 0 ? void 0 : data.selectColumns;
|
|
58
|
+
(0, react_1.useEffect)(function () {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
// SWC-6030: If sql changes, reset what columns are visible
|
|
61
|
+
setIsColumnSelected((_b = selectColumns === null || selectColumns === void 0 ? void 0 : selectColumns.slice(0, (_a = props.visibleColumnCount) !== null && _a !== void 0 ? _a : Infinity).map(function (el) { return el.name; })) !== null && _b !== void 0 ? _b : []);
|
|
62
|
+
}, [selectColumns, lastQueryRequest.query.sql, props.visibleColumnCount]);
|
|
63
|
+
var context = {
|
|
64
|
+
topLevelControlsState: topLevelControlsState,
|
|
65
|
+
setTopLevelControlsState: setTopLevelControlsState,
|
|
66
|
+
columnsToShowInTable: isColumnSelected,
|
|
67
|
+
setColumnsToShowInTable: setIsColumnSelected,
|
|
68
|
+
selectedRowIndices: selectedRowIndices,
|
|
69
|
+
setSelectedRowIndices: setSelectedRowIndices,
|
|
70
|
+
facetAliases: props.facetAliases,
|
|
71
|
+
rgbIndex: props.rgbIndex,
|
|
72
|
+
unitDescription: props.unitDescription,
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Render the children without any formatting
|
|
76
|
+
*/
|
|
77
|
+
var children = props.children;
|
|
78
|
+
return (react_1.default.createElement(exports.QueryVisualizationContextProvider, { queryVisualizationContext: context }, children));
|
|
79
|
+
}
|
|
80
|
+
exports.QueryVisualizationWrapper = QueryVisualizationWrapper;
|
|
81
|
+
//# sourceMappingURL=QueryVisualizationWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryVisualizationWrapper.js","sourceRoot":"","sources":["../../src/lib/containers/QueryVisualizationWrapper.tsx"],"names":[],"mappings":";;;;AAAA,0DAA6E;AAC7E,+CAAgD;AAiBhD;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAA,qBAAa,EAEpD,SAAS,CAAC,CAAA;AAMZ;;GAEG;AACI,IAAM,iCAAiC,GAC5C,UAAC,EAAuC;QAArC,QAAQ,cAAA,EAAE,yBAAyB,+BAAA;IACpC,OAAO,CACL,8BAAC,iCAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,yBAAyB,IACjE,QAAQ,CAC0B,CACtC,CAAA;AACH,CAAC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obStatus, QueryBundleRequest, QueryResultBundle, SelectColumn } from '../utils/synapseTypes/';
|
|
3
2
|
import { SynapseClientError } from '../utils/SynapseClient';
|
|
3
|
+
import { AsynchronousJobStatus, Entity, QueryBundleRequest, QueryResultBundle } from '../utils/synapseTypes';
|
|
4
|
+
export declare const QUERY_FILTERS_EXPANDED_CSS: string;
|
|
5
|
+
export declare const QUERY_FILTERS_COLLAPSED_CSS: string;
|
|
6
|
+
export declare type QueryContextType = {
|
|
7
|
+
/** The entity being queried. Will be undefined while initially fetching */
|
|
8
|
+
entity: Entity | undefined;
|
|
9
|
+
/** The query results, which will be undefined while initially fetching a new bundle, but will not be unloaded when fetching new pages */
|
|
10
|
+
data: QueryResultBundle | undefined;
|
|
11
|
+
/** Returns a deep clone of the current query bundle request */
|
|
12
|
+
getLastQueryRequest: () => QueryBundleRequest;
|
|
13
|
+
/** Returns a deep clone of the initial query bundle request */
|
|
14
|
+
getInitQueryRequest: () => QueryBundleRequest;
|
|
15
|
+
/** Updates the current query with the passed request */
|
|
16
|
+
executeQueryRequest: (param: QueryBundleRequest) => void;
|
|
17
|
+
/** Returns true when loading a new page of query results */
|
|
18
|
+
isLoadingNewPage: boolean;
|
|
19
|
+
/** Returns true when loading a brand new query result bundle. Will not be true when just loading the next page of query results. */
|
|
20
|
+
isLoadingNewBundle: boolean;
|
|
21
|
+
/** The error returned by the query request, if one is encountered */
|
|
22
|
+
error: SynapseClientError | null;
|
|
23
|
+
/** The status of the asynchronous job. */
|
|
24
|
+
asyncJobStatus: AsynchronousJobStatus<unknown, unknown>;
|
|
25
|
+
/** Whether or not the query result bundle has a next page */
|
|
26
|
+
hasNextPage: boolean;
|
|
27
|
+
/** Invoke this method to fetch and append the next page of rows to the data */
|
|
28
|
+
appendNextPageToResults: () => Promise<void>;
|
|
29
|
+
/** Invoke to fetch and update the data with the next page of query results */
|
|
30
|
+
goToNextPage: () => Promise<void>;
|
|
31
|
+
/** Whether or not the query result bundle has a previous page */
|
|
32
|
+
hasPreviousPage: boolean;
|
|
33
|
+
/** Invoke to fetch and update the data with the previous page of query results */
|
|
34
|
+
goToPreviousPage: () => Promise<void>;
|
|
35
|
+
/** Whether or not facets are available to be filtered upon based on the current data */
|
|
36
|
+
isFacetsAvailable: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* A facet may be "locked" so that it is not modifiable by the user, for example when showing only data relevant to a particular facet value on a Details Page.
|
|
39
|
+
* The value of a locked facet will result in a client-side modification of the result bundle data.
|
|
40
|
+
*/
|
|
41
|
+
lockedFacet?: LockedFacet;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* This must be exported to use the context in class components.
|
|
45
|
+
*/
|
|
46
|
+
export declare const QueryContext: React.Context<QueryContextType | undefined>;
|
|
47
|
+
export declare type QueryContextProviderProps = {
|
|
48
|
+
queryContext: QueryContextType;
|
|
49
|
+
};
|
|
4
50
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This wasn't done because Enzyme's shallow renderer is not currently
|
|
8
|
-
* compatible with the `contextType` field in the React 16+ context API.
|
|
9
|
-
*
|
|
10
|
-
* This can be fixed by rewriting tests to not rely on the shallow renderer.
|
|
11
|
-
*
|
|
12
|
-
* See here: https://github.com/enzymejs/enzyme/issues/1553
|
|
51
|
+
* Provides data related to a Synapse table query, and functions for iterating through pages of the data.
|
|
13
52
|
*/
|
|
53
|
+
export declare const QueryContextProvider: React.FC<QueryContextProviderProps>;
|
|
54
|
+
export declare function useQueryContext(): QueryContextType;
|
|
55
|
+
export declare const QueryContextConsumer: React.Consumer<QueryContextType | undefined>;
|
|
14
56
|
export declare type QueryWrapperProps = {
|
|
15
|
-
|
|
57
|
+
children: React.ReactNode | React.ReactNode[];
|
|
16
58
|
initQueryRequest: QueryBundleRequest;
|
|
17
|
-
rgbIndex?: number;
|
|
18
|
-
token?: string;
|
|
19
|
-
facet?: string;
|
|
20
|
-
unitDescription?: string;
|
|
21
|
-
facetAliases?: Record<string, string>;
|
|
22
|
-
loadNow?: boolean;
|
|
23
|
-
showBarChart?: boolean;
|
|
24
59
|
componentIndex?: number;
|
|
25
60
|
shouldDeepLink?: boolean;
|
|
26
61
|
onQueryChange?: (newQueryJson: string) => void;
|
|
27
62
|
onQueryResultBundleChange?: (newQueryResultBundleJson: string) => void;
|
|
28
|
-
hiddenColumns?: string[];
|
|
29
63
|
lockedFacet?: LockedFacet;
|
|
30
|
-
defaultShowFacetVisualization?: boolean;
|
|
31
|
-
children?: (queryWrapperChildProps: QueryWrapperChildProps) => React.ReactNode | React.ReactNode[];
|
|
32
64
|
};
|
|
33
65
|
export declare type TopLevelControlsState = {
|
|
34
66
|
showFacetVisualization: boolean;
|
|
@@ -43,134 +75,12 @@ export declare type SearchQuery = {
|
|
|
43
75
|
columnName: string;
|
|
44
76
|
searchText: string;
|
|
45
77
|
};
|
|
46
|
-
export declare type QueryWrapperState = {
|
|
47
|
-
isAllFilterSelectedForFacet: Record<string, boolean>;
|
|
48
|
-
data: QueryResultBundle | undefined;
|
|
49
|
-
isLoadingNewData: boolean;
|
|
50
|
-
isLoading: boolean;
|
|
51
|
-
lastQueryRequest: QueryBundleRequest;
|
|
52
|
-
hasMoreData: boolean;
|
|
53
|
-
lastFacetSelection: FacetSelection;
|
|
54
|
-
chartSelectionIndex: number;
|
|
55
|
-
asyncJobStatus?: AsynchronousJobStatus;
|
|
56
|
-
facetAliases?: Record<string, string>;
|
|
57
|
-
loadNowStarted: boolean;
|
|
58
|
-
topLevelControlsState?: TopLevelControlsState;
|
|
59
|
-
isColumnSelected: string[];
|
|
60
|
-
selectedRowIndices?: number[];
|
|
61
|
-
error: SynapseClientError | undefined;
|
|
62
|
-
isFacetsAvailable: boolean;
|
|
63
|
-
};
|
|
64
78
|
export declare type LockedFacet = {
|
|
65
79
|
facet?: string;
|
|
66
80
|
value?: string;
|
|
67
81
|
};
|
|
68
|
-
export declare type FacetSelection = {
|
|
69
|
-
columnName: string;
|
|
70
|
-
facetValue: string;
|
|
71
|
-
selector: string;
|
|
72
|
-
};
|
|
73
|
-
export declare type QueryWrapperChildProps = {
|
|
74
|
-
isAllFilterSelectedForFacet?: Record<string, boolean>;
|
|
75
|
-
isLoading?: boolean;
|
|
76
|
-
token?: string;
|
|
77
|
-
entityId?: string;
|
|
78
|
-
isLoadingNewData?: boolean;
|
|
79
|
-
executeQueryRequest?: (param: QueryBundleRequest) => void;
|
|
80
|
-
executeInitialQueryRequest?: () => void;
|
|
81
|
-
getNextPageOfData?: (queryRequest: QueryBundleRequest) => void;
|
|
82
|
-
getLastQueryRequest?: () => QueryBundleRequest;
|
|
83
|
-
getInitQueryRequest?: () => QueryBundleRequest;
|
|
84
|
-
data?: QueryResultBundle;
|
|
85
|
-
facet?: string;
|
|
86
|
-
updateParentState?: <K extends keyof QueryWrapperState>(param: Pick<QueryWrapperState, K>) => void;
|
|
87
|
-
rgbIndex?: number;
|
|
88
|
-
unitDescription?: string;
|
|
89
|
-
facetAliases?: Record<string, string>;
|
|
90
|
-
lastFacetSelection?: FacetSelection;
|
|
91
|
-
chartSelectionIndex?: number;
|
|
92
|
-
asyncJobStatus?: AsynchronousJobStatus;
|
|
93
|
-
showBarChart?: boolean;
|
|
94
|
-
hasMoreData?: boolean;
|
|
95
|
-
topLevelControlsState?: TopLevelControlsState;
|
|
96
|
-
isColumnSelected?: string[];
|
|
97
|
-
selectedRowIndices?: number[];
|
|
98
|
-
error?: SynapseClientError | undefined;
|
|
99
|
-
lockedFacet?: LockedFacet;
|
|
100
|
-
isFacetsAvailable?: boolean;
|
|
101
|
-
};
|
|
102
|
-
export declare const QUERY_FILTERS_EXPANDED_CSS: string;
|
|
103
|
-
export declare const QUERY_FILTERS_COLLAPSED_CSS: string;
|
|
104
82
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @class QueryWrapper
|
|
109
|
-
* @extends {React.Component}
|
|
83
|
+
* Component that manages the state of a Synapse table query. Data can be accessed via QueryContext using
|
|
84
|
+
* either `useQueryContext` or `QueryContextConsumer`.
|
|
110
85
|
*/
|
|
111
|
-
export
|
|
112
|
-
private componentIndex;
|
|
113
|
-
constructor(props: QueryWrapperProps);
|
|
114
|
-
/**
|
|
115
|
-
* Compute default query request
|
|
116
|
-
*
|
|
117
|
-
* @memberof QueryWrapper
|
|
118
|
-
*/
|
|
119
|
-
componentDidMount(): void;
|
|
120
|
-
/**
|
|
121
|
-
* @memberof QueryWrapper
|
|
122
|
-
*/
|
|
123
|
-
componentDidUpdate(prevProps: QueryWrapperProps): void;
|
|
124
|
-
/**
|
|
125
|
-
* Pass down a deep clone (so no side affects on the child's part) of the
|
|
126
|
-
* last query request made
|
|
127
|
-
*
|
|
128
|
-
* @returns
|
|
129
|
-
* @memberof QueryWrapper
|
|
130
|
-
*/
|
|
131
|
-
getLastQueryRequest(): QueryBundleRequest;
|
|
132
|
-
/**
|
|
133
|
-
* Pass down a deep clone (so no side affects on the child's part) of the
|
|
134
|
-
* first query request made
|
|
135
|
-
*
|
|
136
|
-
* @returns
|
|
137
|
-
* @memberof QueryWrapper
|
|
138
|
-
*/
|
|
139
|
-
getInitQueryRequest(): QueryBundleRequest;
|
|
140
|
-
getSelectedColumns(isReset: boolean, selectColumns?: SelectColumn[]): string[];
|
|
141
|
-
/**
|
|
142
|
-
* Execute the given query
|
|
143
|
-
*
|
|
144
|
-
* @param {*} queryRequest Query request as specified by
|
|
145
|
-
* https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Query.html
|
|
146
|
-
* @memberof QueryWrapper
|
|
147
|
-
*/
|
|
148
|
-
executeQueryRequest(queryRequest: QueryBundleRequest): Promise<void>;
|
|
149
|
-
/**
|
|
150
|
-
* Grab the next page of data, pulling in 25 more rows.
|
|
151
|
-
*
|
|
152
|
-
* @param {*} queryRequest Query request as specified by
|
|
153
|
-
* https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Query.html
|
|
154
|
-
* @memberof QueryWrapper
|
|
155
|
-
*/
|
|
156
|
-
getNextPageOfData(queryRequest: QueryBundleRequest): Promise<void>;
|
|
157
|
-
/**
|
|
158
|
-
* Execute the initial query passed into the component
|
|
159
|
-
*
|
|
160
|
-
* @param {*} queryRequest Query request as specified by
|
|
161
|
-
* https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Query.html
|
|
162
|
-
* @memberof QueryWrapper
|
|
163
|
-
*/
|
|
164
|
-
executeInitialQueryRequest(initQueryRequest?: QueryBundleRequest): void;
|
|
165
|
-
updateParentState<K extends keyof QueryWrapperState>(update: Pick<QueryWrapperState, K>): void;
|
|
166
|
-
/**
|
|
167
|
-
* remove a particular facet name (e.g. study) and its all possible values based on the parameter specified in the url
|
|
168
|
-
* this is to remove the facet from the charts, search and filter.
|
|
169
|
-
* @return data: QueryResultBundle
|
|
170
|
-
*/
|
|
171
|
-
removeLockedFacetData(): QueryResultBundle | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* Render the children without any formatting
|
|
174
|
-
*/
|
|
175
|
-
render(): JSX.Element;
|
|
176
|
-
}
|
|
86
|
+
export declare function QueryWrapper(props: QueryWrapperProps): JSX.Element;
|