@sphereon/ui-components.ssi-react 0.1.3-unstable.68 → 0.1.3-unstable.69

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';
3
2
  export type Props = {
4
3
  text: string;
5
- opts?: ColumnHeaderTextOptions;
4
+ truncationLength?: number | undefined;
5
+ enableHover?: boolean | undefined;
6
6
  };
7
7
  declare const SSIHoverText: FC<Props>;
8
8
  export default SSIHoverText;
@@ -1,8 +1,7 @@
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, opts = {} } = props;
5
- const { truncationLength, enableHover = false } = opts;
4
+ const { text, truncationLength, enableHover = true } = props;
6
5
  const value = truncationLength ? text.substring(0, truncationLength) : text;
7
6
  return (_jsxs(Container, { children: [_jsx(Text, { children: value }), enableHover && _jsx(TextHover, { children: text })] }));
8
7
  };
@@ -20,7 +20,8 @@ function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
20
20
  const getCellFormatting = (type, value, opts) => {
21
21
  switch (type) {
22
22
  case TableCellType.TEXT:
23
- return _jsx(SSIHoverText, { text: value, ...(opts && { opts }) });
23
+ const { truncationLength, enableHover = false } = opts ?? {};
24
+ return _jsx(SSIHoverText, { text: value, truncationLength: truncationLength, enableHover: enableHover });
24
25
  case TableCellType.LABEL: {
25
26
  const labels = Array.isArray(value) ? value.map((label) => _jsx(SSITypeLabel, { type: label })) : _jsx(SSITypeLabel, { type: value });
26
27
  return _jsx(LabelCell, { children: labels });
@@ -8,9 +8,9 @@ export type ColumnHeader<T> = {
8
8
  accessor: AccessorFn<T> | DeepKeys<T>;
9
9
  type: TableCellType;
10
10
  label?: string;
11
- opts?: ColumnHeaderTextOptions;
11
+ opts?: ColumnHeaderOptions;
12
12
  };
13
- export interface ColumnHeaderTextOptions {
13
+ export interface ColumnHeaderOptions {
14
14
  truncationLength?: number;
15
15
  enableHover?: boolean;
16
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.68+23ba373",
4
+ "version": "0.1.3-unstable.69+d068744",
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.68+23ba373",
31
+ "@sphereon/ui-components.core": "0.1.3-unstable.69+d068744",
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": "23ba373c7a77b3dd60f01b74e81a3b0a9e87fa54"
45
+ "gitHead": "d0687440bc86afb8010dd30c4683cd5e8fdedae3"
46
46
  }