@gooddata/sdk-ui-kit 11.62.0-alpha.0 → 11.62.0-alpha.2
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/esm/@ui/@types/icon.d.ts +1 -1
- package/esm/@ui/@types/icon.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableHeader.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableHeader.js +38 -5
- package/esm/@ui/UiAsyncTable/types.d.ts +4 -0
- package/esm/@ui/UiAsyncTable/types.d.ts.map +1 -1
- package/esm/@ui/UiChip/ChipActionButton.d.ts.map +1 -1
- package/esm/@ui/UiChip/ChipActionButton.js +5 -3
- package/esm/@ui/UiFocusManager/utils.js +2 -2
- package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
- package/esm/@ui/UiIcon/icons.js +4 -1
- package/esm/@ui/UiModalDialog/UiModalDialog.js +2 -2
- package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.d.ts +52 -0
- package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.d.ts.map +1 -0
- package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.js +449 -0
- package/esm/@ui/UiResizableSidebar/types.d.ts +70 -1
- package/esm/@ui/UiResizableSidebar/types.d.ts.map +1 -1
- package/esm/@ui/UiResizableSidebar/useUiResizableSidebarState.d.ts +1 -1
- package/esm/@ui/UiResizableSidebar/useUiResizableSidebarState.d.ts.map +1 -1
- package/esm/@ui/UiResizableSidebar/useUiResizableSidebarState.js +5 -4
- package/esm/@ui/UiToolbarInput/UiToolbarInput.d.ts +71 -0
- package/esm/@ui/UiToolbarInput/UiToolbarInput.d.ts.map +1 -0
- package/esm/@ui/UiToolbarInput/UiToolbarInput.js +78 -0
- package/esm/@ui/UiToolbarPagination/UiToolbarPagination.d.ts +58 -0
- package/esm/@ui/UiToolbarPagination/UiToolbarPagination.d.ts.map +1 -0
- package/esm/@ui/UiToolbarPagination/UiToolbarPagination.js +56 -0
- package/esm/@ui/UiToolbarStepper/UiToolbarStepper.d.ts +7 -11
- package/esm/@ui/UiToolbarStepper/UiToolbarStepper.d.ts.map +1 -1
- package/esm/@ui/UiToolbarStepper/UiToolbarStepper.js +6 -10
- package/esm/Header/generateHeaderMenuItemsGroups.d.ts +1 -5
- package/esm/Header/generateHeaderMenuItemsGroups.d.ts.map +1 -1
- package/esm/Header/generateHeaderMenuItemsGroups.js +3 -21
- package/esm/Overlay/Overlay.d.ts.map +1 -1
- package/esm/Overlay/Overlay.js +2 -2
- package/esm/Overlay/OverlayContext.d.ts +15 -0
- package/esm/Overlay/OverlayContext.d.ts.map +1 -1
- package/esm/Overlay/OverlayContext.js +18 -1
- package/esm/index.d.ts +6 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +5 -2
- package/esm/sdk-ui-kit.d.ts +284 -20
- package/package.json +11 -11
- package/src/@ui/UiButtonSegmentedControl/UiButtonSegmentedControl.scss +13 -1
- package/src/@ui/UiIconButton/UiIconButton.scss +8 -1
- package/src/@ui/UiResizableSidebar/UiResizableSidebarNavigation.scss +205 -0
- package/src/@ui/UiToolbar/UiToolbar.scss +1 -1
- package/src/@ui/UiToolbar/toolbarItem.scss +9 -1
- package/src/@ui/UiToolbarInput/UiToolbarInput.scss +82 -0
- package/src/@ui/UiToolbarPagination/UiToolbarPagination.scss +63 -0
- package/src/@ui/UiToolbarStepper/UiToolbarStepper.scss +25 -10
- package/src/@ui/defaultTheme.scss +4 -1
- package/src/@ui/index.scss +3 -0
- package/styles/css/main.css +313 -18
- package/styles/css/main.css.map +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { forwardRef, useId, useState } from "react";
|
|
4
|
+
import { bem } from "../@utils/bem.js";
|
|
5
|
+
import { UiIcon } from "../UiIcon/UiIcon.js";
|
|
6
|
+
import { hasSystemModifier } from "../UiToolbar/rovingFocusUtils.js";
|
|
7
|
+
const { b, e } = bem("gd-ui-kit-toolbar-input");
|
|
8
|
+
const DEFAULT_WIDTH = 64;
|
|
9
|
+
/**
|
|
10
|
+
* A typable number field with an optional prefix and unit. The prefix stays on the left; the value
|
|
11
|
+
* and the unit are aligned to the right.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export const UiToolbarInput = forwardRef(function UiToolbarInput({ value, onCommit, onStep, prefix, prefixIcon, unit, width = DEFAULT_WIDTH, isDisabled = false, isInvalid = false, placeholder, accessibilityConfig, inputRef, dataTestId, }, ref) {
|
|
16
|
+
const unitId = useId();
|
|
17
|
+
const [draft, setDraft] = useState(value);
|
|
18
|
+
const [committed, setCommitted] = useState(value);
|
|
19
|
+
// The text last typed, while it may still come back as `value`.
|
|
20
|
+
const [typed, setTyped] = useState();
|
|
21
|
+
// What the status region says. A value that merely echoes the typed text is left out: the
|
|
22
|
+
// input reads the keystrokes itself, and a second reading of each one would talk over it.
|
|
23
|
+
const [announced, setAnnounced] = useState(value);
|
|
24
|
+
// The text last sent to onCommit, so Enter followed by blur commits it only once.
|
|
25
|
+
const [sent, setSent] = useState();
|
|
26
|
+
// Set by a commit. On the next render the field shows `value` again, which also covers a
|
|
27
|
+
// parent that clamps or rejects the text and so keeps `value` as it was. A parent that marks
|
|
28
|
+
// the text invalid keeps it in the field instead, so the user can correct it.
|
|
29
|
+
const [isCommitPending, setIsCommitPending] = useState(false);
|
|
30
|
+
if (committed !== value) {
|
|
31
|
+
setCommitted(value);
|
|
32
|
+
setDraft(value);
|
|
33
|
+
if (value !== typed) {
|
|
34
|
+
setAnnounced(value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (isCommitPending) {
|
|
38
|
+
setIsCommitPending(false);
|
|
39
|
+
if (!isInvalid) {
|
|
40
|
+
setDraft(value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const commitDraft = () => {
|
|
44
|
+
if (draft !== value && draft !== sent) {
|
|
45
|
+
setTyped(undefined);
|
|
46
|
+
setSent(draft);
|
|
47
|
+
setIsCommitPending(true);
|
|
48
|
+
onCommit(draft);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const handleKeyDown = (event) => {
|
|
52
|
+
// While an IME is composing, the arrows and Enter belong to the input method.
|
|
53
|
+
if (isDisabled || event.nativeEvent.isComposing) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if ((event.code === "ArrowUp" || event.code === "ArrowDown") && !hasSystemModifier(event)) {
|
|
57
|
+
if (onStep) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
setTyped(undefined);
|
|
60
|
+
onStep(event.code === "ArrowUp" ? 1 : -1, event.shiftKey);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (event.code === "Enter") {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
commitDraft();
|
|
66
|
+
}
|
|
67
|
+
else if (event.code === "Escape") {
|
|
68
|
+
setTyped(undefined);
|
|
69
|
+
setDraft(value);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const unitLabel = unit ? (accessibilityConfig.unitLabel ?? unit) : undefined;
|
|
73
|
+
return (_jsxs("label", { ref: ref, className: b({ isDisabled, isInvalid }), style: { width }, "data-testid": dataTestId, children: [prefixIcon ? (_jsx("span", { className: e("prefix"), children: _jsx(UiIcon, { type: prefixIcon, size: 14, color: "currentColor", accessibilityConfig: { ariaHidden: true } }) })) : prefix ? (_jsx("span", { className: e("prefix"), "aria-hidden": true, children: prefix })) : null, _jsx("input", { ref: inputRef, className: e("value"), type: "text", inputMode: "decimal", value: draft, placeholder: placeholder, "aria-label": accessibilityConfig.ariaLabel, "aria-describedby": unit ? unitId : undefined, "aria-disabled": isDisabled || undefined, "aria-invalid": isInvalid || undefined, readOnly: isDisabled, onChange: (event) => {
|
|
74
|
+
setDraft(event.target.value);
|
|
75
|
+
setTyped(event.target.value);
|
|
76
|
+
setSent(undefined);
|
|
77
|
+
}, onBlur: isDisabled ? undefined : commitDraft, onKeyDown: handleKeyDown }), unit ? (_jsxs(_Fragment, { children: [_jsx("span", { className: e("unit"), "aria-hidden": true, children: unit }), _jsx("span", { id: unitId, className: "sr-only", children: unitLabel })] })) : null, _jsx("span", { className: "sr-only", role: "status", children: [accessibilityConfig.ariaLabel, announced, unitLabel].filter(Boolean).join(" ") })] }));
|
|
78
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export interface IUiToolbarPaginationAccessibilityConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the current page, for example "Page".
|
|
7
|
+
*/
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Name of the previous control, for example "Previous page".
|
|
11
|
+
*/
|
|
12
|
+
previousLabel: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name of the next control, for example "Next page".
|
|
15
|
+
*/
|
|
16
|
+
nextLabel: string;
|
|
17
|
+
/**
|
|
18
|
+
* Spoken form of the position, for example "Page 3 of 12". Announced when the page changes.
|
|
19
|
+
* Defaults to the label followed by the visible text.
|
|
20
|
+
*/
|
|
21
|
+
valueText?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Spoken form of the total next to the editable page, for example "of 12".
|
|
24
|
+
* Defaults to the visible text.
|
|
25
|
+
*/
|
|
26
|
+
totalLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export interface IUiToolbarPaginationProps {
|
|
32
|
+
/**
|
|
33
|
+
* The current page, starting at 1.
|
|
34
|
+
*/
|
|
35
|
+
currentPage: number;
|
|
36
|
+
totalPages: number;
|
|
37
|
+
/**
|
|
38
|
+
* Called with the page to move to. A typed page is clamped to the range from 1 to `totalPages`.
|
|
39
|
+
*/
|
|
40
|
+
onPageChange: (page: number) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Makes the current page a field the user can type a page into. Enter and blur go to the typed
|
|
43
|
+
* page, Escape reverts it.
|
|
44
|
+
* @defaultValue false
|
|
45
|
+
*/
|
|
46
|
+
isValueEditable?: boolean;
|
|
47
|
+
isDisabled?: boolean;
|
|
48
|
+
accessibilityConfig: IUiToolbarPaginationAccessibilityConfig;
|
|
49
|
+
dataTestId?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Previous and next controls around the current page and the total, for example "1 / 12". Each
|
|
53
|
+
* control is its own toolbar stop.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export declare const UiToolbarPagination: import("react").ForwardRefExoticComponent<IUiToolbarPaginationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
+
//# sourceMappingURL=UiToolbarPagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiToolbarPagination.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiToolbarPagination/UiToolbarPagination.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACpD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,uCAAuC,CAAC;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAYD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sHAsG/B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { forwardRef, useId, useState } from "react";
|
|
4
|
+
import { bem } from "../@utils/bem.js";
|
|
5
|
+
import { UiToolbarIconButton } from "../UiToolbarIconButton/UiToolbarIconButton.js";
|
|
6
|
+
const { b, e } = bem("gd-ui-kit-toolbar-pagination");
|
|
7
|
+
function parsePage(text, totalPages) {
|
|
8
|
+
const page = Number.parseInt(text.trim(), 10);
|
|
9
|
+
if (Number.isNaN(page)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return Math.min(Math.max(page, 1), Math.max(totalPages, 1));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Previous and next controls around the current page and the total, for example "1 / 12". Each
|
|
16
|
+
* control is its own toolbar stop.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export const UiToolbarPagination = forwardRef(function UiToolbarPagination({ currentPage, totalPages, onPageChange, isValueEditable = false, isDisabled = false, accessibilityConfig, dataTestId, }, ref) {
|
|
21
|
+
const totalId = useId();
|
|
22
|
+
const current = String(currentPage);
|
|
23
|
+
const total = String(totalPages);
|
|
24
|
+
const [draft, setDraft] = useState(current);
|
|
25
|
+
const [committed, setCommitted] = useState(current);
|
|
26
|
+
if (committed !== current) {
|
|
27
|
+
setCommitted(current);
|
|
28
|
+
setDraft(current);
|
|
29
|
+
}
|
|
30
|
+
const goTo = (page) => {
|
|
31
|
+
if (page !== currentPage) {
|
|
32
|
+
onPageChange(page);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const commitDraft = () => {
|
|
36
|
+
const page = parsePage(draft, totalPages);
|
|
37
|
+
setDraft(current);
|
|
38
|
+
if (page !== undefined) {
|
|
39
|
+
goTo(page);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const handleKeyDown = (event) => {
|
|
43
|
+
if (isDisabled || event.nativeEvent.isComposing) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (event.code === "Enter") {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
commitDraft();
|
|
49
|
+
}
|
|
50
|
+
else if (event.code === "Escape") {
|
|
51
|
+
setDraft(current);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const valueText = accessibilityConfig.valueText ?? `${accessibilityConfig.ariaLabel} ${current} / ${total}`;
|
|
55
|
+
return (_jsxs("div", { ref: ref, className: b({ isValueEditable, isDisabled }), "data-testid": dataTestId, children: [_jsx(UiToolbarIconButton, { size: "small", icon: "navigateLeft", label: accessibilityConfig.previousLabel, isDisabled: isDisabled || currentPage <= 1, onClick: () => goTo(currentPage - 1) }), isValueEditable ? (_jsxs(_Fragment, { children: [_jsx("input", { className: e("field"), type: "text", inputMode: "numeric", value: draft, "aria-label": accessibilityConfig.ariaLabel, "aria-describedby": totalId, "aria-disabled": isDisabled || undefined, readOnly: isDisabled, onChange: (event) => setDraft(event.target.value), onBlur: isDisabled ? undefined : commitDraft, onKeyDown: handleKeyDown }), _jsx("span", { className: e("total"), "aria-hidden": true, children: `/ ${total}` }), _jsx("span", { id: totalId, className: "sr-only", children: accessibilityConfig.totalLabel ?? `/ ${total}` })] })) : (_jsx("span", { className: e("readout"), "aria-hidden": true, children: `${current} / ${total}` })), _jsx("span", { className: "sr-only", role: "status", children: valueText }), _jsx(UiToolbarIconButton, { size: "small", icon: "navigateRight", label: accessibilityConfig.nextLabel, isDisabled: isDisabled || currentPage >= totalPages, onClick: () => goTo(currentPage + 1) })] }));
|
|
56
|
+
});
|
|
@@ -6,15 +6,15 @@ import { type IUiDropdownButtonRenderProps } from "../UiDropdown/types.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IUiToolbarStepperAccessibilityConfig {
|
|
8
8
|
/**
|
|
9
|
-
* Name of the value, for example "Zoom"
|
|
9
|
+
* Name of the value, for example "Zoom".
|
|
10
10
|
*/
|
|
11
11
|
ariaLabel: string;
|
|
12
12
|
/**
|
|
13
|
-
* Name of the increase control, for example "Zoom in"
|
|
13
|
+
* Name of the increase control, for example "Zoom in".
|
|
14
14
|
*/
|
|
15
15
|
incrementLabel: string;
|
|
16
16
|
/**
|
|
17
|
-
* Name of the decrease control, for example "Zoom out"
|
|
17
|
+
* Name of the decrease control, for example "Zoom out".
|
|
18
18
|
*/
|
|
19
19
|
decrementLabel: string;
|
|
20
20
|
}
|
|
@@ -23,12 +23,7 @@ export interface IUiToolbarStepperAccessibilityConfig {
|
|
|
23
23
|
*/
|
|
24
24
|
export interface IUiToolbarStepperProps {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* left and right arrows and shows the value as a readout.
|
|
28
|
-
*/
|
|
29
|
-
variant: "value" | "pagination";
|
|
30
|
-
/**
|
|
31
|
-
* The committed value as text, for example "100%" or "1 / 2".
|
|
26
|
+
* The committed value as text, for example "100%".
|
|
32
27
|
*/
|
|
33
28
|
value: string;
|
|
34
29
|
onStep: (direction: 1 | -1) => void;
|
|
@@ -45,7 +40,7 @@ export interface IUiToolbarStepperProps {
|
|
|
45
40
|
decreaseIcon?: IconType;
|
|
46
41
|
increaseIcon?: IconType;
|
|
47
42
|
/**
|
|
48
|
-
* Makes the value
|
|
43
|
+
* Makes the value editable. Enter commits the typed text. Escape and blur
|
|
49
44
|
* revert the typed text to the committed value.
|
|
50
45
|
*/
|
|
51
46
|
onCommit?: (value: string) => void;
|
|
@@ -84,7 +79,8 @@ export interface IUiToolbarStepperProps {
|
|
|
84
79
|
dataTestId?: string;
|
|
85
80
|
}
|
|
86
81
|
/**
|
|
87
|
-
* Two side controls around a value. Each part is its
|
|
82
|
+
* Two side controls around a value that is adjusted by steps, for example zoom. Each part is its
|
|
83
|
+
* own toolbar stop. To move through pages, use {@link UiToolbarPagination}.
|
|
88
84
|
*
|
|
89
85
|
* @internal
|
|
90
86
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiToolbarStepper.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiToolbarStepper/UiToolbarStepper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAwB,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAK3E;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC
|
|
1
|
+
{"version":3,"file":"UiToolbarStepper.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiToolbarStepper/UiToolbarStepper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAwB,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAK3E;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,oCAAoC,CAAC;IAC1D,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;IAChE,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAiBD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,mHAmJ3B,CAAC"}
|
|
@@ -18,17 +18,14 @@ function keepPopupKeys(event) {
|
|
|
18
18
|
event.preventDefault();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const DEFAULT_ICONS = {
|
|
22
|
-
value: { decrease: "minus", increase: "plus" },
|
|
23
|
-
pagination: { decrease: "navigateLeft", increase: "navigateRight" },
|
|
24
|
-
};
|
|
25
21
|
/**
|
|
26
|
-
* Two side controls around a value. Each part is its
|
|
22
|
+
* Two side controls around a value that is adjusted by steps, for example zoom. Each part is its
|
|
23
|
+
* own toolbar stop. To move through pages, use {@link UiToolbarPagination}.
|
|
27
24
|
*
|
|
28
25
|
* @internal
|
|
29
26
|
*/
|
|
30
|
-
export const UiToolbarStepper = forwardRef(function UiToolbarStepper({
|
|
31
|
-
const isEditable =
|
|
27
|
+
export const UiToolbarStepper = forwardRef(function UiToolbarStepper({ value, onStep, canStepUp = true, canStepDown = true, isDisabled = false, accessibilityConfig, decreaseIcon, increaseIcon, onCommit, onDraftChange, isInvalid = false, placeholder, isOpen = false, ariaAttributes, inputRef, onClick, onInputKeyDown, dataTestId, }, ref) {
|
|
28
|
+
const isEditable = onCommit !== undefined;
|
|
32
29
|
const [draft, setDraft] = useState(value);
|
|
33
30
|
const [committed, setCommitted] = useState(value);
|
|
34
31
|
// The text last typed, while it may still come back as `value`.
|
|
@@ -92,13 +89,12 @@ export const UiToolbarStepper = forwardRef(function UiToolbarStepper({ variant,
|
|
|
92
89
|
setDraft(value);
|
|
93
90
|
}
|
|
94
91
|
};
|
|
95
|
-
|
|
96
|
-
return (_jsxs("div", { ref: ref, className: b({ variant }), "data-testid": dataTestId, children: [_jsx(UiToolbarIconButton, { size: "small", icon: decreaseIcon ?? icons.decrease, label: accessibilityConfig.decrementLabel, isDisabled: isDisabled || !canStepDown, onClick: () => onStep(-1), onKeyDown: keepPopupKeys }), isEditable ? (_jsx("input", { ref: inputRef, className: e("value", { isEditable, isActive: isOpen, isInvalid }), type: "text", inputMode: "decimal", value: draft, placeholder: placeholder, "aria-label": accessibilityConfig.ariaLabel, "aria-disabled": isDisabled || undefined, "aria-invalid": isInvalid || undefined, readOnly: isDisabled, onChange: (event) => {
|
|
92
|
+
return (_jsxs("div", { ref: ref, className: b(), "data-testid": dataTestId, children: [_jsx(UiToolbarIconButton, { size: "small", icon: decreaseIcon ?? "minus", label: accessibilityConfig.decrementLabel, isDisabled: isDisabled || !canStepDown, onClick: () => onStep(-1), onKeyDown: keepPopupKeys }), isEditable ? (_jsx("input", { ref: inputRef, className: e("value", { isEditable, isActive: isOpen, isInvalid }), type: "text", inputMode: "decimal", value: draft, placeholder: placeholder, "aria-label": accessibilityConfig.ariaLabel, "aria-disabled": isDisabled || undefined, "aria-invalid": isInvalid || undefined, readOnly: isDisabled, onChange: (event) => {
|
|
97
93
|
setDraft(event.target.value);
|
|
98
94
|
setTyped(event.target.value);
|
|
99
95
|
onDraftChange?.(event.target.value);
|
|
100
96
|
}, onBlur: () => {
|
|
101
97
|
setTyped(undefined);
|
|
102
98
|
setDraft(value);
|
|
103
|
-
}, onClick: isDisabled ? undefined : onClick, onKeyDown: handleKeyDown, ...ariaAttributes })) : (_jsx("span", { className: e("value", { isEditable }), role: "status", "aria-label": accessibilityConfig.ariaLabel, children: value })), isEditable ? (_jsx("span", { className: "sr-only", role: "status", children: `${accessibilityConfig.ariaLabel} ${announced}` })) : null, _jsx(UiToolbarIconButton, { size: "small", icon: increaseIcon ??
|
|
99
|
+
}, onClick: isDisabled ? undefined : onClick, onKeyDown: handleKeyDown, ...ariaAttributes })) : (_jsx("span", { className: e("value", { isEditable }), role: "status", "aria-label": accessibilityConfig.ariaLabel, children: value })), isEditable ? (_jsx("span", { className: "sr-only", role: "status", children: `${accessibilityConfig.ariaLabel} ${announced}` })) : null, _jsx(UiToolbarIconButton, { size: "small", icon: increaseIcon ?? "plus", label: accessibilityConfig.incrementLabel, isDisabled: isDisabled || !canStepUp, onClick: () => onStep(1), onKeyDown: keepPopupKeys })] }));
|
|
104
100
|
});
|
|
@@ -24,10 +24,6 @@ export declare const HEADER_ITEM_ID_ANALYZE: string;
|
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
export declare const HEADER_ITEM_ID_METRICS: string;
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare const HEADER_ITEM_ID_LOAD: string;
|
|
31
27
|
/**
|
|
32
28
|
* @internal
|
|
33
29
|
*/
|
|
@@ -43,5 +39,5 @@ export declare const HEADER_ITEM_ID_CATALOG: string;
|
|
|
43
39
|
/**
|
|
44
40
|
* @internal
|
|
45
41
|
*/
|
|
46
|
-
export declare function generateHeaderMenuItemsGroups(featureFlags: ISettings, workspacePermissions: IWorkspacePermissions, hasAnalyticalDashboards?: boolean, workspaceId?: string, hasNoDataSet?: boolean, backendSupportsDataItem?: boolean,
|
|
42
|
+
export declare function generateHeaderMenuItemsGroups(featureFlags: ISettings, workspacePermissions: IWorkspacePermissions, hasAnalyticalDashboards?: boolean, workspaceId?: string, hasNoDataSet?: boolean, backendSupportsDataItem?: boolean, hasMeasures?: boolean, hasManage?: boolean, baseUrl?: string): IHeaderMenuItem[][];
|
|
47
43
|
//# sourceMappingURL=generateHeaderMenuItemsGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateHeaderMenuItemsGroups.d.ts","sourceRoot":"","sources":["../../src/Header/generateHeaderMenuItemsGroups.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"generateHeaderMenuItemsGroups.d.ts","sourceRoot":"","sources":["../../src/Header/generateHeaderMenuItemsGroups.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAmD,CAAC;AAC1F;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAgD,CAAC;AACpF;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAiD,CAAC;AACtF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAA6C,CAAC;AAC9E;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAgD,CAAC;AACpF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAgD,CAAC;AACpF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAA6C,CAAC;AAC9E;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAA+C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAgD,CAAC;AAEpF;;GAEG;AACH,wBAAgB,6BAA6B,CACzC,YAAY,EAAE,SAAS,EACvB,oBAAoB,EAAE,qBAAqB,EAC3C,uBAAuB,GAAE,OAAe,EACxC,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,GAAE,OAAe,EAC7B,uBAAuB,GAAE,OAAe,EACxC,WAAW,GAAE,OAAe,EAC5B,SAAS,GAAE,OAAc,EACzB,OAAO,GAAE,MAAW,GACrB,eAAe,EAAE,EAAE,CAqBrB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
2
|
import { defineMessage } from "react-intl";
|
|
3
|
-
import { isFreemiumEdition } from "../utils/featureFlags.js";
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
6
5
|
*/
|
|
@@ -25,10 +24,6 @@ export const HEADER_ITEM_ID_ANALYZE = defineMessage({ id: "gs.header.analyze" })
|
|
|
25
24
|
* @internal
|
|
26
25
|
*/
|
|
27
26
|
export const HEADER_ITEM_ID_METRICS = defineMessage({ id: "gs.header.metrics" }).id;
|
|
28
|
-
/**
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export const HEADER_ITEM_ID_LOAD = defineMessage({ id: "gs.header.load" }).id;
|
|
32
27
|
/**
|
|
33
28
|
* @internal
|
|
34
29
|
*/
|
|
@@ -44,12 +39,12 @@ export const HEADER_ITEM_ID_CATALOG = defineMessage({ id: "gs.header.catalog" })
|
|
|
44
39
|
/**
|
|
45
40
|
* @internal
|
|
46
41
|
*/
|
|
47
|
-
export function generateHeaderMenuItemsGroups(featureFlags, workspacePermissions, hasAnalyticalDashboards = false, workspaceId, hasNoDataSet = false, backendSupportsDataItem = false,
|
|
42
|
+
export function generateHeaderMenuItemsGroups(featureFlags, workspacePermissions, hasAnalyticalDashboards = false, workspaceId, hasNoDataSet = false, backendSupportsDataItem = false, hasMeasures = false, hasManage = true, baseUrl = "") {
|
|
48
43
|
if (!workspaceId) {
|
|
49
44
|
return [];
|
|
50
45
|
}
|
|
51
46
|
const pixelPerfectItemsGroup = [];
|
|
52
|
-
const insightItemsGroup = createInsightsItemsGroup(featureFlags, workspaceId, workspacePermissions, hasAnalyticalDashboards, hasMeasures,
|
|
47
|
+
const insightItemsGroup = createInsightsItemsGroup(featureFlags, workspaceId, workspacePermissions, hasAnalyticalDashboards, hasMeasures, backendSupportsDataItem, hasNoDataSet, baseUrl);
|
|
53
48
|
const manageItemsGroup = createManageItemsGroup(workspacePermissions, workspaceId, hasManage);
|
|
54
49
|
return [pixelPerfectItemsGroup, insightItemsGroup, manageItemsGroup].filter((itemsGroup) => itemsGroup.length > 0);
|
|
55
50
|
}
|
|
@@ -60,8 +55,7 @@ function createManageItemsGroup(workspacePermissions, workspaceId, hasManage) {
|
|
|
60
55
|
pushConditionally(manageItemsGroup, createIHeaderMenuItem(HEADER_ITEM_ID_MANAGE, "s-menu-manage", manageUrl), canManageMetric && hasManage);
|
|
61
56
|
return manageItemsGroup;
|
|
62
57
|
}
|
|
63
|
-
function createInsightsItemsGroup(featureFlags, workspaceId, workspacePermissions, hasAnalyticalDashboards, hasMeasures,
|
|
64
|
-
const isFreemiumCustomer = isFreemiumEdition(featureFlags.platformEdition);
|
|
58
|
+
function createInsightsItemsGroup(featureFlags, workspaceId, workspacePermissions, hasAnalyticalDashboards, hasMeasures, backendSupportsDataItem, hasNoDataSet, baseUrl) {
|
|
65
59
|
const insightItemsGroup = [];
|
|
66
60
|
const kpisUrl = kpisItemUrl(baseUrl, workspaceId, Boolean(featureFlags.enableShellApplication_dashboards));
|
|
67
61
|
pushConditionally(insightItemsGroup, createIHeaderMenuItem(HEADER_ITEM_ID_KPIS_NEW, "s-menu-kpis", kpisUrl), canShowKpisItem(workspacePermissions, hasAnalyticalDashboards));
|
|
@@ -72,8 +66,6 @@ function createInsightsItemsGroup(featureFlags, workspaceId, workspacePermission
|
|
|
72
66
|
const dataUrl = dataItemUrl(workspaceId, workspacePermissions, backendSupportsDataItem, hasNoDataSet, baseUrl);
|
|
73
67
|
pushConditionally(insightItemsGroup, createIHeaderMenuItem(HEADER_ITEM_ID_DATA, "s-menu-data", dataUrl), canShowDataItem(featureFlags, workspacePermissions));
|
|
74
68
|
pushConditionally(insightItemsGroup, createIHeaderMenuItem(HEADER_ITEM_ID_CATALOG, "s-menu-workspace-catalog", catalogItemUrl(workspaceId, featureFlags), true), canShowCatalogItem(featureFlags, workspacePermissions));
|
|
75
|
-
const loadUrl = loadItemUrl(baseUrl, workspaceId);
|
|
76
|
-
pushConditionally(insightItemsGroup, createIHeaderMenuItem(HEADER_ITEM_ID_LOAD, "s-menu-load", loadUrl), canShowLoadItem(featureFlags, workspacePermissions, isFreemiumCustomer, backendSupportsCsvUploader));
|
|
77
69
|
return insightItemsGroup;
|
|
78
70
|
}
|
|
79
71
|
function createIHeaderMenuItem(key, className, href, isActiveByStartWith) {
|
|
@@ -139,13 +131,3 @@ function canShowDataItem(featureFlags, workspacePermissions) {
|
|
|
139
131
|
return Boolean(featureFlags.enableDataSection &&
|
|
140
132
|
(workspacePermissions.canInitData || workspacePermissions.canRefreshData));
|
|
141
133
|
}
|
|
142
|
-
function loadItemUrl(baseUrl, workspaceId) {
|
|
143
|
-
return withBaseUrl(baseUrl, `/data/#/workspaces/${workspaceId}/datasets`);
|
|
144
|
-
}
|
|
145
|
-
function canShowLoadItem(featureFlags, workspacePermissions, isFreemiumCustomer, backendSupportsCsvUploader) {
|
|
146
|
-
const canAccessLoadCsvPage = workspacePermissions.canUploadNonProductionCSV === true;
|
|
147
|
-
const canShowLoadCsvItem = featureFlags.enableDataSection
|
|
148
|
-
? !isFreemiumCustomer && canAccessLoadCsvPage
|
|
149
|
-
: canAccessLoadCsvPage;
|
|
150
|
-
return Boolean(canShowLoadCsvItem && backendSupportsCsvUploader);
|
|
151
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,SAAS,EACT,KAAK,WAAW,EAInB,MAAM,OAAO,CAAC;AAgBf,OAAO,
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,SAAS,EACT,KAAK,WAAW,EAInB,MAAM,OAAO,CAAC;AAgBf,OAAO,EAA4B,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAuBtE,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAqCtD;;GAEG;AACH,qBAAa,OAAO,CAAC,CAAC,GAAG,WAAW,CAAE,SAAQ,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;IACpF,OAAc,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAsBrD;IAEF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAC5B,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,aAAa,CAEb;IACR,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,kBAAkB,CAAU;IACpC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAgB,WAAW,0FAAkB;IACrC,OAAO,EAAE,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,QAAQ,CAA6B;IAE7C,YAAY,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EA6BlC;IAEe,yBAAyB,IAAI,IAAI,CAGhD;IAEe,iBAAiB,IAAI,IAAI,CAaxC;IAEe,gCAAgC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAKlF;IAEe,qBAAqB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,OAAO,CAOpG;IAEe,kBAAkB,IAAI,IAAI,CAEzC;IAEe,oBAAoB,IAAI,IAAI,CAgB3C;IAEe,MAAM,4CAmCrB;IAEM,KAAK,QAAO,IAAI,CAyCrB;IAEF,OAAO,CAAC,6BAA6B,CAyDnC;IAEF,OAAO,CAAC,qBAAqB,CAI3B;IAEF,OAAO,CAAC,gBAAgB,CAMtB;IAEF,OAAO,CAAC,WAAW,CAIjB;IAEF,SAAS,CAAC,SAAS,IAAI,MAAM,GAAG,SAAS,CAExC;IAEM,gBAAgB,QAAO,aAAa,CA4BzC;IAEF,OAAO,CAAC,iBAAiB,CAIvB;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAOrB;IAEF,OAAO,CAAC,kBAAkB,CAMxB;IAEF,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,mCAAmC;IAS3C,OAAO,CAAC,sBAAsB,CAI5B;IAEF,OAAO,CAAC,eAAe,CAIrB;IAEF,OAAO,CAAC,kBAAkB,CAiBxB;IAEF,OAAO,CAAC,uBAAuB,CAqB7B;IAEF,OAAO,CAAC,SAAS,CAEf;IAGF,OAAO,CAAC,uBAAuB,CAS7B;IAEK,mBAAmB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAQ9C;IAEM,mBAAmB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAQ9C;IAEM,gBAAgB,QAAO,IAAI,CAMhC;IAEK,mBAAmB,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAIzC;IAEM,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,CAQ3C;IAED,OAAO,CAAC,eAAe,CAUrB;IAEF,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,eAAe,CAErB;IAEF,OAAO,CAAC,UAAU,CAahB;IAEF,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,qBAAqB;CAOhC"}
|
package/esm/Overlay/Overlay.js
CHANGED
|
@@ -12,7 +12,7 @@ import { elementRegion, isFixedPosition } from "../utils/domUtilities.js";
|
|
|
12
12
|
import { GOODSTRAP_DRAG_EVENT } from "../utils/drag.js";
|
|
13
13
|
import { DEFAULT_ALIGN_POINTS, getOptimalAlignment, getOverlayStyles } from "../utils/overlay.js";
|
|
14
14
|
import { GOODSTRAP_SCROLLED_EVENT } from "../utils/scroll.js";
|
|
15
|
-
import { OverlayContext } from "./OverlayContext.js";
|
|
15
|
+
import { FALLBACK_OVERLAY_Z_INDEX, OverlayContext, OverlayZIndexContext } from "./OverlayContext.js";
|
|
16
16
|
const events = [
|
|
17
17
|
{
|
|
18
18
|
name: "click",
|
|
@@ -159,7 +159,7 @@ export class Overlay extends Component {
|
|
|
159
159
|
render() {
|
|
160
160
|
// Need stop propagation of events from Portal thats new behavior of react 16
|
|
161
161
|
// https://github.com/facebook/react/issues/11387
|
|
162
|
-
return (_jsx("span", { "data-testid": "portal-scroll-anchor", className: "s-portal-scroll-anchor", ref: this.containerRef, style: { display: "none" }, children: _jsx(Portal, { node: this.portalNode, children: _jsxs("div", { id: this.id, className: cx(this.props.containerClassName, OVERLAY_CONTENT_CLASS), onClick: this.props.onClick, onMouseOver: this.props.onMouseOver, onMouseUp: this.props.onMouseUp, children: [this.renderMask(), _jsx("div", { ref: this.overlayRef, style: this.getOverlayStyles(), className: this.getOverlayClasses(), children: this.props.children })] }) }) }));
|
|
162
|
+
return (_jsx("span", { "data-testid": "portal-scroll-anchor", className: "s-portal-scroll-anchor", ref: this.containerRef, style: { display: "none" }, children: _jsx(Portal, { node: this.portalNode, children: _jsxs("div", { id: this.id, className: cx(this.props.containerClassName, OVERLAY_CONTENT_CLASS), onClick: this.props.onClick, onMouseOver: this.props.onMouseOver, onMouseUp: this.props.onMouseUp, children: [this.renderMask(), _jsx("div", { ref: this.overlayRef, style: this.getOverlayStyles(), className: this.getOverlayClasses(), children: _jsx(OverlayZIndexContext.Provider, { value: this.getZIndex() ?? FALLBACK_OVERLAY_Z_INDEX, children: this.props.children }) })] }) }) }));
|
|
163
163
|
}
|
|
164
164
|
align = () => {
|
|
165
165
|
const { alignPoints, alignTo, positionType } = this.props;
|
|
@@ -4,6 +4,20 @@ import { type OverlayController } from "./OverlayController.js";
|
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
6
|
export declare const OverlayContext: import("react").Context<OverlayController | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* Context with the z-index of the closest ui-kit overlay that renders its subtree.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const OverlayZIndexContext: import("react").Context<number | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Hook to get the z-index of the closest ui-kit overlay that renders the calling component.
|
|
15
|
+
*
|
|
16
|
+
* @returns the overlay's z-index, or undefined when the component is not rendered inside an overlay
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const useContainingOverlayZIndex: () => number | undefined;
|
|
7
21
|
/**
|
|
8
22
|
* Properties for {@link OverlayControllerProvider} component.
|
|
9
23
|
*
|
|
@@ -33,6 +47,7 @@ export declare function OverlayControllerProvider({ children, overlayController
|
|
|
33
47
|
* @internal
|
|
34
48
|
*/
|
|
35
49
|
export declare const useOverlayController: () => OverlayController | undefined;
|
|
50
|
+
export declare const FALLBACK_OVERLAY_Z_INDEX = 5001;
|
|
36
51
|
/**
|
|
37
52
|
* Hook to get the css `z-index` property for given overlay.
|
|
38
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwD,MAAM,OAAO,CAAC;AAI7F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,cAAc,wDAA0D,CAAC;AAGtF;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC5C;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,+BAA+B,2CAEzG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAO,iBAAiB,GAAG,SAE3D,CAAC;
|
|
1
|
+
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwD,MAAM,OAAO,CAAC;AAI7F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,cAAc,wDAA0D,CAAC;AAGtF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6CAA+C,CAAC;AAGjF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAAO,MAAM,GAAG,SAEtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC5C;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,+BAA+B,2CAEzG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAO,iBAAiB,GAAG,SAE3D,CAAC;AAEF,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,MAAM,GAAG,SAGxD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,4BAA4B,WAoB3C"}
|
|
@@ -7,6 +7,23 @@ import { v4 as uuid } from "uuid";
|
|
|
7
7
|
*/
|
|
8
8
|
export const OverlayContext = createContext(undefined);
|
|
9
9
|
OverlayContext.displayName = "OverlayContext";
|
|
10
|
+
/**
|
|
11
|
+
* Context with the z-index of the closest ui-kit overlay that renders its subtree.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export const OverlayZIndexContext = createContext(undefined);
|
|
16
|
+
OverlayZIndexContext.displayName = "OverlayZIndexContext";
|
|
17
|
+
/**
|
|
18
|
+
* Hook to get the z-index of the closest ui-kit overlay that renders the calling component.
|
|
19
|
+
*
|
|
20
|
+
* @returns the overlay's z-index, or undefined when the component is not rendered inside an overlay
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export const useContainingOverlayZIndex = () => {
|
|
25
|
+
return useContext(OverlayZIndexContext);
|
|
26
|
+
};
|
|
10
27
|
/**
|
|
11
28
|
* Component for injecting {@link OverlayController} into all components in the application.
|
|
12
29
|
*
|
|
@@ -25,7 +42,7 @@ export function OverlayControllerProvider({ children, overlayController }) {
|
|
|
25
42
|
export const useOverlayController = () => {
|
|
26
43
|
return useContext(OverlayContext);
|
|
27
44
|
};
|
|
28
|
-
const FALLBACK_OVERLAY_Z_INDEX = 5001; // Same as in OverlayController
|
|
45
|
+
export const FALLBACK_OVERLAY_Z_INDEX = 5001; // Same as in OverlayController
|
|
29
46
|
/**
|
|
30
47
|
* Hook to get the css `z-index` property for given overlay.
|
|
31
48
|
*
|
package/esm/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export { generateHeaderCommonHelpMenuItems } from "./Header/generateHeaderCommon
|
|
|
88
88
|
export { generateHeaderStaticHelpMenuItems } from "./Header/generateHeaderStaticHelpMenuItems.js";
|
|
89
89
|
export { HeaderBadge, type IHeaderBadgeProps } from "./Header/HeaderBadge.js";
|
|
90
90
|
export { HeaderBadgeWithModal, type IHeaderBadgeWithModalProps } from "./Header/HeaderBadgeWithModal.js";
|
|
91
|
-
export { HEADER_ITEM_ID_DASHBOARDS, HEADER_ITEM_ID_REPORTS, HEADER_ITEM_ID_KPIS_NEW, HEADER_ITEM_ID_KPIS, HEADER_ITEM_ID_ANALYZE, HEADER_ITEM_ID_METRICS,
|
|
91
|
+
export { HEADER_ITEM_ID_DASHBOARDS, HEADER_ITEM_ID_REPORTS, HEADER_ITEM_ID_KPIS_NEW, HEADER_ITEM_ID_KPIS, HEADER_ITEM_ID_ANALYZE, HEADER_ITEM_ID_METRICS, HEADER_ITEM_ID_DATA, HEADER_ITEM_ID_MANAGE, HEADER_ITEM_ID_CATALOG, generateHeaderMenuItemsGroups, } from "./Header/generateHeaderMenuItemsGroups.js";
|
|
92
92
|
export { activateHeaderMenuItems } from "./Header/activateHeaderMenuItems.js";
|
|
93
93
|
export type { IHeaderMenuItem, IAppHeaderProps, IAppHeaderState, IHeaderAccountProps, IHeaderAccountState, IHeaderMenuProps, IHeaderUpsellButtonProps, TUTMContent, } from "./Header/typings.js";
|
|
94
94
|
export { type HeaderSearchContext, HeaderSearchProvider, useHeaderSearch, } from "./Header/headerSearchContext.js";
|
|
@@ -148,7 +148,7 @@ export { Overlay } from "./Overlay/Overlay.js";
|
|
|
148
148
|
export { ZoomAwareOverlay } from "./Overlay/ZoomAwareOverlay.js";
|
|
149
149
|
export { FullScreenOverlay } from "./Overlay/FullScreenOverlay.js";
|
|
150
150
|
export { OverlayController } from "./Overlay/OverlayController.js";
|
|
151
|
-
export { OverlayContext, OverlayControllerProvider, useOverlayController, useOverlayZIndex, useOverlayZIndexWithRegister, type IOverlayControllerProviderProps, } from "./Overlay/OverlayContext.js";
|
|
151
|
+
export { OverlayContext, OverlayControllerProvider, OverlayZIndexContext, useContainingOverlayZIndex, useOverlayController, useOverlayZIndex, useOverlayZIndexWithRegister, type IOverlayControllerProviderProps, } from "./Overlay/OverlayContext.js";
|
|
152
152
|
export { ErrorOverlay, type IErrorOverlayProps } from "./Overlay/ErrorOverlay.js";
|
|
153
153
|
export { alignConfigToAlignPoint, type AlignConfig, type HorizontalPosition, type VerticalPosition, type PositionPoint, } from "./Overlay/utils.js";
|
|
154
154
|
export { ResponsiveText, type IResponsiveTextProps } from "./ResponsiveText/ResponsiveText.js";
|
|
@@ -419,6 +419,8 @@ export { UiToolbarIconButton, type IUiToolbarIconButtonProps, } from "./@ui/UiTo
|
|
|
419
419
|
export { UiToolbarIconSelect, type IUiToolbarIconSelectProps, } from "./@ui/UiToolbarIconSelect/UiToolbarIconSelect.js";
|
|
420
420
|
export { UiToolbarSelect, type IUiToolbarSelectProps } from "./@ui/UiToolbarSelect/UiToolbarSelect.js";
|
|
421
421
|
export { UiToolbarStepper, type IUiToolbarStepperProps, type IUiToolbarStepperAccessibilityConfig, } from "./@ui/UiToolbarStepper/UiToolbarStepper.js";
|
|
422
|
+
export { UiToolbarInput, type IUiToolbarInputProps, type IUiToolbarInputAccessibilityConfig, } from "./@ui/UiToolbarInput/UiToolbarInput.js";
|
|
423
|
+
export { UiToolbarPagination, type IUiToolbarPaginationProps, type IUiToolbarPaginationAccessibilityConfig, } from "./@ui/UiToolbarPagination/UiToolbarPagination.js";
|
|
422
424
|
export { UiToolbarSegmentedControl, type IUiToolbarSegmentedControlProps, } from "./@ui/UiToolbarSegmentedControl/UiToolbarSegmentedControl.js";
|
|
423
425
|
export type { UiToolbarSegmentedControlChangeEvent } from "./@ui/UiToolbarSegmentedControl/context.js";
|
|
424
426
|
export { UiToolbarMoreButton, type IUiToolbarMoreButtonProps, } from "./@ui/UiToolbarMoreButton/UiToolbarMoreButton.js";
|
|
@@ -520,7 +522,8 @@ export { UiResizableSidebar, type IUiResizableSidebarProps, } from "./@ui/UiResi
|
|
|
520
522
|
export { UiResizableSidebarHandle, type IUiResizableSidebarHandleProps, } from "./@ui/UiResizableSidebar/UiResizableSidebarHandle.js";
|
|
521
523
|
export { UiResizableSidebarProvider, useUiResizableSidebar, type IUiResizableSidebarProviderProps, } from "./@ui/UiResizableSidebar/UiResizableSidebarContext.js";
|
|
522
524
|
export { useUiResizableSidebarState, UI_RESIZABLE_SIDEBAR_RAIL_WIDTH, } from "./@ui/UiResizableSidebar/useUiResizableSidebarState.js";
|
|
523
|
-
export { type IUiResizableSidebarState, type IUiResizableSidebarStateOptions, } from "./@ui/UiResizableSidebar/types.js";
|
|
525
|
+
export { type IUiResizableSidebarState, type IUiResizableSidebarStateOptions, type IUiResizableSidebarNavigationActionRequired, type IUiResizableSidebarNavigationItem, type IUiResizableSidebarNavigationSubItem, type UiResizableSidebarNavigationNamingConfig, } from "./@ui/UiResizableSidebar/types.js";
|
|
526
|
+
export { UiResizableSidebarNavigation, type IUiResizableSidebarNavigationProps, type UiResizableSidebarNavigationItem, } from "./@ui/UiResizableSidebar/UiResizableSidebarNavigation.js";
|
|
524
527
|
export { UiResizableSidebarCollapseToggle, type IUiResizableSidebarCollapseToggleProps, } from "./@ui/UiResizableSidebar/UiResizableSidebarCollapseToggle.js";
|
|
525
528
|
export { UiResizableSidebarExpandTrigger, type IUiResizableSidebarExpandTriggerProps, } from "./@ui/UiResizableSidebar/UiResizableSidebarExpandTrigger.js";
|
|
526
529
|
//# sourceMappingURL=index.d.ts.map
|