diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f6a8d798..6c30afc4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `operation-filterreset` - `toggler-pin-empty` - `toggler-pin-filled` +- `` + - simple placeholder element that can be used to display info about missing data +- `` + - `forceInline` property: force inline rendering +- `` + - `togglerSize`: replaces the deprecated `togglerLarge` property +- `: + - `searchListPredicate` property: Allows to filter the complete list of search options at once. + - Following optional BlueprintJs properties are forwarded now to override default behaviour: `noResults`, `createNewItemRenderer` and `itemRenderer` + - `isValidNewOption` property: Checks if an input string is or can be turned into a valid new option. + ### Fixed @@ -85,6 +96,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Focus outlines - we use again bold focus outlines for input elements - they are also used for clickable elements that are focused via keyboard (tab navigation) +- ``: + - border of the BlueprintJS `Tag` elements were fixed ### Changed @@ -105,11 +118,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `` - `` - `` and `` +- `` + - by default, if no searchPredicate or searchListPredicate is defined, the filtering is done via case-insensitive multi-word filtering. ### Deprecated - `` - `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"` +- `` + - `togglerLarge`: replaced by the more versatile `togglerSize` property +- `` + - `searchPredicate`: replaced by the, in some cases, more efficient `searchListPredicate` ## [25.0.0] - 2025-12-01 diff --git a/eslint.config.mjs b/eslint.config.mjs index 4dc59ed7e..b50d55fdf 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,11 +17,13 @@ const compat = new FlatCompat({ allConfig: js.configs.all }); -export default [...compat.extends( +const base = compat.extends( "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", -), { +); + +export default [...base, { plugins: { "@typescript-eslint": typescriptEslint, react, @@ -31,6 +33,9 @@ export default [...compat.extends( languageOptions: { parser: tsParser, + globals: { + window: "readonly", + } }, rules: { @@ -54,4 +59,4 @@ export default [...compat.extends( "no-console": "error", }, -}]; \ No newline at end of file +}]; diff --git a/package.json b/package.json index be2468159..1b97326e7 100644 --- a/package.json +++ b/package.json @@ -92,8 +92,8 @@ "lodash": "^4.18.1", "n3": "^1.26.0", "re-resizable": "^6.10.3", - "react": "^16.13.1", - "react-dom": "^16.14.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-flow-renderer": "9.7.4", "react-inlinesvg": "^3.0.3", "react-is": "^16.13.1", @@ -132,7 +132,7 @@ "@storybook/react-webpack5": "^8.6.14", "@storybook/test": "^8.6.14", "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^12.1.5", + "@testing-library/react": "^14.3.1", "@types/color": "^3.0.6", "@types/he": "^1.2.3", "@types/jest": "^30.0.0", @@ -153,6 +153,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^30.2.0", "jest-environment-jsdom": "^30.2.0", + "jest-fixed-jsdom": "^0.0.11", "jest-pnp-resolver": "^1.2.3", "lint-staged": "^15.5.2", "node-sass-package-importer": "^5.3.3", @@ -180,7 +181,7 @@ "react": ">=16" }, "resolutions": { - "**/@types/react": "^17.0.90", + "**/@types/react": "^18.2.0", "node-sass-package-importer/**/postcss": "^8.5.6", "string-width": "^4.2.3", "wrap-ansi": "^7.0.0", @@ -228,7 +229,7 @@ "testMatch": [ "/src/**/*(*.)@(spec|test).{js,jsx,ts,tsx}" ], - "testEnvironment": "jest-environment-jsdom", + "testEnvironment": "jest-fixed-jsdom", "transform": { "^.+\\.(js|jsx|ts|tsx)$": "babel-jest" }, diff --git a/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx b/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx index 811eef16a..68dd3412c 100644 --- a/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +++ b/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx @@ -4,14 +4,9 @@ import { OverlaysProvider } from "@blueprintjs/core"; import { Meta, StoryFn } from "@storybook/react"; import { helpersArgTypes } from "../../../.storybook/helpers"; -import { - ActivityControlWidget, - ActivityControlWidgetAction, - IconButton, - SimpleDialog, - Tag, - TagList, -} from "../../../index"; +import { IconButton, SimpleDialog, Tag, TagList } from "../../components"; + +import { ActivityControlWidget, ActivityControlWidgetAction } from "./ActivityControlWidget"; export default { title: "Cmem/ActivityControlWidget", diff --git a/src/cmem/ActivityControl/ActivityControlWidget.tsx b/src/cmem/ActivityControl/ActivityControlWidget.tsx index 319889e73..c063eb213 100644 --- a/src/cmem/ActivityControl/ActivityControlWidget.tsx +++ b/src/cmem/ActivityControl/ActivityControlWidget.tsx @@ -1,12 +1,5 @@ import React from "react"; -import {ValidIconName} from "../../components/Icon/canonicalIconNames"; -import {IconProps} from "../../components/Icon/Icon"; -import {TestIconProps} from "../../components/Icon/TestIcon"; -import {TestableComponent} from "../../components/interfaces"; -import {ProgressBarProps} from "../../components/ProgressBar/ProgressBar"; -import {SpinnerProps} from "../../components/Spinner/Spinner"; -import {CLASSPREFIX as eccgui} from "../../configuration/constants"; import { Card, ContextMenu, @@ -24,22 +17,29 @@ import { ProgressBar, Spinner, Tooltip, -} from "../../index"; +} from "../../components"; +import { ValidIconName } from "../../components/Icon/canonicalIconNames"; +import { IconProps } from "../../components/Icon/Icon"; +import { TestIconProps } from "../../components/Icon/TestIcon"; +import { TestableComponent } from "../../components/interfaces"; +import { ProgressBarProps } from "../../components/ProgressBar/ProgressBar"; +import { SpinnerProps } from "../../components/Spinner/Spinner"; +import { CLASSPREFIX as eccgui } from "../../configuration/constants"; export interface ActivityControlWidgetProps extends TestableComponent { /** * The label to be shown */ - label?: string | JSX.Element; + label?: string | React.JSX.Element; /** * Element that wraps around the label. * Default: `` */ - labelWrapper?: JSX.Element; + labelWrapper?: React.JSX.Element; /** * To add tags in addition to the widget status description */ - tags?: JSX.Element; + tags?: React.JSX.Element; /** * The progress bar parameters if it should be show by a progres bar */ @@ -83,7 +83,7 @@ export interface ActivityControlWidgetProps extends TestableComponent { /** * execution timer messages for waiting and running times. */ - timerExecutionMsg?: JSX.Element | null; + timerExecutionMsg?: React.JSX.Element | null; /** * additional actions that can serve as a complex component, positioned between the default actions and the context menu */ @@ -159,7 +159,7 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) { keepColors > {progressSpinnerFinishedIcon ? ( - React.cloneElement(progressSpinnerFinishedIcon as JSX.Element, { small, large: !small }) + React.cloneElement(progressSpinnerFinishedIcon as React.JSX.Element, { small, large: !small }) ) : ( any; // The error report - report: JSX.Element; + report: React.JSX.Element; // Value of the download button downloadButtonValue: string; // Value of the close button diff --git a/src/cmem/ActivityControl/SilkActivityControl.tsx b/src/cmem/ActivityControl/SilkActivityControl.tsx index 3997fe4e2..d4acac0e7 100644 --- a/src/cmem/ActivityControl/SilkActivityControl.tsx +++ b/src/cmem/ActivityControl/SilkActivityControl.tsx @@ -15,11 +15,11 @@ const progressBreakpointAnimation = 99; export interface SilkActivityControlProps extends TestableComponent { // The label of this activity - label: string | JSX.Element; + label: string | React.JSX.Element; /** * To add tags in addition to the widget status description */ - tags?: JSX.Element; + tags?: React.JSX.Element; // Initial state initialStatus?: SilkActivityStatusProps; // Register a function in order to receive callbacks @@ -80,7 +80,7 @@ export interface SilkActivityControlLayoutProps { // what type of progrss display should be uses, horizontal progress bar, circular spinner, or none of that visualization?: "none" | "progressbar" | "spinner"; // wrapper around label - labelWrapper?: JSX.Element; + labelWrapper?: React.JSX.Element; } const defaultLayout: SilkActivityControlLayoutProps = { @@ -94,7 +94,7 @@ interface IErrorReportAction { // The title of the error report modal title?: string; // The element that will be rendered in the modal, either as Markdown or object - renderReport: (report: string | SilkActivityExecutionReportProps) => JSX.Element; + renderReport: (report: string | SilkActivityExecutionReportProps) => React.JSX.Element; // What version of the report should be handed to the renderReport function, if false SilkActivityExecutionReportProps, if true the Markdown string renderMarkdown: boolean; // The function to fetch the error report. It returns undefined if something went wrong. diff --git a/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx b/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx index 26b214ab1..aa3462e35 100644 --- a/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +++ b/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx @@ -1,6 +1,8 @@ import React, { useState } from "react"; -import { Link, Spacing } from "../../index"; +import Link from "../../components/Link/Link"; +import Spacing from "../../components/Separation/Spacing"; +import InlineText from "../../components/Typography/InlineText"; export interface ContentBlobTogglerProps extends React.HTMLAttributes { /** @@ -31,6 +33,10 @@ export interface ContentBlobTogglerProps extends React.HTMLAttributes { + const handlerToggleView = (event: React.MouseEvent) => { event.preventDefault(); event.stopPropagation(); setViewState(!isExtended); }; - return ( + const tooglerDisplay = (
{!isExtended ? ( <> {previewContent} {enableToggler && ( <> - {" "}…{" "} + {" "} + …{" "} { + onClick={(e: React.MouseEvent) => { handlerToggleView(e); }} > @@ -76,11 +84,11 @@ export function ContentBlobToggler({ {fullviewContent} {enableToggler && (
- + {forceInline ? <> : } { + onClick={(e: React.MouseEvent) => { handlerToggleView(e); }} > @@ -92,4 +100,6 @@ export function ContentBlobToggler({ )}
); + + return forceInline ? {tooglerDisplay} : tooglerDisplay; } diff --git a/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx b/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx index 374bb6529..836526240 100644 --- a/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +++ b/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx @@ -1,6 +1,9 @@ import React from "react"; +import {ContentBlobToggler, ContentBlobTogglerProps} from "./ContentBlobToggler"; +import {Markdown} from "../markdown/Markdown"; +import {utils} from "../../common"; +import InlineText from "../../components/Typography/InlineText"; -import { ContentBlobToggler, ContentBlobTogglerProps, InlineText, Markdown, utils } from "./../../index"; export interface StringPreviewContentBlobTogglerProps extends Omit { @@ -31,7 +34,7 @@ export interface StringPreviewContentBlobTogglerProps * Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary. * This allows to add non-string elements to both the full-view content and the pure string content. */ - noTogglerContentSuffix?: JSX.Element; + noTogglerContentSuffix?: React.JSX.Element; /** * If only the first non-empty line should be shown in the preview. * This will in addition also be shortened according to `previewMaxLength`. @@ -54,6 +57,7 @@ export function StringPreviewContentBlobToggler({ allowedHtmlElementsInPreview, noTogglerContentSuffix, firstNonEmptyLineOnly, + ...otherContentBlobTogglerProps }: StringPreviewContentBlobTogglerProps) { // need to test `firstNonEmptyLineOnly` until property is removed const useOnlyTest: StringPreviewContentBlobTogglerProps["useOnly"] = firstNonEmptyLineOnly @@ -105,6 +109,7 @@ export function StringPreviewContentBlobToggler({ fullviewContent={fullviewContent} startExtended={startExtended} enableToggler={enableToggler} + {...otherContentBlobTogglerProps} /> ); } diff --git a/src/cmem/markdown/Markdown.tsx b/src/cmem/markdown/Markdown.tsx index 7544d8f95..1821f1ef5 100644 --- a/src/cmem/markdown/Markdown.tsx +++ b/src/cmem/markdown/Markdown.tsx @@ -8,8 +8,9 @@ import { remarkDefinitionList } from "remark-definition-list"; import remarkGfm from "remark-gfm"; import { PluggableList } from "unified"; +import { TestableComponent } from "../../components"; +import { HtmlContentBlock, HtmlContentBlockProps } from "../../components/Typography"; import { CLASSPREFIX as eccgui } from "../../configuration/constants"; -import { HtmlContentBlock, HtmlContentBlockProps, TestableComponent } from "../../index"; export interface MarkdownProps extends TestableComponent { children: string; diff --git a/src/cmem/react-flow/configuration/graph.ts b/src/cmem/react-flow/configuration/graph.ts index e7abf6028..73489798d 100644 --- a/src/cmem/react-flow/configuration/graph.ts +++ b/src/cmem/react-flow/configuration/graph.ts @@ -1,8 +1,7 @@ +import { NodeProps } from "react-flow-renderer"; import { EdgeBezier } from "./../../../extensions/react-flow/edges/EdgeBezier"; import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault"; import { GRAPH_NODE_TYPES } from "./typing"; -//import {ComponentType} from "react"; -//import {NodeProps} from "react-flow-renderer-lts"; const edgeTypes = { default: EdgeBezier, @@ -16,7 +15,7 @@ const edgeTypes = { danger: EdgeBezier, }; -const nodeTypes: Record*/> = { +const nodeTypes: Record> = { default: NodeDefault, graph: NodeDefault, class: NodeDefault, diff --git a/src/cmem/react-flow/configuration/linking.ts b/src/cmem/react-flow/configuration/linking.ts index 4a8326a78..9d00c8d88 100644 --- a/src/cmem/react-flow/configuration/linking.ts +++ b/src/cmem/react-flow/configuration/linking.ts @@ -2,8 +2,7 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep"; import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault"; import { StickyNoteNode } from "./../nodes/StickyNoteNode"; import { LINKING_NODE_TYPES } from "./typing"; -//import {ComponentType} from "react"; -//import {NodeProps} from "react-flow-renderer-lts"; +import {NodeProps} from "react-flow-renderer"; const edgeTypes = { default: EdgeStep, @@ -14,7 +13,7 @@ const edgeTypes = { danger: EdgeStep, }; -const nodeTypes: Record*/> = { +const nodeTypes: Record> = { default: NodeDefault, sourcepath: NodeDefault, targetpath: NodeDefault, diff --git a/src/cmem/react-flow/configuration/workflow.ts b/src/cmem/react-flow/configuration/workflow.ts index 5a8621a89..508e64076 100644 --- a/src/cmem/react-flow/configuration/workflow.ts +++ b/src/cmem/react-flow/configuration/workflow.ts @@ -2,8 +2,7 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep"; import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault"; import { StickyNoteNode } from "./../nodes/StickyNoteNode"; import { WORKFLOW_NODE_TYPES } from "./typing"; -//import {ComponentType} from "react"; -//import {NodeProps} from "react-flow-renderer-lts"; +import {NodeProps} from "react-flow-renderer"; const edgeTypes = { default: EdgeStep, @@ -12,7 +11,7 @@ const edgeTypes = { danger: EdgeStep, }; -const nodeTypes: Record*/> = { +const nodeTypes: Record> = { default: NodeDefault, dataset: NodeDefault, linking: NodeDefault, diff --git a/src/components/Accordion/AccordionItem.tsx b/src/components/Accordion/AccordionItem.tsx index 1c3b18a11..c63d6c6d7 100644 --- a/src/components/Accordion/AccordionItem.tsx +++ b/src/components/Accordion/AccordionItem.tsx @@ -18,7 +18,7 @@ export interface AccordionItemProps /** * header of accordion item */ - label: string | JSX.Element; + label: string | React.JSX.Element; /** * use full available width for content */ diff --git a/src/components/Accordion/Stories/AccordionItem.stories.tsx b/src/components/Accordion/Stories/AccordionItem.stories.tsx index 12e2bdc9b..54a4a4309 100644 --- a/src/components/Accordion/Stories/AccordionItem.stories.tsx +++ b/src/components/Accordion/Stories/AccordionItem.stories.tsx @@ -2,7 +2,7 @@ import React from "react"; import { LoremIpsum } from "react-lorem-ipsum"; import { Meta, StoryFn } from "@storybook/react"; -import { Accordion, AccordionItem, HtmlContentBlock } from "../../../../index"; +import { Accordion, AccordionItem, HtmlContentBlock } from "../../../components"; export default { title: "Components/Accordion/AccordionItem", diff --git a/src/components/Application/ApplicationSidebarNavigation.tsx b/src/components/Application/ApplicationSidebarNavigation.tsx index c4c5e977d..34a24d76a 100644 --- a/src/components/Application/ApplicationSidebarNavigation.tsx +++ b/src/components/Application/ApplicationSidebarNavigation.tsx @@ -4,14 +4,17 @@ import { SideNav as CarbonSideNav, SideNavProps as CarbonSideNavProps } from "@c import { CLASSPREFIX as eccgui } from "../../configuration/constants"; export interface ApplicationSidebarNavigationProps - extends Omit, - React.HTMLAttributes {} + extends Omit, React.HTMLAttributes { + children: React.ReactNode; + className?: string; + } export const ApplicationSidebarNavigation = ({ children, className = "", ...otherCarbonSideNavProps }: ApplicationSidebarNavigationProps) => { + return ( {!!depiction && ( <> - {depiction} + + {React.isValidElement(depiction) + ? depiction + : depiction instanceof HTMLElement + ? <>{depiction.outerHTML} + : depiction} + )} {!!prefix && ( diff --git a/src/components/Application/_header.scss b/src/components/Application/_header.scss index 9fef52717..218628ea5 100644 --- a/src/components/Application/_header.scss +++ b/src/components/Application/_header.scss @@ -52,19 +52,22 @@ $shell-header-icon-03: $eccgui-color-applicationheader-text !default; /// Item link $shell-header-link: $blue-60 !default; +/// Height +$shell-header-height: mini-units(8) !default; + // load library sub component @import "~@carbon/react/scss/components/ui-shell/header/index"; // tweak original layout .#{$prefix}--header { - height: mini-units(8); + height: $shell-header-height; } .#{$prefix}--header__action, .#{$prefix}--header__action.#{$prefix}--btn--icon-only { - width: mini-units(8); - height: mini-units(8); + width: $shell-header-height; + height: $shell-header-height; padding-block-start: 0; background-color: transparent; @@ -128,7 +131,7 @@ span.#{$prefix}--header__name { } .#{$prefix}--header__menu .#{$prefix}--header__menu-item { - height: mini-units(8); + height: $shell-header-height; } // tweak original colors (as long as config does not work properly) @@ -267,15 +270,15 @@ a.#{$prefix}--header__menu-item:focus > svg { // adjust position of all other modal dialogs .#{$ns}-dialog-container { - top: mini-units(8); - left: mini-units(8); - width: calc(100% - #{mini-units(8)}); - min-height: calc(100% - #{mini-units(8)}); + top: $shell-header-height; + left: $shell-header-height; + width: calc(100% - #{$shell-header-height}); + min-height: calc(100% - #{$shell-header-height}); } .#{$eccgui}-dialog__wrapper { - max-width: calc(100vw - #{mini-units(8)} - #{2 * $eccgui-size-block-whitespace}); - max-height: calc(100vh - #{mini-units(8)} - #{2 * $eccgui-size-block-whitespace}); + max-width: calc(100vw - #{$shell-header-height} - #{2 * $eccgui-size-block-whitespace}); + max-height: calc(100vh - #{$shell-header-height} - #{2 * $eccgui-size-block-whitespace}); margin: 0; } } diff --git a/src/components/Application/stories/ColorPalettes.stories.tsx b/src/components/Application/stories/ColorPalettes.stories.tsx index ecee1e8df..e31d98d8b 100644 --- a/src/components/Application/stories/ColorPalettes.stories.tsx +++ b/src/components/Application/stories/ColorPalettes.stories.tsx @@ -1,8 +1,8 @@ import React from "react"; -import { render } from "react-dom"; import { loremIpsum } from "react-lorem-ipsum"; import { Meta, StoryFn } from "@storybook/react"; import Color from "color"; +import { createRoot } from 'react-dom/client'; import CssCustomProperties from "./../../../common/utils/CssCustomProperties"; import { @@ -194,10 +194,11 @@ const ColorPaletteConfigurator = ({ }, 0 as number); const warningsTarget = document.getElementById("sumWarnings"); if (warningsTarget) { + const warningsRoot = createRoot(warningsTarget) if (warnings > 0) { - render({warnings}, warningsTarget); + warningsRoot.render({warnings}); } else { - render(<>, warningsTarget); + warningsRoot.render(<>); } } } diff --git a/src/components/AutoSuggestion/AutoSuggestion.tsx b/src/components/AutoSuggestion/AutoSuggestion.tsx index 057164e29..9e956692b 100644 --- a/src/components/AutoSuggestion/AutoSuggestion.tsx +++ b/src/components/AutoSuggestion/AutoSuggestion.tsx @@ -124,10 +124,10 @@ export interface CodeAutocompleteFieldProps { */ useTabForCompletions?: boolean; /** An additional element that is put to the left side of the input field */ - leftElement?: JSX.Element | null; + leftElement?: React.JSX.Element | null; /** An additional element that is put to the right side of the input field */ - rightElement?: JSX.Element | null; + rightElement?: React.JSX.Element | null; /** Placeholder tobe shown when no text has been entered, yet. */ placeholder?: string; /** If the horizontal scrollbars should be shown. */ @@ -214,7 +214,7 @@ export const CodeAutocompleteField = ({ CodeAutocompleteFieldSuggestionWithReplacementInfo | undefined >(undefined); const [cm, setCM] = React.useState(); - const currentCm = React.useRef(); + const currentCm = React.useRef(undefined); currentCm.current = cm; const isFocused = React.useRef(false); const autoSuggestionDivRef = React.useRef(null); @@ -361,7 +361,7 @@ export const CodeAutocompleteField = ({ return { fromOffset, toOffset }; }; - const inputActionsDisplayed = React.useCallback((node) => { + const inputActionsDisplayed = React.useCallback((node:any) => { if (!node) return; const width = node.offsetWidth; const slCodeEditor = node.parentElement.getElementsByClassName(`${eccgui}-singlelinecodeeditor`); diff --git a/src/components/AutoSuggestion/AutoSuggestionList.tsx b/src/components/AutoSuggestion/AutoSuggestionList.tsx index ff524fad3..eb6889cb9 100644 --- a/src/components/AutoSuggestion/AutoSuggestionList.tsx +++ b/src/components/AutoSuggestion/AutoSuggestionList.tsx @@ -88,7 +88,7 @@ export const AutoSuggestionList = ({ }: AutoSuggestionListProps) => { const [hoveredItem, setHoveredItem] = React.useState(undefined); // Refs of list items - const [refs] = React.useState[]>([]); + const [refs] = React.useState[]>([]); const dropdownRef = React.useRef(null); const generateRef = (index: number) => { if (!refs[index]) { diff --git a/src/components/AutocompleteField/AutoCompleteField.tsx b/src/components/AutocompleteField/AutoCompleteField.tsx index 02f6a5613..8b64610e2 100644 --- a/src/components/AutocompleteField/AutoCompleteField.tsx +++ b/src/components/AutocompleteField/AutoCompleteField.tsx @@ -64,7 +64,7 @@ export interface SuggestFieldProps { query: string, modifiers: SuggestFieldItemRendererModifierProps, handleClick: () => any - ): string | JSX.Element; + ): string | React.JSX.Element; /** Renders the string that should be displayed in the input field after the item has been selected. */ @@ -122,7 +122,7 @@ export interface SuggestFieldProps { query: string, modifiers: SuggestFieldItemRendererModifierProps, handleClick: React.MouseEventHandler - ) => JSX.Element | undefined; + ) => React.JSX.Element | undefined; /** If the new item option will always be shown as the first entry in the suggestion list, else it will be the last entry. * @default false @@ -160,19 +160,10 @@ export interface SuggestFieldProps { loadMoreResults?: () => Promise; } -SuggestField.defaultProps = { - autoFocus: false, - disabled: false, - onlyDropdownWithQuery: false, // FIXME: this should be `true` by default, otherwise similarity to `