@eccenca/gui-elements 24.1.0-rc.4 → 24.1.0-rc.6
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 +35 -2
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +7 -2
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +8 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +10 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItem.js +5 -2
- package/dist/cjs/components/OverviewItem/OverviewItem.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemList.js +2 -2
- package/dist/cjs/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/cjs/components/TextField/SearchField.js +19 -2
- package/dist/cjs/components/TextField/SearchField.js.map +1 -1
- package/dist/cjs/components/Typography/OverflowText.js +1 -1
- package/dist/cjs/components/Typography/OverflowText.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +37 -8
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/toolbars/commands/markdown.command.js +278 -0
- package/dist/cjs/extensions/codemirror/toolbars/commands/markdown.command.js.map +1 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js +47 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -0
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +7 -2
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +8 -0
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +10 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItem.js +5 -2
- package/dist/esm/components/OverviewItem/OverviewItem.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemList.js +2 -2
- package/dist/esm/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/esm/components/TextField/SearchField.js +35 -2
- package/dist/esm/components/TextField/SearchField.js.map +1 -1
- package/dist/esm/components/Typography/OverflowText.js +1 -1
- package/dist/esm/components/Typography/OverflowText.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +38 -9
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/toolbars/commands/markdown.command.js +283 -0
- package/dist/esm/extensions/codemirror/toolbars/commands/markdown.command.js.map +1 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js +41 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -0
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +10 -0
- package/dist/types/components/OverviewItem/OverviewItem.d.ts +13 -1
- package/dist/types/components/OverviewItem/OverviewItemList.d.ts +3 -2
- package/dist/types/components/TextField/SearchField.d.ts +1 -1
- package/dist/types/components/Typography/OverflowText.d.ts +23 -2
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +10 -1
- package/dist/types/extensions/codemirror/toolbars/commands/markdown.command.d.ts +55 -0
- package/dist/types/extensions/codemirror/toolbars/markdown.toolbar.d.ts +12 -0
- package/package.json +21 -19
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -2
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +9 -0
- package/src/components/CodeAutocompleteField/CodeAutocompleteField.stories.tsx +3 -2
- package/src/components/ContextOverlay/ContextOverlay.stories.tsx +15 -4
- package/src/components/Depiction/depiction.scss +7 -0
- package/src/components/Dialog/stories/AlertDialog.stories.tsx +5 -1
- package/src/components/Dialog/stories/Modal.stories.tsx +4 -2
- package/src/components/Dialog/stories/SimpleDialog.stories.tsx +5 -2
- package/src/components/Icon/canonicalIconNames.tsx +10 -0
- package/src/components/OverviewItem/OverviewItem.tsx +24 -1
- package/src/components/OverviewItem/OverviewItemList.tsx +3 -2
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +6 -12
- package/src/components/Select/Select.stories.tsx +4 -1
- package/src/components/TextField/SearchField.tsx +37 -9
- package/src/components/TextField/stories/SearchField.stories.tsx +15 -1
- package/src/components/TextField/textfield.scss +17 -3
- package/src/components/Typography/OverflowText.tsx +24 -3
- package/src/components/Typography/stories/OverflowText.stories.tsx +33 -0
- package/src/extensions/codemirror/CodeMirror.stories.tsx +5 -17
- package/src/extensions/codemirror/CodeMirror.tsx +67 -8
- package/src/extensions/codemirror/_codemirror.scss +35 -2
- package/src/extensions/codemirror/toolbars/commands/markdown.command.ts +340 -0
- package/src/extensions/codemirror/toolbars/markdown.toolbar.tsx +117 -0
|
@@ -69,7 +69,7 @@ interface IActivityContextMenu extends TestableComponent {
|
|
|
69
69
|
menuItems: IActivityMenuAction[];
|
|
70
70
|
}
|
|
71
71
|
export interface ActivityControlWidgetAction extends TestableComponent {
|
|
72
|
-
action: () =>
|
|
72
|
+
action: () => void;
|
|
73
73
|
tooltip?: string;
|
|
74
74
|
icon: ValidIconName | React.ReactElement<TestIconProps>;
|
|
75
75
|
disabled?: boolean;
|
|
@@ -17,6 +17,8 @@ declare const canonicalIcons: {
|
|
|
17
17
|
"artefact-commit": icons.CarbonIconType;
|
|
18
18
|
"artefact-task-deleteprojectfiles": icons.CarbonIconType;
|
|
19
19
|
"artefact-task-downloadfile": icons.CarbonIconType;
|
|
20
|
+
"artefact-task-pivot": icons.CarbonIconType;
|
|
21
|
+
"artefact-task-unpivot": icons.CarbonIconType;
|
|
20
22
|
"artefact-task-concatenatetofile": icons.CarbonIconType;
|
|
21
23
|
"artefact-dataset-csv": icons.CarbonIconType;
|
|
22
24
|
"artefact-dataset-eccencadataplatform": icons.CarbonIconType;
|
|
@@ -81,6 +83,7 @@ declare const canonicalIcons: {
|
|
|
81
83
|
"item-vertmenu": icons.CarbonIconType;
|
|
82
84
|
"item-viewdetails": icons.CarbonIconType;
|
|
83
85
|
"item-hidedetails": icons.CarbonIconType;
|
|
86
|
+
"item-image": icons.CarbonIconType;
|
|
84
87
|
"list-sortasc": icons.CarbonIconType;
|
|
85
88
|
"list-sortdesc": icons.CarbonIconType;
|
|
86
89
|
"list-sort": icons.CarbonIconType;
|
|
@@ -118,6 +121,13 @@ declare const canonicalIcons: {
|
|
|
118
121
|
"operation-filterremove": icons.CarbonIconType;
|
|
119
122
|
"operation-filter": icons.CarbonIconType;
|
|
120
123
|
"operation-format-codeblock": icons.CarbonIconType;
|
|
124
|
+
"operation-format-text-code": icons.CarbonIconType;
|
|
125
|
+
"operation-format-text-bold": icons.CarbonIconType;
|
|
126
|
+
"operation-format-text-italic": icons.CarbonIconType;
|
|
127
|
+
"operation-format-text-strikethrough": icons.CarbonIconType;
|
|
128
|
+
"operation-format-list-bullet": icons.CarbonIconType;
|
|
129
|
+
"operation-format-list-checked": icons.CarbonIconType;
|
|
130
|
+
"operation-format-list-numbered": icons.CarbonIconType;
|
|
121
131
|
"operation-fix": icons.CarbonIconType;
|
|
122
132
|
"operation-link": icons.CarbonIconType;
|
|
123
133
|
"operation-logout": icons.CarbonIconType;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { CardProps } from "../Card/Card";
|
|
2
3
|
export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* Displays the element using reduced height and less white space inside.
|
|
@@ -8,10 +9,21 @@ export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
8
9
|
* Add a bit white space around the element.
|
|
9
10
|
*/
|
|
10
11
|
hasSpacing?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Uses a `Card` element to wrap the `OverviewItem` inside.
|
|
14
|
+
* It is always used with `isOnlyLayout` set to `true`.
|
|
15
|
+
* Should be used together with `hasSpacing`.
|
|
16
|
+
*/
|
|
17
|
+
hasCardWrapper?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Forwarding basic `Card` properties to the wrapper element.
|
|
20
|
+
* Only used if `hasCardWrapper` is set to `true`.
|
|
21
|
+
*/
|
|
22
|
+
cardProps?: Omit<CardProps, "children" | "isOnlyLayout" | "fullHeight" | "whitespaceAmount" | "compact">;
|
|
11
23
|
}
|
|
12
24
|
/**
|
|
13
25
|
* This element can include all basic information and actions to give an overview about the item.
|
|
14
26
|
* Mainly used in items list or to create basic widgets.
|
|
15
27
|
*/
|
|
16
|
-
export declare const OverviewItem: ({ children, className, densityHigh, hasSpacing, ...otherProps }: OverviewItemProps) => React.
|
|
28
|
+
export declare const OverviewItem: ({ children, className, densityHigh, hasSpacing, hasCardWrapper, cardProps, ...otherProps }: OverviewItemProps) => React.JSX.Element;
|
|
17
29
|
export default OverviewItem;
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
3
3
|
/**
|
|
4
4
|
* Displays the element using reduced height and less white space inside.
|
|
5
|
+
* @deprecated (v25) use property directly on `OverviewItem` children.
|
|
5
6
|
*/
|
|
6
7
|
densityHigh?: boolean;
|
|
7
8
|
/**
|
|
@@ -19,8 +20,8 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
|
|
|
19
20
|
columns?: 1 | 2;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
* This
|
|
23
|
-
*
|
|
23
|
+
* This component is a listing container for multiple `OverviewItem` elements.
|
|
24
|
+
* It should only contains `OverviewItem` children but it does not check and control that condition.
|
|
24
25
|
*/
|
|
25
26
|
export declare const OverviewItemList: ({ children, className, densityHigh, hasDivider, hasSpacing, columns, ...restProps }: OverviewItemListProps) => React.JSX.Element;
|
|
26
27
|
export default OverviewItemList;
|
|
@@ -19,5 +19,5 @@ export interface SearchFieldProps extends TestableComponent, Omit<TextFieldProps
|
|
|
19
19
|
/**
|
|
20
20
|
* Special `TextField` element for search term inputs.
|
|
21
21
|
*/
|
|
22
|
-
export declare const SearchField: ({ className, emptySearchInputMessage, onClearanceHandler, onClearanceText, leftIcon, ...otherProps }: SearchFieldProps) => React.JSX.Element;
|
|
22
|
+
export declare const SearchField: ({ className, emptySearchInputMessage, onClearanceHandler, onClearanceText, onChange, leftIcon, rightElement, ...otherProps }: SearchFieldProps) => React.JSX.Element;
|
|
23
23
|
export default SearchField;
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { TestableComponent } from "../../components/interfaces";
|
|
3
|
+
export interface OverflowTextProps extends React.HTMLAttributes<HTMLElement>, TestableComponent {
|
|
4
|
+
/**
|
|
5
|
+
* How is ellipsis used to cut text overflows.
|
|
6
|
+
* Use `reverse`to use the ellipis on text start and display the end of the text.
|
|
7
|
+
*/
|
|
8
|
+
ellipsis?: "add" | "reverse" | "none";
|
|
9
|
+
/**
|
|
10
|
+
* Display component as inline element.
|
|
11
|
+
*/
|
|
4
12
|
inline?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Using text overflow on all children elements.
|
|
15
|
+
*/
|
|
5
16
|
passDown?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Additional CSS class name.
|
|
19
|
+
*/
|
|
6
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* HTML element that is used for the component.
|
|
23
|
+
*/
|
|
7
24
|
useHtmlElement?: "p" | "div" | "span";
|
|
25
|
+
/**
|
|
26
|
+
* Used for all other necessary properties.
|
|
27
|
+
* @deprecated (v25) we will allow only basic HTML element properties and testing IDs
|
|
28
|
+
*/
|
|
8
29
|
[key: string]: any;
|
|
9
30
|
}
|
|
10
31
|
/** Prevents text from overflowing. */
|
|
@@ -119,11 +119,20 @@ export interface CodeEditorProps extends TestableComponent {
|
|
|
119
119
|
* Disables the editor.
|
|
120
120
|
*/
|
|
121
121
|
disabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Add toolbar for mode.
|
|
124
|
+
* Currently only `markdown` is supported.
|
|
125
|
+
*/
|
|
126
|
+
useToolbar?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Get the translation for a specific key
|
|
129
|
+
*/
|
|
130
|
+
translate?: (key: string) => string | false;
|
|
122
131
|
}
|
|
123
132
|
/**
|
|
124
133
|
* Includes a code editor, currently we use CodeMirror library as base.
|
|
125
134
|
*/
|
|
126
135
|
export declare const CodeEditor: {
|
|
127
|
-
({ onChange, onSelection, onMouseDown, onFocusChange, onKeyDown, onCursorChange, name, id, mode, preventLineNumbers, defaultValue, readOnly, shouldHaveMinimalSetup, wrapLines, onScroll, setEditorView, supportCodeFolding, shouldHighlightActiveLine, outerDivAttributes, tabIntentSize, tabIntentStyle, placeholder, additionalExtensions, tabForceSpaceForModes, enableTab, height, useLinting, "data-test-id": dataTestId, autoFocus, disabled, intent, ...otherCodeEditorProps }: CodeEditorProps): React.JSX.Element;
|
|
136
|
+
({ onChange, onSelection, onMouseDown, onFocusChange, onKeyDown, onCursorChange, name, id, mode, preventLineNumbers, defaultValue, readOnly, shouldHaveMinimalSetup, wrapLines, onScroll, setEditorView, supportCodeFolding, shouldHighlightActiveLine, outerDivAttributes, tabIntentSize, tabIntentStyle, placeholder, additionalExtensions, tabForceSpaceForModes, enableTab, height, useLinting, "data-test-id": dataTestId, autoFocus, disabled, intent, useToolbar, translate, ...otherCodeEditorProps }: CodeEditorProps): React.JSX.Element;
|
|
128
137
|
supportedModes: ("markdown" | "python" | "sparql" | "turtle" | "xml" | "yaml" | "jinja2" | "json" | "ntriples" | "mathematica" | "sql" | "javascript")[];
|
|
129
138
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EditorView } from "codemirror";
|
|
2
|
+
import { ValidIconName } from "../../../../components/Icon/canonicalIconNames";
|
|
3
|
+
declare enum Commands {
|
|
4
|
+
header1 = "Heading 1",
|
|
5
|
+
header2 = "Heading 2",
|
|
6
|
+
header3 = "Heading 3",
|
|
7
|
+
header4 = "Heading 4",
|
|
8
|
+
header5 = "Heading 5",
|
|
9
|
+
header6 = "Heading 6",
|
|
10
|
+
codeBlock = "Code block",
|
|
11
|
+
quote = "Block quote",
|
|
12
|
+
bold = "Bold",
|
|
13
|
+
italic = "Italic",
|
|
14
|
+
strike = "StrikeThrough",
|
|
15
|
+
inlineCode = "Inline code",
|
|
16
|
+
unorderedList = "Unordered list",
|
|
17
|
+
orderedList = "Ordered list",
|
|
18
|
+
todoList = "Todo list",
|
|
19
|
+
link = "Link",
|
|
20
|
+
image = "Image"
|
|
21
|
+
}
|
|
22
|
+
export default class MarkdownCommand {
|
|
23
|
+
private view;
|
|
24
|
+
static commands: {
|
|
25
|
+
readonly paragraphs: readonly [Commands.header1, Commands.header2, Commands.header3, Commands.header4, Commands.header5, Commands.header6, Commands.quote, Commands.codeBlock];
|
|
26
|
+
readonly basic: {
|
|
27
|
+
title: Commands;
|
|
28
|
+
icon: ValidIconName;
|
|
29
|
+
}[];
|
|
30
|
+
readonly lists: {
|
|
31
|
+
title: Commands;
|
|
32
|
+
icon: ValidIconName;
|
|
33
|
+
moniker: string;
|
|
34
|
+
}[];
|
|
35
|
+
readonly attachments: {
|
|
36
|
+
title: Commands;
|
|
37
|
+
icon: ValidIconName;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
constructor(view: EditorView);
|
|
41
|
+
/**
|
|
42
|
+
* Supported list types are ol, ul, todo.
|
|
43
|
+
* utility helps to determine which at the start of the line
|
|
44
|
+
*/
|
|
45
|
+
private getListTypeOfLine;
|
|
46
|
+
private createListDelimiter;
|
|
47
|
+
private createList;
|
|
48
|
+
private enforceCursorFocus;
|
|
49
|
+
private createHeading;
|
|
50
|
+
private applyFormatting;
|
|
51
|
+
private applyAttachment;
|
|
52
|
+
private applyQuoteFormatting;
|
|
53
|
+
executeCommand: (command: Commands) => true | void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EditorView } from "codemirror";
|
|
3
|
+
interface MarkdownToolbarProps {
|
|
4
|
+
view?: EditorView;
|
|
5
|
+
togglePreviewStatus: () => void;
|
|
6
|
+
showPreview: boolean;
|
|
7
|
+
translate: (key: string) => string | false;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const MarkdownToolbar: React.FC<MarkdownToolbarProps>;
|
|
12
|
+
export {};
|
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": "24.1.0-rc.
|
|
4
|
+
"version": "24.1.0-rc.6",
|
|
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",
|
|
@@ -106,27 +106,27 @@
|
|
|
106
106
|
"xml-formatter": "^3.6.3"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@babel/core": "^7.26.
|
|
110
|
-
"@babel/plugin-
|
|
111
|
-
"@babel/plugin-
|
|
112
|
-
"@babel/plugin-
|
|
113
|
-
"@babel/preset-env": "^7.26.
|
|
109
|
+
"@babel/core": "^7.26.10",
|
|
110
|
+
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
111
|
+
"@babel/plugin-transform-private-methods": "^7.25.9",
|
|
112
|
+
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
|
113
|
+
"@babel/preset-env": "^7.26.9",
|
|
114
114
|
"@babel/preset-flow": "^7.25.9",
|
|
115
115
|
"@babel/preset-react": "^7.26.3",
|
|
116
|
-
"@babel/preset-typescript": "^7.
|
|
116
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
117
117
|
"@eslint/compat": "^1.2.4",
|
|
118
118
|
"@eslint/eslintrc": "^3.2.0",
|
|
119
119
|
"@eslint/js": "^9.17.0",
|
|
120
|
-
"@storybook/addon-actions": "^8.
|
|
121
|
-
"@storybook/addon-essentials": "^8.
|
|
122
|
-
"@storybook/addon-jest": "^8.
|
|
123
|
-
"@storybook/addon-links": "^8.
|
|
124
|
-
"@storybook/addon-webpack5-compiler-babel": "^3.0.
|
|
125
|
-
"@storybook/cli": "^8.
|
|
120
|
+
"@storybook/addon-actions": "^8.6.9",
|
|
121
|
+
"@storybook/addon-essentials": "^8.6.9",
|
|
122
|
+
"@storybook/addon-jest": "^8.6.9",
|
|
123
|
+
"@storybook/addon-links": "^8.6.9",
|
|
124
|
+
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
|
125
|
+
"@storybook/cli": "^8.6.9",
|
|
126
126
|
"@storybook/preset-scss": "^1.0.3",
|
|
127
|
-
"@storybook/react": "^8.
|
|
128
|
-
"@storybook/react-webpack5": "^8.
|
|
129
|
-
"@storybook/test": "^8.
|
|
127
|
+
"@storybook/react": "^8.6.9",
|
|
128
|
+
"@storybook/react-webpack5": "^8.6.9",
|
|
129
|
+
"@storybook/test": "^8.6.9",
|
|
130
130
|
"@testing-library/jest-dom": "^6.6.3",
|
|
131
131
|
"@testing-library/react": "^12.1.2",
|
|
132
132
|
"@types/codemirror": "^5.60.15",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
140
140
|
"@typescript-eslint/parser": "^8.18.1",
|
|
141
141
|
"babel-jest": "^29.7.0",
|
|
142
|
-
"chromatic": "^11.
|
|
142
|
+
"chromatic": "^11.27.0",
|
|
143
143
|
"eslint": "^9.17.0",
|
|
144
144
|
"eslint-plugin-react": "^7.37.2",
|
|
145
145
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"rimraf": "^5.0.10",
|
|
160
160
|
"sass": "1.62.1",
|
|
161
161
|
"sass-loader": "10.3.1",
|
|
162
|
-
"storybook": "^8.
|
|
162
|
+
"storybook": "^8.6.9",
|
|
163
163
|
"stylelint": "^15.11.0",
|
|
164
164
|
"stylelint-config-recess-order": "^4.6.0",
|
|
165
165
|
"stylelint-config-standard-scss": "^9.0.0",
|
|
@@ -178,7 +178,9 @@
|
|
|
178
178
|
"**/@types/react": "^17.0.83",
|
|
179
179
|
"node-sass-package-importer/**/postcss": "^8.4.49",
|
|
180
180
|
"**/cross-spawn": "^7.0.5 ",
|
|
181
|
-
"**/micromatch": "^4.0.8"
|
|
181
|
+
"**/micromatch": "^4.0.8",
|
|
182
|
+
"**/@babel/runtime": "^7.26.10",
|
|
183
|
+
"**/@babel/helpers": "^7.26.10"
|
|
182
184
|
},
|
|
183
185
|
"husky": {
|
|
184
186
|
"hooks": {
|
|
@@ -92,7 +92,7 @@ interface IActivityContextMenu extends TestableComponent {
|
|
|
92
92
|
|
|
93
93
|
export interface ActivityControlWidgetAction extends TestableComponent {
|
|
94
94
|
// The action that should be triggered
|
|
95
|
-
action: () =>
|
|
95
|
+
action: () => void;
|
|
96
96
|
// The tooltip that should be shown over the action icon
|
|
97
97
|
tooltip?: string;
|
|
98
98
|
// The icon of the action button
|
|
@@ -147,6 +147,7 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
|
|
|
147
147
|
{props.label && (
|
|
148
148
|
<OverviewItemLine small={small}>
|
|
149
149
|
{React.cloneElement(labelWrapper, {}, props.label)}
|
|
150
|
+
{timerExecutionMsg && (props.statusMessage || tags) && <> ({timerExecutionMsg})</>}
|
|
150
151
|
</OverviewItemLine>
|
|
151
152
|
)}
|
|
152
153
|
{(props.statusMessage || tags) && (
|
|
@@ -170,7 +171,9 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
|
|
|
170
171
|
)}
|
|
171
172
|
</OverviewItemLine>
|
|
172
173
|
)}
|
|
173
|
-
{timerExecutionMsg &&
|
|
174
|
+
{timerExecutionMsg && !(props.statusMessage || tags) && (
|
|
175
|
+
<OverviewItemLine small>{timerExecutionMsg}</OverviewItemLine>
|
|
176
|
+
)}
|
|
174
177
|
</OverviewItemDescription>
|
|
175
178
|
<OverviewItemActions>
|
|
176
179
|
{activityActions &&
|
|
@@ -241,9 +241,18 @@ const AutoSuggestion = ({
|
|
|
241
241
|
dispatch({
|
|
242
242
|
changes: { from: 0, to: currentCm.current.state?.doc.length, insert: initialValue },
|
|
243
243
|
});
|
|
244
|
+
// Validate initial value change
|
|
245
|
+
checkValuePathValidity(initialValue)
|
|
244
246
|
}
|
|
245
247
|
}, [initialValue, reInitOnInitialValueChange]);
|
|
246
248
|
|
|
249
|
+
React.useEffect(() => {
|
|
250
|
+
if(currentCm.current) {
|
|
251
|
+
// Validate initial value
|
|
252
|
+
checkValuePathValidity(initialValue)
|
|
253
|
+
}
|
|
254
|
+
}, [currentCm.current!!])
|
|
255
|
+
|
|
247
256
|
const setCurrentIndex = (newIndex: number) => {
|
|
248
257
|
editorState.index = newIndex;
|
|
249
258
|
setFocusedIndex(newIndex);
|
|
@@ -15,9 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
} as Meta<typeof CodeAutocompleteField>;
|
|
17
17
|
|
|
18
|
+
let forcedUpdateKey = 0; // @see https://github.com/storybookjs/storybook/issues/13375#issuecomment-1291011856
|
|
18
19
|
const Template: StoryFn<typeof CodeAutocompleteField> = (args) => (
|
|
19
20
|
<OverlaysProvider>
|
|
20
|
-
<CodeAutocompleteField {...args} />
|
|
21
|
+
<CodeAutocompleteField {...args} key={++forcedUpdateKey} />
|
|
21
22
|
</OverlaysProvider>
|
|
22
23
|
);
|
|
23
24
|
|
|
@@ -63,7 +64,7 @@ const defaultProps: CodeAutocompleteFieldProps = {
|
|
|
63
64
|
},
|
|
64
65
|
placeholder:
|
|
65
66
|
"The word before the cursor will be auto-completed. At the beginning or after a space, all results are shown.",
|
|
66
|
-
onChange():
|
|
67
|
+
onChange(): void {
|
|
67
68
|
// Do nothing
|
|
68
69
|
},
|
|
69
70
|
};
|
|
@@ -4,31 +4,40 @@ import { PopoverInteractionKind, PopperModifierOverrides } from "@blueprintjs/co
|
|
|
4
4
|
import { PopperPlacements } from "@blueprintjs/core";
|
|
5
5
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
6
6
|
import { Meta, StoryFn } from "@storybook/react";
|
|
7
|
+
import { fn } from "@storybook/test";
|
|
7
8
|
|
|
8
9
|
import { Button, ContextOverlay, HtmlContentBlock } from "../../index";
|
|
9
10
|
|
|
11
|
+
const interactionKindOptions = { UNDEFINED: undefined, ...PopoverInteractionKind };
|
|
12
|
+
const rootBoundaryOptions = { UNDEFINED: undefined, VIEWPORT: "viewport", DOCUMENT: "document" };
|
|
13
|
+
const positioningStrategyOptions = { UNDEFINED: undefined, ABSOLUTE: "absolute", FIXED: "fixed" };
|
|
14
|
+
|
|
10
15
|
export default {
|
|
11
16
|
title: "Components/ContextOverlay",
|
|
12
17
|
component: ContextOverlay,
|
|
13
18
|
argTypes: {
|
|
14
19
|
interactionKind: {
|
|
15
|
-
options:
|
|
20
|
+
options: Object.keys(interactionKindOptions),
|
|
21
|
+
mapping: interactionKindOptions,
|
|
16
22
|
},
|
|
17
23
|
placement: {
|
|
18
24
|
options: PopperPlacements,
|
|
19
25
|
},
|
|
20
26
|
rootBoundary: {
|
|
21
|
-
options:
|
|
27
|
+
options: Object.keys(rootBoundaryOptions),
|
|
28
|
+
mapping: rootBoundaryOptions,
|
|
22
29
|
},
|
|
23
30
|
positioningStrategy: {
|
|
24
|
-
options:
|
|
31
|
+
options: Object.keys(positioningStrategyOptions),
|
|
32
|
+
mapping: positioningStrategyOptions,
|
|
25
33
|
},
|
|
26
34
|
},
|
|
27
35
|
} as Meta<typeof ContextOverlay>;
|
|
28
36
|
|
|
37
|
+
let forcedUpdateKey = 0;
|
|
29
38
|
const Template: StoryFn<typeof ContextOverlay> = (args) => (
|
|
30
39
|
<OverlaysProvider>
|
|
31
|
-
<ContextOverlay {...args} />
|
|
40
|
+
<ContextOverlay {...args} key={++forcedUpdateKey} />
|
|
32
41
|
</OverlaysProvider>
|
|
33
42
|
);
|
|
34
43
|
|
|
@@ -55,4 +64,6 @@ Default.args = {
|
|
|
55
64
|
} as PopperModifierOverrides,
|
|
56
65
|
rootBoundary: "viewport",
|
|
57
66
|
hasBackdrop: false,
|
|
67
|
+
onOpening: fn(),
|
|
68
|
+
onInteraction: fn(),
|
|
58
69
|
};
|
|
@@ -72,6 +72,13 @@ $eccgui-size-depiction-border-radius: $pt-border-radius !default;
|
|
|
72
72
|
.#{$eccgui}-overviewitem__list--highdensity > li > .#{$eccgui}-overviewitem__item & {
|
|
73
73
|
height: $button-height;
|
|
74
74
|
}
|
|
75
|
+
.#{$eccgui}-overviewitem__item--highdensity.#{$eccgui}-overviewitem__item--hasspacing > .#{$eccgui}-depiction &,
|
|
76
|
+
.#{$eccgui}-overviewitem__list--highdensity
|
|
77
|
+
> li
|
|
78
|
+
> .#{$eccgui}-overviewitem__item.#{$eccgui}-overviewitem__item--hasspacing
|
|
79
|
+
& {
|
|
80
|
+
height: calc(#{$button-height} - #{$eccgui-size-typo-base * 0.5});
|
|
81
|
+
}
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
.#{$eccgui}-depiction__image--disabled {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { AlertDialog } from "./../../../../index";
|
|
6
|
-
import { Default as SimpleDialogExample } from "./SimpleDialog.stories";
|
|
7
|
+
import simpleDialogStory, { Default as SimpleDialogExample } from "./SimpleDialog.stories";
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
title: "Components/Dialog/AlertDialog",
|
|
10
11
|
component: AlertDialog,
|
|
11
12
|
argTypes: {
|
|
13
|
+
...simpleDialogStory.argTypes,
|
|
12
14
|
headerOptions: { table: { disable: true } },
|
|
13
15
|
children: { table: { disable: true } },
|
|
14
16
|
actions: { table: { disable: true } },
|
|
@@ -42,4 +44,6 @@ Default.args = {
|
|
|
42
44
|
success: false,
|
|
43
45
|
warning: true,
|
|
44
46
|
danger: false,
|
|
47
|
+
onOpening: fn(),
|
|
48
|
+
onClosing: fn(),
|
|
45
49
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { SimpleCard } from "../../Card/stories/Card.stories";
|
|
6
7
|
|
|
@@ -11,8 +12,7 @@ export default {
|
|
|
11
12
|
component: Modal,
|
|
12
13
|
argTypes: {
|
|
13
14
|
children: {
|
|
14
|
-
control:
|
|
15
|
-
description: "Elements to include into the modal container.",
|
|
15
|
+
control: false,
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
} as Meta<typeof Modal>;
|
|
@@ -30,4 +30,6 @@ Default.args = {
|
|
|
30
30
|
isOpen: true,
|
|
31
31
|
usePortal: false,
|
|
32
32
|
children: <Card {...SimpleCard.args} />,
|
|
33
|
+
onOpening: fn(),
|
|
34
|
+
onClosing: fn(),
|
|
33
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { SimpleDialog } from "./../../../../index";
|
|
6
7
|
import { Default as CardActionsExample } from "./../../Card/stories/CardActions.stories";
|
|
@@ -14,10 +15,10 @@ export default {
|
|
|
14
15
|
argTypes: {
|
|
15
16
|
...storyModal.argTypes,
|
|
16
17
|
headerOptions: {
|
|
17
|
-
control:
|
|
18
|
+
control: false,
|
|
18
19
|
},
|
|
19
20
|
actions: {
|
|
20
|
-
control:
|
|
21
|
+
control: false,
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
} as Meta<typeof SimpleDialog>;
|
|
@@ -39,4 +40,6 @@ Default.args = {
|
|
|
39
40
|
hasBorder: true,
|
|
40
41
|
isOpen: true,
|
|
41
42
|
usePortal: false,
|
|
43
|
+
onOpening: fn(),
|
|
44
|
+
onClosing: fn(),
|
|
42
45
|
};
|
|
@@ -19,6 +19,8 @@ const canonicalIcons = {
|
|
|
19
19
|
"artefact-commit": icons.Commit,
|
|
20
20
|
"artefact-task-deleteprojectfiles": icons.TrashCan,
|
|
21
21
|
"artefact-task-downloadfile": icons.CloudDownload,
|
|
22
|
+
"artefact-task-pivot": icons.Transpose,
|
|
23
|
+
"artefact-task-unpivot": icons.Transpose,
|
|
22
24
|
"artefact-task-concatenatetofile": icons.DocumentExport,
|
|
23
25
|
"artefact-dataset-csv": icons.Csv,
|
|
24
26
|
"artefact-dataset-eccencadataplatform": icons.DataVis_1,
|
|
@@ -86,6 +88,7 @@ const canonicalIcons = {
|
|
|
86
88
|
"item-vertmenu": icons.OverflowMenuHorizontal,
|
|
87
89
|
"item-viewdetails": icons.View,
|
|
88
90
|
"item-hidedetails": icons.ViewOff,
|
|
91
|
+
"item-image": icons.Image,
|
|
89
92
|
|
|
90
93
|
"list-sortasc": icons.ArrowDown,
|
|
91
94
|
"list-sortdesc": icons.ArrowUp,
|
|
@@ -127,6 +130,13 @@ const canonicalIcons = {
|
|
|
127
130
|
"operation-filterremove": icons.FilterRemove,
|
|
128
131
|
"operation-filter": icons.Filter,
|
|
129
132
|
"operation-format-codeblock": icons.CodeBlock,
|
|
133
|
+
"operation-format-text-code": icons.Code,
|
|
134
|
+
"operation-format-text-bold": icons.TextBold,
|
|
135
|
+
"operation-format-text-italic": icons.TextItalic,
|
|
136
|
+
"operation-format-text-strikethrough": icons.TextStrikethrough,
|
|
137
|
+
"operation-format-list-bullet": icons.ListBulleted,
|
|
138
|
+
"operation-format-list-checked": icons.ListChecked,
|
|
139
|
+
"operation-format-list-numbered": icons.ListNumbered,
|
|
130
140
|
"operation-fix": icons.Tools,
|
|
131
141
|
"operation-link": icons.Link,
|
|
132
142
|
"operation-logout": icons.Logout,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
import Card, { CardProps } from "../Card/Card";
|
|
4
5
|
|
|
5
6
|
export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
7
|
/**
|
|
@@ -11,6 +12,17 @@ export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
11
12
|
* Add a bit white space around the element.
|
|
12
13
|
*/
|
|
13
14
|
hasSpacing?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Uses a `Card` element to wrap the `OverviewItem` inside.
|
|
17
|
+
* It is always used with `isOnlyLayout` set to `true`.
|
|
18
|
+
* Should be used together with `hasSpacing`.
|
|
19
|
+
*/
|
|
20
|
+
hasCardWrapper?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Forwarding basic `Card` properties to the wrapper element.
|
|
23
|
+
* Only used if `hasCardWrapper` is set to `true`.
|
|
24
|
+
*/
|
|
25
|
+
cardProps?: Omit<CardProps, "children" | "isOnlyLayout" | "fullHeight" | "whitespaceAmount" | "compact">;
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
/**
|
|
@@ -22,6 +34,8 @@ export const OverviewItem = ({
|
|
|
22
34
|
className = "",
|
|
23
35
|
densityHigh = false,
|
|
24
36
|
hasSpacing = false,
|
|
37
|
+
hasCardWrapper = false,
|
|
38
|
+
cardProps,
|
|
25
39
|
...otherProps
|
|
26
40
|
}: OverviewItemProps) => {
|
|
27
41
|
const item = (
|
|
@@ -38,6 +52,7 @@ export const OverviewItem = ({
|
|
|
38
52
|
</div>
|
|
39
53
|
);
|
|
40
54
|
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
56
|
const accessibilityParameters: { [key: string]: any } = Object.create(null);
|
|
42
57
|
if (typeof otherProps.onClick !== "undefined" || typeof otherProps.onKeyDown !== "undefined") {
|
|
43
58
|
accessibilityParameters["tabIndex"] = 0;
|
|
@@ -46,7 +61,15 @@ export const OverviewItem = ({
|
|
|
46
61
|
accessibilityParameters["role"] = "button";
|
|
47
62
|
}
|
|
48
63
|
|
|
49
|
-
|
|
64
|
+
const element = React.cloneElement(item, accessibilityParameters);
|
|
65
|
+
|
|
66
|
+
return hasCardWrapper ? (
|
|
67
|
+
<Card isOnlyLayout {...cardProps}>
|
|
68
|
+
{element}
|
|
69
|
+
</Card>
|
|
70
|
+
) : (
|
|
71
|
+
element
|
|
72
|
+
);
|
|
50
73
|
};
|
|
51
74
|
|
|
52
75
|
export default OverviewItem;
|
|
@@ -5,6 +5,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
|
5
5
|
export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
6
6
|
/**
|
|
7
7
|
* Displays the element using reduced height and less white space inside.
|
|
8
|
+
* @deprecated (v25) use property directly on `OverviewItem` children.
|
|
8
9
|
*/
|
|
9
10
|
densityHigh?: boolean;
|
|
10
11
|
/**
|
|
@@ -23,8 +24,8 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
* This
|
|
27
|
-
*
|
|
27
|
+
* This component is a listing container for multiple `OverviewItem` elements.
|
|
28
|
+
* It should only contains `OverviewItem` children but it does not check and control that condition.
|
|
28
29
|
*/
|
|
29
30
|
export const OverviewItemList = ({
|
|
30
31
|
children,
|