@gooddata/sdk-ui-dashboard 11.69.0-alpha.2 → 11.69.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 +49 -49
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/dashboard/dashboardFilterConverter.d.ts +2 -0
- package/esm/_staging/dashboard/dashboardFilterConverter.d.ts.map +1 -1
- package/esm/_staging/dashboard/dashboardFilterConverter.js +2 -0
- package/esm/_staging/dashboard/flexibleLayout/builder/layout.d.ts +1 -0
- package/esm/_staging/dashboard/flexibleLayout/builder/layout.d.ts.map +1 -1
- package/esm/_staging/dashboard/flexibleLayout/builder/layout.js +1 -0
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts +5 -2
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +5 -2
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.js +2 -0
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.js +1 -0
- package/esm/model/commands/filters.d.ts +4 -0
- package/esm/model/commands/filters.d.ts.map +1 -1
- package/esm/model/commands/filters.js +4 -0
- package/esm/model/store/widgetDrills/drillRestrictionUtils.d.ts +2 -0
- package/esm/model/store/widgetDrills/drillRestrictionUtils.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/drillRestrictionUtils.js +2 -0
- package/esm/model/utils/alertsUtils.d.ts +1 -0
- package/esm/model/utils/alertsUtils.d.ts.map +1 -1
- package/esm/model/utils/alertsUtils.js +1 -0
- package/esm/model/utils/filterResolver.d.ts +1 -0
- package/esm/model/utils/filterResolver.d.ts.map +1 -1
- package/esm/model/utils/filterResolver.js +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.js +29 -6
- package/esm/presentation/dashboardContexts/ExportCsvDialogContext.d.ts +5 -1
- package/esm/presentation/dashboardContexts/ExportCsvDialogContext.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/ExportCsvDialogContext.js +5 -2
- package/esm/presentation/dashboardContexts/ExportTabularPdfDialogContext.d.ts +5 -1
- package/esm/presentation/dashboardContexts/ExportTabularPdfDialogContext.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/ExportTabularPdfDialogContext.js +5 -2
- package/esm/presentation/dashboardContexts/ExportTemplateDialogContext.d.ts +4 -0
- package/esm/presentation/dashboardContexts/ExportTemplateDialogContext.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/ExportXlsxDialogContext.d.ts +5 -1
- package/esm/presentation/dashboardContexts/ExportXlsxDialogContext.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/ExportXlsxDialogContext.js +6 -3
- package/esm/presentation/dialogs/ExportCsvDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dialogs/ExportCsvDialogProvider.js +6 -5
- package/esm/presentation/dialogs/ExportTabularPdfDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dialogs/ExportTabularPdfDialogProvider.js +3 -3
- package/esm/presentation/dialogs/ExportTemplateDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dialogs/ExportTemplateDialogProvider.js +8 -7
- package/esm/presentation/dialogs/ExportXlsxDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dialogs/ExportXlsxDialogProvider.js +3 -3
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +49 -11
- package/esm/presentation/filterBar/filterBar/ResetFiltersButton.d.ts +7 -0
- package/esm/presentation/filterBar/filterBar/ResetFiltersButton.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/ResetFiltersButton.js +10 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +4 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +4 -0
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +8 -3
- package/esm/presentation/topBar/menuButton/useExportWithTemplateSelection.d.ts +3 -1
- package/esm/presentation/topBar/menuButton/useExportWithTemplateSelection.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useExportWithTemplateSelection.js +4 -2
- package/esm/presentation/widget/common/useInsightExport.d.ts +4 -0
- package/esm/presentation/widget/common/useInsightExport.d.ts.map +1 -1
- package/esm/presentation/widget/common/useInsightExport.js +12 -8
- package/esm/presentation/widget/insight/configuration/DrillFilters/drillFiltersConfigUtils.d.ts +1 -0
- package/esm/presentation/widget/insight/configuration/DrillFilters/drillFiltersConfigUtils.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/drillFiltersConfigUtils.js +1 -0
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenuButton.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenuButton.js +7 -2
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js +3 -1
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +3 -1
- package/esm/sdk-ui-dashboard.d.ts +4 -0
- package/package.json +23 -23
- package/styles/css/filterBar.css +6 -1
- package/styles/css/filterBar.css.map +1 -1
- package/styles/css/main.css +16 -2
- package/styles/css/main.css.map +1 -1
- package/styles/scss/filterBar.scss +6 -1
|
@@ -10,6 +10,7 @@ import { type IBrokenAlertFilterBasicInfo } from "../types/alertTypes.js";
|
|
|
10
10
|
* @param kpi - the KPI widget that the alert is relevant to
|
|
11
11
|
* @param appliedFilters - all the currently applied filters (including All Time date filters)
|
|
12
12
|
* @param displayFormsMap - map of all resolved related display forms
|
|
13
|
+
* @param displayAsLabelMap - map of display-as labels
|
|
13
14
|
*
|
|
14
15
|
* @internal
|
|
15
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertsUtils.d.ts","sourceRoot":"","sources":["../../../src/model/utils/alertsUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAQd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E
|
|
1
|
+
{"version":3,"file":"alertsUtils.d.ts","sourceRoot":"","sources":["../../../src/model/utils/alertsUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAQd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,sBAAsB,GAAG,SAAS,EACzC,GAAG,EAAE,iBAAiB,EACtB,cAAc,EAAE,OAAO,EAAE,EACzB,eAAe,EAAE,SAAS,CAAC,mCAAmC,CAAC,EAC/D,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,2BAA2B,EAAE,CAqE/B"}
|
|
@@ -11,6 +11,7 @@ import { _partition } from "@gooddata/util";
|
|
|
11
11
|
* @param kpi - the KPI widget that the alert is relevant to
|
|
12
12
|
* @param appliedFilters - all the currently applied filters (including All Time date filters)
|
|
13
13
|
* @param displayFormsMap - map of all resolved related display forms
|
|
14
|
+
* @param displayAsLabelMap - map of display-as labels
|
|
14
15
|
*
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|
|
@@ -9,6 +9,7 @@ import { type DashboardContext } from "../types/commonTypes.js";
|
|
|
9
9
|
*
|
|
10
10
|
* @param ctx - dashboard context where the resolution is being done
|
|
11
11
|
* @param filters - list of dashboard filters; resolver will extract just the attribute filters from here
|
|
12
|
+
* @param displayAsLabels - display-as labels to resolve as well
|
|
12
13
|
* @param displayForms - in-memory mapping of known display forms to use during the initial lookup; if not specified, the
|
|
13
14
|
* code will obtain all catalog display forms; note: this parameter is really only useful during the dashboard initialization
|
|
14
15
|
* where the catalog is not yet set. once the dashboard is initialized, the parameter is not needed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterResolver.d.ts","sourceRoot":"","sources":["../../../src/model/utils/filterResolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE
|
|
1
|
+
{"version":3,"file":"filterResolver.d.ts","sourceRoot":"","sources":["../../../src/model/utils/filterResolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE;;;;;;;;;;;GAWG;AACH,wBAAiB,yBAAyB,CACtC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,EACzB,YAAY,CAAC,EAAE,SAAS,CAAC,mCAAmC,CAAC,GAC9D,YAAY,CAAC,mCAAmC,EAAE,CAAC,CAsBrD"}
|
|
@@ -11,6 +11,7 @@ import { resolveDisplayFormMetadata } from "./displayFormResolver.js";
|
|
|
11
11
|
*
|
|
12
12
|
* @param ctx - dashboard context where the resolution is being done
|
|
13
13
|
* @param filters - list of dashboard filters; resolver will extract just the attribute filters from here
|
|
14
|
+
* @param displayAsLabels - display-as labels to resolve as well
|
|
14
15
|
* @param displayForms - in-memory mapping of known display forms to use during the initial lookup; if not specified, the
|
|
15
16
|
* code will obtain all catalog display forms; note: this parameter is really only useful during the dashboard initialization
|
|
16
17
|
* where the catalog is not yet set. once the dashboard is initialized, the parameter is not needed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScheduledEmailManagementDialogContent.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAqBrE,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAO3E,UAAU,kDAAkD;IACxD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,cAAc,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC5D,mBAAmB,CAAC,EAAE,6BAA6B,CAAC;CACvD;AAED,wBAAgB,4CAA4C,CAAC,EACzD,KAAK,EACL,OAAO,EACP,MAAM,EACN,mBAAmB,EAAE,yBAAyB,GACjD,EAAE,kDAAkD,
|
|
1
|
+
{"version":3,"file":"DefaultScheduledEmailManagementDialogContent.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAqBrE,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAO3E,UAAU,kDAAkD;IACxD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,cAAc,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC5D,mBAAmB,CAAC,EAAE,6BAA6B,CAAC;CACvD;AAED,wBAAgB,4CAA4C,CAAC,EACzD,KAAK,EACL,OAAO,EACP,MAAM,EACN,mBAAmB,EAAE,yBAAyB,GACjD,EAAE,kDAAkD,2CAsLpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
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) 2022-2026 GoodData Corporation
|
|
3
|
-
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { defineMessage, useIntl } from "react-intl";
|
|
6
6
|
import { buildDashboardUrl, useBackend, useWorkspace } from "@gooddata/sdk-ui";
|
|
@@ -43,15 +43,31 @@ export function DefaultScheduledEmailManagementDialogContent({ onAdd, onClose, o
|
|
|
43
43
|
? { recipient: externalRecipientOverride }
|
|
44
44
|
: undefined,
|
|
45
45
|
}), [customDashboardUrlBuilder, isEmbedded, externalRecipientOverride]);
|
|
46
|
+
const createButtonId = useId();
|
|
47
|
+
// When the create dialog closes, focus goes back to the "Create new" button that opened it.
|
|
48
|
+
const [focusCreateButton, setFocusCreateButton] = useState(false);
|
|
49
|
+
// Do not forward the click event: `onAdd` accepts an optional target widget, and the event
|
|
50
|
+
// object would be mistaken for it.
|
|
51
|
+
const handleAdd = useCallback(() => {
|
|
52
|
+
setFocusCreateButton(true);
|
|
53
|
+
onAdd?.();
|
|
54
|
+
}, [onAdd]);
|
|
55
|
+
const handleEdit = useCallback((scheduledEmail) => {
|
|
56
|
+
setFocusCreateButton(false);
|
|
57
|
+
onEdit(scheduledEmail);
|
|
58
|
+
}, [onEdit]);
|
|
46
59
|
const titleElementId = useId();
|
|
47
|
-
return (_jsx(Dialog, { displayCloseButton: true, autofocusOnOpen: true, onCancel: onClose, className: cx("gd-notifications-channels-management-dialog s-scheduled-email-management-dialog", "gd-dialog--wide gd-notifications-channels-management-dialog--wide", "gd-dialog--no-padding"),
|
|
60
|
+
return (_jsx(Dialog, { displayCloseButton: true, autofocusOnOpen: true, onCancel: onClose, className: cx("gd-notifications-channels-management-dialog s-scheduled-email-management-dialog", "gd-dialog--wide gd-notifications-channels-management-dialog--wide", "gd-dialog--no-padding"),
|
|
61
|
+
// While the create/edit dialog is open on top of this one, this dialog must not stay
|
|
62
|
+
// the active modal: otherwise the create/edit dialog cannot take focus from it.
|
|
63
|
+
accessibilityConfig: { titleElementId, isModal: !isEditDialogOpen }, returnFocusAfterClose: true, returnFocusTo: returnFocusTo, refocusKey: isEditDialogOpen, initialFocus: focusCreateButton && !isEditDialogOpen ? createButtonId : undefined, children: _jsxs(OverlayControllerProvider, { overlayController: overlayController, children: [_jsx("div", { className: "gd-notifications-channels-management-dialog-title", children: _jsx(Typography, { tagName: "h3", className: "gd-dialog-header", id: titleElementId, children: intl.formatMessage({ id: "dialogs.schedule.management.title" }) }) }), _jsx(ContentDivider, { className: "gd-content-divider--no-spacing" }), _jsx("div", { className: "gd-notifications-channels-content", children: _jsx(Automations, { workspace: workspace, timezone: timezone, type: "schedule", backend: backend, scope: "workspace", maxHeight: AUTOMATIONS_MAX_HEIGHT, isMobileView: isMobile, tableVariant: "small", editAutomation: handleEdit, preselectedFilters: {
|
|
48
64
|
dashboard: dashboardId
|
|
49
65
|
? [{ value: dashboardId, label: dashboardTitle }]
|
|
50
66
|
: undefined,
|
|
51
67
|
externalRecipients: externalRecipientOverride
|
|
52
68
|
? [{ value: externalRecipientOverride }]
|
|
53
69
|
: undefined,
|
|
54
|
-
}, enableBulkActions: enableBulkActions, availableFilters: availableFilters, locale: locale, externalInvalidationId: automationsInvalidationId, renderToolbarCustomElement: () => canCreateAutomation ? (_jsx(CreateButton, { onClick:
|
|
70
|
+
}, enableBulkActions: enableBulkActions, availableFilters: availableFilters, locale: locale, externalInvalidationId: automationsInvalidationId, renderToolbarCustomElement: () => canCreateAutomation ? (_jsx(CreateButton, { id: createButtonId, onClick: handleAdd, isDisabled: isAddButtonDisabled, label: intl.formatMessage({
|
|
55
71
|
id: messages.scheduleManagementCreateNew.id,
|
|
56
72
|
}), tooltipContent: maxAutomationsReached
|
|
57
73
|
? intl.formatMessage({
|
|
@@ -66,6 +82,13 @@ export function DefaultScheduledEmailManagementDialogContent({ onAdd, onClose, o
|
|
|
66
82
|
ariaControls: SCHEDULED_EMAIL_DIALOG_ID,
|
|
67
83
|
} })) : null, selectedColumnDefinitions: AUTOMATIONS_COLUMN_CONFIG, dashboardUrlBuilder: dashboardUrlBuilder }) }), _jsx(ContentDivider, { className: "gd-content-divider--no-spacing" }), _jsxs("div", { className: `gd-buttons${isWhiteLabeled ? " gd-buttons--end" : ""}`, children: [isWhiteLabeled ? null : (_jsx(Hyperlink, { text: intl.formatMessage({ id: helpTextId }), href: "https://www.gooddata.com/docs/cloud/create-dashboards/automation/scheduled-exports/#ScheduleExportsinDashboards-ScheduleExport", iconClass: "gd-icon-circle-question" })), _jsx("div", { className: "gd-buttons-inner", children: _jsx(Button, { onClick: onClose, className: "gd-button-secondary s-close-button", value: intl.formatMessage({ id: "close" }) }) })] })] }) }));
|
|
68
84
|
}
|
|
69
|
-
function CreateButton({ onClick, isDisabled, label, tooltipContent, isTooltipDisabled, accessibilityConfig, }) {
|
|
70
|
-
|
|
85
|
+
function CreateButton({ id, onClick, isDisabled, label, tooltipContent, isTooltipDisabled, accessibilityConfig, }) {
|
|
86
|
+
const disabledReasonId = useId();
|
|
87
|
+
const disabledReason = isDisabled && tooltipContent ? tooltipContent : undefined;
|
|
88
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiTooltip, { optimalPlacement: true, anchor: _jsx(Button, { id: id, onClick: onClick, disabled: isDisabled, value: label, size: "small", className: "gd-button-action", accessibilityConfig: {
|
|
89
|
+
...accessibilityConfig,
|
|
90
|
+
// a disabled button does not open the dialog, so it must not claim to control it
|
|
91
|
+
...(isDisabled ? { ariaHaspopup: undefined, ariaControls: undefined } : {}),
|
|
92
|
+
...(disabledReason ? { ariaDescribedBy: disabledReasonId } : {}),
|
|
93
|
+
} }), disabled: isTooltipDisabled, triggerBy: ["hover"], content: tooltipContent }), disabledReason ? (_jsx("span", { id: disabledReasonId, className: "sr-only", children: disabledReason })) : null] }));
|
|
71
94
|
}
|
|
@@ -11,7 +11,11 @@ export interface IExportCsvDialogConfig {
|
|
|
11
11
|
export interface IExportCsvDialogContext {
|
|
12
12
|
isOpen: boolean;
|
|
13
13
|
dialogConfig?: IExportCsvDialogConfig;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Id of the element that receives focus when the dialog closes (typically the trigger of the export flow).
|
|
16
|
+
*/
|
|
17
|
+
returnFocusTo?: string;
|
|
18
|
+
openDialog: (config: IExportCsvDialogConfig, returnFocusTo?: string) => void;
|
|
15
19
|
closeDialog: () => void;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportCsvDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportCsvDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6D,MAAM,OAAO,CAAC;AAElG,MAAM,WAAW,oBAAoB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,UAAU,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ExportCsvDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportCsvDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6D,MAAM,OAAO,CAAC;AAElG,MAAM,WAAW,oBAAoB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAC,MAAM,EAAE,sBAAsB,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAUD;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAO,uBAE5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAqBpF"}
|
|
@@ -4,6 +4,7 @@ import { createContext, useCallback, useContext, useMemo, useState } from "react
|
|
|
4
4
|
const ExportCsvDialogContext = createContext({
|
|
5
5
|
isOpen: false,
|
|
6
6
|
dialogConfig: undefined,
|
|
7
|
+
returnFocusTo: undefined,
|
|
7
8
|
closeDialog: () => { },
|
|
8
9
|
openDialog: () => { },
|
|
9
10
|
});
|
|
@@ -19,13 +20,15 @@ export const useExportCsvDialogContext = () => {
|
|
|
19
20
|
export function ExportCsvDialogContextProvider({ children }) {
|
|
20
21
|
const [isOpen, setIsOpen] = useState(false);
|
|
21
22
|
const [dialogConfig, setDialogConfig] = useState();
|
|
22
|
-
const
|
|
23
|
+
const [returnFocusTo, setReturnFocusTo] = useState();
|
|
24
|
+
const openDialog = useCallback((config, focusTarget) => {
|
|
23
25
|
setDialogConfig(config);
|
|
26
|
+
setReturnFocusTo(focusTarget);
|
|
24
27
|
setIsOpen(true);
|
|
25
28
|
}, []);
|
|
26
29
|
const closeDialog = useCallback(() => {
|
|
27
30
|
setIsOpen(false);
|
|
28
31
|
}, []);
|
|
29
|
-
const contextValue = useMemo(() => ({ isOpen, dialogConfig, openDialog, closeDialog }), [isOpen, dialogConfig, openDialog, closeDialog]);
|
|
32
|
+
const contextValue = useMemo(() => ({ isOpen, dialogConfig, returnFocusTo, openDialog, closeDialog }), [isOpen, dialogConfig, returnFocusTo, openDialog, closeDialog]);
|
|
30
33
|
return _jsx(ExportCsvDialogContext.Provider, { value: contextValue, children: children });
|
|
31
34
|
}
|
|
@@ -4,7 +4,11 @@ export type IExportTabularPdfDialogConfig = Omit<IExportTabularPdfDialogProps, "
|
|
|
4
4
|
interface IExportTabularPdfDialogContextValue {
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
config: IExportTabularPdfDialogConfig;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Id of the element that receives focus when the dialog closes (typically the trigger of the export flow).
|
|
9
|
+
*/
|
|
10
|
+
returnFocusTo?: string;
|
|
11
|
+
openDialog: (config: IExportTabularPdfDialogConfig, returnFocusTo?: string) => void;
|
|
8
12
|
closeDialog: () => void;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTabularPdfDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportTabularPdfDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,4BAA4B,EAAE,UAAU,CAAC,CAAC;AAE3F,UAAU,mCAAmC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,6BAA6B,CAAC;IACtC,UAAU,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ExportTabularPdfDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportTabularPdfDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,4BAA4B,EAAE,UAAU,CAAC,CAAC;AAE3F,UAAU,mCAAmC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,6BAA6B,CAAC;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAC,MAAM,EAAE,6BAA6B,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpF,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAMD;;GAEG;AACH,wBAAgB,qCAAqC,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA6B1F;AAED;;GAEG;AACH,eAAO,MAAM,gCAAgC,QAAO,mCAQnD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2025 GoodData Corporation
|
|
2
|
+
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { createContext, useContext, useState } from "react";
|
|
4
4
|
const ExportTabularPdfDialogContext = createContext(undefined);
|
|
5
5
|
/**
|
|
@@ -8,8 +8,10 @@ const ExportTabularPdfDialogContext = createContext(undefined);
|
|
|
8
8
|
export function ExportTabularPdfDialogContextProvider({ children }) {
|
|
9
9
|
const [isOpen, setIsOpen] = useState(false);
|
|
10
10
|
const [config, setConfig] = useState({});
|
|
11
|
-
const
|
|
11
|
+
const [returnFocusTo, setReturnFocusTo] = useState();
|
|
12
|
+
const openDialog = (newConfig, focusTarget) => {
|
|
12
13
|
setConfig(newConfig);
|
|
14
|
+
setReturnFocusTo(focusTarget);
|
|
13
15
|
setIsOpen(true);
|
|
14
16
|
};
|
|
15
17
|
const closeDialog = () => {
|
|
@@ -19,6 +21,7 @@ export function ExportTabularPdfDialogContextProvider({ children }) {
|
|
|
19
21
|
const value = {
|
|
20
22
|
isOpen,
|
|
21
23
|
config,
|
|
24
|
+
returnFocusTo,
|
|
22
25
|
openDialog,
|
|
23
26
|
closeDialog,
|
|
24
27
|
};
|
|
@@ -7,6 +7,10 @@ export interface IExportTemplateDialogConfig {
|
|
|
7
7
|
templates: IExportTemplate[];
|
|
8
8
|
onConfirm: (templateId: string) => void;
|
|
9
9
|
onCancel?: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Id of the element that receives focus when the dialog closes (typically the trigger of the export flow).
|
|
12
|
+
*/
|
|
13
|
+
returnFocusTo?: string;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTemplateDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportTemplateDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ExportTemplateDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportTemplateDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,2BAA2B,GAAG,SAAS,CAAC;IACtD,UAAU,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AASD;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAO,4BAEjD,CAAC;AAEF;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAkBzF"}
|
|
@@ -7,7 +7,11 @@ export type ExportXlsxDialogConfig = Omit<IExportDialogBaseProps, "children">;
|
|
|
7
7
|
export interface IExportXlsxDialogContext {
|
|
8
8
|
isOpen: boolean;
|
|
9
9
|
dialogConfig: ExportXlsxDialogConfig;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Id of the element that receives focus when the dialog closes (typically the trigger of the export flow).
|
|
12
|
+
*/
|
|
13
|
+
returnFocusTo?: string;
|
|
14
|
+
openDialog: (config?: ExportXlsxDialogConfig, returnFocusTo?: string) => void;
|
|
11
15
|
closeDialog: () => void;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportXlsxDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportXlsxDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6D,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,sBAAsB,CAAC;IACrC,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ExportXlsxDialogContext.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/ExportXlsxDialogContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6D,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,sBAAsB,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9E,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAUD;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAO,wBAE7C,CAAC;AAEF;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAuBrF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2021-
|
|
2
|
+
// (C) 2021-2026 GoodData Corporation
|
|
3
3
|
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
4
|
const ExportXlsxDialogContext = createContext({
|
|
5
5
|
isOpen: false,
|
|
6
6
|
dialogConfig: {},
|
|
7
|
+
returnFocusTo: undefined,
|
|
7
8
|
closeDialog: () => { },
|
|
8
9
|
openDialog: () => { },
|
|
9
10
|
});
|
|
@@ -19,13 +20,15 @@ export const useExportXlsxDialogContext = () => {
|
|
|
19
20
|
export function ExportXlsxDialogContextProvider({ children }) {
|
|
20
21
|
const [isOpen, setIsOpen] = useState(false);
|
|
21
22
|
const [dialogConfig, setDialogConfig] = useState({});
|
|
22
|
-
const
|
|
23
|
+
const [returnFocusTo, setReturnFocusTo] = useState();
|
|
24
|
+
const openDialog = useCallback((config = {}, focusTarget) => {
|
|
23
25
|
setIsOpen(true);
|
|
24
26
|
setDialogConfig(config);
|
|
27
|
+
setReturnFocusTo(focusTarget);
|
|
25
28
|
}, []);
|
|
26
29
|
const closeDialog = useCallback(() => {
|
|
27
30
|
setIsOpen(false);
|
|
28
31
|
}, []);
|
|
29
|
-
const contextValue = useMemo(() => ({ isOpen, dialogConfig, openDialog, closeDialog }), [isOpen, dialogConfig, openDialog, closeDialog]);
|
|
32
|
+
const contextValue = useMemo(() => ({ isOpen, dialogConfig, returnFocusTo, openDialog, closeDialog }), [isOpen, dialogConfig, returnFocusTo, openDialog, closeDialog]);
|
|
30
33
|
return (_jsx(ExportXlsxDialogContext.Provider, { value: contextValue, children: children }));
|
|
31
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportCsvDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportCsvDialogProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExportCsvDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportCsvDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,uBAAuB,mDActC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { UiReturnFocusOnUnmount } from "@gooddata/sdk-ui-kit";
|
|
3
4
|
import { useExportCsvDialogContext } from "../dashboardContexts/ExportCsvDialogContext.js";
|
|
4
5
|
import { ExportCsvDialog } from "./ExportCsvDialog.js";
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export function ExportCsvDialogProvider() {
|
|
9
|
-
const { closeDialog, dialogConfig, isOpen } = useExportCsvDialogContext();
|
|
10
|
-
return isOpen && dialogConfig ? (_jsx(ExportCsvDialog, { onCancel: closeDialog, onSubmit: (data) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const { closeDialog, dialogConfig, isOpen, returnFocusTo } = useExportCsvDialogContext();
|
|
11
|
+
return isOpen && dialogConfig ? (_jsx(UiReturnFocusOnUnmount, { returnFocusTo: returnFocusTo, children: _jsx(ExportCsvDialog, { onCancel: closeDialog, onSubmit: (data) => {
|
|
12
|
+
closeDialog();
|
|
13
|
+
dialogConfig.onSubmit(data);
|
|
14
|
+
} }) })) : null;
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTabularPdfDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportTabularPdfDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ExportTabularPdfDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportTabularPdfDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,8BAA8B,mDAc7C"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2021-2026 GoodData Corporation
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { ExportTabularPdfDialog } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
import { ExportTabularPdfDialog, UiReturnFocusOnUnmount } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import { useExportTabularPdfDialogContext } from "../dashboardContexts/ExportTabularPdfDialogContext.js";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function ExportTabularPdfDialogProvider() {
|
|
10
|
-
const { closeDialog, config, isOpen } = useExportTabularPdfDialogContext();
|
|
10
|
+
const { closeDialog, config, isOpen, returnFocusTo } = useExportTabularPdfDialogContext();
|
|
11
11
|
const intl = useIntl();
|
|
12
|
-
return isOpen ? (_jsx(ExportTabularPdfDialog, { ...config, cancelButtonText: intl.formatMessage({ id: "cancel" }), submitButtonText: intl.formatMessage({ id: "dialogs.export.submit" }), onCancel: closeDialog })) : null;
|
|
12
|
+
return isOpen ? (_jsx(UiReturnFocusOnUnmount, { returnFocusTo: returnFocusTo, children: _jsx(ExportTabularPdfDialog, { ...config, cancelButtonText: intl.formatMessage({ id: "cancel" }), submitButtonText: intl.formatMessage({ id: "dialogs.export.submit" }), onCancel: closeDialog }) })) : null;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTemplateDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportTemplateDialogProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExportTemplateDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportTemplateDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,4BAA4B,mDAsB3C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { UiReturnFocusOnUnmount } from "@gooddata/sdk-ui-kit";
|
|
3
4
|
import { useExportTemplateDialogContext } from "../dashboardContexts/ExportTemplateDialogContext.js";
|
|
4
5
|
import { ExportTemplateSelectionDialog } from "./ExportTemplateSelectionDialog/ExportTemplateSelectionDialog.js";
|
|
5
6
|
/**
|
|
@@ -10,11 +11,11 @@ export function ExportTemplateDialogProvider() {
|
|
|
10
11
|
if (!isOpen || !dialogConfig) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
|
-
return (_jsx(ExportTemplateSelectionDialog, { templates: dialogConfig.templates, onConfirm: (templateId) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
return (_jsx(UiReturnFocusOnUnmount, { returnFocusTo: dialogConfig.returnFocusTo, children: _jsx(ExportTemplateSelectionDialog, { templates: dialogConfig.templates, onConfirm: (templateId) => {
|
|
15
|
+
closeDialog();
|
|
16
|
+
dialogConfig.onConfirm(templateId);
|
|
17
|
+
}, onCancel: () => {
|
|
18
|
+
closeDialog();
|
|
19
|
+
dialogConfig.onCancel?.();
|
|
20
|
+
} }) }));
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportXlsxDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportXlsxDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"ExportXlsxDialogProvider.d.ts","sourceRoot":"","sources":["../../../src/presentation/dialogs/ExportXlsxDialogProvider.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,wBAAwB,mDAmBvC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2021-2026 GoodData Corporation
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { ExportDialog } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
import { ExportDialog, UiReturnFocusOnUnmount } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import { useExportXlsxDialogContext } from "../dashboardContexts/ExportXlsxDialogContext.js";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function ExportXlsxDialogProvider() {
|
|
10
|
-
const { closeDialog, dialogConfig, isOpen } = useExportXlsxDialogContext();
|
|
10
|
+
const { closeDialog, dialogConfig, isOpen, returnFocusTo } = useExportXlsxDialogContext();
|
|
11
11
|
const intl = useIntl();
|
|
12
|
-
return isOpen ? (_jsx(ExportDialog, { headline: intl.formatMessage({ id: "dialogs.export.headline" }), cancelButtonText: intl.formatMessage({ id: "cancel" }), submitButtonText: intl.formatMessage({ id: "dialogs.export.submit" }), filterContextText: intl.formatMessage({ id: "dialogs.export.includeFilters" }), filterContextTitle: intl.formatMessage({ id: "dialogs.export.filters" }), mergeHeadersText: intl.formatMessage({ id: "dialogs.export.mergeHeaders" }), mergeHeadersTitle: intl.formatMessage({ id: "dialogs.export.cells" }), onCancel: closeDialog, ...dialogConfig })) : null;
|
|
12
|
+
return isOpen ? (_jsx(UiReturnFocusOnUnmount, { returnFocusTo: returnFocusTo, children: _jsx(ExportDialog, { headline: intl.formatMessage({ id: "dialogs.export.headline" }), cancelButtonText: intl.formatMessage({ id: "cancel" }), submitButtonText: intl.formatMessage({ id: "dialogs.export.submit" }), filterContextText: intl.formatMessage({ id: "dialogs.export.includeFilters" }), filterContextTitle: intl.formatMessage({ id: "dialogs.export.filters" }), mergeHeadersText: intl.formatMessage({ id: "dialogs.export.mergeHeaders" }), mergeHeadersTitle: intl.formatMessage({ id: "dialogs.export.cells" }), onCancel: closeDialog, ...dialogConfig }) })) : null;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFilterBarContainer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,SAAS,EAOjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultFilterBarContainer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,SAAS,EAOjB,MAAM,OAAO,CAAC;AAiff;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAQ/E"}
|
|
@@ -22,6 +22,7 @@ import { FilterViews } from "./filterViews/FilterViews.js";
|
|
|
22
22
|
import { useFilterBarState } from "./hooks/useFilterBarState.js";
|
|
23
23
|
import { useFilterExpansionByDragAndDrop } from "./hooks/useFilterExpansionByDragAndDrop.js";
|
|
24
24
|
import { useRowsCalculator } from "./hooks/useRowsCalculator.js";
|
|
25
|
+
import { RESET_FILTERS_BUTTON_CLASS_NAME } from "./ResetFiltersButton.js";
|
|
25
26
|
import { ShowAllFiltersButton } from "./ShowAllFiltersButton.js";
|
|
26
27
|
import { useExecutionTimestampMessage } from "./useExecutionTimestampMessage.js";
|
|
27
28
|
// There are known compatibility issues between CommonJS (CJS) and ECMAScript modules (ESM).
|
|
@@ -129,30 +130,47 @@ function MeasuredDiv({ measureRef, isAutoExpanded, children, }) {
|
|
|
129
130
|
const containerRef = useRef(null);
|
|
130
131
|
const [activeFilterIndex, setActiveFilterIndex] = useState(null);
|
|
131
132
|
const { registerHandler, unregisterHandler } = useDashboardEventsContext();
|
|
132
|
-
// Focus management: Move focus to filter region when
|
|
133
|
+
// Focus management: Move focus to filter region when apply event occurs
|
|
133
134
|
const moveToFilterRegion = useCallback(() => {
|
|
134
135
|
const filterRegion = containerRef.current;
|
|
135
136
|
if (filterRegion) {
|
|
136
137
|
filterRegion.focus();
|
|
137
138
|
}
|
|
138
139
|
}, []);
|
|
140
|
+
// Focus management: after reset the reset button disappears, so move focus to the first filter
|
|
141
|
+
// (falling back to the filter region) to not lose it to the document body.
|
|
142
|
+
const moveToFirstFilter = useCallback(() => {
|
|
143
|
+
const firstFilter = getFilterElements(containerRef.current).find((element) => !isResetFiltersButton(element));
|
|
144
|
+
if (firstFilter) {
|
|
145
|
+
firstFilter.focus();
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
moveToFilterRegion();
|
|
149
|
+
}
|
|
150
|
+
}, [moveToFilterRegion]);
|
|
139
151
|
// Listen for filter context working selection reset/apply events
|
|
140
152
|
useEffect(() => {
|
|
141
|
-
const
|
|
142
|
-
eval: (event) =>
|
|
143
|
-
isDashboardFilterContextWorkingSelectionApplied(event) ||
|
|
144
|
-
isDashboardParametersSelectionReset(event),
|
|
153
|
+
const applyHandler = {
|
|
154
|
+
eval: (event) => isDashboardFilterContextWorkingSelectionApplied(event),
|
|
145
155
|
handler: () => {
|
|
146
156
|
moveToFilterRegion();
|
|
147
157
|
},
|
|
148
158
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
159
|
+
const resetHandler = {
|
|
160
|
+
eval: (event) => isDashboardFilterContextSelectionReset(event) || isDashboardParametersSelectionReset(event),
|
|
161
|
+
handler: () => {
|
|
162
|
+
moveToFirstFilter();
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
registerHandler(applyHandler);
|
|
166
|
+
registerHandler(resetHandler);
|
|
167
|
+
return () => {
|
|
168
|
+
unregisterHandler(applyHandler);
|
|
169
|
+
unregisterHandler(resetHandler);
|
|
170
|
+
};
|
|
171
|
+
}, [registerHandler, unregisterHandler, moveToFilterRegion, moveToFirstFilter]);
|
|
152
172
|
const getActiveIndexAndFilterElements = () => {
|
|
153
|
-
const filterElements = containerRef.current
|
|
154
|
-
? Array.from(containerRef.current.querySelectorAll('button, [tabindex]:not([tabindex="-1"])'))
|
|
155
|
-
: [];
|
|
173
|
+
const filterElements = getFilterElements(containerRef.current);
|
|
156
174
|
const activeIndex = filterElements.findIndex((el) => el === document.activeElement);
|
|
157
175
|
return { activeIndex, filterElements };
|
|
158
176
|
};
|
|
@@ -183,6 +201,18 @@ function MeasuredDiv({ measureRef, isAutoExpanded, children, }) {
|
|
|
183
201
|
onUnhandledKeyDown(e) {
|
|
184
202
|
if (e.key === "Tab") {
|
|
185
203
|
const { filterElements } = getActiveIndexAndFilterElements();
|
|
204
|
+
// The region itself holds focus after apply: Tab enters the bar at the first filter,
|
|
205
|
+
// so the filters are not skipped in favour of the reset button.
|
|
206
|
+
if (document.activeElement === containerRef.current && !e.shiftKey) {
|
|
207
|
+
const firstFilter = filterElements.find((el) => !isResetFiltersButton(el));
|
|
208
|
+
if (firstFilter) {
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
firstFilter.focus();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// The bar is a toolbar: one Tab stop, items (including the reset button) are reached
|
|
215
|
+
// with the arrow keys, so the reset button does not add an extra Tab stop.
|
|
186
216
|
if (activeFilterIndex === -1) {
|
|
187
217
|
// First tab into bar: focus first filter
|
|
188
218
|
e.preventDefault();
|
|
@@ -228,6 +258,14 @@ function MeasuredDiv({ measureRef, isAutoExpanded, children, }) {
|
|
|
228
258
|
: intl.formatMessage({ id: "filterBar.label" });
|
|
229
259
|
return (_jsx("div", { className: "dash-filters-all", role: "region", "aria-label": regionLabel, tabIndex: -1, ref: containerRef, onKeyDown: keyboardNavigation, children: _jsx("div", { className: "dash-filters-toolbar", role: "toolbar", "aria-orientation": "horizontal", ref: measureRef, children: children }) }));
|
|
230
260
|
}
|
|
261
|
+
function getFilterElements(container) {
|
|
262
|
+
return container
|
|
263
|
+
? Array.from(container.querySelectorAll('button, [tabindex]:not([tabindex="-1"])'))
|
|
264
|
+
: [];
|
|
265
|
+
}
|
|
266
|
+
function isResetFiltersButton(element) {
|
|
267
|
+
return element.classList.contains(RESET_FILTERS_BUTTON_CLASS_NAME);
|
|
268
|
+
}
|
|
231
269
|
function FiltersRows({ rows }) {
|
|
232
270
|
return (_jsx(_Fragment, { children: rows.length > 1 && (_jsx("div", { className: "dash-filters-rows", children: rows.map((height, index) => (_jsx("div", { className: "dash-filters-row", style: { height } }, index))) })) }));
|
|
233
271
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class name of the reset button; the filter bar keyboard navigation uses it to tell the button
|
|
3
|
+
* apart from the filters.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const RESET_FILTERS_BUTTON_CLASS_NAME = "button-filter-bar-reset";
|
|
1
8
|
/**
|
|
2
9
|
* @internal
|
|
3
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResetFiltersButton.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/ResetFiltersButton.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ResetFiltersButton.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/ResetFiltersButton.tsx"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,4BAA4B,CAAC;AAEzE;;GAEG;AACH,wBAAgB,kBAAkB,mDAqEjC"}
|
|
@@ -5,6 +5,13 @@ import { useIntl } from "react-intl";
|
|
|
5
5
|
import { IconReset, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { messages } from "../../../locales.js";
|
|
7
7
|
import { useResetFiltersButton } from "./hooks/useResetFiltersButton.js";
|
|
8
|
+
/**
|
|
9
|
+
* Class name of the reset button; the filter bar keyboard navigation uses it to tell the button
|
|
10
|
+
* apart from the filters.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const RESET_FILTERS_BUTTON_CLASS_NAME = "button-filter-bar-reset";
|
|
8
15
|
/**
|
|
9
16
|
* @internal
|
|
10
17
|
*/
|
|
@@ -46,5 +53,7 @@ export function ResetFiltersButton() {
|
|
|
46
53
|
const bubbleText = resetType === "all"
|
|
47
54
|
? intl.formatMessage(messages.filterResetButtonTooltip)
|
|
48
55
|
: intl.formatMessage(messages.crossFilterResetButtonTooltip);
|
|
49
|
-
return (_jsx("div", { className: "dash-filters-reset", children: _jsx(UiTooltip, { arrowPlacement: "top-start", content: bubbleText, triggerBy: ["hover", "focus"], disabled: !isOpenInternal, anchor: _jsx("button", {
|
|
56
|
+
return (_jsx("div", { className: "dash-filters-reset", children: _jsx(UiTooltip, { arrowPlacement: "top-start", content: bubbleText, triggerBy: ["hover", "focus"], disabled: !isOpenInternal, anchor: _jsx("button", { type: "button",
|
|
57
|
+
// The filter bar toolbar is a single Tab stop; the button is reached with arrow keys.
|
|
58
|
+
tabIndex: -1, className: `gd-button-link ${RESET_FILTERS_BUTTON_CLASS_NAME}`, onClick: resetFilters, "aria-label": bubbleText, onMouseEnter: () => setIsOpen(true), ...customFocusHandlers, children: _jsx(IconReset, { className: "gd-icon-reset", width: 20, height: 20, ariaHidden: true }) }) }) }));
|
|
50
59
|
}
|
|
@@ -1791,6 +1791,10 @@ export declare const en_US: {
|
|
|
1791
1791
|
text: string;
|
|
1792
1792
|
crowdinContext: string;
|
|
1793
1793
|
};
|
|
1794
|
+
"controlButtons.options.widgetLabel": {
|
|
1795
|
+
text: string;
|
|
1796
|
+
crowdinContext: string;
|
|
1797
|
+
};
|
|
1794
1798
|
"controlButtons.options.back": {
|
|
1795
1799
|
text: string;
|
|
1796
1800
|
crowdinContext: string;
|