@eccenca/gui-elements 23.0.0-rc.3 → 23.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +2 -1
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/common/utils/colorDecideContrastvalue.js +18 -0
- package/dist/cjs/common/utils/colorDecideContrastvalue.js.map +1 -0
- package/dist/cjs/common/utils/getColorConfiguration.js +9 -5
- package/dist/cjs/common/utils/getColorConfiguration.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +18 -16
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +15 -2
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +12 -14
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Breadcrumb/BreadcrumbList.js +28 -8
- package/dist/cjs/components/Breadcrumb/BreadcrumbList.js.map +1 -1
- package/dist/cjs/components/Card/Card.js +1 -1
- package/dist/cjs/components/Card/CardContent.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +3 -3
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/Form/FieldItem.js +4 -1
- package/dist/cjs/components/Form/FieldItem.js.map +1 -1
- package/dist/cjs/components/Form/FieldItemRow.js +7 -6
- package/dist/cjs/components/Form/FieldItemRow.js.map +1 -1
- package/dist/cjs/components/Grid/Grid.js +1 -1
- package/dist/cjs/components/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/Grid/GridColumn.js +1 -1
- package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
- package/dist/cjs/components/Grid/GridRow.js.map +1 -1
- package/dist/cjs/components/HoverToggler/HoverToggler.js +33 -0
- package/dist/cjs/components/HoverToggler/HoverToggler.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +45 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/InteractionGate/InteractionGate.js +67 -0
- package/dist/cjs/components/InteractionGate/InteractionGate.js.map +1 -0
- package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +6 -6
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js +4 -2
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tabs/Tab.js +2 -1
- package/dist/cjs/components/Tabs/Tab.js.map +1 -1
- package/dist/cjs/components/Tabs/TabPanel.js +29 -0
- package/dist/cjs/components/Tabs/TabPanel.js.map +1 -0
- package/dist/cjs/components/Tag/Tag.js +2 -1
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/Tag/TagList.js +1 -1
- package/dist/cjs/components/Tag/TagList.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +3 -0
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +9 -2
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Tree/Tree.js +37 -0
- package/dist/cjs/components/Tree/Tree.js.map +1 -0
- package/dist/cjs/index.js +14 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +2 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/common/utils/colorDecideContrastvalue.js +14 -0
- package/dist/esm/common/utils/colorDecideContrastvalue.js.map +1 -0
- package/dist/esm/common/utils/getColorConfiguration.js +9 -5
- package/dist/esm/common/utils/getColorConfiguration.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +35 -33
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +25 -2
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +3 -2
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +18 -20
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Breadcrumb/BreadcrumbList.js +9 -8
- package/dist/esm/components/Breadcrumb/BreadcrumbList.js.map +1 -1
- package/dist/esm/components/Card/Card.js +1 -1
- package/dist/esm/components/Card/CardContent.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +3 -3
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/Form/FieldItem.js +4 -1
- package/dist/esm/components/Form/FieldItem.js.map +1 -1
- package/dist/esm/components/Form/FieldItemRow.js +7 -6
- package/dist/esm/components/Form/FieldItemRow.js.map +1 -1
- package/dist/esm/components/Grid/Grid.js +1 -1
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Grid/GridColumn.js +1 -1
- package/dist/esm/components/Grid/GridColumn.js.map +1 -1
- package/dist/esm/components/Grid/GridRow.js.map +1 -1
- package/dist/esm/components/HoverToggler/HoverToggler.js +37 -0
- package/dist/esm/components/HoverToggler/HoverToggler.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +45 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/InteractionGate/InteractionGate.js +54 -0
- package/dist/esm/components/InteractionGate/InteractionGate.js.map +1 -0
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +7 -7
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +4 -2
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +2 -1
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabPanel.js +35 -0
- package/dist/esm/components/Tabs/TabPanel.js.map +1 -0
- package/dist/esm/components/Tag/Tag.js +2 -1
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/Tag/TagList.js +1 -1
- package/dist/esm/components/Tag/TagList.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +3 -0
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +9 -2
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tree/Tree.js +40 -0
- package/dist/esm/components/Tree/Tree.js.map +1 -0
- package/dist/esm/index.js +10 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +1 -0
- package/dist/types/cmem/markdown/Markdown.d.ts +1 -2
- package/dist/types/common/utils/colorDecideContrastvalue.d.ts +9 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +7 -1
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +3 -3
- package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +1 -1
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +1 -1
- package/dist/types/components/Card/CardContent.d.ts +2 -2
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +3 -1
- package/dist/types/components/Form/FieldItem.d.ts +6 -3
- package/dist/types/components/Form/FieldItemRow.d.ts +11 -3
- package/dist/types/components/Grid/Grid.d.ts +6 -1
- package/dist/types/components/Grid/GridColumn.d.ts +8 -1
- package/dist/types/components/Grid/GridRow.d.ts +7 -1
- package/dist/types/components/HoverToggler/HoverToggler.d.ts +24 -0
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/InteractionGate/InteractionGate.d.ts +28 -0
- package/dist/types/components/Notification/Notification.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +21 -4
- package/dist/types/components/Spinner/Spinner.d.ts +7 -1
- package/dist/types/components/Switch/Switch.d.ts +5 -1
- package/dist/types/components/Tabs/TabPanel.d.ts +21 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +12 -1
- package/dist/types/components/Tree/Tree.d.ts +43 -0
- package/dist/types/index.d.ts +6 -2
- package/package.json +3 -2
- package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +2 -1
- package/src/cmem/markdown/Markdown.tsx +1 -1
- package/src/common/utils/colorDecideContrastvalue.ts +28 -0
- package/src/common/utils/getColorConfiguration.ts +10 -5
- package/src/components/AutoSuggestion/AutoSuggestion.scss +16 -10
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +81 -52
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +7 -3
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -3
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +2 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +10 -8
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +15 -4
- package/src/components/Breadcrumb/BreadcrumbList.tsx +10 -8
- package/src/components/Breadcrumb/breadcrumb.scss +4 -0
- package/src/components/Breadcrumb/stories/BreadcrumbList.stories.tsx +1 -0
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardContent.tsx +2 -2
- package/src/components/ContextOverlay/ContextMenu.tsx +4 -0
- package/src/components/Form/FieldItem.tsx +6 -3
- package/src/components/Form/FieldItemRow.tsx +28 -6
- package/src/components/Form/form.scss +6 -0
- package/src/components/Grid/Grid.tsx +9 -3
- package/src/components/Grid/GridColumn.tsx +10 -2
- package/src/components/Grid/GridRow.tsx +8 -1
- package/src/components/HoverToggler/HoverToggler.stories.tsx +20 -0
- package/src/components/HoverToggler/HoverToggler.tsx +58 -0
- package/src/components/HoverToggler/hovertoggler.scss +45 -0
- package/src/components/Icon/canonicalIconNames.tsx +58 -0
- package/src/components/InteractionGate/InteractionGate.stories.tsx +32 -0
- package/src/components/InteractionGate/InteractionGate.tsx +76 -0
- package/src/components/InteractionGate/interactiongate.scss +11 -0
- package/src/components/Link/link.scss +9 -0
- package/src/components/Notification/Notification.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +22 -6
- package/src/components/SimpleTable/simpletable.scss +62 -2
- package/src/components/Spinner/Spinner.tsx +13 -5
- package/src/components/Spinner/spinner.scss +14 -0
- package/src/components/Switch/Switch.tsx +10 -5
- package/src/components/Tabs/Tab.tsx +2 -1
- package/src/components/Tabs/TabPanel.tsx +43 -0
- package/src/components/Tabs/stories/TabPanel.stories.tsx +21 -0
- package/src/components/Tabs/tabs.scss +1 -5
- package/src/components/Tag/Tag.tsx +2 -1
- package/src/components/Tag/TagList.tsx +1 -1
- package/src/components/Tag/tag.scss +1 -0
- package/src/components/TextField/TextField.tsx +4 -0
- package/src/components/TextField/stories/TextField.stories.tsx +1 -0
- package/src/components/TextField/textfield.scss +25 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -7
- package/src/components/Tooltip/Tooltip.tsx +24 -1
- package/src/components/Tooltip/tooltip.scss +4 -0
- package/src/components/Tree/Tree.stories.tsx +63 -0
- package/src/components/Tree/Tree.tsx +61 -0
- package/src/components/Tree/tree.scss +28 -0
- package/src/includes/carbon-components/_variables.scss +3 -1
- package/src/index.scss +5 -2
- package/src/index.ts +16 -5
|
@@ -50,6 +50,7 @@ export type ValidIconName =
|
|
|
50
50
|
| "item-add-artefact"
|
|
51
51
|
| "item-launch"
|
|
52
52
|
| "item-download"
|
|
53
|
+
| "item-upload"
|
|
53
54
|
| "item-question"
|
|
54
55
|
| "item-comment"
|
|
55
56
|
| "item-copy"
|
|
@@ -57,8 +58,10 @@ export type ValidIconName =
|
|
|
57
58
|
| "item-start"
|
|
58
59
|
| "item-stop"
|
|
59
60
|
| "item-reload"
|
|
61
|
+
| "item-reset"
|
|
60
62
|
| "item-shuffle"
|
|
61
63
|
| "item-draggable"
|
|
64
|
+
| "item-settings"
|
|
62
65
|
| "operation-search"
|
|
63
66
|
| "operation-clear"
|
|
64
67
|
| "operation-undo"
|
|
@@ -84,6 +87,8 @@ export type ValidIconName =
|
|
|
84
87
|
| "state-checked"
|
|
85
88
|
| "state-checkedsimple"
|
|
86
89
|
| "state-partlychecked"
|
|
90
|
+
| "state-declined"
|
|
91
|
+
| "state-confirmed"
|
|
87
92
|
| "artefact-project"
|
|
88
93
|
| "artefact-workflow"
|
|
89
94
|
| "artefact-dataset"
|
|
@@ -110,12 +115,16 @@ export type ValidIconName =
|
|
|
110
115
|
| "artefact-uncategorized"
|
|
111
116
|
| "artefact-rawdata"
|
|
112
117
|
| "artefact-report"
|
|
118
|
+
| "artefact-commit"
|
|
113
119
|
| "activity-error-report"
|
|
114
120
|
| "select-caret"
|
|
115
121
|
| "linked-item"
|
|
116
122
|
| "operation-auto-graph-layout"
|
|
117
123
|
| "unlinked-item"
|
|
118
124
|
| "write-protected"
|
|
125
|
+
| "settings"
|
|
126
|
+
| "favorite-empty"
|
|
127
|
+
| "favorite-filled"
|
|
119
128
|
| "undefined"
|
|
120
129
|
| "Undefined";
|
|
121
130
|
|
|
@@ -367,6 +376,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
367
376
|
normal: icons.Download20,
|
|
368
377
|
large: icons.Download32,
|
|
369
378
|
},
|
|
379
|
+
"item-upload": {
|
|
380
|
+
small: icons.Upload16,
|
|
381
|
+
normal: icons.Upload20,
|
|
382
|
+
large: icons.Upload32,
|
|
383
|
+
},
|
|
370
384
|
"item-question": {
|
|
371
385
|
small: icons.Help16,
|
|
372
386
|
normal: icons.Help20,
|
|
@@ -397,6 +411,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
397
411
|
normal: icons.Renew20,
|
|
398
412
|
large: icons.Renew32,
|
|
399
413
|
},
|
|
414
|
+
"item-reset": {
|
|
415
|
+
small: icons.Reset16,
|
|
416
|
+
normal: icons.Reset20,
|
|
417
|
+
large: icons.Reset32,
|
|
418
|
+
},
|
|
400
419
|
"item-comment": {
|
|
401
420
|
small: icons.AddComment16,
|
|
402
421
|
normal: icons.AddComment20,
|
|
@@ -412,6 +431,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
412
431
|
normal: icons.Draggable20,
|
|
413
432
|
large: icons.Draggable32,
|
|
414
433
|
},
|
|
434
|
+
"item-settings": {
|
|
435
|
+
small: icons.Settings16,
|
|
436
|
+
normal: icons.Settings20,
|
|
437
|
+
large: icons.Settings32,
|
|
438
|
+
},
|
|
415
439
|
|
|
416
440
|
"operation-search": {
|
|
417
441
|
small: icons.Search16,
|
|
@@ -541,6 +565,17 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
541
565
|
normal: icons.CheckboxIndeterminate20,
|
|
542
566
|
large: icons.CheckboxIndeterminate32,
|
|
543
567
|
},
|
|
568
|
+
"state-declined": {
|
|
569
|
+
small: icons.ThumbsDown16,
|
|
570
|
+
normal: icons.ThumbsDown20,
|
|
571
|
+
large: icons.ThumbsDown32
|
|
572
|
+
},
|
|
573
|
+
"state-confirmed": {
|
|
574
|
+
small: icons.ThumbsUp16,
|
|
575
|
+
normal: icons.ThumbsUp20,
|
|
576
|
+
large: icons.ThumbsUp32
|
|
577
|
+
},
|
|
578
|
+
|
|
544
579
|
|
|
545
580
|
"artefact-project": {
|
|
546
581
|
small: icons.Folder16,
|
|
@@ -672,6 +707,11 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
672
707
|
normal: icons.Report20,
|
|
673
708
|
large: icons.Report32,
|
|
674
709
|
},
|
|
710
|
+
"artefact-commit": {
|
|
711
|
+
small: icons.Commit16,
|
|
712
|
+
normal: icons.Commit20,
|
|
713
|
+
large: icons.Commit32
|
|
714
|
+
},
|
|
675
715
|
|
|
676
716
|
"activity-error-report": {
|
|
677
717
|
small: icons.Error16,
|
|
@@ -708,6 +748,24 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
708
748
|
large: icons.DocumentProtected32,
|
|
709
749
|
},
|
|
710
750
|
|
|
751
|
+
"settings": {
|
|
752
|
+
small: icons.Settings16,
|
|
753
|
+
normal: icons.Settings20,
|
|
754
|
+
large: icons.Settings32
|
|
755
|
+
},
|
|
756
|
+
|
|
757
|
+
"favorite-empty": {
|
|
758
|
+
small: icons.Star16,
|
|
759
|
+
normal: icons.Star20,
|
|
760
|
+
large: icons.Star32
|
|
761
|
+
},
|
|
762
|
+
|
|
763
|
+
"favorite-filled": {
|
|
764
|
+
small: icons.StarFilled16,
|
|
765
|
+
normal: icons.StarFilled20,
|
|
766
|
+
large: icons.StarFilled32
|
|
767
|
+
},
|
|
768
|
+
|
|
711
769
|
undefined: {
|
|
712
770
|
small: icons.Undefined16,
|
|
713
771
|
normal: icons.Undefined20,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
4
|
+
|
|
5
|
+
import { InteractionGate, Spinner, Link, Button, HtmlContentBlock } from "./../../index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/InteractionGate",
|
|
9
|
+
component: InteractionGate,
|
|
10
|
+
subcomponents: { Spinner },
|
|
11
|
+
argTypes: {
|
|
12
|
+
children: {
|
|
13
|
+
control: "none",
|
|
14
|
+
description: "Any sub lements, could contain elements that provide options for user interactions."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
} as ComponentMeta<typeof InteractionGate>;
|
|
18
|
+
|
|
19
|
+
const Template: ComponentStory<typeof InteractionGate> = (args) => (
|
|
20
|
+
<InteractionGate {...args}></InteractionGate>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const Default = Template.bind({});
|
|
24
|
+
Default.args = {
|
|
25
|
+
children: (
|
|
26
|
+
<HtmlContentBlock>
|
|
27
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
|
|
28
|
+
<p><Link href="https://example.net">Link</Link></p>
|
|
29
|
+
<p><Button onClick={() => alert("click")}>Button</Button></p>
|
|
30
|
+
</HtmlContentBlock>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
// FIXME: re-evaluate if polyfill is necessary
|
|
3
|
+
// we currently need a polyfill for inert because Firefox do not support it natively atm
|
|
4
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert#browser_compatibility
|
|
5
|
+
import "wicg-inert";
|
|
6
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
|
+
import Spinner, { SpinnerProps } from "./../Spinner/Spinner";
|
|
8
|
+
|
|
9
|
+
export interface InteractionGateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "inert"> {
|
|
10
|
+
/**
|
|
11
|
+
* Prevent interaction with sub elements and narrow them in their visibility.
|
|
12
|
+
*/
|
|
13
|
+
inert?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Displays a spinner centered over the sub element.
|
|
16
|
+
*/
|
|
17
|
+
showSpinner?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Configure the included `<Spinner />` element.
|
|
20
|
+
*/
|
|
21
|
+
spinnerProps?: SpinnerProps;
|
|
22
|
+
/**
|
|
23
|
+
* Do not use own wrapper element to set the position of the spinner element, if used.
|
|
24
|
+
* Use the positioning of the parent container.
|
|
25
|
+
*/
|
|
26
|
+
useParentPositioning?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Wrap content that need to be blocked from user interactions
|
|
31
|
+
* It also has options to display a spinner as overlay.
|
|
32
|
+
*/
|
|
33
|
+
function InteractionGate({
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
inert = false,
|
|
37
|
+
showSpinner = false,
|
|
38
|
+
spinnerProps = {},
|
|
39
|
+
useParentPositioning = false,
|
|
40
|
+
...otherProps
|
|
41
|
+
}: InteractionGateProps) {
|
|
42
|
+
const domRef = useRef<HTMLDivElement>(null);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
// we currently cannot add inert property directly to the div because react types module seem not to know it
|
|
46
|
+
if (inert) {
|
|
47
|
+
domRef.current!.setAttribute('inert', '');
|
|
48
|
+
} else {
|
|
49
|
+
domRef.current!.removeAttribute('inert');
|
|
50
|
+
}
|
|
51
|
+
}, [inert]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
className={
|
|
56
|
+
`${eccgui}-interactiongate__wrapper` +
|
|
57
|
+
(useParentPositioning ? ` ${eccgui}-interactiongate__wrapper--tunnelpositioning` : "")
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
ref={domRef}
|
|
62
|
+
className={
|
|
63
|
+
`${eccgui}-interactiongate` +
|
|
64
|
+
(inert ? ` ${eccgui}-interactiongate--inert` : "") +
|
|
65
|
+
(className ? ` ${className}` : "")
|
|
66
|
+
}
|
|
67
|
+
{...otherProps}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</div>
|
|
71
|
+
{showSpinner && <Spinner showLocalBackdrop={true} {...spinnerProps} className={`${eccgui}-interactiongate__spinner`} />}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default InteractionGate;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.#{eccgui}-interactiongate__wrapper:not(.#{eccgui}-interactiongate__wrapper--tunnelpositioning) {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.#{eccgui}-interactiongate--inert {
|
|
6
|
+
opacity: $eccgui-opacity-disabled;
|
|
7
|
+
|
|
8
|
+
& + .#{$eccgui}-spinner--localbackdrop {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -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}} : {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Classes } from "@blueprintjs/core";
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
|
|
5
|
+
export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Addicional CSS class name.
|
|
8
|
+
*/
|
|
9
|
+
className?: string,
|
|
10
|
+
/**
|
|
11
|
+
* `id` of the tab element that is connected to this panel content.
|
|
12
|
+
*/
|
|
13
|
+
labelledBy?: string,
|
|
14
|
+
/**
|
|
15
|
+
* Tab panel is not displayed.
|
|
16
|
+
*/
|
|
17
|
+
hidden?: boolean,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Element to display the content related to a tab.
|
|
22
|
+
* This could be used if `<Tabs />` is used in uncontrolled mode.
|
|
23
|
+
*/
|
|
24
|
+
function TabPanel({
|
|
25
|
+
children,
|
|
26
|
+
className = "",
|
|
27
|
+
labelledBy,
|
|
28
|
+
hidden = false,
|
|
29
|
+
...otherDivProps
|
|
30
|
+
}: TabPanelProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
{...otherDivProps}
|
|
34
|
+
className={`${Classes.TAB_PANEL} ${eccgui}-tab__panel ${className}`}
|
|
35
|
+
aria-labelledby={labelledBy}
|
|
36
|
+
aria-hidden={hidden}
|
|
37
|
+
>
|
|
38
|
+
{ children }
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default TabPanel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
4
|
+
import { TabPanel } from "./../../../";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Tabs",
|
|
8
|
+
component: TabPanel,
|
|
9
|
+
argTypes: {
|
|
10
|
+
},
|
|
11
|
+
} as ComponentMeta<typeof TabPanel>;
|
|
12
|
+
|
|
13
|
+
const TemplateFull: ComponentStory<typeof TabPanel> = (args) => (
|
|
14
|
+
<TabPanel {...args} />
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const TabPanelElement = TemplateFull.bind({});
|
|
18
|
+
TabPanelElement.args = {
|
|
19
|
+
children: <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />,
|
|
20
|
+
hidden: false
|
|
21
|
+
};
|
|
@@ -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}
|