@eccenca/gui-elements 23.0.0-rc.3 → 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 +13 -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 +9 -7
- 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 +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/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 +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/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 +3 -2
- 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/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 +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
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {Pagination as CarbonPagination} from "carbon-components-react";
|
|
2
|
+
import {Pagination as CarbonPagination, PaginationProps as CarbonPaginationProps} from "carbon-components-react";
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
4
|
|
|
5
|
+
interface PaginationProps extends CarbonPaginationProps {
|
|
6
|
+
/**
|
|
7
|
+
Hide the select option to set how many items per page are displayed.
|
|
8
|
+
*/
|
|
9
|
+
hidePageSizeConfiguration?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
Hide info about the item numbers that are currently displayed.
|
|
12
|
+
*/
|
|
13
|
+
hideInfoText?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
Hide select box to switch between pages.
|
|
16
|
+
*/
|
|
17
|
+
hidePageSelect?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
Hide buttons to switch beteen nex/prev pages.
|
|
20
|
+
*/
|
|
21
|
+
hideNavigationArrows?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
5
24
|
function Pagination({
|
|
6
25
|
className,
|
|
7
26
|
hidePageSizeConfiguration = false,
|
|
@@ -9,7 +28,7 @@ function Pagination({
|
|
|
9
28
|
hidePageSelect = false,
|
|
10
29
|
hideNavigationArrows = false,
|
|
11
30
|
...otherProps
|
|
12
|
-
}:
|
|
31
|
+
}: PaginationProps) {
|
|
13
32
|
return (
|
|
14
33
|
<CarbonPagination
|
|
15
34
|
{...otherProps}
|
|
@@ -38,10 +57,7 @@ interface IPaginationOptions {
|
|
|
38
57
|
// The option of page sizes
|
|
39
58
|
pageSizes?: number[];
|
|
40
59
|
// Presentation options
|
|
41
|
-
presentation?:
|
|
42
|
-
// For narrow space requirements, the info text in the middle can be hidden
|
|
43
|
-
hideInfoText?: boolean;
|
|
44
|
-
};
|
|
60
|
+
presentation?: Omit<PaginationProps, "onChange" | "totalItems" | "pageSizes" | "page" | "pageSize">;
|
|
45
61
|
}
|
|
46
62
|
|
|
47
63
|
// Custom hook to add pagination. Currently only use-cases are supported where paging has no further side effects, e.g. REST calls.
|
|
@@ -7,9 +7,14 @@ $eccgui-size-tablecell-height-tall: mini-units(6) !default;
|
|
|
7
7
|
$eccgui-size-tablecell-padding-tall: ($eccgui-size-tablecell-height-tall - carbon--rem($eccgui-size-typo-text)) * 0.5 !default;
|
|
8
8
|
$eccgui-size-tablecell-font-weight: $eccgui-font-weight-regular !default;
|
|
9
9
|
$eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
10
|
+
$eccgui-color-tableheader-background: lighten($menu-item-color-hover, 15%) !default; // rgba($ui-03, alpha($ui-03) * $eccgui-opacity-muted);
|
|
11
|
+
$eccgui-color-tablerow-background-even: $card-background-color !default;
|
|
12
|
+
$eccgui-color-tablerow-background-odd: lighten($menu-item-color-hover, 24%) !default;
|
|
13
|
+
$eccgui-color-tablerow-hover: $menu-item-color-hover !default;
|
|
14
|
+
$eccgui-color-tablerow-selected: rgba($eccgui-color-accent, 0.1) !default;
|
|
15
|
+
$eccgui-color-tablerow-selected-hover: mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-hover, 50%) !default;
|
|
10
16
|
|
|
11
17
|
// lib vars
|
|
12
|
-
/* already defined */
|
|
13
18
|
// import libs
|
|
14
19
|
// currently not needed @import '~carbon-components/scss/components/data-table/data-table-action';
|
|
15
20
|
@import "~carbon-components/scss/components/data-table/data-table-core";
|
|
@@ -23,6 +28,10 @@ $eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
|
23
28
|
min-width: unset;
|
|
24
29
|
}
|
|
25
30
|
|
|
31
|
+
.#{$prefix}--data-table-header {
|
|
32
|
+
background-color: $eccgui-color-tablerow-background-even;
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
.#{$prefix}--data-table {
|
|
27
36
|
min-width: 100%;
|
|
28
37
|
}
|
|
@@ -33,9 +42,12 @@ $eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
.#{$prefix}--data-table th {
|
|
36
|
-
background-color:
|
|
45
|
+
background-color: $eccgui-color-tableheader-background;
|
|
37
46
|
font-weight: $eccgui-size-tableheader-font-weight;
|
|
38
47
|
}
|
|
48
|
+
.#{$prefix}--data-table th.#{$prefix}--table-column-checkbox {
|
|
49
|
+
background: $eccgui-color-tableheader-background;
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
.#{$prefix}--data-table thead tr,
|
|
41
53
|
.#{$prefix}--data-table tbody tr,
|
|
@@ -72,6 +84,50 @@ $eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
|
|
87
|
+
.#{$prefix}--data-table td,
|
|
88
|
+
.#{$prefix}--data-table tbody th {
|
|
89
|
+
border-top: 1px solid $eccgui-color-tablerow-background-even;
|
|
90
|
+
background-color: $eccgui-color-tablerow-background-even;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.#{$prefix}--data-table tbody {
|
|
94
|
+
background-color: $eccgui-color-tablerow-background-even;
|
|
95
|
+
|
|
96
|
+
tr {
|
|
97
|
+
&:hover {
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
|
|
100
|
+
th, td {
|
|
101
|
+
border-top: 1px solid $eccgui-color-tablerow-hover;
|
|
102
|
+
border-bottom: 1px solid $eccgui-color-tablerow-hover;
|
|
103
|
+
background-color: $eccgui-color-tablerow-hover;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.#{$prefix}--data-table--selected {
|
|
108
|
+
th {
|
|
109
|
+
border-top: 1px solid mix($eccgui-color-tablerow-selected, $eccgui-color-tableheader-background, 50%);
|
|
110
|
+
background-color: mix($eccgui-color-tablerow-selected, $eccgui-color-tableheader-background, 50%);
|
|
111
|
+
}
|
|
112
|
+
td {
|
|
113
|
+
border-top: 1px solid $eccgui-color-tablerow-selected;
|
|
114
|
+
background-color: $eccgui-color-tablerow-selected;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:hover {
|
|
118
|
+
th {
|
|
119
|
+
border-top: 1px solid mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tableheader-background, 50%);
|
|
120
|
+
background-color: mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tableheader-background, 50%);
|
|
121
|
+
}
|
|
122
|
+
td {
|
|
123
|
+
border-top: 1px solid $eccgui-color-tablerow-selected-hover;
|
|
124
|
+
background-color: $eccgui-color-tablerow-selected-hover;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
75
131
|
// Compact
|
|
76
132
|
|
|
77
133
|
.#{$prefix}--data-table--compact thead tr,
|
|
@@ -110,6 +166,10 @@ $eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
|
110
166
|
|
|
111
167
|
// Sticky header
|
|
112
168
|
|
|
169
|
+
.#{$prefix}--data-table_inner-container {
|
|
170
|
+
background-color: $eccgui-color-tableheader-background;
|
|
171
|
+
}
|
|
172
|
+
|
|
113
173
|
.#{$prefix}--data-table--sticky-header {
|
|
114
174
|
thead tr th {
|
|
115
175
|
// border-bottom-color: $active-ui;
|
|
@@ -23,6 +23,12 @@ export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<Bluep
|
|
|
23
23
|
stroke?: SpinnerStroke
|
|
24
24
|
// Delay when to show the spinner in ms, default: 0
|
|
25
25
|
delay?: number
|
|
26
|
+
/**
|
|
27
|
+
* Includes a backdrop behind the spinner that narrows visibility of the area behind the spinner.
|
|
28
|
+
* This option only works with "local" spinners, for "inline" spinners there is no backdrop, "global" spinners always have backdrops.
|
|
29
|
+
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or soe equivalent CSS rule.
|
|
30
|
+
*/
|
|
31
|
+
showLocalBackdrop?: boolean
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
function Spinner({
|
|
@@ -32,6 +38,7 @@ function Spinner({
|
|
|
32
38
|
position = "local",
|
|
33
39
|
size,
|
|
34
40
|
stroke,
|
|
41
|
+
showLocalBackdrop = false,
|
|
35
42
|
delay = 0,
|
|
36
43
|
...otherProps
|
|
37
44
|
}: SpinnerProps) {
|
|
@@ -80,11 +87,12 @@ function Spinner({
|
|
|
80
87
|
tagName={spinnerElement}
|
|
81
88
|
className={
|
|
82
89
|
`${eccgui}-spinner` +
|
|
83
|
-
|
|
84
|
-
` ${eccgui}-spinner--intent
|
|
85
|
-
|
|
86
|
-
` ${eccgui}-spinner--
|
|
87
|
-
|
|
90
|
+
` ${eccgui}-spinner--position-${position}` +
|
|
91
|
+
` ${eccgui}-spinner--intent-${spinnerIntent}` +
|
|
92
|
+
` ${eccgui}-spinner--size-${spinnerSize}` +
|
|
93
|
+
(showLocalBackdrop ? ` ${eccgui}-spinner--localbackdrop` : "") +
|
|
94
|
+
(className ? " " + className : "")
|
|
95
|
+
|
|
88
96
|
}
|
|
89
97
|
{...otherProps}
|
|
90
98
|
/>
|
|
@@ -69,6 +69,20 @@ span.#{$eccgui}-spinner {
|
|
|
69
69
|
width: 1em;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
.#{$eccgui}-spinner--localbackdrop {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 0;
|
|
75
|
+
right: 0;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
|
|
79
|
+
background-color: rgba($eccgui-color-workspace-background, $eccgui-opacity-muted);
|
|
80
|
+
|
|
81
|
+
.#{$eccgui}-card & {
|
|
82
|
+
background-color: rgba($card-background-color, $eccgui-opacity-muted);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
72
86
|
.#{$eccgui}-spinner__overlay {
|
|
73
87
|
position: fixed;
|
|
74
88
|
display: flex;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { Switch as BlueprintSwitch } from "@blueprintjs/core";
|
|
1
|
+
import React, {memo, SyntheticEvent} from 'react';
|
|
2
|
+
import { Switch as BlueprintSwitch, SwitchProps } from "@blueprintjs/core";
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface Props extends Omit<SwitchProps, "onChange"> {
|
|
6
|
+
onChange?: (value: boolean) => any
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function Switch({onChange, ...otherProps}: Props) {
|
|
10
|
+
const handleChange = (e: SyntheticEvent<HTMLInputElement>) => {
|
|
11
|
+
const checked = !!(e as any).target?.checked
|
|
12
|
+
onChange && onChange(checked);
|
|
8
13
|
};
|
|
9
14
|
|
|
10
15
|
return <BlueprintSwitch
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
TabProps as BlueprintTabProps
|
|
5
5
|
} from "@blueprintjs/core";
|
|
6
6
|
import Color from "color";
|
|
7
|
+
import decideContrastColorValue from "./../../common/utils/colorDecideContrastvalue";
|
|
7
8
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
8
9
|
import TabTitle, { TabTitleProps } from "./TabTitle";
|
|
9
10
|
|
|
@@ -47,7 +48,7 @@ export const transformTabProperties = ({
|
|
|
47
48
|
}
|
|
48
49
|
colorStyles = {
|
|
49
50
|
backgroundColor: `${color.rgb().toString()}`,
|
|
50
|
-
color:
|
|
51
|
+
color: decideContrastColorValue({testColor: color}),
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
const extraStyles = (dontShrink || !!backgroundColor) ? {style: {...flexStyles, ...colorStyles}} : {};
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
TagProps as BlueprintTagProps
|
|
5
5
|
} from "@blueprintjs/core";
|
|
6
6
|
import Color from "color";
|
|
7
|
+
import decideContrastColorValue from "./../../common/utils/colorDecideContrastvalue";
|
|
7
8
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
8
9
|
|
|
9
10
|
interface TagProps extends Omit<
|
|
@@ -74,7 +75,7 @@ function Tag({
|
|
|
74
75
|
...additionalStyles,
|
|
75
76
|
...{
|
|
76
77
|
backgroundColor: color.rgb().toString(),
|
|
77
|
-
color:
|
|
78
|
+
color: decideContrastColorValue({testColor: color}),
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -69,6 +69,10 @@ function TextField({
|
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
if ((!!otherProps.readOnly || !!otherProps.disabled) && !!otherProps.value && !otherProps.title) {
|
|
73
|
+
otherProps["title"] = otherProps.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
return (
|
|
73
77
|
<BlueprintInputGroup
|
|
74
78
|
className={`${eccgui}-textfield ` + className}
|
|
@@ -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 ==============================================================
|