tycho-components 0.2.4-SNAPSHOT-7 → 0.2.5-SNAPSHOT
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/dist/AppPicture/AppPicture.d.ts +2 -1
- package/dist/AppPicture/AppPicture.js +3 -3
- package/dist/TreeView/cytoscape/CytoscapeTreeConverter.js +1 -1
- package/dist/functions/ImageUtils.d.ts +2 -2
- package/dist/functions/ImageUtils.js +4 -3
- package/dist/functions/placeholder-person.png +0 -0
- package/package.json +1 -1
|
@@ -3,7 +3,8 @@ type PictureProps = {
|
|
|
3
3
|
src: string;
|
|
4
4
|
title?: string;
|
|
5
5
|
className?: string;
|
|
6
|
+
person?: boolean;
|
|
6
7
|
onClick?: () => void;
|
|
7
8
|
};
|
|
8
|
-
export default function AppPicture({ src, title, className, onClick, }: PictureProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function AppPicture({ src, title, className, person, onClick, }: PictureProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -2,16 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import ImageUtils from '../functions/ImageUtils';
|
|
4
4
|
import './style.scss';
|
|
5
|
-
export default function AppPicture({ src, title, className, onClick, }) {
|
|
5
|
+
export default function AppPicture({ src, title, className, person, onClick, }) {
|
|
6
6
|
const [empty, setEmpty] = useState(false);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
setEmpty(!src);
|
|
9
9
|
}, []);
|
|
10
|
-
return (_jsx("div", { className: `app-picture-container ${empty ? 'empty' : ''}`, children: _jsx("img", { className: `${className} ${src ? '' : 'picture-placeholder'}`, src: ImageUtils.display(src), title: title, onClick: () => onClick && onClick(), onError: ({ currentTarget }) => {
|
|
10
|
+
return (_jsx("div", { className: `app-picture-container ${empty ? 'empty' : ''}`, children: _jsx("img", { className: `${className} ${src ? '' : 'picture-placeholder'}`, src: ImageUtils.display(src, person), title: title, onClick: () => onClick && onClick(), onError: ({ currentTarget }) => {
|
|
11
11
|
setEmpty(true);
|
|
12
12
|
/* eslint-disable no-param-reassign */
|
|
13
13
|
currentTarget.onerror = null; // prevents looping
|
|
14
|
-
currentTarget.src = ImageUtils.getPlaceHolder();
|
|
14
|
+
currentTarget.src = ImageUtils.getPlaceHolder(person);
|
|
15
15
|
/* eslint-enable no-param-reassign */
|
|
16
16
|
} }) }));
|
|
17
17
|
}
|
|
@@ -30,7 +30,7 @@ export default class CytoscapeTreeConverter {
|
|
|
30
30
|
if (this.extraInfo && token.attributes) {
|
|
31
31
|
const attrLines = Object.values(token.attributes)
|
|
32
32
|
.map((v) => v)
|
|
33
|
-
.join('
|
|
33
|
+
.join('<br/>');
|
|
34
34
|
return `<span class="token-value">${token.v}</span><span class="token-attributes">${attrLines}</span>`;
|
|
35
35
|
}
|
|
36
36
|
return `<span class="token-value">${token.v}</span>`;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import placeholder from './placeholder-image.png';
|
|
2
|
-
|
|
2
|
+
import placeholderPerson from './placeholder-person.png';
|
|
3
|
+
const display = (url, person) => {
|
|
3
4
|
if (url && url !== '')
|
|
4
5
|
return url;
|
|
5
|
-
return placeholder;
|
|
6
|
+
return person ? placeholderPerson : placeholder;
|
|
6
7
|
};
|
|
7
|
-
const getPlaceHolder = () => placeholder;
|
|
8
|
+
const getPlaceHolder = (person) => person ? placeholderPerson : placeholder;
|
|
8
9
|
const ImageUtils = {
|
|
9
10
|
display,
|
|
10
11
|
getPlaceHolder,
|
|
Binary file
|