fix(storybook): Fixing broken UI Storybook components' pages (#3455)
This commit is contained in:
parent
9ee13860a2
commit
874260340a
@ -1,8 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Typography, Icon } from '../';
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import detect from 'browser-detect';
|
import detect from 'browser-detect';
|
||||||
|
|
||||||
|
import Typography from '../Typography';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const Link = ({ href, children, showIcon = false }) => {
|
const Link = ({ href, children, showIcon = false }) => {
|
||||||
return (
|
return (
|
||||||
<a href={href} target="_blank" rel="noopener noreferrer">
|
<a href={href} target="_blank" rel="noopener noreferrer">
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
import { Icon, Tooltip, InputRange } from '../';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
import InputRange from '../InputRange';
|
||||||
|
|
||||||
import './CinePlayer.css';
|
import './CinePlayer.css';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Typography } from '..';
|
import Typography from '../Typography';
|
||||||
|
|
||||||
const Body = ({ text, className }) => {
|
const Body = ({ text, className }) => {
|
||||||
const theme = 'bg-primary-dark';
|
const theme = 'bg-primary-dark';
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Button } from '..';
|
import Button from '../Button';
|
||||||
|
|
||||||
const Footer = ({ actions, className, onSubmit, value }) => {
|
const Footer = ({ actions, className, onSubmit, value }) => {
|
||||||
const flex = 'flex items-center justify-end';
|
const flex = 'flex items-center justify-end';
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Typography, Icon } from '..';
|
import Typography from '../Typography';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const CloseButton = ({ onClick }) => {
|
const CloseButton = ({ onClick }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import React, { useEffect, useCallback, useState, useRef } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import { Icon, Typography } from '../';
|
import Icon from '../Icon';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
|
||||||
const Dropdown = ({ id, children, showDropdownIcon, list, titleClassName }) => {
|
const Dropdown = ({ id, children, showDropdownIcon, list, titleClassName }) => {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon, Typography } from '../';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
|
||||||
// TODO: Add loading spinner to OHIF + use it here.
|
// TODO: Add loading spinner to OHIF + use it here.
|
||||||
const EmptyStudies = ({ className }) => {
|
const EmptyStudies = ({ className }) => {
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { ErrorBoundary as ReactErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary as ReactErrorBoundary } from 'react-error-boundary';
|
||||||
import { Icon, IconButton } from '@ohif/ui';
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import Modal from '../Modal';
|
import Modal from '../Modal';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import IconButton from '../IconButton';
|
||||||
|
|
||||||
const isProduction = process.env.NODE_ENV === 'production';
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import { IconButton, Icon } from '../';
|
import IconButton from '../IconButton';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
import './ExpandableToolbarButton.css';
|
import './ExpandableToolbarButton.css';
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,12 @@ import React, { ReactNode } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { NavBar, Svg, Icon, IconButton, Dropdown } from '../';
|
|
||||||
|
import NavBar from '../NavBar';
|
||||||
|
import Svg from '../Svg';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import IconButton from '../IconButton';
|
||||||
|
import Dropdown from '../Dropdown';
|
||||||
|
|
||||||
function Header({
|
function Header({
|
||||||
children,
|
children,
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { HotkeyField, Typography } from '../';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import HotkeyField from '../HotkeyField';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
|
||||||
/* TODO: Move these configs and utils to core? */
|
/* TODO: Move these configs and utils to core? */
|
||||||
import { MODIFIER_KEYS } from './hotkeysConfig';
|
import { MODIFIER_KEYS } from './hotkeysConfig';
|
||||||
import { validate, splitHotkeyDefinitionsAndCreateTuples } from './utils';
|
import { validate, splitHotkeyDefinitionsAndCreateTuples } from './utils';
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { DateRange, InputLabelWrapper } from '../';
|
import DateRange from '../DateRange';
|
||||||
|
import InputLabelWrapper from '../InputLabelWrapper';
|
||||||
|
|
||||||
const InputDateRange = ({
|
const InputDateRange = ({
|
||||||
id,
|
id,
|
||||||
@ -14,7 +15,7 @@ const InputDateRange = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { startDate, endDate } = value;
|
const { startDate, endDate } = value;
|
||||||
|
|
||||||
const onClickHandler = (event) => {
|
const onClickHandler = event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onLabelClick(event);
|
onLabelClick(event);
|
||||||
};
|
};
|
||||||
@ -38,11 +39,11 @@ const InputDateRange = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const noop = () => { };
|
const noop = () => {};
|
||||||
|
|
||||||
InputDateRange.defaultProps = {
|
InputDateRange.defaultProps = {
|
||||||
value: {},
|
value: {},
|
||||||
onLabelClick: noop
|
onLabelClick: noop,
|
||||||
};
|
};
|
||||||
|
|
||||||
InputDateRange.propTypes = {
|
InputDateRange.propTypes = {
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import getGridWidthClass from '../../utils/getGridWidthClass'
|
import getGridWidthClass from '../../utils/getGridWidthClass';
|
||||||
|
|
||||||
import {
|
import InputText from '../InputText';
|
||||||
InputText,
|
import InputDateRange from '../InputDateRange';
|
||||||
InputDateRange,
|
import InputMultiSelect from '../InputMultiSelect';
|
||||||
InputMultiSelect,
|
import InputLabelWrapper from '../InputLabelWrapper';
|
||||||
InputLabelWrapper,
|
|
||||||
} from '../';
|
|
||||||
|
|
||||||
const InputGroup = ({
|
const InputGroup = ({
|
||||||
inputMeta,
|
inputMeta,
|
||||||
|
|||||||
@ -3,11 +3,12 @@ import PropTypes from 'prop-types';
|
|||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { Icon } from '../';
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const baseLabelClassName =
|
const baseLabelClassName =
|
||||||
'flex flex-col flex-1 text-white text-lg pl-1 select-none';
|
'flex flex-col flex-1 text-white text-lg pl-1 select-none';
|
||||||
const spanClassName = 'flex flex-row items-center cursor-pointer focus:outline-none';
|
const spanClassName =
|
||||||
|
'flex flex-row items-center cursor-pointer focus:outline-none';
|
||||||
const sortIconMap = {
|
const sortIconMap = {
|
||||||
descending: 'sorting-active-up',
|
descending: 'sorting-active-up',
|
||||||
ascending: 'sorting-active-down',
|
ascending: 'sorting-active-down',
|
||||||
@ -22,7 +23,7 @@ const InputLabelWrapper = ({
|
|||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation("StudyList")
|
const { t } = useTranslation('StudyList');
|
||||||
|
|
||||||
const onClickHandler = e => {
|
const onClickHandler = e => {
|
||||||
if (!isSortable) {
|
if (!isSortable) {
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Select, InputLabelWrapper } from '../';
|
import Select from '../Select';
|
||||||
|
import InputLabelWrapper from '../InputLabelWrapper';
|
||||||
|
|
||||||
const InputMultiSelect = ({
|
const InputMultiSelect = ({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Input, InputLabelWrapper } from '../';
|
import Input from '../Input';
|
||||||
|
import InputLabelWrapper from '../InputLabelWrapper';
|
||||||
|
|
||||||
const InputText = ({
|
const InputText = ({
|
||||||
id,
|
id,
|
||||||
@ -36,7 +37,7 @@ const InputText = ({
|
|||||||
InputText.defaultProps = {
|
InputText.defaultProps = {
|
||||||
value: '',
|
value: '',
|
||||||
isSortable: false,
|
isSortable: false,
|
||||||
onLabelClick: () => { },
|
onLabelClick: () => {},
|
||||||
sortDirection: 'none',
|
sortDirection: 'none',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
import { IconButton, Icon } from '../';
|
|
||||||
|
import IconButton from '../IconButton';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
import './LegacyCinePlayerCustomInputRange.css';
|
import './LegacyCinePlayerCustomInputRange.css';
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Icon, Tooltip } from '../';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
infoHeader: 'text-base text-primary-light',
|
infoHeader: 'text-base text-primary-light',
|
||||||
infoText: 'text-base text-white max-w-24 truncate',
|
infoText: 'text-base text-white max-w-24 truncate',
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Icon, ButtonGroup, Button, LegacyCinePlayer } from '../';
|
|
||||||
import useOnClickOutside from '../../utils/useOnClickOutside';
|
import useOnClickOutside from '../../utils/useOnClickOutside';
|
||||||
import LegacyPatientInfo from '../LegacyPatientInfo';
|
|
||||||
import { StringNumber } from '../../types';
|
import { StringNumber } from '../../types';
|
||||||
|
|
||||||
|
import LegacyPatientInfo from '../LegacyPatientInfo';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import ButtonGroup from '../ButtonGroup';
|
||||||
|
import Button from '../Button';
|
||||||
|
import LegacyCinePlayer from '../LegacyCinePlayer';
|
||||||
|
|
||||||
const LegacyViewportActionBar = ({
|
const LegacyViewportActionBar = ({
|
||||||
studyData,
|
studyData,
|
||||||
showNavArrows,
|
showNavArrows,
|
||||||
@ -75,7 +79,7 @@ const LegacyViewportActionBar = ({
|
|||||||
<div className="flex flex-1 grow mt-2 min-w-48">
|
<div className="flex flex-1 grow mt-2 min-w-48">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<span className="mr-2 text-white text-large">{label}</span>
|
<span className="mr-2 text-white text-large">{label}</span>
|
||||||
{showStatus && getStatusComponent()}
|
{showStatus && getStatusComponent && getStatusComponent()}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col justify-start ml-4">
|
<div className="flex flex-col justify-start ml-4">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Icon } from '@ohif/ui';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
import ProgressLoadingBar from '../ProgressLoadingBar';
|
import ProgressLoadingBar from '../ProgressLoadingBar';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon } from '../';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const MeasurementItem = ({
|
const MeasurementItem = ({
|
||||||
uid,
|
uid,
|
||||||
|
|||||||
@ -34,6 +34,13 @@ MeasurementTable is a component that renders the MeasurementTables.
|
|||||||
name="Overview"
|
name="Overview"
|
||||||
args={{
|
args={{
|
||||||
title: 'Measurements',
|
title: 'Measurements',
|
||||||
|
servicesManager: {
|
||||||
|
services: {
|
||||||
|
customizationService: {
|
||||||
|
getCustomization: (title, data) => data.content,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{MeasurementTableTemplate.bind({})}
|
{MeasurementTableTemplate.bind({})}
|
||||||
@ -62,6 +69,13 @@ With data
|
|||||||
isActive: false,
|
isActive: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
servicesManager: {
|
||||||
|
services: {
|
||||||
|
customizationService: {
|
||||||
|
getCustomization: (title, data) => data,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{MeasurementTableTemplate.bind({})}
|
{MeasurementTableTemplate.bind({})}
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ReactModal from 'react-modal';
|
import ReactModal from 'react-modal';
|
||||||
|
import { useModal } from '../../contextProviders';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
|
||||||
import './Modal.css';
|
import './Modal.css';
|
||||||
|
|
||||||
import { Typography, Icon } from '../';
|
|
||||||
import { useModal } from '../../contextProviders';
|
|
||||||
|
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
ReactModal.setAppElement(document.getElementById('root'));
|
ReactModal.setAppElement(document.getElementById('root'));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, Icon } from '../';
|
|
||||||
|
import Button from '../Button';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const Notification = ({
|
const Notification = ({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Icon, Tooltip } from '../';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
infoHeader: 'text-base text-primary-light',
|
infoHeader: 'text-base text-primary-light',
|
||||||
infoText: 'text-base text-white max-w-24 truncate',
|
infoText: 'text-base text-white max-w-24 truncate',
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Icon, InputRange, CheckBox, InputNumber } from '../';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import InputRange from '../InputRange';
|
||||||
|
import CheckBox from '../CheckBox';
|
||||||
|
import InputNumber from '../InputNumber';
|
||||||
|
|
||||||
const ActiveSegmentationConfig = ({
|
const ActiveSegmentationConfig = ({
|
||||||
config,
|
config,
|
||||||
setRenderOutline,
|
setRenderOutline,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon } from '@ohif/ui';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const SegmentItem = ({
|
const SegmentItem = ({
|
||||||
segmentIndex,
|
segmentIndex,
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon } from '../';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const SegmentationItem = ({
|
const SegmentationItem = ({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Icon } from '../';
|
|
||||||
import SegmentationItem from './SegmentationItem';
|
import SegmentationItem from './SegmentationItem';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const SegmentationTable = ({
|
const SegmentationTable = ({
|
||||||
title,
|
title,
|
||||||
segmentations,
|
segmentations,
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import ReactSelect, { components } from 'react-select';
|
import ReactSelect, { components } from 'react-select';
|
||||||
import { Icon } from '@ohif/ui';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
import './Select.css';
|
import './Select.css';
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,10 @@ import { Swiper, SwiperSlide } from 'swiper/react';
|
|||||||
|
|
||||||
import { PanelService, ServicesManager, Types } from '@ohif/core';
|
import { PanelService, ServicesManager, Types } from '@ohif/core';
|
||||||
|
|
||||||
import { Button, Icon, IconButton, Tooltip } from '../';
|
import Button from '../Button';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import IconButton from '../IconButton';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
|
||||||
import 'swiper/css';
|
import 'swiper/css';
|
||||||
import 'swiper/css/navigation';
|
import 'swiper/css/navigation';
|
||||||
@ -75,7 +78,7 @@ const SidePanel = ({
|
|||||||
activeTabIndex: activeTabIndexProp,
|
activeTabIndex: activeTabIndexProp,
|
||||||
tabs,
|
tabs,
|
||||||
}) => {
|
}) => {
|
||||||
const panelService: PanelService = servicesManager.services.panelService;
|
const panelService: PanelService = servicesManager?.services?.panelService;
|
||||||
|
|
||||||
const { t } = useTranslation('SidePanel');
|
const { t } = useTranslation('SidePanel');
|
||||||
|
|
||||||
@ -128,6 +131,7 @@ const SidePanel = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (panelService) {
|
||||||
const activatePanelSubscription = panelService.subscribe(
|
const activatePanelSubscription = panelService.subscribe(
|
||||||
panelService.EVENTS.ACTIVATE_PANEL,
|
panelService.EVENTS.ACTIVATE_PANEL,
|
||||||
(activatePanelEvent: Types.ActivatePanelEvent) => {
|
(activatePanelEvent: Types.ActivatePanelEvent) => {
|
||||||
@ -145,6 +149,7 @@ const SidePanel = ({
|
|||||||
return () => {
|
return () => {
|
||||||
activatePanelSubscription.unsubscribe();
|
activatePanelSubscription.unsubscribe();
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}, [tabs, hasBeenOpened, panelService, updateActiveTabIndex]);
|
}, [tabs, hasBeenOpened, panelService, updateActiveTabIndex]);
|
||||||
|
|
||||||
const getCloseStateComponent = () => {
|
const getCloseStateComponent = () => {
|
||||||
|
|||||||
@ -32,6 +32,16 @@ SidePanel is a component that renders the SidePanels.
|
|||||||
args={{
|
args={{
|
||||||
side: 'left',
|
side: 'left',
|
||||||
defaultComponentOpen: 'Example',
|
defaultComponentOpen: 'Example',
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
id: 'tab1',
|
||||||
|
name: 'tab1',
|
||||||
|
label: 'Tab 1',
|
||||||
|
iconName: 'group-layers',
|
||||||
|
iconLabel: 'group-layers',
|
||||||
|
content: () => <div class="text-primary-light p-3">Hello</div>,
|
||||||
|
}
|
||||||
|
],
|
||||||
childComponents: [
|
childComponents: [
|
||||||
{
|
{
|
||||||
iconName: 'home',
|
iconName: 'home',
|
||||||
|
|||||||
@ -4,7 +4,10 @@ import classNames from 'classnames';
|
|||||||
import OutsideClickHandler from 'react-outside-click-handler';
|
import OutsideClickHandler from 'react-outside-click-handler';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { Icon, Tooltip, ListMenu, ToolbarButton } from '../';
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
import ListMenu from '../ListMenu';
|
||||||
|
import ToolbarButton from '../ToolbarButton';
|
||||||
|
|
||||||
const baseClasses = {
|
const baseClasses = {
|
||||||
Button:
|
Button:
|
||||||
@ -92,7 +95,7 @@ const SplitButton = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation('Buttons');
|
const { t } = useTranslation('Buttons');
|
||||||
|
|
||||||
const { toolbarService } = servicesManager.services;
|
const { toolbarService } = servicesManager?.services || {};
|
||||||
|
|
||||||
const { primaryToolId, toggles } = bState;
|
const { primaryToolId, toggles } = bState;
|
||||||
/* Bubbles up individual item clicks */
|
/* Bubbles up individual item clicks */
|
||||||
@ -146,7 +149,7 @@ const SplitButton = ({
|
|||||||
(isPrimaryToggle && toggles[state.primary.id] === true);
|
(isPrimaryToggle && toggles[state.primary.id] === true);
|
||||||
|
|
||||||
const PrimaryButtonComponent =
|
const PrimaryButtonComponent =
|
||||||
toolbarService.getButtonComponentForUIType(state.primary.uiType) ??
|
toolbarService?.getButtonComponentForUIType(state.primary.uiType) ??
|
||||||
ToolbarButton;
|
ToolbarButton;
|
||||||
|
|
||||||
const primaryButtonClassName = classes.Primary({
|
const primaryButtonClassName = classes.Primary({
|
||||||
|
|||||||
@ -2,7 +2,10 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { ButtonGroup, Button, StudyItem, ThumbnailList } from '../';
|
import StudyItem from '../StudyItem';
|
||||||
|
import ButtonGroup from '../ButtonGroup';
|
||||||
|
import Button from '../Button';
|
||||||
|
import ThumbnailList from '../ThumbnailList';
|
||||||
import { StringNumber } from '../../types';
|
import { StringNumber } from '../../types';
|
||||||
|
|
||||||
const getTrackedSeries = displaySets => {
|
const getTrackedSeries = displaySets => {
|
||||||
@ -171,7 +174,7 @@ StudyBrowser.propTypes = {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const noop = () => { };
|
const noop = () => {};
|
||||||
|
|
||||||
StudyBrowser.defaultProps = {
|
StudyBrowser.defaultProps = {
|
||||||
onClickTab: noop,
|
onClickTab: noop,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import { Icon } from '../';
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const baseClasses =
|
const baseClasses =
|
||||||
'first:border-0 border-t border-secondary-light cursor-pointer select-none outline-none';
|
'first:border-0 border-t border-secondary-light cursor-pointer select-none outline-none';
|
||||||
|
|||||||
@ -2,7 +2,11 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { Table, TableHead, TableBody, TableRow, TableCell } from '../';
|
import Table from '../Table';
|
||||||
|
import TableHead from '../TableHead';
|
||||||
|
import TableBody from '../TableBody';
|
||||||
|
import TableRow from '../TableRow';
|
||||||
|
import TableCell from '../TableCell';
|
||||||
|
|
||||||
const StudyListExpandedRow = ({
|
const StudyListExpandedRow = ({
|
||||||
seriesTableColumns,
|
seriesTableColumns,
|
||||||
@ -11,7 +15,6 @@ const StudyListExpandedRow = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation('StudyList');
|
const { t } = useTranslation('StudyList');
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full bg-black py-4 pl-12 pr-2">
|
<div className="w-full bg-black py-4 pl-12 pr-2">
|
||||||
<div className="block">{children}</div>
|
<div className="block">{children}</div>
|
||||||
|
|||||||
@ -2,7 +2,10 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { Button, Icon, Typography, InputGroup } from '../';
|
import Button from '../Button';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
import InputGroup from '../InputGroup';
|
||||||
|
|
||||||
const StudyListFilter = ({
|
const StudyListFilter = ({
|
||||||
filtersMeta,
|
filtersMeta,
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, ButtonGroup, Typography, Select } from '../';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import Button from '../Button';
|
||||||
|
import ButtonGroup from '../ButtonGroup';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
import Select from '../Select';
|
||||||
|
|
||||||
const StudyListPagination = ({
|
const StudyListPagination = ({
|
||||||
onChangePage,
|
onChangePage,
|
||||||
currentPage,
|
currentPage,
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon } from '../';
|
|
||||||
import getGridWidthClass from '../../utils/getGridWidthClass';
|
import getGridWidthClass from '../../utils/getGridWidthClass';
|
||||||
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const StudyListTableRow = props => {
|
const StudyListTableRow = props => {
|
||||||
const { tableData } = props;
|
const { tableData } = props;
|
||||||
const { row, expandedContent, onClickRow, isExpanded } = tableData;
|
const { row, expandedContent, onClickRow, isExpanded } = tableData;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { useDrag } from 'react-dnd';
|
import { useDrag } from 'react-dnd';
|
||||||
import { Icon } from '../';
|
import Icon from '../Icon';
|
||||||
import { StringNumber } from '../../types';
|
import { StringNumber } from '../../types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Thumbnail, ThumbnailNoImage, ThumbnailTracked } from '../';
|
import Thumbnail from '../Thumbnail';
|
||||||
|
import ThumbnailNoImage from '../ThumbnailNoImage';
|
||||||
|
import ThumbnailTracked from '../ThumbnailTracked';
|
||||||
import * as Types from '../../types';
|
import * as Types from '../../types';
|
||||||
|
|
||||||
const ThumbnailList = ({
|
const ThumbnailList = ({
|
||||||
|
|||||||
@ -2,7 +2,9 @@ import React from 'react';
|
|||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useDrag } from 'react-dnd';
|
import { useDrag } from 'react-dnd';
|
||||||
import { Icon, Tooltip, Typography } from '../';
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
|
||||||
const ThumbnailNoImage = ({
|
const ThumbnailNoImage = ({
|
||||||
displaySetInstanceUID,
|
displaySetInstanceUID,
|
||||||
|
|||||||
@ -2,7 +2,9 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import { Icon, Thumbnail, Tooltip } from '../';
|
import Icon from '../Icon';
|
||||||
|
import Thumbnail from '../Thumbnail';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
import { StringNumber } from '../../types';
|
import { StringNumber } from '../../types';
|
||||||
|
|
||||||
const ThumbnailTracked = ({
|
const ThumbnailTracked = ({
|
||||||
|
|||||||
@ -2,7 +2,9 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import { IconButton, Icon, Tooltip } from '../';
|
import IconButton from '../IconButton';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import Tooltip from '../Tooltip';
|
||||||
|
|
||||||
const ToolbarButton = ({
|
const ToolbarButton = ({
|
||||||
type = 'tool',
|
type = 'tool',
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon } from '../';
|
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
const DELAY_TO_SHOW = 1000;
|
const DELAY_TO_SHOW = 1000;
|
||||||
const DELAY_TO_HIDE = 10; // it needs at least a little delay to prevent tooltip to suddenly hide
|
const DELAY_TO_HIDE = 10; // it needs at least a little delay to prevent tooltip to suddenly hide
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Select, Typography, Button, HotkeysPreferences } from '../';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import Select from '../Select';
|
||||||
|
import Typography from '../Typography';
|
||||||
|
import Button from '../Button';
|
||||||
|
import HotkeysPreferences from '../HotkeysPreferences';
|
||||||
|
|
||||||
const UserPreferences = ({
|
const UserPreferences = ({
|
||||||
availableLanguages,
|
availableLanguages,
|
||||||
defaultLanguage,
|
defaultLanguage,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { LegacyViewportActionBar, Notification } from '../';
|
import LegacyViewportActionBar from '../LegacyViewportActionBar';
|
||||||
|
import Notification from '../Notification';
|
||||||
|
|
||||||
const Viewport = ({
|
const Viewport = ({
|
||||||
viewportId,
|
viewportId,
|
||||||
|
|||||||
@ -7,10 +7,11 @@ import React, {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Icon } from '..';
|
|
||||||
import { useResizeObserver } from '../../hooks';
|
import { useResizeObserver } from '../../hooks';
|
||||||
import useOnClickOutside from '../../utils/useOnClickOutside';
|
import useOnClickOutside from '../../utils/useOnClickOutside';
|
||||||
|
|
||||||
import PatientInfo from '../PatientInfo';
|
import PatientInfo from '../PatientInfo';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
|
||||||
export type ViewportActionBarProps = {
|
export type ViewportActionBarProps = {
|
||||||
studyData: any;
|
studyData: any;
|
||||||
|
|||||||
@ -7,16 +7,14 @@ import React, {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import Typography from '../Typography';
|
||||||
Typography,
|
import Input from '../Input';
|
||||||
Input,
|
import Tooltip from '../Tooltip';
|
||||||
Tooltip,
|
import IconButton from '../IconButton';
|
||||||
IconButton,
|
import Icon from '../Icon';
|
||||||
Icon,
|
import Select from '../Select';
|
||||||
Select,
|
import InputLabelWrapper from '../InputLabelWrapper';
|
||||||
InputLabelWrapper,
|
import Button from '../Button';
|
||||||
Button,
|
|
||||||
} from '../';
|
|
||||||
|
|
||||||
const FILE_TYPE_OPTIONS = [
|
const FILE_TYPE_OPTIONS = [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user