@eccenca/gui-elements 23.0.0-rc.3 → 23.0.0-rc.5
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/CHANGELOG.md +15 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +2 -1
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/common/utils/colorDecideContrastvalue.js +18 -0
- package/dist/cjs/common/utils/colorDecideContrastvalue.js.map +1 -0
- package/dist/cjs/common/utils/getColorConfiguration.js +9 -5
- package/dist/cjs/common/utils/getColorConfiguration.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +18 -16
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +15 -2
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +12 -14
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Breadcrumb/BreadcrumbList.js +28 -8
- package/dist/cjs/components/Breadcrumb/BreadcrumbList.js.map +1 -1
- package/dist/cjs/components/Card/Card.js +1 -1
- package/dist/cjs/components/Card/CardContent.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +3 -3
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/Form/FieldItem.js +4 -1
- package/dist/cjs/components/Form/FieldItem.js.map +1 -1
- package/dist/cjs/components/Form/FieldItemRow.js +7 -6
- package/dist/cjs/components/Form/FieldItemRow.js.map +1 -1
- package/dist/cjs/components/Grid/Grid.js +1 -1
- package/dist/cjs/components/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/Grid/GridColumn.js +1 -1
- package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
- package/dist/cjs/components/Grid/GridRow.js.map +1 -1
- package/dist/cjs/components/HoverToggler/HoverToggler.js +33 -0
- package/dist/cjs/components/HoverToggler/HoverToggler.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +45 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/InteractionGate/InteractionGate.js +67 -0
- package/dist/cjs/components/InteractionGate/InteractionGate.js.map +1 -0
- package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +6 -6
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js +4 -2
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tabs/Tab.js +2 -1
- package/dist/cjs/components/Tabs/Tab.js.map +1 -1
- package/dist/cjs/components/Tabs/TabPanel.js +29 -0
- package/dist/cjs/components/Tabs/TabPanel.js.map +1 -0
- package/dist/cjs/components/Tag/Tag.js +2 -1
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/Tag/TagList.js +1 -1
- package/dist/cjs/components/Tag/TagList.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +3 -0
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +9 -2
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Tree/Tree.js +37 -0
- package/dist/cjs/components/Tree/Tree.js.map +1 -0
- package/dist/cjs/index.js +14 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +2 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/common/utils/colorDecideContrastvalue.js +14 -0
- package/dist/esm/common/utils/colorDecideContrastvalue.js.map +1 -0
- package/dist/esm/common/utils/getColorConfiguration.js +9 -5
- package/dist/esm/common/utils/getColorConfiguration.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +35 -33
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +25 -2
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +18 -20
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Breadcrumb/BreadcrumbList.js +9 -8
- package/dist/esm/components/Breadcrumb/BreadcrumbList.js.map +1 -1
- package/dist/esm/components/Card/Card.js +1 -1
- package/dist/esm/components/Card/CardContent.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +3 -3
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/Form/FieldItem.js +4 -1
- package/dist/esm/components/Form/FieldItem.js.map +1 -1
- package/dist/esm/components/Form/FieldItemRow.js +7 -6
- package/dist/esm/components/Form/FieldItemRow.js.map +1 -1
- package/dist/esm/components/Grid/Grid.js +1 -1
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Grid/GridColumn.js +1 -1
- package/dist/esm/components/Grid/GridColumn.js.map +1 -1
- package/dist/esm/components/Grid/GridRow.js.map +1 -1
- package/dist/esm/components/HoverToggler/HoverToggler.js +37 -0
- package/dist/esm/components/HoverToggler/HoverToggler.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +45 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/InteractionGate/InteractionGate.js +54 -0
- package/dist/esm/components/InteractionGate/InteractionGate.js.map +1 -0
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +7 -7
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +4 -2
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +2 -1
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabPanel.js +35 -0
- package/dist/esm/components/Tabs/TabPanel.js.map +1 -0
- package/dist/esm/components/Tag/Tag.js +2 -1
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/Tag/TagList.js +1 -1
- package/dist/esm/components/Tag/TagList.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +3 -0
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +9 -2
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tree/Tree.js +40 -0
- package/dist/esm/components/Tree/Tree.js.map +1 -0
- package/dist/esm/index.js +10 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +1 -0
- package/dist/types/cmem/markdown/Markdown.d.ts +1 -2
- package/dist/types/common/utils/colorDecideContrastvalue.d.ts +9 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +7 -1
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +3 -3
- package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +1 -1
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +1 -1
- package/dist/types/components/Card/CardContent.d.ts +2 -2
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +3 -1
- package/dist/types/components/Form/FieldItem.d.ts +6 -3
- package/dist/types/components/Form/FieldItemRow.d.ts +11 -3
- package/dist/types/components/Grid/Grid.d.ts +6 -1
- package/dist/types/components/Grid/GridColumn.d.ts +8 -1
- package/dist/types/components/Grid/GridRow.d.ts +7 -1
- package/dist/types/components/HoverToggler/HoverToggler.d.ts +24 -0
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/InteractionGate/InteractionGate.d.ts +28 -0
- package/dist/types/components/Notification/Notification.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +21 -4
- package/dist/types/components/Spinner/Spinner.d.ts +7 -1
- package/dist/types/components/Switch/Switch.d.ts +5 -1
- package/dist/types/components/Tabs/TabPanel.d.ts +21 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +12 -1
- package/dist/types/components/Tree/Tree.d.ts +43 -0
- package/dist/types/index.d.ts +6 -2
- package/package.json +3 -2
- package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +2 -1
- package/src/cmem/markdown/Markdown.tsx +1 -1
- package/src/common/utils/colorDecideContrastvalue.ts +28 -0
- package/src/common/utils/getColorConfiguration.ts +10 -5
- package/src/components/AutoSuggestion/AutoSuggestion.scss +16 -10
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +81 -52
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +7 -3
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -3
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +2 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +10 -8
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +15 -4
- package/src/components/Breadcrumb/BreadcrumbList.tsx +10 -8
- package/src/components/Breadcrumb/breadcrumb.scss +4 -0
- package/src/components/Breadcrumb/stories/BreadcrumbList.stories.tsx +1 -0
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardContent.tsx +2 -2
- package/src/components/ContextOverlay/ContextMenu.tsx +4 -0
- package/src/components/Form/FieldItem.tsx +6 -3
- package/src/components/Form/FieldItemRow.tsx +28 -6
- package/src/components/Form/form.scss +6 -0
- package/src/components/Grid/Grid.tsx +9 -3
- package/src/components/Grid/GridColumn.tsx +10 -2
- package/src/components/Grid/GridRow.tsx +8 -1
- package/src/components/HoverToggler/HoverToggler.stories.tsx +20 -0
- package/src/components/HoverToggler/HoverToggler.tsx +58 -0
- package/src/components/HoverToggler/hovertoggler.scss +45 -0
- package/src/components/Icon/canonicalIconNames.tsx +58 -0
- package/src/components/InteractionGate/InteractionGate.stories.tsx +32 -0
- package/src/components/InteractionGate/InteractionGate.tsx +76 -0
- package/src/components/InteractionGate/interactiongate.scss +11 -0
- package/src/components/Link/link.scss +9 -0
- package/src/components/Notification/Notification.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +22 -6
- package/src/components/SimpleTable/simpletable.scss +62 -2
- package/src/components/Spinner/Spinner.tsx +13 -5
- package/src/components/Spinner/spinner.scss +14 -0
- package/src/components/Switch/Switch.tsx +10 -5
- package/src/components/Tabs/Tab.tsx +2 -1
- package/src/components/Tabs/TabPanel.tsx +43 -0
- package/src/components/Tabs/stories/TabPanel.stories.tsx +21 -0
- package/src/components/Tabs/tabs.scss +1 -5
- package/src/components/Tag/Tag.tsx +2 -1
- package/src/components/Tag/TagList.tsx +1 -1
- package/src/components/Tag/tag.scss +1 -0
- package/src/components/TextField/TextField.tsx +4 -0
- package/src/components/TextField/stories/TextField.stories.tsx +1 -0
- package/src/components/TextField/textfield.scss +25 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -7
- package/src/components/Tooltip/Tooltip.tsx +24 -1
- package/src/components/Tooltip/tooltip.scss +4 -0
- package/src/components/Tree/Tree.stories.tsx +63 -0
- package/src/components/Tree/Tree.tsx +61 -0
- package/src/components/Tree/tree.scss +28 -0
- package/src/includes/carbon-components/_variables.scss +3 -1
- package/src/index.scss +5 -2
- package/src/index.ts +16 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/** Valid icon names. */
|
|
3
|
-
export declare type ValidIconName = "application-dataintegration" | "application-homepage" | "application-useraccount" | "application-warning" | "application-mapping" | "application-explore" | "application-vocabularies" | "application-queries" | "application-legacygui" | "application-activities" | "module-timetracker" | "module-accesscontrol" | "module-annotation" | "module-dashboard" | "module-search" | "module-visualization" | "module-reports" | "module-thesauri" | "module-linkedrules" | "module-integrations" | "module-gdprsearch" | "toggler-showmore" | "toggler-showless" | "toggler-moveright" | "toggler-moveleft" | "toggler-maximize" | "toggler-minimize" | "toggler-tree" | "navigation-back" | "navigation-forth" | "navigation-close" | "navigation-jump" | "navigation-last" | "navigation-previous" | "navigation-next" | "navigation-first" | "item-moremenu" | "item-vertmenu" | "item-viewdetails" | "item-clone" | "item-edit" | "item-evaluation" | "item-execution" | "item-info" | "item-remove" | "item-add-artefact" | "item-launch" | "item-download" | "item-question" | "item-comment" | "item-copy" | "item-save" | "item-start" | "item-stop" | "item-reload" | "item-shuffle" | "item-draggable" | "operation-search" | "operation-clear" | "operation-undo" | "operation-redo" | "operation-logout" | "operation-filter" | "operation-filteredit" | "operation-comparison" | "operation-transform" | "operation-aggregation" | "operation-commit" | "operation-sharelink" | "data-sourcepath" | "data-targetpath" | "list-sort" | "list-sortasc" | "list-sortdesc" | "state-info" | "state-success" | "state-warning" | "state-danger" | "state-unchecked" | "state-checked" | "state-checkedsimple" | "state-partlychecked" | "artefact-project" | "artefact-workflow" | "artefact-dataset" | "artefact-dataset-csv" | "artefact-dataset-multicsv" | "artefact-dataset-sparkview" | "artefact-dataset-sqlendpoint" | "artefact-dataset-jdbc" | "artefact-dataset-xml" | "artefact-dataset-json" | "artefact-dataset-excel" | "artefact-dataset-file" | "artefact-dataset-eccencadataplatform" | "artefact-dataset-sparqlendpoint" | "artefact-dataset-neo4j" | "artefact-transform" | "artefact-linking" | "artefact-task" | "artefact-customtask" | "artefact-file" | "artefact-embedded" | "artefact-remote" | "artefact-deprecated" | "artefact-uncategorized" | "artefact-rawdata" | "artefact-report" | "activity-error-report" | "select-caret" | "linked-item" | "operation-auto-graph-layout" | "unlinked-item" | "write-protected" | "undefined" | "Undefined";
|
|
3
|
+
export declare type ValidIconName = "application-dataintegration" | "application-homepage" | "application-useraccount" | "application-warning" | "application-mapping" | "application-explore" | "application-vocabularies" | "application-queries" | "application-legacygui" | "application-activities" | "module-timetracker" | "module-accesscontrol" | "module-annotation" | "module-dashboard" | "module-search" | "module-visualization" | "module-reports" | "module-thesauri" | "module-linkedrules" | "module-integrations" | "module-gdprsearch" | "toggler-showmore" | "toggler-showless" | "toggler-moveright" | "toggler-moveleft" | "toggler-maximize" | "toggler-minimize" | "toggler-tree" | "navigation-back" | "navigation-forth" | "navigation-close" | "navigation-jump" | "navigation-last" | "navigation-previous" | "navigation-next" | "navigation-first" | "item-moremenu" | "item-vertmenu" | "item-viewdetails" | "item-clone" | "item-edit" | "item-evaluation" | "item-execution" | "item-info" | "item-remove" | "item-add-artefact" | "item-launch" | "item-download" | "item-upload" | "item-question" | "item-comment" | "item-copy" | "item-save" | "item-start" | "item-stop" | "item-reload" | "item-reset" | "item-shuffle" | "item-draggable" | "item-settings" | "operation-search" | "operation-clear" | "operation-undo" | "operation-redo" | "operation-logout" | "operation-filter" | "operation-filteredit" | "operation-comparison" | "operation-transform" | "operation-aggregation" | "operation-commit" | "operation-sharelink" | "data-sourcepath" | "data-targetpath" | "list-sort" | "list-sortasc" | "list-sortdesc" | "state-info" | "state-success" | "state-warning" | "state-danger" | "state-unchecked" | "state-checked" | "state-checkedsimple" | "state-partlychecked" | "state-declined" | "state-confirmed" | "artefact-project" | "artefact-workflow" | "artefact-dataset" | "artefact-dataset-csv" | "artefact-dataset-multicsv" | "artefact-dataset-sparkview" | "artefact-dataset-sqlendpoint" | "artefact-dataset-jdbc" | "artefact-dataset-xml" | "artefact-dataset-json" | "artefact-dataset-excel" | "artefact-dataset-file" | "artefact-dataset-eccencadataplatform" | "artefact-dataset-sparqlendpoint" | "artefact-dataset-neo4j" | "artefact-transform" | "artefact-linking" | "artefact-task" | "artefact-customtask" | "artefact-file" | "artefact-embedded" | "artefact-remote" | "artefact-deprecated" | "artefact-uncategorized" | "artefact-rawdata" | "artefact-report" | "artefact-commit" | "activity-error-report" | "select-caret" | "linked-item" | "operation-auto-graph-layout" | "unlinked-item" | "write-protected" | "settings" | "favorite-empty" | "favorite-filled" | "undefined" | "Undefined";
|
|
4
4
|
export interface IconSized {
|
|
5
5
|
small: (props: any) => JSX.Element | null;
|
|
6
6
|
normal: (props: any) => JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "wicg-inert";
|
|
3
|
+
import { SpinnerProps } from "./../Spinner/Spinner";
|
|
4
|
+
export interface InteractionGateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "inert"> {
|
|
5
|
+
/**
|
|
6
|
+
* Prevent interaction with sub elements and narrow them in their visibility.
|
|
7
|
+
*/
|
|
8
|
+
inert?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Displays a spinner centered over the sub element.
|
|
11
|
+
*/
|
|
12
|
+
showSpinner?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Configure the included `<Spinner />` element.
|
|
15
|
+
*/
|
|
16
|
+
spinnerProps?: SpinnerProps;
|
|
17
|
+
/**
|
|
18
|
+
* Do not use own wrapper element to set the position of the spinner element, if used.
|
|
19
|
+
* Use the positioning of the parent container.
|
|
20
|
+
*/
|
|
21
|
+
useParentPositioning?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Wrap content that need to be blocked from user interactions
|
|
25
|
+
* It also has options to display a spinner as overlay.
|
|
26
|
+
*/
|
|
27
|
+
declare function InteractionGate({ children, className, inert, showSpinner, spinnerProps, useParentPositioning, ...otherProps }: InteractionGateProps): JSX.Element;
|
|
28
|
+
export default InteractionGate;
|
|
@@ -45,7 +45,7 @@ export interface NotificationProps extends Omit<BlueprintToastProps, "message" |
|
|
|
45
45
|
/**
|
|
46
46
|
* Icon used as depiction that is displayed with the notification.
|
|
47
47
|
*/
|
|
48
|
-
iconName?: ValidIconName;
|
|
48
|
+
iconName?: ValidIconName | null;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Displays a notification message, optionally combined with depiction and further action buttons.
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { PaginationProps as CarbonPaginationProps } from "carbon-components-react";
|
|
3
|
+
interface PaginationProps extends CarbonPaginationProps {
|
|
4
|
+
/**
|
|
5
|
+
Hide the select option to set how many items per page are displayed.
|
|
6
|
+
*/
|
|
7
|
+
hidePageSizeConfiguration?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
Hide info about the item numbers that are currently displayed.
|
|
10
|
+
*/
|
|
11
|
+
hideInfoText?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
Hide select box to switch between pages.
|
|
14
|
+
*/
|
|
15
|
+
hidePageSelect?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
Hide buttons to switch beteen nex/prev pages.
|
|
18
|
+
*/
|
|
19
|
+
hideNavigationArrows?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare function Pagination({ className, hidePageSizeConfiguration, hideInfoText, hidePageSelect, hideNavigationArrows, ...otherProps }: PaginationProps): JSX.Element;
|
|
3
22
|
interface IPaginationDetails {
|
|
4
23
|
total: number;
|
|
5
24
|
current: number;
|
|
@@ -9,9 +28,7 @@ interface IPaginationDetails {
|
|
|
9
28
|
interface IPaginationOptions {
|
|
10
29
|
initialPageSize?: number;
|
|
11
30
|
pageSizes?: number[];
|
|
12
|
-
presentation?:
|
|
13
|
-
hideInfoText?: boolean;
|
|
14
|
-
};
|
|
31
|
+
presentation?: Omit<PaginationProps, "onChange" | "totalItems" | "pageSizes" | "page" | "pageSize">;
|
|
15
32
|
}
|
|
16
33
|
export declare const usePagination: ({ pageSizes, presentation, initialPageSize, }: IPaginationOptions) => readonly [IPaginationDetails, JSX.Element, (total: number) => void];
|
|
17
34
|
export default Pagination;
|
|
@@ -13,7 +13,13 @@ export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<Bluep
|
|
|
13
13
|
size?: SpinnerSize;
|
|
14
14
|
stroke?: SpinnerStroke;
|
|
15
15
|
delay?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Includes a backdrop behind the spinner that narrows visibility of the area behind the spinner.
|
|
18
|
+
* This option only works with "local" spinners, for "inline" spinners there is no backdrop, "global" spinners always have backdrops.
|
|
19
|
+
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or soe equivalent CSS rule.
|
|
20
|
+
*/
|
|
21
|
+
showLocalBackdrop?: boolean;
|
|
16
22
|
}
|
|
17
23
|
declare function Spinner({ className, color, description, // currently unsupported (FIXME)
|
|
18
|
-
position, size, stroke, delay, ...otherProps }: SpinnerProps): JSX.Element | null;
|
|
24
|
+
position, size, stroke, showLocalBackdrop, delay, ...otherProps }: SpinnerProps): JSX.Element | null;
|
|
19
25
|
export default Spinner;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SwitchProps } from "@blueprintjs/core";
|
|
3
|
+
interface Props extends Omit<SwitchProps, "onChange"> {
|
|
4
|
+
onChange?: (value: boolean) => any;
|
|
5
|
+
}
|
|
6
|
+
declare function Switch({ onChange, ...otherProps }: Props): JSX.Element;
|
|
3
7
|
declare const _default: React.MemoExoticComponent<typeof Switch>;
|
|
4
8
|
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Addicional CSS class name.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* `id` of the tab element that is connected to this panel content.
|
|
9
|
+
*/
|
|
10
|
+
labelledBy?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Tab panel is not displayed.
|
|
13
|
+
*/
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Element to display the content related to a tab.
|
|
18
|
+
* This could be used if `<Tabs />` is used in uncontrolled mode.
|
|
19
|
+
*/
|
|
20
|
+
declare function TabPanel({ children, className, labelledBy, hidden, ...otherDivProps }: TabPanelProps): JSX.Element;
|
|
21
|
+
export default TabPanel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Tooltip2Props as BlueprintTooltipProps } from "@blueprintjs/popover2";
|
|
3
|
+
import { MarkdownParserProps } from "./../../cmem/markdown/Markdown";
|
|
3
4
|
export interface TooltipProps extends Omit<BlueprintTooltipProps, "position"> {
|
|
4
5
|
/**
|
|
5
6
|
* Add dotted underline as visual indication to the target that a tooltip is attached.
|
|
@@ -14,6 +15,16 @@ export interface TooltipProps extends Omit<BlueprintTooltipProps, "position"> {
|
|
|
14
15
|
* The tolltip will be attached to this element when it is hovered.
|
|
15
16
|
*/
|
|
16
17
|
children: React.ReactNode | React.ReactNode[];
|
|
18
|
+
/**
|
|
19
|
+
* A regular expression that when it matches against the tooltip text, enables the tooltip to be rendered as Markdown.
|
|
20
|
+
* This only works if the tooltip content is a string.
|
|
21
|
+
* Set to `false` to turn off Markdown rendering completely.
|
|
22
|
+
*/
|
|
23
|
+
markdownEnabler?: false | string;
|
|
24
|
+
/**
|
|
25
|
+
* Set properties for the Markdown parser
|
|
26
|
+
*/
|
|
27
|
+
markdownProps?: Omit<MarkdownParserProps, "children">;
|
|
17
28
|
}
|
|
18
|
-
declare function Tooltip({ children, content, className, size, addIndicator, ...otherProps }: TooltipProps): JSX.Element;
|
|
29
|
+
declare function Tooltip({ children, content, className, size, addIndicator, markdownEnabler, markdownProps, ...otherProps }: TooltipProps): JSX.Element;
|
|
19
30
|
export default Tooltip;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tree as BlueprintTree, TreeProps as BlueprintTreeProps, TreeNode as BlueprintTreeNode, TreeNodeInfo as BlueprintTreeNodeInfo } from "@blueprintjs/core";
|
|
3
|
+
import { IconProps } from "./../Icon/Icon";
|
|
4
|
+
export interface TreeNodeInfo<T = {}> extends Omit<BlueprintTreeNodeInfo<T>, "childNodes" | "icon"> {
|
|
5
|
+
/**
|
|
6
|
+
* Child tree nodes of this node.
|
|
7
|
+
*/
|
|
8
|
+
childNodes?: Array<TreeNodeInfo<T>>;
|
|
9
|
+
/**
|
|
10
|
+
* `<Icon />` element to render next to the node's label.
|
|
11
|
+
*/
|
|
12
|
+
icon?: React.ReactElement<IconProps>;
|
|
13
|
+
}
|
|
14
|
+
export interface TreeNodeProps<T = {}> extends TreeNodeInfo<T> {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
contentRef?: (node: TreeNode<T>, element: HTMLDivElement | null) => void;
|
|
17
|
+
depth: number;
|
|
18
|
+
key?: string | number;
|
|
19
|
+
onClick?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
20
|
+
onCollapse?: (node: TreeNode<T>, e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
21
|
+
onContextMenu?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
22
|
+
onDoubleClick?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
23
|
+
onExpand?: (node: TreeNode<T>, e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
24
|
+
onMouseEnter?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
onMouseLeave?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
26
|
+
path: number[];
|
|
27
|
+
}
|
|
28
|
+
export declare class TreeNode<T = {}> extends BlueprintTreeNode<TreeNodeProps<T>> {
|
|
29
|
+
}
|
|
30
|
+
export declare class TreeNodeShadow<T = {}> extends React.Component<TreeNodeProps<T>> {
|
|
31
|
+
}
|
|
32
|
+
export interface TreeProps<T = {}> extends Omit<BlueprintTreeProps<T>, "contents"> {
|
|
33
|
+
/**
|
|
34
|
+
* Tree contents.
|
|
35
|
+
*/
|
|
36
|
+
contents: ReadonlyArray<TreeNodeInfo<T>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Tree component to display a tree structure.
|
|
40
|
+
* Have a look to the underlaying [BlueprintJS Tree](https://blueprintjs.com/docs/#core/components/tree) component for examples how to use handlers.
|
|
41
|
+
* Use only our `<Icon />` elements in the tree nodes!
|
|
42
|
+
*/
|
|
43
|
+
export declare const Tree: typeof BlueprintTree;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import Highlighter from "./components/Typography/Highlighter";
|
|
|
19
19
|
import Grid from "./components/Grid/Grid";
|
|
20
20
|
import GridRow from "./components/Grid/GridRow";
|
|
21
21
|
import GridColumn from "./components/Grid/GridColumn";
|
|
22
|
+
import { HoverToggler } from "./components/HoverToggler/HoverToggler";
|
|
22
23
|
import WorkspaceContent from "./components/Workspace/WorkspaceContent";
|
|
23
24
|
import WorkspaceMain from "./components/Workspace/WorkspaceMain";
|
|
24
25
|
import WorkspaceSide from "./components/Workspace/WorkspaceSide";
|
|
@@ -32,6 +33,7 @@ import RadioButton from "./components/RadioButton/RadioButton";
|
|
|
32
33
|
import Tabs from "./components/Tabs/Tabs";
|
|
33
34
|
import Tab from "./components/Tabs/Tab";
|
|
34
35
|
import TabTitle from "./components/Tabs/TabTitle";
|
|
36
|
+
import TabPanel from "./components/Tabs/TabPanel";
|
|
35
37
|
import TextField from "./components/TextField/TextField";
|
|
36
38
|
import TextArea from "./components/TextField/TextArea";
|
|
37
39
|
import SearchField from "./components/TextField/SearchField";
|
|
@@ -77,6 +79,7 @@ import Accordion from "./components/Accordion/Accordion";
|
|
|
77
79
|
import AccordionItem from "./components/Accordion/AccordionItem";
|
|
78
80
|
import Link from "./components/Link/Link";
|
|
79
81
|
import Spinner from "./components/Spinner/Spinner";
|
|
82
|
+
import InteractionGate from "./components/InteractionGate/InteractionGate";
|
|
80
83
|
import { PropertyName, PropertyValue, PropertyValuePair, PropertyValueList } from "./components/PropertyValuePair";
|
|
81
84
|
import * as TypographyClassNames from "./components/Typography/classnames";
|
|
82
85
|
import { ProgressBar } from "./components/ProgressBar/ProgressBar";
|
|
@@ -90,9 +93,10 @@ declare const HelperClasses: {
|
|
|
90
93
|
};
|
|
91
94
|
declare const Utilities: {
|
|
92
95
|
openInNewTab: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, handler?: ((e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined, url?: string | undefined) => void;
|
|
96
|
+
decideContrastColorValue: ({ testColor, lightColor, darkColor }: import("./common/utils/colorDecideContrastvalue").decideContrastColorValueProps) => string;
|
|
93
97
|
};
|
|
94
|
-
export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select,
|
|
95
|
-
|
|
98
|
+
export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TabPanel, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, HoverToggler, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, InteractionGate, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
|
|
99
|
+
export * from "./components/Tree/Tree";
|
|
96
100
|
export * from "./cmem";
|
|
97
101
|
export * from "./extensions";
|
|
98
102
|
export * from "./components/interfaces";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "23.0.0-rc.
|
|
4
|
+
"version": "23.0.0-rc.5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -87,7 +87,8 @@
|
|
|
87
87
|
"remark-gfm": "^3.0.0",
|
|
88
88
|
"remark-parse": "^10.0.0",
|
|
89
89
|
"reset-css": "^5.0.1",
|
|
90
|
-
"unified": "^10.1.1"
|
|
90
|
+
"unified": "^10.1.1",
|
|
91
|
+
"wicg-inert": "^3.1.2"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
94
|
"@babel/core": "7.9.0",
|
|
@@ -3,8 +3,10 @@ export interface IActivityStatus {
|
|
|
3
3
|
project?: string;
|
|
4
4
|
// Optional task ID
|
|
5
5
|
task?: string;
|
|
6
|
-
// The activity
|
|
6
|
+
// The activity ID
|
|
7
7
|
activity: string;
|
|
8
|
+
// Human-readable activity label
|
|
9
|
+
activityLabel: string
|
|
8
10
|
// If the activity is currently running
|
|
9
11
|
isRunning: boolean;
|
|
10
12
|
// If the activity has failed
|
|
@@ -177,7 +177,8 @@ export function ActivityControlWidget(props: IActivityControlProps) {
|
|
|
177
177
|
disabled={action.disabled}
|
|
178
178
|
hasStateWarning={action.hasStateWarning}
|
|
179
179
|
tooltipProps={{
|
|
180
|
-
hoverOpenDelay: 200
|
|
180
|
+
hoverOpenDelay: 200,
|
|
181
|
+
placement: "bottom"
|
|
181
182
|
}}
|
|
182
183
|
/>
|
|
183
184
|
);
|
|
@@ -8,7 +8,7 @@ import React from "react";
|
|
|
8
8
|
import { HtmlContentBlock } from "../../index";
|
|
9
9
|
import { PluggableList } from "react-markdown/lib/react-markdown";
|
|
10
10
|
|
|
11
|
-
interface MarkdownParserProps {
|
|
11
|
+
export interface MarkdownParserProps {
|
|
12
12
|
children: string;
|
|
13
13
|
// allow HTML as partial content, otherwise escape HTML tags (pls use with caution)
|
|
14
14
|
allowHtml?: boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Color from "color";
|
|
2
|
+
|
|
3
|
+
export type colorValue = Color | string;
|
|
4
|
+
|
|
5
|
+
export interface decideContrastColorValueProps {
|
|
6
|
+
// The color that is used to test if it need a light or dark color as contrast value.
|
|
7
|
+
testColor: colorValue;
|
|
8
|
+
// the light color that can be used on a dark color
|
|
9
|
+
lightColor?: colorValue;
|
|
10
|
+
// the dark color that can be used on a light color
|
|
11
|
+
darkColor?: colorValue;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const decideContrastColorValue = ({
|
|
15
|
+
testColor,
|
|
16
|
+
lightColor = "#fff",
|
|
17
|
+
darkColor = "#000"
|
|
18
|
+
}: decideContrastColorValueProps): string => {
|
|
19
|
+
let contrastColor = "";
|
|
20
|
+
try {
|
|
21
|
+
contrastColor = Color(testColor).isLight() ? Color(darkColor).rgb().toString() : Color(lightColor).rgb().toString();
|
|
22
|
+
} catch(ex) {
|
|
23
|
+
console.warn("Received invalid colors", {testColor, lightColor, darkColor});
|
|
24
|
+
}
|
|
25
|
+
return contrastColor;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default decideContrastColorValue;
|
|
@@ -4,17 +4,22 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
|
4
4
|
// Configurations can be found in `src/cmem/react-flow/configuration/_colors-*.scss`
|
|
5
5
|
type colorconfigs = "react-flow-graph" | "react-flow-linking" | "react-flow-workflow" | "stickynotes";
|
|
6
6
|
|
|
7
|
+
const colorConfigurationMemo = new Map<colorconfigs, any>()
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Read and returns color values provided by CSS custom properties.
|
|
9
11
|
* They are defined for special CSS classes.
|
|
10
12
|
* Currently color configurations for the react flow editors are supported.
|
|
11
13
|
**/
|
|
12
14
|
const getColorConfiguration = (configId: colorconfigs) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if(!colorConfigurationMemo.has(configId)) {
|
|
16
|
+
colorConfigurationMemo.set(configId, new CssCustomProperties({
|
|
17
|
+
selectorText: `.${eccgui}-configuration--colors__${configId}`,
|
|
18
|
+
removeDashPrefix: true,
|
|
19
|
+
returnObject: true,
|
|
20
|
+
}).customProperties())
|
|
21
|
+
}
|
|
22
|
+
return colorConfigurationMemo.get(configId)!!;
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
export default getColorConfiguration;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.ecc-auto-suggestion-box {
|
|
1
|
+
.#{$eccgui}-autosuggestion {
|
|
4
2
|
position: relative;
|
|
5
3
|
|
|
6
4
|
&__dropdown {
|
|
@@ -8,7 +6,7 @@
|
|
|
8
6
|
// TODO: Replace by variable
|
|
9
7
|
background-color: #fff;
|
|
10
8
|
position: absolute;
|
|
11
|
-
top:
|
|
9
|
+
top: 0;
|
|
12
10
|
z-index:2;
|
|
13
11
|
display: flex;
|
|
14
12
|
flex-flow: column wrap;
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
.#{$eccgui}-singlelinecodeeditor {
|
|
32
30
|
position: relative;
|
|
33
31
|
|
|
34
32
|
.CodeMirror {
|
|
@@ -59,12 +57,20 @@
|
|
|
59
57
|
line-height: calc(#{$eccgui-size-textfield-height-regular} - 4px - 6px);
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
pre.CodeMirror-line
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
pre.CodeMirror-line,
|
|
61
|
+
pre.CodeMirror-placeholder,
|
|
62
|
+
pre.CodeMirror-line-like {
|
|
63
|
+
font-family: $eccgui-font-family-default;
|
|
64
|
+
font-size: $eccgui-size-typo-base;
|
|
65
65
|
padding: 3px 0;
|
|
66
66
|
height: calc(#{$eccgui-size-textfield-height-regular} - 4px - 6px);
|
|
67
|
+
line-height: calc(#{$eccgui-size-textfield-height-regular} - 4px - 6px);
|
|
67
68
|
box-sizing: content-box;
|
|
69
|
+
color: $input-color;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
pre.CodeMirror-placeholder {
|
|
73
|
+
color: $input-placeholder-color;
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
.CodeMirror-cursor {
|
|
@@ -87,13 +93,13 @@
|
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
.#{$eccgui}-autosuggestion__text--highlighted {
|
|
91
97
|
display: inline-block;
|
|
92
98
|
background-color: $eccgui-color-warning-background;
|
|
93
99
|
color:$eccgui-color-warning-text;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
|
|
102
|
+
.#{$eccgui}-autosuggestion__text--highlighted-error {
|
|
97
103
|
background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
|
|
98
104
|
background-position: left bottom;
|
|
99
105
|
background-repeat: repeat-x;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, {useEffect, useMemo, useState} from "react";
|
|
2
2
|
import CodeMirror from "codemirror";
|
|
3
|
-
import {FieldItem, IconButton, Spinner, Toolbar, ToolbarSection} from "./../../";
|
|
3
|
+
import {FieldItem, IconButton, Spinner, Toolbar, ToolbarSection, ContextOverlay} from "./../../";
|
|
4
4
|
import {Classes as BlueprintClassNames} from "@blueprintjs/core";
|
|
5
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
5
6
|
|
|
6
7
|
//custom components
|
|
7
8
|
import SingleLineCodeEditor, {IRange} from "./SingleLineCodeEditor";
|
|
@@ -102,6 +103,12 @@ export interface IProps {
|
|
|
102
103
|
placeholder?: string
|
|
103
104
|
/** If the horizontal scrollbars should be shown. */
|
|
104
105
|
showScrollBar?: boolean
|
|
106
|
+
/** Delay in ms before an auto-completion request should be send after nothing is typed in anymore.
|
|
107
|
+
* This should prevent the UI to send too many requests to the backend. */
|
|
108
|
+
autoCompletionRequestDelay?: number
|
|
109
|
+
/** Delay in ms before a validation request should be send after nothing is typed in anymore.
|
|
110
|
+
* This should prevent the UI to send too many requests to the backend. */
|
|
111
|
+
validationRequestDelay?: number
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
/** Input component that allows partial, fine-grained auto-completion, i.e. of sub-strings of the input string.
|
|
@@ -121,11 +128,13 @@ const AutoSuggestion = ({
|
|
|
121
128
|
rightElement,
|
|
122
129
|
useTabForCompletions = false,
|
|
123
130
|
placeholder,
|
|
124
|
-
showScrollBar = true
|
|
131
|
+
showScrollBar = true,
|
|
132
|
+
autoCompletionRequestDelay = 1000,
|
|
133
|
+
validationRequestDelay = 200
|
|
125
134
|
}: IProps) => {
|
|
126
135
|
const [value, setValue] = React.useState(initialValue);
|
|
127
136
|
const [cursorPosition, setCursorPosition] = React.useState(0);
|
|
128
|
-
const [
|
|
137
|
+
const [horizontalShift, setHorizontalShift] = React.useState<number>(0);
|
|
129
138
|
const [shouldShowDropdown, setShouldShowDropdown] = React.useState(false);
|
|
130
139
|
const [suggestions, setSuggestions] = React.useState<ISuggestionWithReplacementInfo[]>([]);
|
|
131
140
|
const [suggestionsPending, setSuggestionsPending] = React.useState(false);
|
|
@@ -177,7 +186,7 @@ const AutoSuggestion = ({
|
|
|
177
186
|
const marker = editorInstance.markText(
|
|
178
187
|
{line: 0, ch: from},
|
|
179
188
|
{line: 0, ch: to},
|
|
180
|
-
{className:
|
|
189
|
+
{className: `${eccgui}-autosuggestion__text--highlighted`}
|
|
181
190
|
);
|
|
182
191
|
return () => marker.clear()
|
|
183
192
|
}
|
|
@@ -194,7 +203,7 @@ const AutoSuggestion = ({
|
|
|
194
203
|
const marker = editorInstance.markText(
|
|
195
204
|
{ line: 0, ch: start },
|
|
196
205
|
{ line: 0, ch: end },
|
|
197
|
-
{ className:
|
|
206
|
+
{ className: `${eccgui}-autosuggestion__text--highlighted-error`, title: message }
|
|
198
207
|
);
|
|
199
208
|
setErrorMarkers((previousMarkers) => {
|
|
200
209
|
previousMarkers.forEach(marker => marker.clear())
|
|
@@ -252,8 +261,8 @@ const AutoSuggestion = ({
|
|
|
252
261
|
}, [checkInput])
|
|
253
262
|
|
|
254
263
|
const checkValuePathValidity = useMemo(
|
|
255
|
-
() => debounce((inputString: string) => asyncCheckInput(inputString),
|
|
256
|
-
[asyncCheckInput]
|
|
264
|
+
() => debounce((inputString: string) => asyncCheckInput(inputString), validationRequestDelay),
|
|
265
|
+
[asyncCheckInput, validationRequestDelay]
|
|
257
266
|
)
|
|
258
267
|
|
|
259
268
|
const asyncHandleEditorInputChange = useMemo(() => async (inputString: string, cursorPosition: number) => {
|
|
@@ -270,8 +279,8 @@ const AutoSuggestion = ({
|
|
|
270
279
|
}, [fetchSuggestions])
|
|
271
280
|
|
|
272
281
|
const handleEditorInputChange = useMemo(() =>
|
|
273
|
-
debounce((inputString: string, cursorPosition: number) => asyncHandleEditorInputChange(inputString, cursorPosition),
|
|
274
|
-
[asyncHandleEditorInputChange]
|
|
282
|
+
debounce((inputString: string, cursorPosition: number) => asyncHandleEditorInputChange(inputString, cursorPosition), autoCompletionRequestDelay),
|
|
283
|
+
[asyncHandleEditorInputChange, autoCompletionRequestDelay]
|
|
275
284
|
)
|
|
276
285
|
|
|
277
286
|
React.useEffect(() => {
|
|
@@ -294,9 +303,9 @@ const AutoSuggestion = ({
|
|
|
294
303
|
onChange(val)
|
|
295
304
|
};
|
|
296
305
|
|
|
297
|
-
const handleCursorChange = (pos: any, coords: any) => {
|
|
306
|
+
const handleCursorChange = (pos: any, coords: any, scrollinfo: any) => {
|
|
298
307
|
setCursorPosition(pos.ch);
|
|
299
|
-
|
|
308
|
+
setHorizontalShift(Math.min(coords.left, Math.max(coords.left - scrollinfo.left, 0)));
|
|
300
309
|
};
|
|
301
310
|
|
|
302
311
|
const handleInputEditorKeyPress = (event: KeyboardEvent) => {
|
|
@@ -382,48 +391,68 @@ const AutoSuggestion = ({
|
|
|
382
391
|
}, [])
|
|
383
392
|
|
|
384
393
|
const hasError = !!value && !pathIsValid && !pathValidationPending;
|
|
385
|
-
const autoSuggestionInput =
|
|
386
|
-
<div
|
|
387
|
-
<
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
394
|
+
const autoSuggestionInput = (
|
|
395
|
+
<div id={id} className={`${eccgui}-autosuggestion`}>
|
|
396
|
+
<div className={`${eccgui}-autosuggestion__inputfield ${BlueprintClassNames.INPUT_GROUP} ${BlueprintClassNames.FILL} ${hasError ? BlueprintClassNames.INTENT_DANGER : ""}`}>
|
|
397
|
+
<ContextOverlay
|
|
398
|
+
minimal
|
|
399
|
+
fill
|
|
400
|
+
isOpen={shouldShowDropdown}
|
|
401
|
+
placement="bottom-start"
|
|
402
|
+
openOnTargetFocus={false}
|
|
403
|
+
autoFocus={false}
|
|
404
|
+
content={(
|
|
405
|
+
<AutoSuggestionList
|
|
406
|
+
id={id+"__dropdown"}
|
|
407
|
+
left={horizontalShift}
|
|
408
|
+
loading={suggestionsPending}
|
|
409
|
+
options={suggestions}
|
|
410
|
+
isOpen={!suggestionsPending && shouldShowDropdown}
|
|
411
|
+
onItemSelectionChange={handleDropdownChange}
|
|
412
|
+
currentlyFocusedIndex={focusedIndex}
|
|
413
|
+
itemToHighlight={handleItemHighlighting}
|
|
414
|
+
/>
|
|
415
|
+
)}
|
|
416
|
+
>
|
|
417
|
+
<SingleLineCodeEditor
|
|
418
|
+
mode="null"
|
|
419
|
+
setEditorInstance={setEditorInstance}
|
|
420
|
+
onChange={handleChange}
|
|
421
|
+
onCursorChange={handleCursorChange}
|
|
422
|
+
initialValue={value}
|
|
423
|
+
onFocusChange={handleInputFocus}
|
|
424
|
+
onKeyDown={handleInputEditorKeyPress}
|
|
425
|
+
enableTab={useTabForCompletions}
|
|
426
|
+
placeholder={placeholder}
|
|
427
|
+
onSelection={setSelectedTextRanges}
|
|
428
|
+
showScrollBar={showScrollBar}
|
|
429
|
+
/>
|
|
430
|
+
</ContextOverlay>
|
|
431
|
+
{!!value && (
|
|
432
|
+
<span className={BlueprintClassNames.INPUT_ACTION}>
|
|
433
|
+
<IconButton
|
|
434
|
+
data-test-id={"value-path-clear-btn"}
|
|
435
|
+
name="operation-clear"
|
|
436
|
+
text={clearIconText}
|
|
437
|
+
onClick={handleInputEditorClear}
|
|
438
|
+
/>
|
|
439
|
+
</span>
|
|
440
|
+
)}
|
|
441
|
+
</div>
|
|
410
442
|
</div>
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
<ToolbarSection canGrow={true}>{autoSuggestionInput}</ToolbarSection>
|
|
425
|
-
{rightElement && <ToolbarSection>{rightElement}</ToolbarSection>}
|
|
426
|
-
</Toolbar> : autoSuggestionInput
|
|
443
|
+
);
|
|
444
|
+
|
|
445
|
+
const withRightElement = rightElement || leftElement ? (
|
|
446
|
+
<Toolbar noWrap>
|
|
447
|
+
{leftElement && <ToolbarSection>{leftElement}</ToolbarSection>}
|
|
448
|
+
<ToolbarSection canGrow canShrink>
|
|
449
|
+
<div style={{minWidth: "100%", maxWidth: "100%"}}>
|
|
450
|
+
{autoSuggestionInput}
|
|
451
|
+
</div>
|
|
452
|
+
</ToolbarSection>
|
|
453
|
+
{rightElement && <ToolbarSection>{rightElement}</ToolbarSection>}
|
|
454
|
+
</Toolbar>
|
|
455
|
+
) : autoSuggestionInput
|
|
427
456
|
|
|
428
457
|
return label ? (
|
|
429
458
|
<FieldItem
|