@eccenca/gui-elements 23.0.0-rc.3-unofficial.0 → 23.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- 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 +9 -7
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js +13 -4
- package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/dist/cjs/components/Breadcrumb/BreadcrumbList.js +36 -9
- 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 +35 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/InteractionGate/InteractionGate.js +66 -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/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 +12 -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 +15 -13
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Breadcrumb/BreadcrumbItem.js +13 -4
- package/dist/esm/components/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/dist/esm/components/Breadcrumb/BreadcrumbList.js +17 -9
- 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 +35 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/InteractionGate/InteractionGate.js +53 -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/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 +9 -5
- package/dist/esm/index.js.map +1 -1
- 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/Breadcrumb/BreadcrumbItem.d.ts +7 -3
- package/dist/types/components/Breadcrumb/BreadcrumbList.d.ts +20 -8
- 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 +23 -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/Tooltip/Tooltip.d.ts +12 -1
- package/dist/types/components/Tree/Tree.d.ts +43 -0
- package/dist/types/index.d.ts +5 -2
- package/package.json +12 -11
- 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 +5 -2
- 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 +5 -2
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +15 -4
- package/src/components/Breadcrumb/BreadcrumbItem.tsx +15 -6
- package/src/components/Breadcrumb/BreadcrumbList.tsx +41 -17
- package/src/components/Breadcrumb/breadcrumb.scss +28 -1
- package/src/components/Breadcrumb/stories/BreadcrumbItem.stories.tsx +19 -0
- package/src/components/Breadcrumb/stories/BreadcrumbList.stories.tsx +27 -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 +46 -0
- package/src/components/InteractionGate/InteractionGate.stories.tsx +32 -0
- package/src/components/InteractionGate/InteractionGate.tsx +65 -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/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/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 +14 -5
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
$eccgui-size-textfield-height-small: $eccgui-size-block-whitespace * 2 !default;
|
|
5
5
|
$eccgui-size-textfield-height-regular: $eccgui-size-textfield-height-small * $eccgui-size-type-levelratio !default;
|
|
6
6
|
$eccgui-size-textfield-height-large: $eccgui-size-textfield-height-regular * $eccgui-size-type-levelratio *
|
|
7
|
-
|
|
7
|
+
$eccgui-size-type-levelratio !default;
|
|
8
8
|
$eccgui-size-textfield-padding-horizontal-regular: $eccgui-size-inline-whitespace !default;
|
|
9
9
|
$eccgui-size-textfield-padding-horizontal-small: $eccgui-size-inline-whitespace * 0.5 !default;
|
|
10
10
|
$eccgui-typo-textfield-fontweight: $eccgui-font-weight-regular !default;
|
|
@@ -45,6 +45,30 @@ $input-button-height-small: math.div($eccgui-size-textfield-height-small, $eccgu
|
|
|
45
45
|
|
|
46
46
|
// enhancements
|
|
47
47
|
|
|
48
|
+
@mixin intent-state-flash($state, $bgcolor, $mixratio: 24%) {
|
|
49
|
+
@keyframes intent-state-flash-#{$state} {
|
|
50
|
+
0% { background-color: mix($bgcolor, $eccgui-color-textfield-background, $mixratio); }
|
|
51
|
+
39% { background-color: $bgcolor; }
|
|
52
|
+
100% { background-color: mix($bgcolor, $eccgui-color-textfield-background, $mixratio); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.#{$ns}-input-group.#{$ns}-intent-#{$state} & {
|
|
56
|
+
animation-name: intent-state-flash-#{$state};
|
|
57
|
+
background-color: mix($bgcolor, $eccgui-color-textfield-background, $mixratio);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.#{$ns}-input {
|
|
62
|
+
.#{$ns}-input-group[class*="#{$ns}-intent"] & {
|
|
63
|
+
animation-delay: 0.5s;
|
|
64
|
+
animation-duration: 1s;
|
|
65
|
+
}
|
|
66
|
+
@include intent-state-flash("primary", $eccgui-color-info-background);
|
|
67
|
+
@include intent-state-flash("success", $eccgui-color-success-background);
|
|
68
|
+
@include intent-state-flash("warning", $eccgui-color-warning-background);
|
|
69
|
+
@include intent-state-flash("danger", $eccgui-color-danger-background);
|
|
70
|
+
}
|
|
71
|
+
|
|
48
72
|
.#{$eccgui}-textarea {
|
|
49
73
|
width: 100%;
|
|
50
74
|
}
|
|
@@ -17,20 +17,28 @@ const Template: ComponentStory<typeof Tooltip> = (args) => (
|
|
|
17
17
|
<Tooltip {...args} />
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
+
const testContent = loremIpsum({
|
|
21
|
+
p: 1,
|
|
22
|
+
avgSentencesPerParagraph: 2,
|
|
23
|
+
random: false
|
|
24
|
+
}).toString()
|
|
25
|
+
|
|
20
26
|
export const Default = Template.bind({});
|
|
21
27
|
Default.args = {
|
|
22
28
|
children: <span>hover me</span>,
|
|
23
|
-
content:
|
|
24
|
-
p: 1,
|
|
25
|
-
avgSentencesPerParagraph: 2,
|
|
26
|
-
random: false
|
|
27
|
-
}).toString(),
|
|
29
|
+
content: testContent,
|
|
28
30
|
addIndicator: true,
|
|
29
|
-
//
|
|
31
|
+
// Workaround: setting handlers to false is the only way to prevent Storybook to insert empty handlers in the code examples
|
|
30
32
|
onClose: false,
|
|
31
|
-
// onClosed: false, // this somehow leads to a problem when closed with `<span>` target
|
|
32
33
|
onClosing: false,
|
|
34
|
+
//onClosed: false,
|
|
33
35
|
onInteraction: false,
|
|
34
36
|
onOpened: false,
|
|
35
37
|
onOpening: false,
|
|
36
38
|
}
|
|
39
|
+
|
|
40
|
+
export const MarkdownSupport = Template.bind({});
|
|
41
|
+
MarkdownSupport.args = {
|
|
42
|
+
...Default.args,
|
|
43
|
+
content: "### This is a headline" + "\n\n" + testContent,
|
|
44
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Tooltip2 as BlueprintTooltip,
|
|
7
7
|
Tooltip2Props as BlueprintTooltipProps
|
|
8
8
|
} from "@blueprintjs/popover2";
|
|
9
|
+
import { MarkdownParserProps, Markdown } from "./../../cmem/markdown/Markdown";
|
|
9
10
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
10
11
|
|
|
11
12
|
export interface TooltipProps extends Omit<BlueprintTooltipProps, "position"> {
|
|
@@ -22,6 +23,16 @@ export interface TooltipProps extends Omit<BlueprintTooltipProps, "position"> {
|
|
|
22
23
|
* The tolltip will be attached to this element when it is hovered.
|
|
23
24
|
*/
|
|
24
25
|
children: React.ReactNode | React.ReactNode[];
|
|
26
|
+
/**
|
|
27
|
+
* A regular expression that when it matches against the tooltip text, enables the tooltip to be rendered as Markdown.
|
|
28
|
+
* This only works if the tooltip content is a string.
|
|
29
|
+
* Set to `false` to turn off Markdown rendering completely.
|
|
30
|
+
*/
|
|
31
|
+
markdownEnabler?: false | string;
|
|
32
|
+
/**
|
|
33
|
+
* Set properties for the Markdown parser
|
|
34
|
+
*/
|
|
35
|
+
markdownProps?: Omit<MarkdownParserProps, "children">;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
function Tooltip({
|
|
@@ -30,14 +41,26 @@ function Tooltip({
|
|
|
30
41
|
className = "",
|
|
31
42
|
size = "medium",
|
|
32
43
|
addIndicator = false,
|
|
44
|
+
markdownEnabler = "\n\n",
|
|
45
|
+
markdownProps,
|
|
33
46
|
...otherProps
|
|
34
47
|
}: TooltipProps) {
|
|
48
|
+
let tooltipContent = content;
|
|
49
|
+
|
|
50
|
+
if (
|
|
51
|
+
typeof content === "string" &&
|
|
52
|
+
typeof markdownEnabler === "string" &&
|
|
53
|
+
new RegExp(markdownEnabler).test(content)
|
|
54
|
+
) {
|
|
55
|
+
tooltipContent = <Markdown {...markdownProps}>{content}</Markdown>;
|
|
56
|
+
}
|
|
57
|
+
|
|
35
58
|
return (
|
|
36
59
|
<BlueprintTooltip
|
|
37
60
|
lazy={true}
|
|
38
61
|
hoverOpenDelay={500}
|
|
39
62
|
{...otherProps}
|
|
40
|
-
content={
|
|
63
|
+
content={tooltipContent}
|
|
41
64
|
className={
|
|
42
65
|
`${eccgui}-tooltip__wrapper` +
|
|
43
66
|
(className ? " " + className : "") +
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Tree, TreeNodeInfo, Tag, OverflowText, Icon } from "./../../index";
|
|
4
|
+
import { TreeNodeShadow as TreeNode } from "./Tree";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Tree",
|
|
8
|
+
component: Tree,
|
|
9
|
+
subcomponents: { TreeNode },
|
|
10
|
+
argTypes: {
|
|
11
|
+
},
|
|
12
|
+
} as ComponentMeta<typeof Tree>;
|
|
13
|
+
|
|
14
|
+
const Template: ComponentStory<typeof Tree> = (args) => {
|
|
15
|
+
const [treeContents, setTreeContents] = React.useState(args.contents);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Tree
|
|
19
|
+
{...args}
|
|
20
|
+
contents={treeContents}
|
|
21
|
+
/*
|
|
22
|
+
FIXME: should be demonstrated but is not the focus here
|
|
23
|
+
onNodeCollapse={toggleNode}
|
|
24
|
+
onNodeExpand={toggleNode}
|
|
25
|
+
*/
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
contents: [
|
|
33
|
+
{
|
|
34
|
+
id: 0,
|
|
35
|
+
label: "Tree item 1",
|
|
36
|
+
isExpanded: true,
|
|
37
|
+
childNodes: [
|
|
38
|
+
{
|
|
39
|
+
id: 1,
|
|
40
|
+
label: <>Tree item 1a with{" "}<Tag>Tag</Tag></>,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 2,
|
|
44
|
+
label: "Tree item 1b with a very long label that is not ellipsed on overflow",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 3,
|
|
48
|
+
label: <OverflowText inline>Tree item 1c with a very long label that is ellipsed on overflow</OverflowText>,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 4,
|
|
52
|
+
label: "Tree item 1d with icon",
|
|
53
|
+
icon: <Icon name="item-info" />
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 5,
|
|
59
|
+
label: "Tree item 2",
|
|
60
|
+
hasCaret: true,
|
|
61
|
+
},
|
|
62
|
+
] as TreeNodeInfo[]
|
|
63
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Tree as BlueprintTree,
|
|
4
|
+
TreeProps as BlueprintTreeProps,
|
|
5
|
+
TreeNode as BlueprintTreeNode,
|
|
6
|
+
TreeNodeInfo as BlueprintTreeNodeInfo,
|
|
7
|
+
} from "@blueprintjs/core";
|
|
8
|
+
import { IconProps } from "./../Icon/Icon";
|
|
9
|
+
|
|
10
|
+
/* This is basically a tunnel to the Blueprint elements but we change a view thigs regarding the icons */
|
|
11
|
+
|
|
12
|
+
// TreeNode
|
|
13
|
+
|
|
14
|
+
export interface TreeNodeInfo<T = {}> extends Omit<BlueprintTreeNodeInfo<T>, "childNodes" | "icon"> {
|
|
15
|
+
/**
|
|
16
|
+
* Child tree nodes of this node.
|
|
17
|
+
*/
|
|
18
|
+
childNodes?: Array<TreeNodeInfo<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* `<Icon />` element to render next to the node's label.
|
|
21
|
+
*/
|
|
22
|
+
icon?: React.ReactElement<IconProps>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//export const TreeNode = BlueprintTreeNode;
|
|
26
|
+
|
|
27
|
+
export interface TreeNodeProps<T = {}> extends TreeNodeInfo<T> {
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
contentRef?: (node: TreeNode<T>, element: HTMLDivElement | null) => void;
|
|
30
|
+
depth: number;
|
|
31
|
+
key?: string | number;
|
|
32
|
+
onClick?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
33
|
+
onCollapse?: (node: TreeNode<T>, e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
34
|
+
onContextMenu?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
35
|
+
onDoubleClick?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
36
|
+
onExpand?: (node: TreeNode<T>, e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
37
|
+
onMouseEnter?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
38
|
+
onMouseLeave?: (node: TreeNode<T>, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
39
|
+
path: number[];
|
|
40
|
+
}
|
|
41
|
+
export class TreeNode<T = {}> extends BlueprintTreeNode<TreeNodeProps<T>> {
|
|
42
|
+
}
|
|
43
|
+
export class TreeNodeShadow<T = {}> extends React.Component<TreeNodeProps<T>> {
|
|
44
|
+
// only provided for Storybook, so it can read the correct interface
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Tree
|
|
48
|
+
|
|
49
|
+
export interface TreeProps<T = {}> extends Omit<BlueprintTreeProps<T>, "contents"> {
|
|
50
|
+
/**
|
|
51
|
+
* Tree contents.
|
|
52
|
+
*/
|
|
53
|
+
contents: ReadonlyArray<TreeNodeInfo<T>>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tree component to display a tree structure.
|
|
58
|
+
* Have a look to the underlaying [BlueprintJS Tree](https://blueprintjs.com/docs/#core/components/tree) component for examples how to use handlers.
|
|
59
|
+
* Use only our `<Icon />` elements in the tree nodes!
|
|
60
|
+
*/
|
|
61
|
+
export const Tree = BlueprintTree;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import "~@blueprintjs/core/src/components/tree/tree";
|
|
2
|
+
|
|
3
|
+
.#{$ns}-tree {
|
|
4
|
+
overflow-x: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.#{$ns}-tree-node-content {
|
|
8
|
+
& > .#{$eccgui}-icon {
|
|
9
|
+
margin-right: $eccgui-size-inline-whitespace;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.#{$ns}-tree-node-label {
|
|
14
|
+
overflow: visible;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
|
|
17
|
+
span {
|
|
18
|
+
display: inherit;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& > span {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.#{$ns}-tag {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -30,7 +30,7 @@ $feature-flags: (
|
|
|
30
30
|
// not necessary, we include 16 columns grid directly
|
|
31
31
|
) !default;
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Manage deprecations
|
|
34
34
|
$deprecations--entry: true;
|
|
35
35
|
$deprecations--reasons: ();
|
|
36
36
|
$deprecations--message: "Deprecated code was found, this code will be removed before the next release of Carbon.";
|
|
@@ -105,5 +105,7 @@ $layout-04: carbon--rem(
|
|
|
105
105
|
) !default; // regular height of text input
|
|
106
106
|
$spacing-05: carbon--rem($eccgui-size-inline-whitespace) !default;
|
|
107
107
|
|
|
108
|
+
// FIXME: for some unknown reasons it is not possible to set the $layer* vars here, for example they are used to color the tables
|
|
109
|
+
|
|
108
110
|
// fetch some imports even earlier than normally necessary to have them ready before auto-included by library elements
|
|
109
111
|
@import "./../../components/Button/button";
|
package/src/index.scss
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
// used in own component @import "~@blueprintjs/core/src/components/tag-input/tag-input";
|
|
60
60
|
// used in own component @import "~@blueprintjs/core/src/components/toast/toast";
|
|
61
61
|
// used in own component @import "~@blueprintjs/core/src/components/tooltip/tooltip";
|
|
62
|
-
//
|
|
62
|
+
// used in own component @import "~@blueprintjs/core/src/components/tree/tree";
|
|
63
63
|
|
|
64
64
|
// -- Carbon Elements ----------------------------------------------------------
|
|
65
65
|
|
|
@@ -142,7 +142,6 @@
|
|
|
142
142
|
@import "./components/Icon/icon";
|
|
143
143
|
@import "./components/Menu/menu";
|
|
144
144
|
@import "./components/ContextOverlay/contextoverlay";
|
|
145
|
-
@import "./components/SimpleTable/simpletable";
|
|
146
145
|
@import "./components/Button/button";
|
|
147
146
|
@import "./components/OverviewItem/overviewitem";
|
|
148
147
|
@import "./components/Breadcrumb/breadcrumb";
|
|
@@ -165,11 +164,15 @@
|
|
|
165
164
|
@import "./components/Notification/notification";
|
|
166
165
|
@import "./components/Link/link";
|
|
167
166
|
@import "./components/Spinner/spinner";
|
|
167
|
+
@import "./components/InteractionGate/interactiongate";
|
|
168
168
|
@import "./components/Tabs/tabs";
|
|
169
169
|
@import "./components/PropertyValuePair/propertyvalue";
|
|
170
170
|
@import "./components/Iframe/iframe";
|
|
171
171
|
@import "./components/AutoSuggestion/AutoSuggestion";
|
|
172
172
|
@import "./components/Select/select";
|
|
173
|
+
@import "./components/HoverToggler/hovertoggler";
|
|
174
|
+
@import "./components/SimpleTable/simpletable";
|
|
175
|
+
@import "./components/Tree/tree";
|
|
173
176
|
@import "./extensions/codemirror/codemirror";
|
|
174
177
|
|
|
175
178
|
// == load tweaks ==============================================================
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,8 @@ import Grid from "./components/Grid/Grid";
|
|
|
21
21
|
import GridRow from "./components/Grid/GridRow";
|
|
22
22
|
import GridColumn from "./components/Grid/GridColumn";
|
|
23
23
|
|
|
24
|
+
import {HoverToggler} from "./components/HoverToggler/HoverToggler";
|
|
25
|
+
|
|
24
26
|
import WorkspaceContent from "./components/Workspace/WorkspaceContent";
|
|
25
27
|
import WorkspaceMain from "./components/Workspace/WorkspaceMain";
|
|
26
28
|
import WorkspaceSide from "./components/Workspace/WorkspaceSide";
|
|
@@ -123,24 +125,28 @@ import AccordionItem from "./components/Accordion/AccordionItem";
|
|
|
123
125
|
import Link from "./components/Link/Link";
|
|
124
126
|
|
|
125
127
|
import Spinner from "./components/Spinner/Spinner";
|
|
128
|
+
import InteractionGate from "./components/InteractionGate/InteractionGate";
|
|
126
129
|
|
|
127
130
|
import { PropertyName, PropertyValue, PropertyValuePair, PropertyValueList } from "./components/PropertyValuePair";
|
|
128
131
|
|
|
129
132
|
import * as TypographyClassNames from "./components/Typography/classnames";
|
|
130
|
-
import {ClassNames as IntentClassNames} from "./common/Intent";
|
|
131
|
-
import { openInNewTab } from "./common/utils/openInNewTab";
|
|
132
133
|
import { ProgressBar } from "./components/ProgressBar/ProgressBar";
|
|
133
134
|
import List from "./components/List/List";
|
|
134
135
|
|
|
135
136
|
import * as LegacyReplacements from "./legacy-replacements";
|
|
136
137
|
|
|
138
|
+
import {ClassNames as IntentClassNames} from "./common/Intent";
|
|
139
|
+
import { openInNewTab } from "./common/utils/openInNewTab";
|
|
140
|
+
import decideContrastColorValue from "./common/utils/colorDecideContrastvalue";
|
|
141
|
+
|
|
137
142
|
const HelperClasses = {
|
|
138
143
|
Typography: TypographyClassNames,
|
|
139
144
|
Intent: IntentClassNames,
|
|
140
145
|
};
|
|
141
146
|
|
|
142
147
|
const Utilities = {
|
|
143
|
-
openInNewTab
|
|
148
|
+
openInNewTab,
|
|
149
|
+
decideContrastColorValue
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
export {
|
|
@@ -216,6 +222,7 @@ export {
|
|
|
216
222
|
CardContent,
|
|
217
223
|
CardActions,
|
|
218
224
|
CardActionsAux,
|
|
225
|
+
HoverToggler,
|
|
219
226
|
Spacing,
|
|
220
227
|
Divider,
|
|
221
228
|
Tooltip,
|
|
@@ -234,22 +241,24 @@ export {
|
|
|
234
241
|
Notification,
|
|
235
242
|
Link,
|
|
236
243
|
Spinner,
|
|
244
|
+
InteractionGate,
|
|
237
245
|
PropertyName,
|
|
238
246
|
PropertyValue,
|
|
239
247
|
PropertyValuePair,
|
|
240
248
|
PropertyValueList,
|
|
241
249
|
Toast,
|
|
242
250
|
HelperClasses,
|
|
243
|
-
Select,
|
|
251
|
+
Select,
|
|
244
252
|
MultiSelect,
|
|
245
253
|
AutoCompleteField,
|
|
246
254
|
ProgressBar,
|
|
247
255
|
Iframe,
|
|
248
256
|
IframeModal,
|
|
249
257
|
Utilities,
|
|
250
|
-
LegacyReplacements
|
|
258
|
+
LegacyReplacements,
|
|
251
259
|
};
|
|
252
260
|
|
|
261
|
+
export * from "./components/Tree/Tree";
|
|
253
262
|
export * from "./cmem";
|
|
254
263
|
export * from "./extensions";
|
|
255
264
|
export * from "./components/interfaces";
|