@sphereon/ui-components.ssi-react 0.1.3-unstable.64 → 0.1.3-unstable.67
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ColumnHeaderTextOptions } from '../../../types';
|
|
2
3
|
export type Props = {
|
|
3
4
|
text: string;
|
|
4
|
-
|
|
5
|
-
enableHover?: boolean;
|
|
5
|
+
opts?: ColumnHeaderTextOptions;
|
|
6
6
|
};
|
|
7
7
|
declare const SSIHoverText: FC<Props>;
|
|
8
8
|
export default SSIHoverText;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SSIHoverTextTextStyled as Text, SSIHoverTextContainerStyled as Container, SSIHoverTextTextHoverStyled as TextHover, } from '../../../styles/components';
|
|
3
3
|
const SSIHoverText = (props) => {
|
|
4
|
-
const { text,
|
|
5
|
-
const value = truncationLength ? text.substring(0, truncationLength) : text;
|
|
6
|
-
return (_jsxs(Container, { children: [_jsx(Text, { children: value }), enableHover && _jsx(TextHover, { children: text })] }));
|
|
4
|
+
const { text, opts } = props;
|
|
5
|
+
const value = opts?.truncationLength ? text.substring(0, opts.truncationLength) : text;
|
|
6
|
+
return (_jsxs(Container, { children: [_jsx(Text, { children: value }), opts?.enableHover && _jsx(TextHover, { children: text })] }));
|
|
7
7
|
};
|
|
8
8
|
export default SSIHoverText;
|
|
@@ -17,10 +17,10 @@ function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
|
|
|
17
17
|
}, [ref, indeterminate]);
|
|
18
18
|
return _jsx("input", { type: "checkbox", ref: ref, className: className + ' cursor-pointer', ...rest });
|
|
19
19
|
}
|
|
20
|
-
const getCellFormatting = (type, value,
|
|
20
|
+
const getCellFormatting = (type, value, opts) => {
|
|
21
21
|
switch (type) {
|
|
22
22
|
case TableCellType.TEXT:
|
|
23
|
-
return _jsx(SSIHoverText, { text: value, ...(
|
|
23
|
+
return _jsx(SSIHoverText, { text: value, ...(opts && { opts }) });
|
|
24
24
|
case TableCellType.LABEL: {
|
|
25
25
|
const labels = Array.isArray(value) ? value.map((label) => _jsx(SSITypeLabel, { type: label })) : _jsx(SSITypeLabel, { type: value });
|
|
26
26
|
return _jsx(LabelCell, { children: labels });
|
|
@@ -39,7 +39,7 @@ const SSITableView = (props) => {
|
|
|
39
39
|
let availableColumns = columns.map((header) => columnHelper.accessor(header.accessor, {
|
|
40
40
|
id: header.accessor,
|
|
41
41
|
header: header.label,
|
|
42
|
-
cell: (info) => getCellFormatting(header.type, info.getValue(), header.
|
|
42
|
+
cell: (info) => getCellFormatting(header.type, info.getValue(), header.opts),
|
|
43
43
|
}));
|
|
44
44
|
if (enableRowSelection) {
|
|
45
45
|
availableColumns = [
|
|
@@ -8,5 +8,9 @@ export type ColumnHeader<T> = {
|
|
|
8
8
|
accessor: AccessorFn<T> | DeepKeys<T>;
|
|
9
9
|
type: TableCellType;
|
|
10
10
|
label?: string;
|
|
11
|
-
|
|
11
|
+
opts?: ColumnHeaderTextOptions;
|
|
12
12
|
};
|
|
13
|
+
export interface ColumnHeaderTextOptions {
|
|
14
|
+
truncationLength?: number;
|
|
15
|
+
enableHover?: boolean;
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.ssi-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.3-unstable.
|
|
4
|
+
"version": "0.1.3-unstable.67+1418cba",
|
|
5
5
|
"description": "SSI UI components for React",
|
|
6
6
|
"repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
|
|
7
7
|
"author": "Sphereon <dev@sphereon.com>",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sphereon/ui-components.core": "0.1.3-unstable.
|
|
31
|
+
"@sphereon/ui-components.core": "0.1.3-unstable.67+1418cba",
|
|
32
32
|
"@tanstack/react-table": "^8.9.3",
|
|
33
33
|
"react-loader-spinner": "^5.4.5",
|
|
34
34
|
"react-toastify": "^9.1.3",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": ">= 16.8.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "1418cba69a87e3ac95122ba0aca17530731ff364"
|
|
46
46
|
}
|