@eccenca/gui-elements 23.3.1-rc.2 → 23.4.0-rc.0
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 +16 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +61 -19
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +4 -18
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js +65 -0
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/index.js +3 -3
- package/dist/cjs/components/AutoSuggestion/index.js.map +1 -1
- package/dist/cjs/components/Card/CardHeader.js +19 -18
- package/dist/cjs/components/Card/CardHeader.js.map +1 -1
- package/dist/cjs/components/Grid/GridColumn.js +3 -3
- package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyName.js +4 -2
- package/dist/cjs/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyValue.js +6 -4
- package/dist/cjs/components/PropertyValuePair/PropertyValue.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js +13 -3
- package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.js +30 -0
- package/dist/cjs/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/cjs/components/Skeleton/classnames.js +6 -0
- package/dist/cjs/components/Skeleton/classnames.js.map +1 -0
- package/dist/cjs/components/Table/TableCell.js +3 -2
- package/dist/cjs/components/Table/TableCell.js.map +1 -1
- package/dist/cjs/components/TextField/useTextValidation.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +82 -40
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +6 -20
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js +70 -0
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -0
- package/dist/esm/components/AutoSuggestion/index.js +2 -2
- package/dist/esm/components/AutoSuggestion/index.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +15 -14
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Grid/GridColumn.js +3 -3
- package/dist/esm/components/Grid/GridColumn.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyName.js +4 -2
- package/dist/esm/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyValue.js +6 -4
- package/dist/esm/components/PropertyValuePair/PropertyValue.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyValuePair.js +13 -3
- package/dist/esm/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
- package/dist/esm/components/Skeleton/Skeleton.js +24 -0
- package/dist/esm/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/esm/components/Skeleton/classnames.js +3 -0
- package/dist/esm/components/Skeleton/classnames.js.map +1 -0
- package/dist/esm/components/Table/TableCell.js +4 -3
- package/dist/esm/components/Table/TableCell.js.map +1 -1
- package/dist/esm/components/TextField/useTextValidation.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +8 -2
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +6 -4
- package/dist/types/components/AutoSuggestion/{SingleLineCodeEditor.d.ts → ExtendedCodeEditor.d.ts} +7 -4
- package/dist/types/components/AutoSuggestion/index.d.ts +3 -3
- package/dist/types/components/Card/CardHeader.d.ts +2 -2
- package/dist/types/components/Grid/GridColumn.d.ts +1 -0
- package/dist/types/components/PropertyValuePair/PropertyName.d.ts +7 -1
- package/dist/types/components/PropertyValuePair/PropertyValue.d.ts +7 -1
- package/dist/types/components/PropertyValuePair/PropertyValuePair.d.ts +5 -1
- package/dist/types/components/Skeleton/Skeleton.d.ts +13 -0
- package/dist/types/components/Skeleton/classnames.d.ts +1 -0
- package/dist/types/components/Table/TableCell.d.ts +7 -2
- package/dist/types/components/TextField/useTextValidation.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +84 -31
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +11 -42
- package/src/components/AutoSuggestion/ExtendedCodeEditor.tsx +129 -0
- package/src/components/AutoSuggestion/index.ts +3 -11
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +83 -84
- package/src/components/AutoSuggestion/tests/{SingleLineCodeEditor.test.tsx → ExtendedCodeEditor.test.tsx} +7 -7
- package/src/components/Card/CardHeader.tsx +23 -25
- package/src/components/Grid/GridColumn.tsx +15 -13
- package/src/components/Pagination/pagination.scss +6 -1
- package/src/components/PropertyValuePair/PropertyName.tsx +21 -2
- package/src/components/PropertyValuePair/PropertyValue.tsx +21 -5
- package/src/components/PropertyValuePair/PropertyValuePair.tsx +23 -4
- package/src/components/PropertyValuePair/propertyvalue.scss +6 -1
- package/src/components/PropertyValuePair/stories/PropertyName.stories.tsx +18 -0
- package/src/components/PropertyValuePair/stories/PropertyValue.stories.tsx +18 -0
- package/src/components/PropertyValuePair/stories/PropertyValueList.stories.tsx +33 -0
- package/src/components/PropertyValuePair/stories/PropertyValuePair.stories.tsx +29 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +29 -0
- package/src/components/Skeleton/Skeleton.tsx +32 -0
- package/src/components/Skeleton/classnames.ts +3 -0
- package/src/components/Skeleton/skeleton.scss +1 -0
- package/src/components/Table/TableCell.tsx +12 -8
- package/src/components/Table/stories/TableCell.stories.tsx +30 -0
- package/src/components/Table/table.scss +96 -50
- package/src/components/TextField/stories/TextField.stories.tsx +21 -18
- package/src/components/TextField/useTextValidation.ts +82 -68
- package/src/components/index.scss +1 -0
- package/src/components/index.ts +1 -0
- package/src/extensions/codemirror/_codemirror.scss +1 -0
- package/src/index.ts +2 -0
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +0 -53
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +0 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +0 -47
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +0 -1
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +0 -110
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { PropertyValueList, PropertyValuePair } from "../../../index";
|
|
5
|
+
|
|
6
|
+
import { Default as PairExample } from "./PropertyValuePair.stories";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Components/PropertyValuePair/List",
|
|
10
|
+
component: PropertyValueList,
|
|
11
|
+
subcomponents: {
|
|
12
|
+
PropertyValuePair,
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
children: {
|
|
16
|
+
control: "none",
|
|
17
|
+
description: "Shoukd be one or more `<PropertyValuePair />` elements.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
} as Meta<typeof PropertyValueList>;
|
|
21
|
+
|
|
22
|
+
const Template: StoryFn<typeof PropertyValueList> = (args) => <PropertyValueList {...args} />;
|
|
23
|
+
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
Default.args = {
|
|
26
|
+
children: [
|
|
27
|
+
<PropertyValuePair {...PairExample.args} hasDivider hasSpacing />,
|
|
28
|
+
<PropertyValuePair {...PairExample.args} hasDivider hasSpacing />,
|
|
29
|
+
<PropertyValuePair {...PairExample.args} hasDivider hasSpacing />,
|
|
30
|
+
<PropertyValuePair {...PairExample.args} hasDivider hasSpacing />,
|
|
31
|
+
<PropertyValuePair {...PairExample.args} hasDivider hasSpacing />,
|
|
32
|
+
],
|
|
33
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { PropertyName, PropertyValue, PropertyValuePair } from "../../../index";
|
|
5
|
+
|
|
6
|
+
import { Default as NameExample } from "./PropertyName.stories";
|
|
7
|
+
import { Default as ValueExample } from "./PropertyValue.stories";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Components/PropertyValuePair",
|
|
11
|
+
component: PropertyValuePair,
|
|
12
|
+
subcomponents: {
|
|
13
|
+
PropertyName,
|
|
14
|
+
PropertyValue,
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
children: {
|
|
18
|
+
control: "none",
|
|
19
|
+
description: "Shoukd be `<PropertyName/>` and `<PropertyValue/>`, 1 of each.",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as Meta<typeof PropertyValuePair>;
|
|
23
|
+
|
|
24
|
+
const Template: StoryFn<typeof PropertyValuePair> = (args) => <PropertyValuePair {...args} />;
|
|
25
|
+
|
|
26
|
+
export const Default = Template.bind({});
|
|
27
|
+
Default.args = {
|
|
28
|
+
children: [<PropertyName {...NameExample.args} />, <PropertyValue {...ValueExample.args} />],
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Skeleton } from "./../../../index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/Skeleton",
|
|
9
|
+
component: Skeleton,
|
|
10
|
+
argTypes: {},
|
|
11
|
+
} as Meta<typeof Skeleton>;
|
|
12
|
+
|
|
13
|
+
const SkeletonExample: StoryFn<typeof Skeleton> = (args) => <Skeleton {...args} />;
|
|
14
|
+
|
|
15
|
+
export const Inline = SkeletonExample.bind({});
|
|
16
|
+
Inline.args = {
|
|
17
|
+
children: (
|
|
18
|
+
<span className="test">
|
|
19
|
+
{loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 3, random: false }).toString()}
|
|
20
|
+
</span>
|
|
21
|
+
),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Block = SkeletonExample.bind({});
|
|
25
|
+
Block.args = {
|
|
26
|
+
children: (
|
|
27
|
+
<p>{loremIpsum({ p: 1, avgSentencesPerParagraph: 5, avgWordsPerSentence: 8, random: false }).toString()}</p>
|
|
28
|
+
),
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { SKELETON } from "./classnames";
|
|
4
|
+
|
|
5
|
+
export interface SkeletonProps {
|
|
6
|
+
/**
|
|
7
|
+
* Element that need to displayed using the skeleton styles.
|
|
8
|
+
*/
|
|
9
|
+
children: JSX.Element | JSX.Element[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `<Skeleton />` provides a loading state display of its children elements.
|
|
14
|
+
* It does not provide its own content.
|
|
15
|
+
*/
|
|
16
|
+
export function Skeleton({ children }: SkeletonProps) {
|
|
17
|
+
const alteredChildren = React.Children.map(children, (child) => {
|
|
18
|
+
const originalChild = child as React.ReactElement;
|
|
19
|
+
if (originalChild.props) {
|
|
20
|
+
return React.cloneElement(originalChild, {
|
|
21
|
+
className: originalChild.props.className ? originalChild.props.className + " " + SKELETON : SKELETON,
|
|
22
|
+
// @see https://blueprintjs.com/docs/versions/4/#core/components/skeleton
|
|
23
|
+
disabled: true,
|
|
24
|
+
tabIndex: -1,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return originalChild;
|
|
28
|
+
});
|
|
29
|
+
return <>{alteredChildren}</>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default Skeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "~@blueprintjs/core/src/components/skeleton/skeleton";
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
TableCellProps as CarbonTableCellProps,
|
|
5
|
-
} from "carbon-components-react";
|
|
2
|
+
import { TableCell as CarbonTableCell, TableCellProps as CarbonTableCellProps } from "carbon-components-react";
|
|
3
|
+
|
|
6
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
5
|
|
|
8
6
|
export interface TableCellProps extends CarbonTableCellProps, React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
7
|
+
/**
|
|
8
|
+
* By default all table cell content is aligned to the left of the cell.
|
|
9
|
+
* Use this property to change the horizontal alignment.
|
|
10
|
+
*/
|
|
11
|
+
alignHorizontal?: "left" | "center";
|
|
9
12
|
/**
|
|
10
13
|
* By default all table cell content is aligned to the top of the cell.
|
|
11
14
|
* Use this property to change the vertical alignment.
|
|
12
15
|
*/
|
|
13
|
-
alignVertical?: "middle";
|
|
16
|
+
alignVertical?: "top" | "middle";
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export function TableCell({
|
|
17
20
|
className = "",
|
|
18
21
|
children,
|
|
22
|
+
alignHorizontal,
|
|
19
23
|
alignVertical,
|
|
20
24
|
...otherTableCellProps
|
|
21
25
|
}: TableCellProps) {
|
|
22
|
-
|
|
23
26
|
return (
|
|
24
27
|
<CarbonTableCell
|
|
25
28
|
className={
|
|
26
29
|
`${eccgui}-simpletable__cell` +
|
|
27
|
-
(
|
|
30
|
+
(alignHorizontal ? ` ${eccgui}-simpletable__cell--${alignHorizontal}` : "") +
|
|
31
|
+
(alignVertical ? ` ${eccgui}-simpletable__cell--${alignVertical}` : "") +
|
|
28
32
|
(className ? ` ${className}` : "")
|
|
29
33
|
}
|
|
30
34
|
{...otherTableCellProps}
|
|
31
35
|
>
|
|
32
36
|
{children}
|
|
33
37
|
</CarbonTableCell>
|
|
34
|
-
)
|
|
38
|
+
);
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
export default TableCell;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Table, TableBody, TableCell, TableContainer, TableRow } from "../../../index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/Table/TableCell",
|
|
9
|
+
component: TableCell,
|
|
10
|
+
argTypes: {},
|
|
11
|
+
} as Meta<typeof TableCell>;
|
|
12
|
+
|
|
13
|
+
const Template: StoryFn<typeof TableCell> = (args) => {
|
|
14
|
+
return (
|
|
15
|
+
<TableContainer>
|
|
16
|
+
<Table>
|
|
17
|
+
<TableBody>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableCell {...args} />
|
|
20
|
+
</TableRow>
|
|
21
|
+
</TableBody>
|
|
22
|
+
</Table>
|
|
23
|
+
</TableContainer>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Default = Template.bind({});
|
|
28
|
+
Default.args = {
|
|
29
|
+
children: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }).toString(),
|
|
30
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
|
|
1
3
|
// import libs
|
|
2
4
|
@use "~@carbon/styles/scss/components/data-table/data-table";
|
|
5
|
+
|
|
3
6
|
// currently not needed @import "~@carbon/styles/scss/components/data-table/action";
|
|
4
7
|
@use "~@carbon/styles/scss/components/data-table/expandable/index" as table-expandable;
|
|
8
|
+
|
|
5
9
|
// currently not needed @import ~@carbon/styles/scss/components/data-table/skeleton;
|
|
6
10
|
@use "~@carbon/styles/scss/components/data-table/sort/index" as table-sort;
|
|
7
11
|
@include data-table.data-table;
|
|
@@ -17,11 +21,15 @@ $eccgui-size-tablecell-font-weight: $eccgui-font-weight-regular !default;
|
|
|
17
21
|
$eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
|
|
18
22
|
$eccgui-color-table-background: $card-background-color !default;
|
|
19
23
|
$eccgui-color-tableheader-background: $button-background-color !default;
|
|
20
|
-
$eccgui-color-tablerow-background-even:
|
|
24
|
+
$eccgui-color-tablerow-background-even: color.adjust($menu-item-color-hover, $lightness: 24%) !default;
|
|
21
25
|
$eccgui-color-tablerow-background-odd: transparent !default;
|
|
22
26
|
$eccgui-color-tablerow-hover: $menu-item-color-hover !default;
|
|
23
27
|
$eccgui-color-tablerow-selected: rgba($eccgui-color-accent, 0.1) !default;
|
|
24
|
-
$eccgui-color-tablerow-selected-hover: mix(
|
|
28
|
+
$eccgui-color-tablerow-selected-hover: color.mix(
|
|
29
|
+
$eccgui-color-tablerow-selected,
|
|
30
|
+
$eccgui-color-tablerow-hover,
|
|
31
|
+
50%
|
|
32
|
+
) !default;
|
|
25
33
|
$eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
26
34
|
|
|
27
35
|
// changes
|
|
@@ -32,8 +40,29 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
32
40
|
|
|
33
41
|
.#{$prefix}--data-table {
|
|
34
42
|
min-width: 100%;
|
|
43
|
+
|
|
35
44
|
--#{$eccgui}-color-border: #{$eccgui-color-tablerow-border};
|
|
36
45
|
--#{$eccgui}-divider-row: none;
|
|
46
|
+
|
|
47
|
+
thead th,
|
|
48
|
+
tbody td,
|
|
49
|
+
tbody th {
|
|
50
|
+
padding-right: $eccgui-size-block-whitespace * 0.5;
|
|
51
|
+
padding-left: $eccgui-size-block-whitespace * 0.5;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
|
|
54
|
+
&.#{$prefix}--table-expand {
|
|
55
|
+
width: $button-height;
|
|
56
|
+
height: $button-height;
|
|
57
|
+
padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
|
|
58
|
+
padding-left: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
thead th.#{$prefix}--table-expand {
|
|
63
|
+
padding-top: 0;
|
|
64
|
+
padding-bottom: 0;
|
|
65
|
+
}
|
|
37
66
|
}
|
|
38
67
|
|
|
39
68
|
.#{$eccgui}-simpletable--haslayout {
|
|
@@ -45,14 +74,14 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
45
74
|
}
|
|
46
75
|
|
|
47
76
|
.#{$prefix}--data-table thead {
|
|
48
|
-
background-color: transparent;
|
|
49
77
|
font-weight: $eccgui-size-tablecell-font-weight;
|
|
78
|
+
background-color: transparent;
|
|
50
79
|
}
|
|
51
80
|
|
|
52
81
|
.#{$prefix}--data-table th,
|
|
53
82
|
.#{$prefix}--data-table-header {
|
|
54
|
-
background-color: $eccgui-color-tableheader-background;
|
|
55
83
|
font-weight: $eccgui-size-tableheader-font-weight;
|
|
84
|
+
background-color: $eccgui-color-tableheader-background;
|
|
56
85
|
}
|
|
57
86
|
.#{$prefix}--data-table th.#{$prefix}--table-column-checkbox {
|
|
58
87
|
background: $eccgui-color-tableheader-background;
|
|
@@ -65,10 +94,10 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
65
94
|
}
|
|
66
95
|
|
|
67
96
|
.#{$prefix}--data-table .#{$prefix}--table-header-label {
|
|
68
|
-
padding: $eccgui-size-tablecell-padding-regular 0;
|
|
69
|
-
overflow: hidden;
|
|
70
97
|
flex-shrink: 1;
|
|
71
98
|
min-width: 0;
|
|
99
|
+
padding: $eccgui-size-tablecell-padding-regular 0;
|
|
100
|
+
overflow: hidden;
|
|
72
101
|
text-overflow: ellipsis;
|
|
73
102
|
}
|
|
74
103
|
|
|
@@ -76,13 +105,19 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
76
105
|
.#{$prefix}--data-table tbody th {
|
|
77
106
|
padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
|
|
78
107
|
padding-bottom: $eccgui-size-tablecell-padding-regular * 0.95;
|
|
79
|
-
|
|
80
108
|
vertical-align: top;
|
|
109
|
+
background: var(--#{$eccgui}-color-cell) !important;
|
|
110
|
+
border-top: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-cell) !important;
|
|
111
|
+
border-bottom: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-border) !important;
|
|
81
112
|
|
|
82
113
|
&.#{$eccgui}-simpletable__cell--middle {
|
|
83
114
|
vertical-align: middle;
|
|
84
115
|
}
|
|
85
116
|
|
|
117
|
+
&.#{$eccgui}-simpletable__cell--center {
|
|
118
|
+
text-align: center;
|
|
119
|
+
}
|
|
120
|
+
|
|
86
121
|
& + td:first-of-type {
|
|
87
122
|
padding-left: $spacing-05;
|
|
88
123
|
}
|
|
@@ -94,49 +129,25 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
94
129
|
min-width: 0;
|
|
95
130
|
}
|
|
96
131
|
|
|
97
|
-
.#{$prefix}--data-table {
|
|
98
|
-
thead th, tbody td, tbody th {
|
|
99
|
-
padding-left: $eccgui-size-block-whitespace * 0.5;
|
|
100
|
-
padding-right: $eccgui-size-block-whitespace * 0.5;
|
|
101
|
-
overflow: hidden;
|
|
102
|
-
|
|
103
|
-
&.#{$prefix}--table-expand {
|
|
104
|
-
height: $button-height;
|
|
105
|
-
width: $button-height;
|
|
106
|
-
padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
|
|
107
|
-
padding-left: 0;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
thead th.#{$prefix}--table-expand {
|
|
112
|
-
padding-top: 0;
|
|
113
|
-
padding-bottom: 0;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
132
|
.#{$prefix}--table-expand__button {
|
|
118
|
-
height: $button-height;
|
|
119
133
|
width: $button-height;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.#{$prefix}--data-table td,
|
|
123
|
-
.#{$prefix}--data-table tbody th {
|
|
124
|
-
border-top: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-cell) !important;
|
|
125
|
-
border-bottom: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-border) !important;
|
|
126
|
-
background: var(--#{$eccgui}-color-cell) !important;
|
|
134
|
+
height: $button-height;
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
// Row background colors
|
|
130
138
|
|
|
131
139
|
.#{$eccgui}-simpletable--colorless > tbody {
|
|
132
|
-
& > tr,
|
|
140
|
+
& > tr,
|
|
141
|
+
& > tr:hover {
|
|
133
142
|
background: transparent;
|
|
143
|
+
|
|
134
144
|
--#{$eccgui}-color-cell: transparent;
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
.#{$prefix}--data-table:not(.#{$eccgui}-simpletable--colorless) > tbody {
|
|
139
149
|
background-color: transparent;
|
|
150
|
+
|
|
140
151
|
--#{$eccgui}-color-cell: #{$eccgui-color-tablerow-background-odd};
|
|
141
152
|
|
|
142
153
|
& > tr {
|
|
@@ -149,23 +160,34 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
149
160
|
&.#{$prefix}--expandable-row--hover {
|
|
150
161
|
background-color: transparent;
|
|
151
162
|
|
|
152
|
-
& > th,
|
|
163
|
+
& > th,
|
|
164
|
+
& > td {
|
|
153
165
|
--#{$eccgui}-color-cell: #{$eccgui-color-tablerow-hover};
|
|
154
166
|
}
|
|
155
167
|
}
|
|
156
168
|
|
|
157
169
|
&.#{$prefix}--data-table--selected {
|
|
158
170
|
& > th {
|
|
159
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
171
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
172
|
+
$eccgui-color-tablerow-selected,
|
|
173
|
+
$eccgui-color-tableheader-background,
|
|
174
|
+
50%
|
|
175
|
+
)};
|
|
160
176
|
}
|
|
177
|
+
|
|
161
178
|
& > td {
|
|
162
179
|
--#{$eccgui}-color-cell: #{$eccgui-color-tablerow-selected};
|
|
163
180
|
}
|
|
164
181
|
|
|
165
182
|
&:hover {
|
|
166
183
|
& > th {
|
|
167
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
184
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
185
|
+
$eccgui-color-tablerow-selected-hover,
|
|
186
|
+
$eccgui-color-tableheader-background,
|
|
187
|
+
50%
|
|
188
|
+
)};
|
|
168
189
|
}
|
|
190
|
+
|
|
169
191
|
& > td {
|
|
170
192
|
--#{$eccgui}-color-cell: #{$eccgui-color-tablerow-selected-hover};
|
|
171
193
|
}
|
|
@@ -176,43 +198,67 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
|
|
|
176
198
|
|
|
177
199
|
// zebra style
|
|
178
200
|
|
|
179
|
-
.#{$prefix}--data-table--zebra > tbody > tr[data-parent-row]:nth-child(4n+3),
|
|
180
|
-
.#{$prefix}--data-table--zebra > tbody > tr[data-child-row]:nth-child(4n+4),
|
|
201
|
+
.#{$prefix}--data-table--zebra > tbody > tr[data-parent-row]:nth-child(4n + 3),
|
|
202
|
+
.#{$prefix}--data-table--zebra > tbody > tr[data-child-row]:nth-child(4n + 4),
|
|
181
203
|
.#{$prefix}--data-table > tbody > tr.#{eccgui}-simpletable__row--zebra,
|
|
182
204
|
.#{$prefix}--data-table > tbody > tr.#{eccgui}-simpletable__row--zebra + tr[data-child-row],
|
|
183
|
-
.#{$prefix}--data-table--zebra > tbody > tr:not([data-parent-row]):not([data-child-row]):nth-child(2n+0) {
|
|
205
|
+
.#{$prefix}--data-table--zebra > tbody > tr:not([data-parent-row]):not([data-child-row]):nth-child(2n + 0) {
|
|
184
206
|
// even rows
|
|
185
207
|
|
|
186
208
|
&.#{$prefix}--expandable-row:not([data-child-row]) {
|
|
187
209
|
--#{$eccgui}-color-border: #{$eccgui-color-tablerow-background-even};
|
|
188
210
|
}
|
|
189
211
|
|
|
190
|
-
& > th,
|
|
212
|
+
& > th,
|
|
213
|
+
& > td {
|
|
191
214
|
--#{$eccgui}-color-cell: #{$eccgui-color-tablerow-background-even};
|
|
192
215
|
}
|
|
193
216
|
|
|
194
217
|
&:hover,
|
|
195
218
|
&:hover + tr[data-child-row],
|
|
196
219
|
&.#{$prefix}--expandable-row--hover {
|
|
197
|
-
& > th,
|
|
198
|
-
|
|
220
|
+
& > th,
|
|
221
|
+
& > td {
|
|
222
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
223
|
+
$eccgui-color-tablerow-hover,
|
|
224
|
+
$eccgui-color-tablerow-background-even,
|
|
225
|
+
50%
|
|
226
|
+
)};
|
|
199
227
|
}
|
|
200
228
|
}
|
|
201
229
|
|
|
202
230
|
&.#{$prefix}--data-table--selected {
|
|
203
231
|
& > th {
|
|
204
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
232
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
233
|
+
color.mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-background-even, 50%),
|
|
234
|
+
$eccgui-color-tableheader-background,
|
|
235
|
+
50%
|
|
236
|
+
)};
|
|
205
237
|
}
|
|
238
|
+
|
|
206
239
|
& > td {
|
|
207
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
240
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
241
|
+
$eccgui-color-tablerow-selected,
|
|
242
|
+
$eccgui-color-tablerow-background-even,
|
|
243
|
+
50%
|
|
244
|
+
)};
|
|
208
245
|
}
|
|
209
246
|
|
|
210
247
|
&:hover {
|
|
211
248
|
& > th {
|
|
212
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
249
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
250
|
+
color.mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tablerow-background-even, 50%),
|
|
251
|
+
$eccgui-color-tableheader-background,
|
|
252
|
+
50%
|
|
253
|
+
)};
|
|
213
254
|
}
|
|
255
|
+
|
|
214
256
|
& > td {
|
|
215
|
-
--#{$eccgui}-color-cell: #{mix(
|
|
257
|
+
--#{$eccgui}-color-cell: #{color.mix(
|
|
258
|
+
$eccgui-color-tablerow-selected-hover,
|
|
259
|
+
$eccgui-color-tablerow-background-even,
|
|
260
|
+
50%
|
|
261
|
+
)};
|
|
216
262
|
}
|
|
217
263
|
}
|
|
218
264
|
}
|
|
@@ -283,8 +329,8 @@ tr.#{$prefix}--parent-row.#{$prefix}--expandable-row + tr[data-child-row] {
|
|
|
283
329
|
// Sorting option
|
|
284
330
|
|
|
285
331
|
.#{$prefix}--table-sort {
|
|
286
|
-
background-color: transparent;
|
|
287
332
|
padding-left: $eccgui-size-block-whitespace * 0.5;
|
|
333
|
+
background-color: transparent;
|
|
288
334
|
|
|
289
335
|
&:hover {
|
|
290
336
|
background-color: $button-background-color-hover;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
3
|
+
|
|
4
4
|
import { helpersArgTypes } from "../../../../.storybook/helpers";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import characters from "../../../common/utils/characters";
|
|
6
|
+
import { TextFieldProps } from "../TextField";
|
|
7
|
+
|
|
8
|
+
import { TextField } from "./../../../../index";
|
|
7
9
|
|
|
8
10
|
export default {
|
|
9
11
|
title: "Forms/TextField",
|
|
@@ -17,13 +19,11 @@ export default {
|
|
|
17
19
|
},
|
|
18
20
|
intent: {
|
|
19
21
|
...helpersArgTypes.exampleIntent,
|
|
20
|
-
}
|
|
22
|
+
},
|
|
21
23
|
},
|
|
22
24
|
} as ComponentMeta<typeof TextField>;
|
|
23
25
|
|
|
24
|
-
const Template: ComponentStory<typeof TextField> = (args) =>
|
|
25
|
-
<TextField {...args}></TextField>
|
|
26
|
-
);
|
|
26
|
+
const Template: ComponentStory<typeof TextField> = (args) => <TextField {...args}></TextField>;
|
|
27
27
|
|
|
28
28
|
export const Default = Template.bind({});
|
|
29
29
|
|
|
@@ -36,24 +36,27 @@ Default.args = {
|
|
|
36
36
|
/** Text field with default value that contains a zero width/invisible character.
|
|
37
37
|
* As long as the character exists, an alert is raised for every value change with a delay of 500ms.
|
|
38
38
|
* Instead of an alert, something more sophisticated like a clean up action should be offered in production. */
|
|
39
|
-
export const InvisibleCharacterWarning = Template.bind({})
|
|
39
|
+
export const InvisibleCharacterWarning = Template.bind({});
|
|
40
40
|
|
|
41
41
|
const invisibleCharacterWarningProps: TextFieldProps = {
|
|
42
42
|
...Default.args,
|
|
43
43
|
invisibleCharacterWarning: {
|
|
44
44
|
callback: (codePoints) => {
|
|
45
|
-
if(codePoints.size) {
|
|
45
|
+
if (codePoints.size) {
|
|
46
46
|
const codePointsString = [...Array.from(codePoints)]
|
|
47
47
|
.map((n) => {
|
|
48
|
-
const info = characters.invisibleZeroWidthCharacters.codePointMap.get(n)
|
|
49
|
-
return info.fullLabel
|
|
48
|
+
const info = characters.invisibleZeroWidthCharacters.codePointMap.get(n);
|
|
49
|
+
return info.fullLabel;
|
|
50
50
|
})
|
|
51
|
-
.join(", ")
|
|
52
|
-
alert("Invisible character detected in input string. Code points: " + codePointsString)
|
|
51
|
+
.join(", ");
|
|
52
|
+
alert("Invisible character detected in input string. Code points: " + codePointsString);
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
callbackDelay: 500
|
|
55
|
+
callbackDelay: 500,
|
|
56
|
+
},
|
|
57
|
+
onChange: () => {
|
|
58
|
+
/** needs to be defined, else the invisible character warning callback will not be triggered. */
|
|
56
59
|
},
|
|
57
|
-
defaultValue: "Invisible character -><-"
|
|
58
|
-
}
|
|
59
|
-
InvisibleCharacterWarning.args = invisibleCharacterWarningProps
|
|
60
|
+
defaultValue: "Invisible character -><-",
|
|
61
|
+
};
|
|
62
|
+
InvisibleCharacterWarning.args = invisibleCharacterWarningProps;
|