@gooddata/sdk-ui-kit 11.68.0-alpha.2 → 11.68.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/esm/@ui/UiAsyncTable/UiAsyncTable/SkeletonItemFactory.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/SkeletonItemFactory.js +2 -2
- package/esm/@ui/UiConfigEditor/UiConfigEditor.d.ts +1 -1
- package/esm/@ui/UiConfigEditor/UiConfigEditor.d.ts.map +1 -1
- package/esm/@ui/UiConfigEditor/UiConfigEditor.js +62 -25
- package/esm/@ui/UiConfigEditor/configEditorDiagnostics.d.ts +10 -0
- package/esm/@ui/UiConfigEditor/configEditorDiagnostics.d.ts.map +1 -0
- package/esm/@ui/UiConfigEditor/configEditorDiagnostics.js +65 -0
- package/esm/@ui/UiConfigEditor/configEditorYamlIndent.d.ts +8 -0
- package/esm/@ui/UiConfigEditor/configEditorYamlIndent.d.ts.map +1 -0
- package/esm/@ui/UiConfigEditor/configEditorYamlIndent.js +33 -0
- package/esm/@ui/UiConfigEditor/types.d.ts +9 -6
- package/esm/@ui/UiConfigEditor/types.d.ts.map +1 -1
- package/esm/@ui/UiDrawer/UiDrawer.d.ts.map +1 -1
- package/esm/@ui/UiDrawer/UiDrawer.js +14 -4
- package/esm/@ui/UiFocusManager/UiAutofocus.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/UiAutofocus.js +22 -2
- package/esm/@ui/UiFocusManager/UiModalOwner.d.ts +11 -0
- package/esm/@ui/UiFocusManager/UiModalOwner.d.ts.map +1 -0
- package/esm/@ui/UiFocusManager/UiModalOwner.js +18 -0
- package/esm/@ui/UiModalDialog/UiDialogHeader.d.ts +1 -9
- package/esm/@ui/UiModalDialog/UiDialogHeader.d.ts.map +1 -1
- package/esm/@ui/UiModalDialog/UiDialogHeader.js +5 -4
- package/esm/@ui/UiModalDialog/UiModalDialog.d.ts +16 -2
- package/esm/@ui/UiModalDialog/UiModalDialog.d.ts.map +1 -1
- package/esm/@ui/UiModalDialog/UiModalDialog.js +13 -5
- package/esm/@ui/UiSearchableSelect/UiSearchableSelect.d.ts +14 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelect.d.ts.map +1 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelect.js +76 -38
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectContext.d.ts +12 -2
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectContext.d.ts.map +1 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectList.d.ts.map +1 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectList.js +7 -13
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectSearch.d.ts.map +1 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelectSearch.js +6 -12
- package/esm/ChartSorting/ChartSorting.d.ts.map +1 -1
- package/esm/ChartSorting/ChartSorting.js +2 -2
- package/esm/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/esm/ColorPicker/ColorPicker.js +2 -2
- package/esm/DescriptionPanel/DescriptionPanel.d.ts.map +1 -1
- package/esm/DescriptionPanel/DescriptionPanel.js +2 -2
- package/esm/DescriptionPanel/MetadataList.d.ts.map +1 -1
- package/esm/DescriptionPanel/MetadataList.js +2 -3
- package/esm/Dialog/DialogBase.d.ts.map +1 -1
- package/esm/Dialog/DialogBase.js +6 -2
- package/esm/Dialog/EmbedInsightDialog/EmbedInsightDialogBase/components/NumericInput.d.ts.map +1 -1
- package/esm/Dialog/EmbedInsightDialog/EmbedInsightDialogBase/components/NumericInput.js +4 -4
- package/esm/Dialog/ShareDialog/ShareDialogBase/types.d.ts.map +1 -1
- package/esm/Dialog/ShareDialog/ShareDialogBase/types.js +10 -10
- package/esm/Dialog/ShareDialog/ShareDialogBase/useShareDialogBase.d.ts.map +1 -1
- package/esm/Dialog/ShareDialog/ShareDialogBase/useShareDialogBase.js +3 -3
- package/esm/Dropdown/DropdownInvertableSelect.d.ts.map +1 -1
- package/esm/Dropdown/DropdownInvertableSelect.js +2 -2
- package/esm/Header/Header.d.ts.map +1 -1
- package/esm/Header/Header.js +3 -1
- package/esm/Header/HeaderHelp.d.ts.map +1 -1
- package/esm/Header/HeaderHelp.js +2 -2
- package/esm/Hyperlink/Hyperlink.d.ts.map +1 -1
- package/esm/Hyperlink/Hyperlink.js +3 -3
- package/esm/Overlay/Overlay.d.ts.map +1 -1
- package/esm/Overlay/Overlay.js +18 -11
- package/esm/RichText/plugins/rehype-references.js +1 -1
- package/esm/index.d.ts +4 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -2
- package/esm/sdk-ui-kit.d.ts +60 -37
- package/esm/syntaxHighlightingInput/hooks/useCodemirrorKeymap.d.ts +2 -0
- package/esm/syntaxHighlightingInput/hooks/useCodemirrorKeymap.d.ts.map +1 -1
- package/esm/syntaxHighlightingInput/hooks/useCodemirrorKeymap.js +6 -3
- package/esm/syntaxHighlightingInput/syntaxErrorLinter.d.ts +2 -2
- package/esm/syntaxHighlightingInput/syntaxErrorLinter.d.ts.map +1 -1
- package/esm/syntaxHighlightingInput/syntaxErrorLinter.js +10 -5
- package/package.json +11 -11
- package/src/@ui/UiListbox/UiListbox.scss +4 -2
- package/src/@ui/UiModalDialog/UiModalDialog.scss +49 -7
- package/src/@ui/UiSearchableSelect/UiSearchableSelect.scss +31 -0
- package/src/@ui/UiToast/UiToast.scss +7 -0
- package/styles/css/avenirFontPatch.css +111 -0
- package/styles/css/avenirFontPatch.css.map +1 -0
- package/styles/css/main.css +187 -6
- package/styles/css/main.css.map +1 -1
- package/styles/css/richText.css +2 -1
- package/styles/css/richText.css.map +1 -1
- package/styles/scss/avenirFontPatch.scss +63 -0
- package/styles/scss/main.scss +2 -1
- package/styles/scss/richText.scss +2 -1
- package/esm/@ui/UiConfigEditor/configEditorWarnings.d.ts +0 -10
- package/esm/@ui/UiConfigEditor/configEditorWarnings.d.ts.map +0 -1
- package/esm/@ui/UiConfigEditor/configEditorWarnings.js +0 -42
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiModalDialog.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiModalDialog/UiModalDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,SAAS,EAQjB,MAAM,OAAO,CAAC;AAcf,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"UiModalDialog.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiModalDialog/UiModalDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,SAAS,EAQjB,MAAM,OAAO,CAAC;AAcf,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAS/E,UAAU,gBAAgB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,YAAY,EAAE,MAAM,MAAM,IAAI,CAAC;IAC/B,sDAAsD;IACtD,IAAI,EAAE,iBAAiB,CAAC;CAC3B;AAID;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,GAAG,IAAI,CAE5D;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;4DACwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACrC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uFAAuF;IACvF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,WAAW,GAAG,gBAAgB,CAAC,GAAG;QACnF,4EAA4E;QAC5E,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;KACnC,CAAC;IACF,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,EAAE,EACF,YAAY,GACf,EAAE,mBAAmB,kDAoBrB"}
|
|
@@ -6,6 +6,7 @@ import { ConditionalScopedThemeProvider } from "@gooddata/sdk-ui-theme-provider"
|
|
|
6
6
|
import { OverlayZIndexContext, useOverlayZIndexWithRegister } from "../../Overlay/OverlayContext.js";
|
|
7
7
|
import { bem } from "../@utils/bem.js";
|
|
8
8
|
import { markModalOwnedEvent } from "../UiFocusManager/modalOwnedEvents.js";
|
|
9
|
+
import { UiModalOwnerProvider, modalOwnerAttributes } from "../UiFocusManager/UiModalOwner.js";
|
|
9
10
|
const { b, e } = bem("gd-ui-kit-modal-dialog");
|
|
10
11
|
const markModalKeyDown = (event) => markModalOwnedEvent(event.nativeEvent);
|
|
11
12
|
const UiDialogContext = createContext(null);
|
|
@@ -23,18 +24,18 @@ export function useUiDialogContext() {
|
|
|
23
24
|
*
|
|
24
25
|
* @internal
|
|
25
26
|
*/
|
|
26
|
-
export function UiModalDialog({ children, variant, isOpen, onClose, width, initialFocus, closeOnOutsideClick, accessibilityConfig, dataTestId, }) {
|
|
27
|
+
export function UiModalDialog({ children, variant, isOpen, onClose, width, size, initialFocus, closeOnOutsideClick, accessibilityConfig, dataTestId, id, isFullscreen, }) {
|
|
27
28
|
if (!isOpen) {
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
|
-
return (_jsx(OpenModalDialog, { variant: variant, onClose: onClose, width: width, initialFocus: initialFocus, closeOnOutsideClick: closeOnOutsideClick, accessibilityConfig: accessibilityConfig, dataTestId: dataTestId, children: children }));
|
|
31
|
+
return (_jsx(OpenModalDialog, { variant: variant, onClose: onClose, width: width, size: size, initialFocus: initialFocus, closeOnOutsideClick: closeOnOutsideClick, accessibilityConfig: accessibilityConfig, dataTestId: dataTestId, id: id, isFullscreen: isFullscreen, children: children }));
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Inner body — only mounted while the modal is open so the z-index slot is
|
|
34
35
|
* reserved for the open lifetime only. Splitting this out matters because
|
|
35
36
|
* `useOverlayZIndexWithRegister` registers in a mount effect.
|
|
36
37
|
*/
|
|
37
|
-
function OpenModalDialog({ children, variant = "default", onClose, width = 540, initialFocus, closeOnOutsideClick = false, accessibilityConfig, dataTestId, }) {
|
|
38
|
+
function OpenModalDialog({ children, variant = "default", onClose, width = 540, size = "default", initialFocus, closeOnOutsideClick = false, accessibilityConfig, dataTestId, id, isFullscreen = false, }) {
|
|
38
39
|
const zIndex = useOverlayZIndexWithRegister();
|
|
39
40
|
const titleId = useId();
|
|
40
41
|
const descriptionId = useId();
|
|
@@ -67,8 +68,10 @@ function OpenModalDialog({ children, variant = "default", onClose, width = 540,
|
|
|
67
68
|
// makes it focus the dialog card itself instead of the first action.
|
|
68
69
|
const initialFocusRef = useRef(null);
|
|
69
70
|
const [hasAutofocusTarget, setHasAutofocusTarget] = useState(false);
|
|
71
|
+
const [card, setCard] = useState(null);
|
|
70
72
|
const setFloatingRef = useCallback((node) => {
|
|
71
73
|
refs.setFloating(node);
|
|
74
|
+
setCard(node);
|
|
72
75
|
const target = node?.querySelector("[autofocus]") ?? null;
|
|
73
76
|
initialFocusRef.current = target;
|
|
74
77
|
setHasAutofocusTarget(target !== null);
|
|
@@ -113,7 +116,12 @@ function OpenModalDialog({ children, variant = "default", onClose, width = 540,
|
|
|
113
116
|
onClose();
|
|
114
117
|
}, [onClose, refs]);
|
|
115
118
|
const ariaLabelledBy = accessibilityConfig?.ariaLabelledBy ?? (accessibilityConfig?.ariaLabel ? undefined : titleId);
|
|
116
|
-
const dialogContextValue = useMemo(() => ({
|
|
119
|
+
const dialogContextValue = useMemo(() => ({
|
|
120
|
+
titleId,
|
|
121
|
+
descriptionId,
|
|
122
|
+
registerBody,
|
|
123
|
+
size: isFullscreen ? "large" : size,
|
|
124
|
+
}), [titleId, descriptionId, registerBody, isFullscreen, size]);
|
|
117
125
|
// Nested kit popovers/menus (UiPopover, UiTooltip, dropdowns) portal
|
|
118
126
|
// out of the modal card into sibling `[data-floating-ui-portal]` nodes.
|
|
119
127
|
// FloatingFocusManager defaults to `modal=true`, which treats everything
|
|
@@ -137,5 +145,5 @@ function OpenModalDialog({ children, variant = "default", onClose, width = 540,
|
|
|
137
145
|
return (_jsx(FloatingPortal, { children: _jsx(ConditionalScopedThemeProvider, { children: _jsx(FloatingOverlay, { lockScroll: true, className: b(), "data-testid": dataTestId, style: { zIndex },
|
|
138
146
|
// The card, the focus guards and the menus portaled from the card all bubble
|
|
139
147
|
// through here before reaching a focus trap around the opener.
|
|
140
|
-
onKeyDown: markModalKeyDown, children: _jsx(FloatingFocusManager, { context: context, initialFocus: initialFocus ?? (hasAutofocusTarget ? initialFocusRef : undefined), getInsideElements: getInsideElements, children: _jsx("div", { ref: setFloatingRef, className: e("card", { variant }), style: { width }, role: accessibilityConfig?.role ?? "dialog", "aria-modal": "true", "aria-label": accessibilityConfig?.ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": hasBody ? descriptionId : undefined, ...getFloatingProps(), onKeyDown: onCardKeyDown, children: _jsx(UiDialogContext.Provider, { value: dialogContextValue, children: _jsx(OverlayZIndexContext.Provider, { value: zIndex, children: children }) }) }) }) }) }) }));
|
|
148
|
+
onKeyDown: markModalKeyDown, children: _jsx(FloatingFocusManager, { context: context, initialFocus: initialFocus ?? (hasAutofocusTarget ? initialFocusRef : undefined), getInsideElements: getInsideElements, children: _jsx("div", { ref: setFloatingRef, id: id, className: e("card", { variant, isFullscreen }), style: isFullscreen ? undefined : { width }, role: accessibilityConfig?.role ?? "dialog", "aria-modal": "true", "aria-label": accessibilityConfig?.ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": hasBody ? descriptionId : undefined, ...getFloatingProps(), ...modalOwnerAttributes, onKeyDown: onCardKeyDown, children: _jsx(UiDialogContext.Provider, { value: dialogContextValue, children: _jsx(OverlayZIndexContext.Provider, { value: zIndex, children: _jsx(UiModalOwnerProvider, { modal: card, children: children }) }) }) }) }) }) }) }));
|
|
141
149
|
}
|
|
@@ -16,13 +16,26 @@ export interface IUiSearchableSelectProps<T> {
|
|
|
16
16
|
* while searching: without a query, all items show.
|
|
17
17
|
*/
|
|
18
18
|
filter?: (item: T, query: string) => boolean;
|
|
19
|
+
isOpen?: boolean;
|
|
19
20
|
items: T[];
|
|
20
21
|
onChange: (value: string) => void;
|
|
22
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
21
23
|
placeholder: string;
|
|
24
|
+
/**
|
|
25
|
+
* Only null for now as proper custom anchor is not needed. Null is supported only in fullscreen mode as
|
|
26
|
+
* desktop mode would for that need `anchorRef` prop or something similar which is not needed.
|
|
27
|
+
* You can extend this if you find the need for any of those in the future.
|
|
28
|
+
*/
|
|
29
|
+
renderButton?: null;
|
|
30
|
+
shouldCloseOnSelect?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The heading of the full-screen view on mobile, which also names its dialog.
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
22
35
|
value: string | null;
|
|
23
36
|
}
|
|
24
37
|
/**
|
|
25
38
|
* @internal
|
|
26
39
|
*/
|
|
27
|
-
export declare function UiSearchableSelect<T>({ accessibilityConfig, children, items, filter, placeholder, defaultOpen, value, onChange, }: IUiSearchableSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function UiSearchableSelect<T>({ accessibilityConfig, children, items, filter, placeholder, title, defaultOpen, isOpen, onOpenChange, renderButton: renderButtonProp, shouldCloseOnSelect, value, onChange, }: IUiSearchableSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
28
41
|
//# sourceMappingURL=UiSearchableSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"UiSearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;AAGpG,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAiB/E;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACvC,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAClC,mBAAmB,EACnB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,KAAK,EACL,WAAmB,EACnB,MAAM,EACN,YAAY,EACZ,YAAY,EAAE,gBAAgB,EAC9B,mBAA0B,EAC1B,KAAK,EACL,QAAQ,GACX,EAAE,wBAAwB,CAAC,CAAC,CAAC,2CA4L7B"}
|
|
@@ -1,11 +1,14 @@
|
|
|
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) 2026 GoodData Corporation
|
|
3
|
-
import { Children, Fragment, isValidElement, useId, useState } from "react";
|
|
3
|
+
import { Children, Fragment, isValidElement, useId, useRef, useState } from "react";
|
|
4
|
+
import { useMediaQuery } from "../../responsive/useMediaQuery.js";
|
|
4
5
|
import { accessibilityConfigToAttributes } from "../../typings/utilities.js";
|
|
5
6
|
import { matchesSearchQuery } from "../@utils/matchesSearchQuery.js";
|
|
6
7
|
import { UiDropdown } from "../UiDropdown/UiDropdown.js";
|
|
7
8
|
import { UiIcon } from "../UiIcon/UiIcon.js";
|
|
8
9
|
import { getNextFocusableItemId } from "../UiListbox/UiListbox.js";
|
|
10
|
+
import { UiDialogHeader } from "../UiModalDialog/UiDialogHeader.js";
|
|
11
|
+
import { UiModalDialog } from "../UiModalDialog/UiModalDialog.js";
|
|
9
12
|
import { e } from "./searchableSelectBem.js";
|
|
10
13
|
import { UiSearchableSelectContext } from "./UiSearchableSelectContext.js";
|
|
11
14
|
import { UiSearchableSelectDivider } from "./UiSearchableSelectDivider.js";
|
|
@@ -14,14 +17,20 @@ import { findUiSearchableSelectListRenderItem } from "./UiSearchableSelectList.j
|
|
|
14
17
|
/**
|
|
15
18
|
* @internal
|
|
16
19
|
*/
|
|
17
|
-
export function UiSearchableSelect({ accessibilityConfig, children, items, filter, placeholder, defaultOpen = false, value, onChange, }) {
|
|
20
|
+
export function UiSearchableSelect({ accessibilityConfig, children, items, filter, placeholder, title, defaultOpen = false, isOpen, onOpenChange, renderButton: renderButtonProp, shouldCloseOnSelect = true, value, onChange, }) {
|
|
21
|
+
const isFullscreen = useMediaQuery("mobileDevice");
|
|
22
|
+
const [isOpenState, setIsOpenState] = useState(defaultOpen);
|
|
23
|
+
const isOpenResolved = isOpen ?? isOpenState;
|
|
24
|
+
const setIsOpen = (nextIsOpen) => {
|
|
25
|
+
setIsOpenState(nextIsOpen);
|
|
26
|
+
onOpenChange?.(nextIsOpen);
|
|
27
|
+
};
|
|
28
|
+
const dialogId = useId();
|
|
29
|
+
const searchInputRef = useRef(null);
|
|
18
30
|
const buttonId = useId();
|
|
19
|
-
// the button's name is its value followed by its label ("Item 12 Language"), like in React Aria's Select
|
|
20
31
|
const valueId = useId();
|
|
21
|
-
// shared, so that the search can point at the highlighted option (aria-activedescendant)
|
|
22
32
|
const listboxId = useId();
|
|
23
33
|
const [query, setQuery] = useState("");
|
|
24
|
-
// built here, where the items are typed, also to show the selected item while the list is not rendered
|
|
25
34
|
const renderItem = findUiSearchableSelectListRenderItem(children);
|
|
26
35
|
// one group per item: the item and the dividers rendered with it
|
|
27
36
|
const listboxItemGroups = items.map((item) => renderItem ? getListboxItems(renderItem(item), item) : []);
|
|
@@ -36,13 +45,8 @@ export function UiSearchableSelect({ accessibilityConfig, children, items, filte
|
|
|
36
45
|
: matchesSearchQuery(item.stringTitle, searchQuery))))
|
|
37
46
|
.flat();
|
|
38
47
|
const filteredListboxItems = filterListboxItems(query);
|
|
39
|
-
// the highlight the search moves and the list shows; each opening starts on the selected item
|
|
40
48
|
const [focusedItemId, setFocusedItemId] = useState(value);
|
|
41
|
-
// the highlight shows right away, but the search points at it only after the first arrow key or hover, so
|
|
42
|
-
// that screen readers announce the search on open (see the tests)
|
|
43
49
|
const [isActiveDescendantShown, setIsActiveDescendantShown] = useState(false);
|
|
44
|
-
// while searching, the highlight moves to the first match, like in React Aria; without a query, it goes
|
|
45
|
-
// back to the selected item
|
|
46
50
|
const changeQuery = (nextQuery) => {
|
|
47
51
|
setQuery(nextQuery);
|
|
48
52
|
setFocusedItemId(nextQuery
|
|
@@ -53,35 +57,69 @@ export function UiSearchableSelect({ accessibilityConfig, children, items, filte
|
|
|
53
57
|
})
|
|
54
58
|
: value);
|
|
55
59
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// a new opening starts with all items, like TimezoneSelect
|
|
61
|
-
onOpen: () => {
|
|
60
|
+
const [wasOpen, setWasOpen] = useState(isOpenResolved);
|
|
61
|
+
if (wasOpen !== isOpenResolved) {
|
|
62
|
+
setWasOpen(isOpenResolved);
|
|
63
|
+
if (isOpenResolved) {
|
|
62
64
|
setFocusedItemId(value);
|
|
63
65
|
setIsActiveDescendantShown(false);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
setQuery("");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const renderButton = ({ isOpen, onClick, ariaAttributes, ref, }) => (_jsxs("button", { className: e("button"),
|
|
72
|
+
// UiDropdown types its ref as RefObject<HTMLElement>, which a <button> doesn't accept;
|
|
73
|
+
// a callback ref assigns the mounted button to it without a cast
|
|
74
|
+
ref: (button) => {
|
|
75
|
+
if (button && ref) {
|
|
76
|
+
ref.current = button;
|
|
77
|
+
}
|
|
78
|
+
}, type: "button", onClick: onClick, ...ariaAttributes, ...accessibilityConfigToAttributes(accessibilityConfig), id: buttonId, "aria-labelledby": `${valueId} ${accessibilityConfig.ariaLabelledBy ?? buttonId}`, children: [_jsx("span", { id: valueId, className: e("button-title"), children: selectedItem?.stringTitle ?? placeholder }), _jsx("div", { className: e("button-icon"), children: _jsx(UiIcon, { type: isOpen ? "navigateUp" : "navigateDown", size: 14, disableAnimation: true }) })] }));
|
|
79
|
+
const renderBody = (closeDropdown, bodyAttributes) => (_jsx(UiSearchableSelectContext.Provider, { value: {
|
|
80
|
+
listboxItems: filteredListboxItems,
|
|
81
|
+
query,
|
|
82
|
+
setQuery: changeQuery,
|
|
83
|
+
listboxLabelledBy: accessibilityConfig.ariaLabelledBy ??
|
|
84
|
+
(isFullscreen && renderButtonProp === null ? undefined : buttonId),
|
|
85
|
+
listboxLabel: accessibilityConfig.ariaLabel,
|
|
86
|
+
listboxId,
|
|
87
|
+
focusedItemId,
|
|
88
|
+
setFocusedItemId,
|
|
89
|
+
isActiveDescendantShown,
|
|
90
|
+
setIsActiveDescendantShown,
|
|
91
|
+
value,
|
|
92
|
+
onChange,
|
|
93
|
+
closeDropdown,
|
|
94
|
+
shouldCloseOnSelect,
|
|
95
|
+
searchInputRef,
|
|
96
|
+
isFullscreen,
|
|
97
|
+
}, children: _jsx("div", { className: e("body", { isFullscreen }), ...bodyAttributes, children: children }) }));
|
|
98
|
+
if (isFullscreen) {
|
|
99
|
+
const closeFullscreen = () => setIsOpen(false);
|
|
100
|
+
return (_jsxs(_Fragment, { children: [renderButtonProp === null
|
|
101
|
+
? null
|
|
102
|
+
: renderButton({
|
|
103
|
+
isOpen: isOpenResolved,
|
|
104
|
+
onClick: () => setIsOpen(true),
|
|
105
|
+
ariaAttributes: {
|
|
106
|
+
role: "button",
|
|
107
|
+
"aria-haspopup": "dialog",
|
|
108
|
+
"aria-expanded": isOpenResolved,
|
|
109
|
+
// The dialog is rendered only while open, so the button points at it only then
|
|
110
|
+
"aria-controls": isOpenResolved ? dialogId : undefined,
|
|
111
|
+
},
|
|
112
|
+
}), _jsxs(UiModalDialog, { id: dialogId, isFullscreen: true, isOpen: isOpenResolved, onClose: closeFullscreen, initialFocus: searchInputRef, children: [_jsx(UiDialogHeader, { title: title, onClose: closeFullscreen }), renderBody(closeFullscreen)] })] }));
|
|
113
|
+
}
|
|
114
|
+
return (_jsx(UiDropdown, { width: "same-as-anchor", fullWidthButton: true, autofocusOnOpen: true, enableFocusTrap: false, returnFocusTo: buttonId, isOpen: isOpenResolved, onOpenChange: setIsOpen, accessibilityConfig: { popupRole: "listbox" }, renderButton: ({ ref, isOpen, toggleDropdown, ariaAttributes }) => renderButton({
|
|
115
|
+
isOpen,
|
|
116
|
+
onClick: toggleDropdown,
|
|
117
|
+
ref,
|
|
118
|
+
ariaAttributes: {
|
|
119
|
+
...ariaAttributes,
|
|
120
|
+
"aria-controls": isOpen ? listboxId : undefined,
|
|
121
|
+
},
|
|
122
|
+
}), renderBody: ({ ariaAttributes, closeDropdown }) => renderBody(closeDropdown, ariaAttributes) }));
|
|
85
123
|
}
|
|
86
124
|
/**
|
|
87
125
|
* Reads what the item render function returned: an item alone, or an item in a fragment with dividers
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
1
2
|
import { type IUiListboxItem } from "../UiListbox/types.js";
|
|
2
3
|
interface IUiSearchableSelectContext {
|
|
3
4
|
/** The items matching the search query, with the dividers rendered with them. */
|
|
4
5
|
listboxItems: IUiListboxItem<unknown>[];
|
|
5
6
|
query: string;
|
|
6
7
|
setQuery: (query: string) => void;
|
|
7
|
-
/**
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Names the listbox: the select's ariaLabelledBy, or the trigger button (named by its ariaLabel), or the
|
|
10
|
+
* ariaLabel itself when there's no button.
|
|
11
|
+
*/
|
|
12
|
+
listboxLabelledBy?: string;
|
|
13
|
+
listboxLabel?: string;
|
|
9
14
|
/** The id of the listbox, which the search points into with aria-activedescendant. */
|
|
10
15
|
listboxId: string;
|
|
11
16
|
/** The highlighted option: the search moves it, the list shows it. */
|
|
@@ -17,6 +22,11 @@ interface IUiSearchableSelectContext {
|
|
|
17
22
|
value: string | null;
|
|
18
23
|
onChange: (value: string) => void;
|
|
19
24
|
closeDropdown: () => void;
|
|
25
|
+
shouldCloseOnSelect: boolean;
|
|
26
|
+
/** The search's input, which the full-screen dialog (on mobile) focuses when it opens. */
|
|
27
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
28
|
+
/** Whether the select is shown full screen (on mobile), where the list fills the screen. */
|
|
29
|
+
isFullscreen: boolean;
|
|
20
30
|
}
|
|
21
31
|
export declare const UiSearchableSelectContext: import("react").Context<IUiSearchableSelectContext | null>;
|
|
22
32
|
export declare function useUiSearchableSelectContext(): IUiSearchableSelectContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSearchableSelectContext.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UiSearchableSelectContext.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,UAAU,0BAA0B;IAChC,iFAAiF;IACjF,YAAY,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,mFAAmF;IACnF,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,IAAI,CAAC;IACvE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0FAA0F;IAC1F,cAAc,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD,4FAA4F;IAC5F,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,yBAAyB,4DAAyD,CAAC;AAEhG,wBAAgB,4BAA4B,IAAI,0BAA0B,CAMzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSearchableSelectList.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAiBjE;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,4BAA4B,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"UiSearchableSelectList.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAiBjE;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,4BAA4B,CAAC,CAAC,CAAC,2CA6DzF;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAChD,QAAQ,EAAE,SAAS,GACpB,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,GAAG,SAAS,CAgB5C"}
|
|
@@ -16,28 +16,22 @@ const LIST_MAX_HEIGHT = 280;
|
|
|
16
16
|
*/
|
|
17
17
|
export function UiSearchableSelectList({ noItemsText }) {
|
|
18
18
|
const intl = useIntl();
|
|
19
|
-
const { listboxItems, query,
|
|
19
|
+
const { listboxItems, query, listboxLabelledBy, listboxLabel, listboxId, focusedItemId, setFocusedItemId, setIsActiveDescendantShown, value, onChange, closeDropdown, shouldCloseOnSelect, isFullscreen, } = useUiSearchableSelectContext();
|
|
20
20
|
const noItemsMessage = noItemsText ?? intl.formatMessage(messages.noItems);
|
|
21
21
|
// the results of the search, without the dividers
|
|
22
22
|
const options = listboxItems.filter((item) => item.type === "interactive");
|
|
23
23
|
return (_jsxs(_Fragment, { children: [_jsx(UiSearchResultsAnnouncement, { totalResults: query ? options.length : undefined, resultValues: options.map((option) => option.stringTitle), noResultsText: noItemsMessage }), _jsx(UiListbox, { items: listboxItems, selectedItemId: value ?? undefined, onSelect: (item) => {
|
|
24
|
-
// like a native <select>, picking the already selected item only closes the list
|
|
25
24
|
if (item.id !== value) {
|
|
26
25
|
onChange(item.id);
|
|
27
26
|
}
|
|
28
|
-
},
|
|
29
|
-
// UiListbox closes after a selection (shouldCloseOnSelect defaults to true) through onClose
|
|
30
|
-
onClose: closeDropdown,
|
|
31
|
-
// selects on clicks on the option element itself too (tests, assistive technologies)
|
|
32
|
-
shouldSelectOnOptionClick: true,
|
|
33
|
-
// the highlight is moved by the search, which keeps focus (virtual focus)
|
|
34
|
-
focusedItemId: focusedItemId,
|
|
35
|
-
// hovering moves the same highlight, so keyboard and mouse don't highlight two rows, and like
|
|
36
|
-
// an arrow key, it lets the search point at it
|
|
37
|
-
onFocusedItemIdChange: (itemId) => {
|
|
27
|
+
}, onClose: closeDropdown, shouldCloseOnSelect: shouldCloseOnSelect, shouldSelectOnOptionClick: true, focusedItemId: focusedItemId, onFocusedItemIdChange: (itemId) => {
|
|
38
28
|
setFocusedItemId(itemId);
|
|
39
29
|
setIsActiveDescendantShown(true);
|
|
40
|
-
}, isCompact:
|
|
30
|
+
}, isCompact: !isFullscreen, padding: "none", maxHeight: isFullscreen ? undefined : LIST_MAX_HEIGHT, ariaAttributes: {
|
|
31
|
+
id: listboxId,
|
|
32
|
+
"aria-labelledby": listboxLabelledBy,
|
|
33
|
+
"aria-label": listboxLabel,
|
|
34
|
+
}, supportedViews: ["desktop"] }), listboxItems.length ? null : _jsx("div", { className: e("no-items"), children: noItemsMessage })] }));
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
37
|
* Finds the item render function of the UiSearchableSelectList among the select's children. The root needs it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSearchableSelectSearch.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa/E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,mBAAwB,EACxB,WAAW,GACd,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"UiSearchableSelectSearch.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelectSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa/E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,mBAAwB,EACxB,WAAW,GACd,EAAE,8BAA8B,2CA4FhC"}
|
|
@@ -15,14 +15,13 @@ const messages = defineMessages({
|
|
|
15
15
|
*/
|
|
16
16
|
export function UiSearchableSelectSearch({ accessibilityConfig = {}, placeholder, }) {
|
|
17
17
|
const intl = useIntl();
|
|
18
|
-
const { query, setQuery, listboxItems, listboxId, focusedItemId, setFocusedItemId, isActiveDescendantShown, setIsActiveDescendantShown, value, onChange, closeDropdown, } = useUiSearchableSelectContext();
|
|
18
|
+
const { query, setQuery, listboxItems, listboxId, focusedItemId, setFocusedItemId, isActiveDescendantShown, setIsActiveDescendantShown, value, onChange, closeDropdown, shouldCloseOnSelect, searchInputRef, isFullscreen, } = useUiSearchableSelectContext();
|
|
19
19
|
// while typing, the search points at the highlight only a moment after the last key, like in React Aria,
|
|
20
20
|
// so that screen readers read the typed letter first
|
|
21
21
|
const showActiveDescendantLater = useDebounce(() => setIsActiveDescendantShown(true), 300);
|
|
22
22
|
const changeQuery = (nextQuery) => {
|
|
23
23
|
setQuery(nextQuery);
|
|
24
24
|
setIsActiveDescendantShown(false);
|
|
25
|
-
// without a query, it's like a fresh opening again: the search points at nothing until an arrow key
|
|
26
25
|
if (nextQuery) {
|
|
27
26
|
showActiveDescendantLater();
|
|
28
27
|
}
|
|
@@ -30,34 +29,30 @@ export function UiSearchableSelectSearch({ accessibilityConfig = {}, placeholder
|
|
|
30
29
|
showActiveDescendantLater.cancel();
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
|
-
// focus stays in the search, which moves the highlight that the list shows (virtual focus)
|
|
34
32
|
const activeItem = listboxItems.find((item) => item.type === "interactive" && item.id === focusedItemId);
|
|
35
|
-
return (_jsx("div", { className: e("search"), children: _jsx(UiTextInput, { value: query, onChange: changeQuery, onKeyDown: (event) => {
|
|
33
|
+
return (_jsx("div", { className: e("search"), children: _jsx(UiTextInput, { value: query, onChange: changeQuery, inputRef: searchInputRef, onKeyDown: (event) => {
|
|
36
34
|
// while an input method composes text (e.g. Japanese), the keys are its own; Safari reports
|
|
37
35
|
// the key that ends the composition after it, with only the keyCode 229 left
|
|
38
36
|
if (event.nativeEvent.isComposing || event.keyCode === 229) {
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
41
39
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
42
|
-
// keeps the caret where it is
|
|
43
40
|
event.preventDefault();
|
|
44
41
|
const direction = event.key === "ArrowDown" ? "down" : "up";
|
|
45
42
|
setIsActiveDescendantShown(true);
|
|
46
43
|
setFocusedItemId(getNextFocusableItemId({ items: listboxItems, focusedItemId, direction }));
|
|
47
44
|
}
|
|
48
45
|
else if (event.key === "Enter" && activeItem) {
|
|
49
|
-
// like escape, the event ends here, so that e.g. a surrounding dialog doesn't submit
|
|
50
46
|
event.preventDefault();
|
|
51
47
|
event.stopPropagation();
|
|
52
|
-
// like a native <select>, picking the already selected item only closes the list
|
|
53
48
|
if (activeItem.id !== value) {
|
|
54
49
|
onChange(activeItem.id);
|
|
55
50
|
}
|
|
56
|
-
|
|
51
|
+
if (shouldCloseOnSelect) {
|
|
52
|
+
closeDropdown();
|
|
53
|
+
}
|
|
57
54
|
}
|
|
58
55
|
else if (event.key === "Escape") {
|
|
59
|
-
// the first escape clears the query, the next one closes the list; the event ends here,
|
|
60
|
-
// so that e.g. a surrounding dialog doesn't close too
|
|
61
56
|
event.preventDefault();
|
|
62
57
|
event.stopPropagation();
|
|
63
58
|
if (query) {
|
|
@@ -67,10 +62,9 @@ export function UiSearchableSelectSearch({ accessibilityConfig = {}, placeholder
|
|
|
67
62
|
closeDropdown();
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
|
-
}, placeholder: placeholder ?? intl.formatMessage(messages.searchPlaceholder), iconBefore: "search", size: "small", accessibilityConfig: {
|
|
65
|
+
}, placeholder: placeholder ?? intl.formatMessage(messages.searchPlaceholder), iconBefore: "search", size: isFullscreen ? "medium" : "small", accessibilityConfig: {
|
|
71
66
|
ariaLabel: intl.formatMessage(messages.searchAriaLabel),
|
|
72
67
|
...accessibilityConfig,
|
|
73
|
-
// a combobox that filters the list it controls; the list is shown while the search is
|
|
74
68
|
role: "combobox",
|
|
75
69
|
ariaExpanded: true,
|
|
76
70
|
ariaControls: listboxId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartSorting.d.ts","sourceRoot":"","sources":["../../src/ChartSorting/ChartSorting.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartSorting.d.ts","sourceRoot":"","sources":["../../src/ChartSorting/ChartSorting.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAQrD,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,WAAW,EAAE,sBAAsB,CAAC;IACpC,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAwDD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,2CAM3D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { isEqual } from "lodash-es";
|
|
5
4
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
6
5
|
import { IntlWrapper } from "@gooddata/sdk-ui";
|
|
6
|
+
import { _isEqual } from "@gooddata/util";
|
|
7
7
|
import { Button } from "../Button/Button.js";
|
|
8
8
|
import { ChartSortingDropdown } from "./ChartSortingDropdown.js";
|
|
9
9
|
import { ChartSortingDropdownBody } from "./ChartSortingDropdownBody.js";
|
|
@@ -16,7 +16,7 @@ function ChartSorting({ currentSort, availableSorts, bucketItems, buttonNode, on
|
|
|
16
16
|
const onSelect = (item) => {
|
|
17
17
|
setCurrentSort(item);
|
|
18
18
|
};
|
|
19
|
-
const isApplyEnabled = useMemo(() => !
|
|
19
|
+
const isApplyEnabled = useMemo(() => !_isEqual(currentSort, currentSelectedSort), [currentSort, currentSelectedSort]);
|
|
20
20
|
return (_jsxs(ChartSortingDropdownBody, { buttonNode: buttonNode, onClose: onCancel, children: [_jsx("div", { className: "gd-sort-charting-dropdown-header s-sort-charting-dropdown-header", children: _jsx(FormattedMessage, { id: "sorting.dropdown.header" }) }), _jsx("div", { className: "gd-sort-charting-body gd-sort-charting-dropdown", children: _jsx(ChartSortingDropdown, { currentSort: currentSelectedSort, availableSorts: availableSorts, bucketItems: bucketItems, intl: intl, onSelect: onSelect }) }), _jsxs("div", { className: "gd-chart-sorting-dropdown-footer", children: [_jsx(Button, { className: "gd-button-secondary gd-button-small s-sorting-dropdown-cancel", value: intl.formatMessage({ id: "cancel" }), onClick: onCancel }), _jsx(Button, { className: "gd-button-action gd-button-small s-sorting-dropdown-apply", value: intl.formatMessage({ id: "apply" }), onClick: handleApply, disabled: !isApplyEnabled })] })] }));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,2CA4DnD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { isEqual } from "lodash-es";
|
|
5
4
|
import { useIntl } from "react-intl";
|
|
5
|
+
import { _isEqual } from "@gooddata/util";
|
|
6
6
|
import { Button } from "../Button/Button.js";
|
|
7
7
|
import { ColorPickerMatrix } from "./components/ColorPickerMatrix.js";
|
|
8
8
|
import { ColorsPreview } from "./components/ColorsPreview.js";
|
|
@@ -34,5 +34,5 @@ export function ColorPicker(props) {
|
|
|
34
34
|
props.onSubmit(getRgbFromHslColor(draftHslColor));
|
|
35
35
|
}, [props, draftHslColor]);
|
|
36
36
|
const currentHslColorForPreview = getHslFromRgbColor(props.initialRgbColor);
|
|
37
|
-
return (_jsxs("div", { className: "color-picker-container", "aria-label": "Color picker", children: [_jsx(ColorPickerMatrix, { initColor: draftHslColor, onColorSelected: onColorSelected }), _jsxs("div", { className: "color-picker-control-wrapper", children: [_jsx(HueColorPicker, { initColor: draftHslColor, onChange: onColorSelected }), _jsx(HexColorInput, { initColor: draftHslColor, onInputChanged: onHexInputColorSelected, placeholder: intl.formatMessage({ id: "gs.color-picker.inputPlaceholder" }), label: intl.formatMessage({ id: "gs.color-picker.hex" }) }, `${draftHslColor.h}-${draftHslColor.s}-${draftHslColor.l}`), _jsx(ColorsPreview, { currentHslColor: currentHslColorForPreview, draftHslColor: draftHslColor, currentTextLabel: intl.formatMessage({ id: "gs.color-picker.currentColor" }), draftTextLabel: intl.formatMessage({ id: "gs.color-picker.newColor" }) }), _jsxs("div", { className: "color-picker-buttons-wrapper", children: [_jsx(Button, { value: intl.formatMessage({ id: "gs.color-picker.cancelButton" }), className: "gd-button-secondary gd-button color-picker-button", onClick: props.onCancel }), _jsx(Button, { value: intl.formatMessage({ id: "gs.color-picker.okButton" }), disabled:
|
|
37
|
+
return (_jsxs("div", { className: "color-picker-container", "aria-label": "Color picker", children: [_jsx(ColorPickerMatrix, { initColor: draftHslColor, onColorSelected: onColorSelected }), _jsxs("div", { className: "color-picker-control-wrapper", children: [_jsx(HueColorPicker, { initColor: draftHslColor, onChange: onColorSelected }), _jsx(HexColorInput, { initColor: draftHslColor, onInputChanged: onHexInputColorSelected, placeholder: intl.formatMessage({ id: "gs.color-picker.inputPlaceholder" }), label: intl.formatMessage({ id: "gs.color-picker.hex" }) }, `${draftHslColor.h}-${draftHslColor.s}-${draftHslColor.l}`), _jsx(ColorsPreview, { currentHslColor: currentHslColorForPreview, draftHslColor: draftHslColor, currentTextLabel: intl.formatMessage({ id: "gs.color-picker.currentColor" }), draftTextLabel: intl.formatMessage({ id: "gs.color-picker.newColor" }) }), _jsxs("div", { className: "color-picker-buttons-wrapper", children: [_jsx(Button, { value: intl.formatMessage({ id: "gs.color-picker.cancelButton" }), className: "gd-button-secondary gd-button color-picker-button", onClick: props.onCancel }), _jsx(Button, { value: intl.formatMessage({ id: "gs.color-picker.okButton" }), disabled: _isEqual(props.initialRgbColor, getRgbFromHslColor(draftHslColor)), className: "gd-button-action gd-button color-picker-ok-button", onClick: handleSubmit })] })] })] }));
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionPanel.d.ts","sourceRoot":"","sources":["../../src/DescriptionPanel/DescriptionPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DescriptionPanel.d.ts","sourceRoot":"","sources":["../../src/DescriptionPanel/DescriptionPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOzG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKzD;;GAEG;AACH,eAAO,MAAM,8BAA8B;;GAgB1C,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,+BAA+B;IACxC,OAAO;IACP,OAAO;IACP,OAAO;IAEP,OAAO;IACP,OAAO;IACP,OAAO;IAEP,OAAO;IACP,OAAO;IACP,OAAO;IAEP,OAAO;IACP,OAAO;IACP,OAAO;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,0GAA0G;IAC1G,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,sBAAsB,2CAM7D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,sBAAsB,2CAMpE;AACD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,KAAa,EAAE,EAAE,wBAAwB,2CAoBrF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import { isEmpty } from "lodash-es";
|
|
4
3
|
import { IntlWrapper } from "@gooddata/sdk-ui";
|
|
4
|
+
import { _isEmpty } from "@gooddata/util";
|
|
5
5
|
import { UiIcon } from "../@ui/UiIcon/UiIcon.js";
|
|
6
6
|
import { Bubble } from "../Bubble/Bubble.js";
|
|
7
7
|
import { BubbleHoverTrigger } from "../Bubble/BubbleHoverTrigger.js";
|
|
@@ -73,5 +73,5 @@ function DescriptionPanelContentCore({ title, description, isLocked, useReferenc
|
|
|
73
73
|
const className = cx("gd-description-panel s-gd-description-panel", {
|
|
74
74
|
zoomed: isZoomed,
|
|
75
75
|
});
|
|
76
|
-
return (_jsxs("div", { className: className, id: id, children: [!
|
|
76
|
+
return (_jsxs("div", { className: className, id: id, children: [!_isEmpty(title) && (_jsxs("div", { className: "gd-description-panel-title", children: [isLocked ? _jsx(UiIcon, { type: "lock", size: 16, color: "complementary-6" }) : null, title] })), !_isEmpty(description) && (_jsx("div", { className: "gd-description-panel-content", children: _jsx(RichText, { value: description ?? "", renderMode: "view", referencesEnabled: useReferences, filters: filters, isExecutionInputLoading: isExecutionInputLoading, separators: separators, restrictedReferences: restrictedReferences, parameterDisplayValues: parameterDisplayValues, LoadingComponent: LoadingComponent, execConfig: execConfig }) }))] }));
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetadataList.d.ts","sourceRoot":"","sources":["../../src/DescriptionPanel/MetadataList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MetadataList.d.ts","sourceRoot":"","sources":["../../src/DescriptionPanel/MetadataList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAc/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,kBAAkB,2CAuB/D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
import { isEmpty } from "lodash-es";
|
|
2
|
+
import { _isEmpty } from "@gooddata/util";
|
|
4
3
|
import { Bubble } from "../Bubble/Bubble.js";
|
|
5
4
|
import { BubbleHoverTrigger } from "../Bubble/BubbleHoverTrigger.js";
|
|
6
5
|
const ARROW_OFFSETS = {
|
|
@@ -14,5 +13,5 @@ const ALIGN_POINTS = [{ align: "cr cl" }, { align: "tc bc" }, { align: "bc tc" }
|
|
|
14
13
|
* @internal
|
|
15
14
|
*/
|
|
16
15
|
export function MetadataList({ title, list }) {
|
|
17
|
-
return (_jsxs("div", { className: "gd-metadata-list", children: [title ? _jsx("div", { className: "gd-metadata-list-title", children: title }) : null, list?.map((element, index) => (_jsxs("div", { className: "gd-metadata-list-element", children: [_jsx("span", { title: element.title, children: element.title }), !
|
|
16
|
+
return (_jsxs("div", { className: "gd-metadata-list", children: [title ? _jsx("div", { className: "gd-metadata-list-title", children: title }) : null, list?.map((element, index) => (_jsxs("div", { className: "gd-metadata-list-element", children: [_jsx("span", { title: element.title, children: element.title }), !_isEmpty(element.description) && (_jsxs(BubbleHoverTrigger, { className: "gd-metadata-list-icon", showDelay: 0, hideDelay: 0, children: [_jsx("div", { className: "gd-icon-circle-question" }), _jsx(Bubble, { className: "bubble-primary", arrowOffsets: ARROW_OFFSETS, alignPoints: ALIGN_POINTS, children: element.description })] }))] }, index)))] }));
|
|
18
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogBase.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DialogBase.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogBase.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAarD;;GAEG;AACH,eAAO,MAAM,UAAU,wDAgFrB,CAAC"}
|
package/esm/Dialog/DialogBase.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2020-2026 GoodData Corporation
|
|
3
|
-
import { memo, useCallback } from "react";
|
|
3
|
+
import { memo, useCallback, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { UiFocusManager } from "../@ui/UiFocusManager/UiFocusManager.js";
|
|
6
|
+
import { UiModalOwnerProvider, modalOwnerAttributes } from "../@ui/UiFocusManager/UiModalOwner.js";
|
|
6
7
|
import { defaultFocusCheckFn } from "../@ui/UiFocusManager/utils.js";
|
|
7
8
|
import { ScreenReaderToast } from "../Messages/toasts/ToastsCenter.js";
|
|
8
9
|
import { isElementSubmitButton, isElementTextInput } from "../utils/domUtilities.js";
|
|
@@ -32,5 +33,8 @@ export const DialogBase = memo(function DialogBase({ submitOnEnterKey, onCancel,
|
|
|
32
33
|
checkKeyHandler(event, "Escape", shouldCloseOnEscape ? onClose : onCancel);
|
|
33
34
|
}, [onCancel, onSubmit, onClose, submitOnEnterKey, shouldCloseOnEscape]);
|
|
34
35
|
const dialogClasses = cx("overlay", "gd-dialog", className);
|
|
35
|
-
|
|
36
|
+
const [dialog, setDialog] = useState(null);
|
|
37
|
+
const isAriaModal = !!accessibilityConfig?.isModal;
|
|
38
|
+
const content = (_jsxs("div", { className: dialogClasses, children: [displayCloseButton ? (_jsx(CloseButton, { onClose: onClose ?? onCancel, accessibilityConfig: accessibilityConfig })) : null, children] }));
|
|
39
|
+
return (_jsx(UiFocusManager, { enableFocusTrap: isModal, enableAutofocus: autofocusOnOpen ? { initialFocus, refocusKey } : false, enableReturnFocusOnUnmount: returnFocusAfterClose ? { returnFocusTo } : false, focusCheckFn: focusCheckFn, children: _jsxs("div", { ref: setDialog, id: accessibilityConfig?.dialogId, onKeyDown: handleKeyDown, "data-testid": dataTestId, role: "dialog", "aria-modal": accessibilityConfig?.isModal, "aria-label": accessibilityConfig?.title, "aria-labelledby": accessibilityConfig?.titleElementId, "aria-describedby": accessibilityConfig?.descriptionElementId, ...(isAriaModal ? modalOwnerAttributes : {}), children: [_jsx(ScreenReaderToast, {}), isAriaModal ? (_jsx(UiModalOwnerProvider, { modal: dialog, children: content })) : (content)] }) }));
|
|
36
40
|
});
|
package/esm/Dialog/EmbedInsightDialog/EmbedInsightDialogBase/components/NumericInput.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../../../../src/Dialog/EmbedInsightDialog/EmbedInsightDialogBase/components/NumericInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../../../../src/Dialog/EmbedInsightDialog/EmbedInsightDialogBase/components/NumericInput.tsx"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,kBAAkB,2CAqEzE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2020-
|
|
2
|
+
// (C) 2020-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { isEmpty } from "lodash-es";
|
|
6
5
|
import { FormattedMessage } from "react-intl";
|
|
7
6
|
import { v4 } from "uuid";
|
|
7
|
+
import { _isEmpty } from "@gooddata/util";
|
|
8
8
|
import { Bubble } from "../../../../Bubble/Bubble.js";
|
|
9
9
|
const VALID_INPUT = "^[0-9]+[.,]?[0-9]*$";
|
|
10
10
|
const bubbleAlignPoints = [{ align: "bl tl" }];
|
|
@@ -28,13 +28,13 @@ export function NumericInput({ value, onValueChanged }) {
|
|
|
28
28
|
if (val.match(VALID_INPUT)) {
|
|
29
29
|
onValueChanged(val);
|
|
30
30
|
}
|
|
31
|
-
else if (
|
|
31
|
+
else if (_isEmpty(val)) {
|
|
32
32
|
onValueChanged("");
|
|
33
33
|
}
|
|
34
34
|
}, [onValueChanged]);
|
|
35
35
|
const correctKeyPressed = useCallback((e) => {
|
|
36
36
|
const value = e.target.value.replace(/,/, ".");
|
|
37
|
-
setValidPressedButton((value.match(VALID_INPUT) ||
|
|
37
|
+
setValidPressedButton((value.match(VALID_INPUT) || _isEmpty(value)) && value.split(".").length <= 2);
|
|
38
38
|
}, []);
|
|
39
39
|
const onChanged = useCallback((e) => {
|
|
40
40
|
correctKeyPressed(e);
|