@gooddata/sdk-ui-analytical-designer 11.67.0-alpha.2 → 11.67.0-alpha.4
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/NOTICE +798 -2473
- package/README.md +13 -5
- package/esm/Root.d.ts +0 -2
- package/esm/Root.d.ts.map +1 -1
- package/esm/Root.js +0 -4
- package/esm/actions/app_context_actions.d.ts.map +1 -1
- package/esm/actions/app_context_actions.js +2 -4
- package/esm/actions/dialogs_actions.d.ts +2 -2
- package/esm/actions/dialogs_actions.js +2 -2
- package/esm/components/DeleteReportDialog.d.ts.map +1 -1
- package/esm/components/DeleteReportDialog.js +30 -11
- package/esm/components/DeleteReportDialogUsageList.d.ts +6 -2
- package/esm/components/DeleteReportDialogUsageList.d.ts.map +1 -1
- package/esm/components/DeleteReportDialogUsageList.js +29 -16
- package/esm/components/DeleteReportDialogUsageListItem.d.ts +2 -3
- package/esm/components/DeleteReportDialogUsageListItem.d.ts.map +1 -1
- package/esm/components/DeleteReportDialogUsageListItem.js +2 -3
- package/esm/components/Editor.d.ts.map +1 -1
- package/esm/components/Editor.js +31 -2
- package/esm/components/EditorHeader.d.ts +19 -1
- package/esm/components/EditorHeader.d.ts.map +1 -1
- package/esm/components/EditorHeader.js +38 -86
- package/esm/components/ReportDescription.d.ts +8 -1
- package/esm/components/ReportDescription.d.ts.map +1 -1
- package/esm/components/ReportDescription.js +37 -7
- package/esm/components/buckets/MeasureAttributeFilterOrganized.d.ts.map +1 -1
- package/esm/components/buckets/MeasureAttributeFilterOrganized.js +1 -1
- package/esm/components/buckets/MeasureDateFilter.d.ts.map +1 -1
- package/esm/components/buckets/MeasureDateFilter.js +1 -1
- package/esm/components/buckets/categories/DateDatasetsDropdown.d.ts.map +1 -1
- package/esm/components/filterBar/dateFilter/TimeComparisonSection/TimeComparisonTypesDropdown.d.ts.map +1 -1
- package/esm/components/header/CancelButton.d.ts +13 -0
- package/esm/components/header/CancelButton.d.ts.map +1 -0
- package/esm/components/header/CancelButton.js +32 -0
- package/esm/components/header/ClearButton.d.ts +7 -0
- package/esm/components/header/ClearButton.d.ts.map +1 -0
- package/esm/components/header/ClearButton.js +24 -0
- package/esm/components/header/EditorActions.d.ts +14 -0
- package/esm/components/header/EditorActions.d.ts.map +1 -0
- package/esm/components/header/EditorActions.js +71 -0
- package/esm/components/header/Embed/EmbedButton.d.ts +6 -1
- package/esm/components/header/Embed/EmbedButton.d.ts.map +1 -1
- package/esm/components/header/Embed/EmbedButton.js +48 -48
- package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts +6 -0
- package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts.map +1 -0
- package/esm/components/header/Embed/EmbedInsightDialogContainer.js +52 -0
- package/esm/components/header/Embed/EmbedMenu.d.ts +6 -4
- package/esm/components/header/Embed/EmbedMenu.d.ts.map +1 -1
- package/esm/components/header/Embed/EmbedMenu.js +2 -6
- package/esm/components/header/InsightPickerDialog.d.ts +5 -1
- package/esm/components/header/InsightPickerDialog.d.ts.map +1 -1
- package/esm/components/header/InsightPickerDialog.js +9 -29
- package/esm/components/header/OpenControl.d.ts +7 -0
- package/esm/components/header/OpenControl.d.ts.map +1 -0
- package/esm/components/header/OpenControl.js +69 -0
- package/esm/components/header/OptionsMenu/OptionsButton.d.ts +5 -1
- package/esm/components/header/OptionsMenu/OptionsButton.d.ts.map +1 -1
- package/esm/components/header/OptionsMenu/OptionsButton.js +19 -9
- package/esm/components/header/OptionsMenu/OptionsMenu.d.ts +8 -60
- package/esm/components/header/OptionsMenu/OptionsMenu.d.ts.map +1 -1
- package/esm/components/header/OptionsMenu/OptionsMenu.js +56 -112
- package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts +3 -4
- package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts.map +1 -1
- package/esm/components/header/OptionsMenu/OptionsMenuItem.js +5 -9
- package/esm/components/header/OptionsMenu/useOptionsProps.d.ts +26 -0
- package/esm/components/header/OptionsMenu/useOptionsProps.d.ts.map +1 -0
- package/esm/components/header/OptionsMenu/useOptionsProps.js +188 -0
- package/esm/components/header/SaveAsNewReportButton.d.ts +6 -1
- package/esm/components/header/SaveAsNewReportButton.d.ts.map +1 -1
- package/esm/components/header/SaveAsNewReportButton.js +20 -10
- package/esm/components/header/SaveReportButton.d.ts +6 -1
- package/esm/components/header/SaveReportButton.d.ts.map +1 -1
- package/esm/components/header/SaveReportButton.js +41 -18
- package/esm/components/header/TimezoneDialog.d.ts +1 -1
- package/esm/components/header/TimezoneDialog.js +1 -1
- package/esm/components/header/UndoRedoButtons.d.ts +7 -0
- package/esm/components/header/UndoRedoButtons.d.ts.map +1 -0
- package/esm/components/header/UndoRedoButtons.js +31 -0
- package/esm/components/header/VisualizationInfo.d.ts +11 -0
- package/esm/components/header/VisualizationInfo.d.ts.map +1 -0
- package/esm/components/header/VisualizationInfo.js +47 -0
- package/esm/components/header/VisualizationTitle.d.ts +7 -0
- package/esm/components/header/VisualizationTitle.d.ts.map +1 -0
- package/esm/components/header/VisualizationTitle.js +36 -0
- package/esm/components/header/VisualizationsDropdown.d.ts +5 -1
- package/esm/components/header/VisualizationsDropdown.d.ts.map +1 -1
- package/esm/components/header/VisualizationsDropdown.js +7 -33
- package/esm/components/header/editorHeaderContext.d.ts +20 -0
- package/esm/components/header/editorHeaderContext.d.ts.map +1 -0
- package/esm/components/header/editorHeaderContext.js +58 -0
- package/esm/components/header/share/InsightAccess.d.ts +30 -1
- package/esm/components/header/share/InsightAccess.d.ts.map +1 -1
- package/esm/components/header/share/InsightAccess.js +81 -18
- package/esm/components/header/share/InsightAccessChip.d.ts +2 -2
- package/esm/components/header/share/InsightAccessChip.d.ts.map +1 -1
- package/esm/components/header/share/InsightAccessChip.js +3 -3
- package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +1 -1
- package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -1
- package/esm/embedding/editorHeaderSlotTypes.d.ts +569 -0
- package/esm/embedding/editorHeaderSlotTypes.d.ts.map +1 -0
- package/esm/embedding/editorHeaderSlotTypes.js +2 -0
- package/esm/embedding/slots.d.ts +73 -0
- package/esm/embedding/slots.d.ts.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/metrics_changed_events.d.ts +1 -1
- package/esm/postMessageApi/outgoing/metrics_changed_events.js +1 -1
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts +1 -1
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/post_event_helper.js +1 -1
- package/esm/postMessageApi/sagas/control_filtering_saga.js +1 -1
- package/esm/sdk-ui-analytical-designer.d.ts +664 -0
- package/esm/selectors/dialogs_selector.d.ts +26 -2
- package/esm/selectors/dialogs_selector.d.ts.map +1 -1
- package/esm/selectors/dialogs_selector.js +3 -2
- package/esm/selectors/editor_header_selector.d.ts +225 -0
- package/esm/selectors/editor_header_selector.d.ts.map +1 -1
- package/esm/selectors/editor_header_selector.js +8 -1
- package/esm/selectors/feature_flag_selector.d.ts +2 -23
- package/esm/selectors/feature_flag_selector.d.ts.map +1 -1
- package/esm/selectors/feature_flag_selector.js +0 -2
- package/esm/selectors/insight_access_selector.d.ts +185 -4
- package/esm/selectors/insight_access_selector.d.ts.map +1 -1
- package/esm/selectors/insight_access_selector.js +5 -3
- package/esm/selectors/report_title_selector.d.ts +6 -6
- package/esm/selectors/report_title_selector.d.ts.map +1 -1
- package/esm/selectors/report_title_selector.js +4 -3
- package/esm/selectors/report_visualization_selector.d.ts +4 -4
- package/esm/selectors/save_report_selector.d.ts +7 -0
- package/esm/selectors/save_report_selector.d.ts.map +1 -1
- package/esm/selectors/save_report_selector.js +11 -1
- package/esm/selectors/uri_selector.d.ts +22 -0
- package/esm/selectors/uri_selector.d.ts.map +1 -1
- package/esm/selectors/uri_selector.js +1 -0
- package/esm/store/app_context/app_context_slices.d.ts.map +1 -1
- package/esm/store/app_context/app_context_slices.js +2 -3
- package/esm/store/app_context/session_id_reducer.d.ts +2 -3
- package/esm/store/app_context/session_id_reducer.d.ts.map +1 -1
- package/esm/store/app_context/session_id_reducer.js +2 -3
- package/esm/store/intl/intl_slice.d.ts.map +1 -1
- package/esm/store/intl/intl_slice.js +2 -3
- package/esm/translations/en-US.json +22 -2
- package/esm/utils/browser_detect.d.ts +2 -1
- package/esm/utils/browser_detect.d.ts.map +1 -1
- package/esm/utils/browser_detect.js +21 -3
- package/esm/utils/dropdown.d.ts +6 -2
- package/esm/utils/dropdown.d.ts.map +1 -1
- package/esm/utils/dropdown.js +10 -3
- package/package.json +26 -34
- package/styles/css/catalog.css +2 -2
- package/styles/css/catalog_sidebar.css +1 -1
- package/styles/css/catalog_sidebar.css.map +1 -1
- package/styles/css/delete_report_dialog.css +6 -2
- package/styles/css/delete_report_dialog.css.map +1 -1
- package/styles/css/editor_canvas.css +1 -1
- package/styles/css/editor_header.css +16 -1
- package/styles/css/editor_header.css.map +1 -1
- package/styles/css/main.css +26 -7
- package/styles/css/main.css.map +1 -1
- package/styles/scss/catalog.scss +2 -2
- package/styles/scss/catalog_sidebar.scss +2 -1
- package/styles/scss/delete_report_dialog.scss +8 -2
- package/styles/scss/editor_canvas.scss +1 -1
- package/styles/scss/editor_header.scss +20 -1
- package/esm/components/ReportTitle.d.ts +0 -2
- package/esm/components/ReportTitle.d.ts.map +0 -1
- package/esm/components/ReportTitle.js +0 -51
- package/esm/components/header/Embed/utils.d.ts +0 -4
- package/esm/components/header/Embed/utils.d.ts.map +0 -1
- package/esm/components/header/Embed/utils.js +0 -5
|
@@ -1,44 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
|
-
import { useCallback, useEffect,
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { useDispatch, useSelector } from "react-redux";
|
|
6
6
|
import { createSelector } from "reselect";
|
|
7
|
-
import { idRef,
|
|
7
|
+
import { idRef, uriRef } from "@gooddata/sdk-model";
|
|
8
8
|
import { InsightPicker, useInsightPickerState, } from "@gooddata/sdk-ui-ext";
|
|
9
9
|
import { Button, Dialog } from "@gooddata/sdk-ui-kit";
|
|
10
10
|
import { deleteReport } from "../../actions/delete_actions.js";
|
|
11
|
-
import { openReport } from "../../actions/open_actions.js";
|
|
12
11
|
import { saveReportCheck } from "../../actions/save_actions.js";
|
|
13
12
|
import { descriptionTooltipOpened } from "../../sagas/description_tooltip/description_tooltip_ui_actions.js";
|
|
14
13
|
import { isOwnershipSupported, supportsObjectUris } from "../../selectors/backend_capabilities_selector.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { canOpenReport } from "../../selectors/open_report_selector.js";
|
|
18
|
-
import { openReportIdSelector } from "../../selectors/report_selector.js";
|
|
19
|
-
import { getTagsConfiguration } from "../../selectors/route_selector.js";
|
|
20
|
-
import { getEnabledVisualizationClassesUrls } from "../../services/visualization_class_service.js";
|
|
14
|
+
import { getUserLoginMD5, getUserUri } from "../../selectors/bootstrap_selector.js";
|
|
15
|
+
import { getMetadataTimeZone } from "../../selectors/feature_flag_selector.js";
|
|
21
16
|
import { getIsReadOnlyMode } from "../../store/embedding/embedding_selectors.js";
|
|
22
|
-
const isDisabledSelector = createSelector([canOpenReport], (canOpenReport) => !canOpenReport);
|
|
23
17
|
const authorSelector = createSelector(supportsObjectUris, getUserUri, getUserLoginMD5, (isObjectUriSupported, userUri, userLoginMd5) => {
|
|
24
18
|
return isObjectUriSupported ? userUri : userLoginMd5;
|
|
25
19
|
});
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The Open control as a button with the visualization picker in a dialog.
|
|
22
|
+
*/
|
|
23
|
+
export function InsightPickerDialog({ workspace, label, isDisabled, selectedInsightId: openInsightId, includeTags, excludeTags, enabledVisualizationUrls, isSemanticSearchEnabled, onOpenInsight, }) {
|
|
28
24
|
const author = useSelector(authorSelector);
|
|
29
|
-
const isDisabled = useSelector(isDisabledSelector);
|
|
30
|
-
const openInsightId = useSelector(openReportIdSelector);
|
|
31
|
-
const enabledVisualizationClassesUrls = useSelector(getEnabledVisualizationClassesUrls);
|
|
32
25
|
const hasOwnershipSupport = useSelector(isOwnershipSupported);
|
|
33
26
|
const metadataTimeZone = useSelector(getMetadataTimeZone);
|
|
34
|
-
const isFilteringByTagsEnabled = useSelector(enableVisualizationFilteringByTags);
|
|
35
27
|
const isReadOnly = useSelector(getIsReadOnlyMode);
|
|
36
|
-
const isSmartSearchResultsEnabled = useSelector(enableCatalogSmartSearchResults);
|
|
37
|
-
const tagsConfiguration = useSelector(getTagsConfiguration);
|
|
38
28
|
const dispatch = useDispatch();
|
|
39
|
-
const onOpenInsight = useCallback((insightRef) => {
|
|
40
|
-
dispatch(openReport(insightRef, false));
|
|
41
|
-
}, [dispatch]);
|
|
42
29
|
const onDeleteInsight = useCallback((insightRef, insightTitle) => {
|
|
43
30
|
dispatch(deleteReport(insightRef, false, { title: insightTitle }));
|
|
44
31
|
}, [dispatch]);
|
|
@@ -49,7 +36,6 @@ export function InsightPickerDialog() {
|
|
|
49
36
|
dispatch(descriptionTooltipOpened(description));
|
|
50
37
|
}, [dispatch]);
|
|
51
38
|
const intl = useIntl();
|
|
52
|
-
const buttonText = intl.formatMessage({ id: "openReportPlaceholder" });
|
|
53
39
|
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
54
40
|
const pickerState = useInsightPickerState(hasOwnershipSupport ? author : undefined);
|
|
55
41
|
const pendingSaveAsNew = useRef(null);
|
|
@@ -62,12 +48,6 @@ export function InsightPickerDialog() {
|
|
|
62
48
|
onSaveAsNew(true);
|
|
63
49
|
}
|
|
64
50
|
}, [openInsightId, onSaveAsNew]);
|
|
65
|
-
const includeTags = useMemo(() => isFilteringByTagsEnabled
|
|
66
|
-
? tagsConfiguration?.includeObjectsWithTags?.map((tag) => objRefToString(tag))
|
|
67
|
-
: undefined, [isFilteringByTagsEnabled, tagsConfiguration?.includeObjectsWithTags]);
|
|
68
|
-
const excludeTags = useMemo(() => isFilteringByTagsEnabled
|
|
69
|
-
? tagsConfiguration?.excludeObjectsWithTags?.map((tag) => objRefToString(tag))
|
|
70
|
-
: undefined, [isFilteringByTagsEnabled, tagsConfiguration?.excludeObjectsWithTags]);
|
|
71
51
|
const handleSelect = useCallback((insightRef) => {
|
|
72
52
|
setIsDialogOpen(false);
|
|
73
53
|
onOpenInsight(insightRef);
|
|
@@ -103,5 +83,5 @@ export function InsightPickerDialog() {
|
|
|
103
83
|
},
|
|
104
84
|
},
|
|
105
85
|
];
|
|
106
|
-
return (_jsxs("div", { className: "s-report_select report-select editor-header-item", children: [_jsx(Button, { className: "gd-button-secondary type-metric customizable", value:
|
|
86
|
+
return (_jsxs("div", { className: "s-report_select report-select editor-header-item", children: [_jsx(Button, { className: "gd-button-secondary type-metric customizable", value: label, disabled: isDisabled, onClick: () => setIsDialogOpen(true) }), isDialogOpen ? (_jsx(Dialog, { className: "open-visualizations-dialog", containerClassName: "open-visualizations-dialog-container", isModal: false, shouldCloseOnClick: () => true, onClose: () => setIsDialogOpen(false), children: _jsx("div", { className: "open-visualizations s-open-visualizations", children: _jsx(InsightPicker, { workspace: workspace, author: hasOwnershipSupport ? author : undefined, includeTags: includeTags, excludeTags: excludeTags, enabledVisualizationClassesUrls: enabledVisualizationUrls, selectedInsightId: openInsightId, metadataTimeZone: metadataTimeZone, enableSemanticSearch: isSemanticSearchEnabled, width: 740, ...pickerState, onSelect: handleSelect, onDescriptionPanelOpen: onDescriptionTooltipOpened, menuActions: menuActions }) }) })) : null] }));
|
|
107
87
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerOpenProps } from "../../embedding/editorHeaderSlotTypes.js";
|
|
2
|
+
export declare function useOpenProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerOpenProps;
|
|
3
|
+
/**
|
|
4
|
+
* Default of the Open slot: the picker variant the props ask for.
|
|
5
|
+
*/
|
|
6
|
+
export declare function DefaultOpen(props: IAnalyticalDesignerOpenProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=OpenControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenControl.d.ts","sourceRoot":"","sources":["../../../src/components/header/OpenControl.tsx"],"names":[],"mappings":"AAWA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACpC,MAAM,0CAA0C,CAAC;AAgClD,wBAAgB,YAAY,CAAC,OAAO,EAAE,gCAAgC,GAAG,4BAA4B,CAwCpG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,4BAA4B,2CAM9D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import { useSelector } from "react-redux";
|
|
6
|
+
import { createSelector } from "reselect";
|
|
7
|
+
import { objRefToString } from "@gooddata/sdk-model";
|
|
8
|
+
import { openReport } from "../../actions/open_actions.js";
|
|
9
|
+
import { enableCatalogSmartSearchResults, enableEnhancedInsightPicker, enableVisualizationFilteringByTags, } from "../../selectors/feature_flag_selector.js";
|
|
10
|
+
import { canOpenReport, isReportOpeningSelector } from "../../selectors/open_report_selector.js";
|
|
11
|
+
import { openReportIdSelector } from "../../selectors/report_selector.js";
|
|
12
|
+
import { getTagsConfiguration } from "../../selectors/route_selector.js";
|
|
13
|
+
import { getEnabledVisualizationClassesUrls } from "../../services/visualization_class_service.js";
|
|
14
|
+
import { useGuardedCallback } from "./editorHeaderContext.js";
|
|
15
|
+
import { InsightPickerDialog } from "./InsightPickerDialog.js";
|
|
16
|
+
import { VisualizationsDropdown } from "./VisualizationsDropdown.js";
|
|
17
|
+
// Tags come as ObjRef (idRef) from the route; the pickers expect their identifiers, and only with the flag on.
|
|
18
|
+
const pickerTagsSelector = createSelector(enableVisualizationFilteringByTags, getTagsConfiguration, (isFilteringByTagsEnabled, tagsConfiguration) => ({
|
|
19
|
+
includeTags: isFilteringByTagsEnabled
|
|
20
|
+
? tagsConfiguration?.includeObjectsWithTags?.map((tag) => objRefToString(tag))
|
|
21
|
+
: undefined,
|
|
22
|
+
excludeTags: isFilteringByTagsEnabled
|
|
23
|
+
? tagsConfiguration?.excludeObjectsWithTags?.map((tag) => objRefToString(tag))
|
|
24
|
+
: undefined,
|
|
25
|
+
}));
|
|
26
|
+
const runOpen = (dispatch, _state, ref) => dispatch(openReport(ref, false));
|
|
27
|
+
export function useOpenProps(context) {
|
|
28
|
+
const intl = useIntl();
|
|
29
|
+
const isDisabled = !useSelector(canOpenReport);
|
|
30
|
+
const isLoading = useSelector(isReportOpeningSelector);
|
|
31
|
+
const selectedInsightId = useSelector(openReportIdSelector);
|
|
32
|
+
const isEnhancedInsightPickerEnabled = useSelector(enableEnhancedInsightPicker);
|
|
33
|
+
const { includeTags, excludeTags } = useSelector(pickerTagsSelector);
|
|
34
|
+
const enabledVisualizationUrls = useSelector(getEnabledVisualizationClassesUrls);
|
|
35
|
+
const isSemanticSearchEnabled = useSelector(enableCatalogSmartSearchResults);
|
|
36
|
+
const onOpenInsight = useGuardedCallback(canOpenReport, runOpen);
|
|
37
|
+
const label = intl.formatMessage({ id: "openReportPlaceholder" });
|
|
38
|
+
return useMemo(() => ({
|
|
39
|
+
...context,
|
|
40
|
+
label,
|
|
41
|
+
isDisabled,
|
|
42
|
+
isLoading,
|
|
43
|
+
...(selectedInsightId ? { selectedInsightId } : {}),
|
|
44
|
+
pickerVariant: isEnhancedInsightPickerEnabled ? "dialog" : "dropdown",
|
|
45
|
+
...(includeTags ? { includeTags } : {}),
|
|
46
|
+
...(excludeTags ? { excludeTags } : {}),
|
|
47
|
+
enabledVisualizationUrls,
|
|
48
|
+
isSemanticSearchEnabled,
|
|
49
|
+
onOpenInsight,
|
|
50
|
+
}), [
|
|
51
|
+
context,
|
|
52
|
+
label,
|
|
53
|
+
isDisabled,
|
|
54
|
+
isLoading,
|
|
55
|
+
selectedInsightId,
|
|
56
|
+
isEnhancedInsightPickerEnabled,
|
|
57
|
+
includeTags,
|
|
58
|
+
excludeTags,
|
|
59
|
+
enabledVisualizationUrls,
|
|
60
|
+
isSemanticSearchEnabled,
|
|
61
|
+
onOpenInsight,
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default of the Open slot: the picker variant the props ask for.
|
|
66
|
+
*/
|
|
67
|
+
export function DefaultOpen(props) {
|
|
68
|
+
return props.pickerVariant === "dialog" ? (_jsx(InsightPickerDialog, { ...props })) : (_jsx(VisualizationsDropdown, { ...props }));
|
|
69
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { type IAnalyticalDesignerOptionsProps } from "../../../embedding/editorHeaderSlotTypes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default of the Options slot: a button that opens the menu of the given items.
|
|
4
|
+
*/
|
|
5
|
+
export declare function DefaultOptions({ label, accessibleName, isDisabled, items, }: IAnalyticalDesignerOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
//# sourceMappingURL=OptionsButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OptionsButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsButton.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAInG;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,cAAc,EACd,UAAU,EACV,KAAK,GACR,EAAE,+BAA+B,2CA2BjC"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
4
|
import { Button } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import { OptionsMenu } from "./OptionsMenu.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Default of the Options slot: a button that opens the menu of the given items.
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultOptions({ label, accessibleName, isDisabled, items, }) {
|
|
10
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
11
|
+
const toggleMenu = useCallback(() => {
|
|
12
|
+
setIsMenuOpen((open) => !open);
|
|
13
|
+
}, []);
|
|
14
|
+
const closeMenu = useCallback(() => {
|
|
15
|
+
setIsMenuOpen(false);
|
|
16
|
+
}, []);
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { className: "gd-button-secondary s-options-button editor-header-item", value: label, disabled: isDisabled, onClick: toggleMenu, accessibilityConfig: {
|
|
18
|
+
ariaLabel: accessibleName,
|
|
19
|
+
ariaHaspopup: "menu",
|
|
20
|
+
ariaExpanded: isMenuOpen,
|
|
21
|
+
} }), isMenuOpen ? _jsx(OptionsMenu, { items: items, onClose: closeMenu }) : null] }));
|
|
22
|
+
}
|
|
@@ -1,63 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
onOpenAsReport: (title: string) => void;
|
|
6
|
-
showDialogExportCsv: (mode: ExportCsvMode) => void;
|
|
7
|
-
showDialogExportReport: () => void;
|
|
8
|
-
showDialogExportPdf: () => void;
|
|
9
|
-
openInAnalyticalDesigner: () => ReturnType<typeof openInAnalyticalDesignerAction>;
|
|
1
|
+
import { type AnalyticalDesignerOptionsItem } from "../../../embedding/editorHeaderSlotTypes.js";
|
|
2
|
+
interface IOptionsMenuProps {
|
|
3
|
+
items: readonly AnalyticalDesignerOptionsItem[];
|
|
4
|
+
onClose: () => void;
|
|
10
5
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exportRawBubbleTextProvider?: BubbleTextProvider;
|
|
16
|
-
isOpenAsReportDisabled: boolean;
|
|
17
|
-
isExportVisible: boolean;
|
|
18
|
-
isExportCSVDisabled: boolean;
|
|
19
|
-
isExportRawCSVDisabled: boolean;
|
|
20
|
-
isExportXLSXDisabled: boolean;
|
|
21
|
-
isExportPDFDisabled: boolean;
|
|
22
|
-
exportToCsvSupported: boolean;
|
|
23
|
-
exportToXlsxSupported: boolean;
|
|
24
|
-
exportToPdfSupported: boolean;
|
|
25
|
-
isEditFromKD: boolean;
|
|
26
|
-
hiddenActions: string[];
|
|
27
|
-
enableRawExports: boolean;
|
|
28
|
-
hasPartialDataLimitBreaks: boolean;
|
|
29
|
-
isAccessibilityModeEnabled: boolean;
|
|
30
|
-
isEnableTimezoneChange: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface IOptionsMenuOwnProps {
|
|
33
|
-
isShowOptionsMenu: boolean;
|
|
34
|
-
toggleOptionsMenu: () => void;
|
|
35
|
-
}
|
|
36
|
-
type IOptionsMenuProps = IOptionsMenuDispatchProps & IOptionsMenuStateProps & IOptionsMenuOwnProps;
|
|
37
|
-
export declare const OptionsMenuBase: import("react").MemoExoticComponent<({ exportBubbleTextProvider, exportRawBubbleTextProvider, isExportVisible, isExportCSVDisabled, isExportRawCSVDisabled, isExportXLSXDisabled, isExportPDFDisabled, exportToCsvSupported, exportToXlsxSupported, exportToPdfSupported, isEditFromKD, hiddenActions, enableRawExports, hasPartialDataLimitBreaks, isAccessibilityModeEnabled, isEnableTimezoneChange, isShowOptionsMenu, toggleOptionsMenu, showDialogExportCsv, showDialogExportReport, showDialogExportPdf, openInAnalyticalDesigner, }: IOptionsMenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
38
|
-
export declare const OptionsMenu: import("react-redux").ConnectedComponent<import("react").MemoExoticComponent<({ exportBubbleTextProvider, exportRawBubbleTextProvider, isExportVisible, isExportCSVDisabled, isExportRawCSVDisabled, isExportXLSXDisabled, isExportPDFDisabled, exportToCsvSupported, exportToXlsxSupported, exportToPdfSupported, isEditFromKD, hiddenActions, enableRawExports, hasPartialDataLimitBreaks, isAccessibilityModeEnabled, isEnableTimezoneChange, isShowOptionsMenu, toggleOptionsMenu, showDialogExportCsv, showDialogExportReport, showDialogExportPdf, openInAnalyticalDesigner, }: IOptionsMenuProps) => import("react/jsx-runtime").JSX.Element>, {
|
|
39
|
-
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null>;
|
|
40
|
-
store?: import("redux").Store;
|
|
41
|
-
bubbleTextProvider?: BubbleTextProvider;
|
|
42
|
-
exportBubbleTextProvider?: BubbleTextProvider;
|
|
43
|
-
exportRawBubbleTextProvider?: BubbleTextProvider;
|
|
44
|
-
isOpenAsReportDisabled: boolean;
|
|
45
|
-
isExportVisible: boolean;
|
|
46
|
-
isExportCSVDisabled: boolean;
|
|
47
|
-
isExportRawCSVDisabled: boolean;
|
|
48
|
-
isExportXLSXDisabled: boolean;
|
|
49
|
-
isExportPDFDisabled: boolean;
|
|
50
|
-
exportToCsvSupported: boolean;
|
|
51
|
-
exportToXlsxSupported: boolean;
|
|
52
|
-
exportToPdfSupported: boolean;
|
|
53
|
-
isEditFromKD: boolean;
|
|
54
|
-
hiddenActions: string[];
|
|
55
|
-
enableRawExports: boolean;
|
|
56
|
-
hasPartialDataLimitBreaks: boolean;
|
|
57
|
-
isAccessibilityModeEnabled: boolean;
|
|
58
|
-
isEnableTimezoneChange: boolean;
|
|
59
|
-
isShowOptionsMenu: boolean;
|
|
60
|
-
toggleOptionsMenu: () => void;
|
|
61
|
-
}>;
|
|
6
|
+
/**
|
|
7
|
+
* The options menu overlay. Selecting an action closes the menu and starts the action.
|
|
8
|
+
*/
|
|
9
|
+
export declare function OptionsMenu({ items, onClose }: IOptionsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
62
10
|
export {};
|
|
63
11
|
//# sourceMappingURL=OptionsMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"OptionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,6BAA6B,EAErC,MAAM,6CAA6C,CAAC;AA6CrD,UAAU,iBAAiB;IACvB,KAAK,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,iBAAiB,2CAwChE"}
|
|
@@ -1,116 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
|
-
import { memo, useCallback, useState } from "react";
|
|
4
|
-
import { defineMessage, useIntl } from "react-intl";
|
|
5
|
-
import { connect } from "react-redux";
|
|
6
|
-
import { createStructuredSelector } from "reselect";
|
|
7
3
|
import { Header, ItemsWrapper, Overlay, Separator } from "@gooddata/sdk-ui-kit";
|
|
8
|
-
import { showDialogExportCsv, showDialogExportPdf, showDialogExportReport, } from "../../../actions/export_report_actions.js";
|
|
9
|
-
import { exportReport } from "../../../actions/report_actions.js";
|
|
10
|
-
import { supportsExportToCsv, supportsExportToXlsx, } from "../../../selectors/backend_capabilities_selector.js";
|
|
11
|
-
import { AVAILABLE_HIDDEN_ACTIONS, hiddenActions } from "../../../selectors/editor_header_selector.js";
|
|
12
|
-
import { getBubbleTextProvider, getIsExportDisabled } from "../../../selectors/export_button_selector.js";
|
|
13
|
-
import { enableRawExports, isAccessibilityModeEnabled, isEnableTimezoneChange, } from "../../../selectors/feature_flag_selector.js";
|
|
14
|
-
import { getExportBubbleTextProvider, getExportRawBubbleTextProvider, getExportVisible, getIsExportCSVDisabled, getIsExportCSVRawDisabled, getIsExportPDFDisabled, getIsExportXLSXDisabled, isTableVisualization, } from "../../../selectors/options_menu_selector.js";
|
|
15
|
-
import { hasPartialDataLimitBreaks } from "../../../selectors/report_selector.js";
|
|
16
|
-
import { isEditFromKD } from "../../../selectors/route_selector.js";
|
|
17
|
-
import { openInAnalyticalDesignerAction } from "../../../store/router/router_actions.js";
|
|
18
|
-
import { TimezoneDialog } from "../TimezoneDialog.js";
|
|
19
4
|
import { OptionsMenuItem } from "./OptionsMenuItem.js";
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
5
|
+
import { OPTIONS_ITEM_IDS, normalizeOptionsItems } from "./useOptionsProps.js";
|
|
6
|
+
const MENU_ALIGN_POINTS = [{ align: "br tr" }];
|
|
7
|
+
// The class names and bubble ids of the built-in actions, which tests and styles select them by.
|
|
8
|
+
const BUILT_IN_ACTIONS = {
|
|
9
|
+
[OPTIONS_ITEM_IDS.openInAnalyticalDesigner]: {
|
|
10
|
+
className: "gd-open-in-analytical-designer s-open-in-analytical-designer",
|
|
11
|
+
bubbleId: "options.menu.open.in.analytical.designer",
|
|
12
|
+
},
|
|
13
|
+
[OPTIONS_ITEM_IDS.exportXlsx]: {
|
|
14
|
+
className: "gd-export-menu-export-xlsx s-gd-export-menu-export-xlsx gd-export-options-xlsx",
|
|
15
|
+
bubbleId: "ExportXLSXBubble",
|
|
16
|
+
},
|
|
17
|
+
[OPTIONS_ITEM_IDS.exportPdf]: {
|
|
18
|
+
className: "gd-export-menu-export-pdf s-gd-export-menu-export-pdf gd-export-options-pdf",
|
|
19
|
+
bubbleId: "ExportPDFBubble",
|
|
20
|
+
},
|
|
21
|
+
[OPTIONS_ITEM_IDS.exportCsv]: {
|
|
22
|
+
className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted",
|
|
23
|
+
bubbleId: "ExportCSVBubble",
|
|
24
|
+
},
|
|
25
|
+
[OPTIONS_ITEM_IDS.exportCsvRaw]: {
|
|
26
|
+
className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-raw",
|
|
27
|
+
bubbleId: "ExportCSVRawBubble",
|
|
28
|
+
},
|
|
29
|
+
[OPTIONS_ITEM_IDS.changeTimezone]: {
|
|
30
|
+
className: "gd-options-menu-timezone s-options-menu-timezone",
|
|
31
|
+
bubbleId: "options.menu.changeTimezone",
|
|
32
|
+
},
|
|
48
33
|
};
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, [openExportCsvDialog]);
|
|
77
|
-
const onOpenInAnalyticalDesigner = useCallback(() => {
|
|
78
|
-
openInAnalyticalDesigner();
|
|
79
|
-
toggleOptionsMenu();
|
|
80
|
-
}, [openInAnalyticalDesigner, toggleOptionsMenu]);
|
|
81
|
-
const renderExportMenu = useCallback(() => {
|
|
82
|
-
const isOpenInADVisible = isEditFromKD && !hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.OPEN_IN_ANALYTICAL_DESIGNER);
|
|
83
|
-
const formattedExportBubbleTextProvider = hasPartialDataLimitBreaks
|
|
84
|
-
? partialResultExportBubbleTextProvider
|
|
85
|
-
: exportBubbleTextProvider;
|
|
86
|
-
const isFormattedExportDisabled = (isDisabled) => isDisabled || hasPartialDataLimitBreaks;
|
|
87
|
-
return (_jsx(Overlay, { alignTo: ".s-options-button", alignPoints: [{ align: "br tr" }], className: "gd-export-menu-overlay s-gd-export-menu-overlay", closeOnMouseDrag: true, closeOnOutsideClick: true, onClose: toggleOptionsMenu, children: _jsxs(ItemsWrapper, { smallItemsSpacing: true, children: [isOpenInADVisible ? (_jsx(OptionsMenuItem, { bubbleId: "options.menu.open.in.analytical.designer", className: "gd-open-in-analytical-designer s-open-in-analytical-designer", titleId: defineMessage({ id: "options.menu.open.in.analytical.designer" }).id, isDisabled: false, onClick: onOpenInAnalyticalDesigner })) : null, isExportVisible ? (_jsxs(_Fragment, { children: [_jsx(Header, { children: intl.formatMessage({ id: "options.menu.export_data" }) }), exportToXlsxSupported ? (_jsx(OptionsMenuItem, { bubbleId: "ExportXLSXBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-xlsx s-gd-export-menu-export-xlsx gd-export-options-xlsx", isDisabled: isFormattedExportDisabled(isExportXLSXDisabled), titleId: defineMessage({ id: "export.type.XLSX" }).id, onClick: showExportDialog })) : null, exportToPdfSupported && !isAccessibilityModeEnabled ? (_jsx(OptionsMenuItem, { bubbleId: "ExportPDFBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-pdf s-gd-export-menu-export-pdf gd-export-options-pdf", isDisabled: isFormattedExportDisabled(isExportPDFDisabled), titleId: defineMessage({ id: "export.type.PDF" }).id, onClick: exportToPDF })) : null, exportToCsvSupported ? (enableRawExports ? (_jsxs(_Fragment, { children: [_jsx(OptionsMenuItem, { bubbleId: "ExportCSVFormattedBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted", isDisabled: isFormattedExportDisabled(isExportCSVDisabled), titleId: defineMessage({ id: "export.type.CSV.formatted" }).id, onClick: exportToCSV }), _jsx(OptionsMenuItem, { bubbleId: "ExportCSVRawBubble", bubbleTextProvider: exportRawBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-raw", isDisabled: isExportRawCSVDisabled, titleId: defineMessage({ id: "export.type.CSV.raw" }).id, onClick: exportToCSVRaw })] })) : (_jsx(OptionsMenuItem, { bubbleId: "ExportCSVBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted", isDisabled: isFormattedExportDisabled(isExportCSVDisabled), titleId: defineMessage({ id: "export.type.CSV" }).id, onClick: exportToCSV }))) : null] })) : null, isEnableTimezoneChange ? (_jsxs(_Fragment, { children: [isOpenInADVisible || isExportVisible ? _jsx(Separator, {}) : null, _jsx(OptionsMenuItem, { bubbleId: "options.menu.changeTimezone", className: "gd-options-menu-timezone s-options-menu-timezone", titleId: defineMessage({ id: "options.menu.changeTimezone" }).id, isDisabled: false, onClick: openTimezoneDialog })] })) : null] }) }, "OptionsMenu"));
|
|
88
|
-
}, [
|
|
89
|
-
exportBubbleTextProvider,
|
|
90
|
-
exportRawBubbleTextProvider,
|
|
91
|
-
intl,
|
|
92
|
-
isExportCSVDisabled,
|
|
93
|
-
isExportRawCSVDisabled,
|
|
94
|
-
isExportXLSXDisabled,
|
|
95
|
-
isExportPDFDisabled,
|
|
96
|
-
toggleOptionsMenu,
|
|
97
|
-
isExportVisible,
|
|
98
|
-
isEditFromKD,
|
|
99
|
-
hiddenActions,
|
|
100
|
-
exportToCsvSupported,
|
|
101
|
-
exportToXlsxSupported,
|
|
102
|
-
exportToPdfSupported,
|
|
103
|
-
enableRawExports,
|
|
104
|
-
hasPartialDataLimitBreaks,
|
|
105
|
-
onOpenInAnalyticalDesigner,
|
|
106
|
-
showExportDialog,
|
|
107
|
-
exportToCSV,
|
|
108
|
-
exportToCSVRaw,
|
|
109
|
-
exportToPDF,
|
|
110
|
-
isAccessibilityModeEnabled,
|
|
111
|
-
isEnableTimezoneChange,
|
|
112
|
-
openTimezoneDialog,
|
|
113
|
-
]);
|
|
114
|
-
return (_jsxs(_Fragment, { children: [isShowOptionsMenu ? renderExportMenu() : null, isTimezoneDialogOpen ? _jsx(TimezoneDialog, { onClose: closeTimezoneDialog }) : null] }));
|
|
115
|
-
});
|
|
116
|
-
export const OptionsMenu = connect(mapStateToProps, mapDispatchToProps)(OptionsMenuBase);
|
|
34
|
+
function getActionClasses(action) {
|
|
35
|
+
const simplifiedId = action.id.replace(/[^a-zA-Z0-9-]/g, "-");
|
|
36
|
+
return (BUILT_IN_ACTIONS[action.id] ?? {
|
|
37
|
+
className: `s-options-menu-item-${simplifiedId}`,
|
|
38
|
+
bubbleId: `options-menu-item-${simplifiedId}`,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The options menu overlay. Selecting an action closes the menu and starts the action.
|
|
43
|
+
*/
|
|
44
|
+
export function OptionsMenu({ items, onClose }) {
|
|
45
|
+
return (_jsx(Overlay, { alignTo: ".s-options-button", alignPoints: MENU_ALIGN_POINTS, className: "gd-export-menu-overlay s-gd-export-menu-overlay", closeOnMouseDrag: true, closeOnOutsideClick: true, onClose: onClose, children: _jsx(ItemsWrapper, { smallItemsSpacing: true, children: normalizeOptionsItems(items).map((item) => {
|
|
46
|
+
switch (item.type) {
|
|
47
|
+
case "section":
|
|
48
|
+
return _jsx(Header, { children: item.label }, item.id);
|
|
49
|
+
case "separator":
|
|
50
|
+
return _jsx(Separator, {}, item.id);
|
|
51
|
+
default: {
|
|
52
|
+
const { className, bubbleId } = getActionClasses(item);
|
|
53
|
+
return (_jsx(OptionsMenuItem, { bubbleId: bubbleId, className: className, label: item.label, isDisabled: item.isDisabled, disabledTooltip: item.disabledTooltip, onClick: () => {
|
|
54
|
+
onClose();
|
|
55
|
+
item.onSelect();
|
|
56
|
+
} }, item.id));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}) }) }, "OptionsMenu"));
|
|
60
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { type IntlShape } from "react-intl";
|
|
2
1
|
interface IOptionsMenuItemProps {
|
|
3
2
|
bubbleId: string;
|
|
4
|
-
|
|
3
|
+
disabledTooltip?: string;
|
|
5
4
|
className: string;
|
|
6
5
|
isDisabled: boolean;
|
|
7
|
-
|
|
6
|
+
label: string;
|
|
8
7
|
onClick: () => void;
|
|
9
8
|
}
|
|
10
|
-
export declare const OptionsMenuItem: import("react").MemoExoticComponent<({ bubbleId,
|
|
9
|
+
export declare const OptionsMenuItem: import("react").MemoExoticComponent<({ bubbleId, disabledTooltip, className, isDisabled, label, onClick, }: IOptionsMenuItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=OptionsMenuItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenuItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OptionsMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenuItem.tsx"],"names":[],"mappings":"AAQA,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,8GAOzB,qBAAqB,6CAmCtB,CAAC"}
|
|
@@ -2,11 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
5
|
import { Bubble, BubbleHoverTrigger, Item } from "@gooddata/sdk-ui-kit";
|
|
7
|
-
const
|
|
8
|
-
export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, bubbleTextProvider = noopString, className, isDisabled, titleId, onClick, }) {
|
|
9
|
-
const intl = useIntl();
|
|
6
|
+
export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, disabledTooltip, className, isDisabled, label, onClick, }) {
|
|
10
7
|
const getItemClasses = (customClassName, isDisabled) => {
|
|
11
8
|
return classNames("gd-list-item", "gd-menu-item", customClassName, { "is-disabled": isDisabled });
|
|
12
9
|
};
|
|
@@ -15,16 +12,15 @@ export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, bubbleT
|
|
|
15
12
|
};
|
|
16
13
|
const itemClasses = getItemClasses(className, isDisabled);
|
|
17
14
|
if (isDisabled) {
|
|
18
|
-
const button = _jsx(Item, { className: itemClasses, children:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return renderBubble(bubbleId, button, bubbleMessage);
|
|
15
|
+
const button = _jsx(Item, { className: itemClasses, children: label });
|
|
16
|
+
if (disabledTooltip) {
|
|
17
|
+
return renderBubble(bubbleId, button, disabledTooltip);
|
|
22
18
|
}
|
|
23
19
|
else {
|
|
24
20
|
return button;
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
else {
|
|
28
|
-
return (_jsx(Item, { className: itemClasses, onClick: onClick, children:
|
|
24
|
+
return (_jsx(Item, { className: itemClasses, onClick: onClick, children: label }));
|
|
29
25
|
}
|
|
30
26
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type AnalyticalDesignerOptionsItem, type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerOptionsProps } from "../../../embedding/editorHeaderSlotTypes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Identifiers of the built-in options menu items.
|
|
4
|
+
*/
|
|
5
|
+
export declare const OPTIONS_ITEM_IDS: {
|
|
6
|
+
readonly openInAnalyticalDesigner: "openInAnalyticalDesigner";
|
|
7
|
+
readonly exportSection: "exportSection";
|
|
8
|
+
readonly exportXlsx: "exportXlsx";
|
|
9
|
+
readonly exportPdf: "exportPdf";
|
|
10
|
+
readonly exportCsv: "exportCsv";
|
|
11
|
+
readonly exportCsvRaw: "exportCsvRaw";
|
|
12
|
+
readonly timezoneSeparator: "timezoneSeparator";
|
|
13
|
+
readonly changeTimezone: "changeTimezone";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Props of the Options slot.
|
|
17
|
+
*
|
|
18
|
+
* @param onChangeTimezone - opens the time zone dialog, which the editor actions own so that it opens for a
|
|
19
|
+
* host's own Options menu too
|
|
20
|
+
*/
|
|
21
|
+
export declare function useOptionsProps(context: IAnalyticalDesignerHeaderContext, onChangeTimezone: () => void): IAnalyticalDesignerOptionsProps;
|
|
22
|
+
/**
|
|
23
|
+
* Drops the sections with no action after them and the separators that separate nothing.
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeOptionsItems(items: readonly AnalyticalDesignerOptionsItem[]): AnalyticalDesignerOptionsItem[];
|
|
26
|
+
//# sourceMappingURL=useOptionsProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOptionsProps.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/useOptionsProps.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACvC,MAAM,6CAA6C,CAAC;AA0BrD;;GAEG;AACH,eAAO,MAAM,gBAAgB;aACzB,wBAAwB,EAAE,0BAA0B;aACpD,aAAa,EAAE,eAAe;aAC9B,UAAU,EAAE,YAAY;aACxB,SAAS,EAAE,WAAW;aACtB,SAAS,EAAE,WAAW;aACtB,YAAY,EAAE,cAAc;aAC5B,iBAAiB,EAAE,mBAAmB;aACtC,cAAc,EAAE,gBAAgB;CAC1B,CAAC;AA4BX;;;;;GAKG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,gCAAgC,EACzC,gBAAgB,EAAE,MAAM,IAAI,GAC7B,+BAA+B,CA4IjC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,SAAS,6BAA6B,EAAE,GAChD,6BAA6B,EAAE,CAkBjC"}
|