@sphereon/ui-components.ssi-react 0.1.3-unstable.99 → 0.2.1-next.18
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/LICENSE +201 -636
- package/dist/@config/toasts/index.d.ts +2 -3
- package/dist/components/assets/icons/{BitterballenIcon → CrossIcon}/index.d.ts +2 -2
- package/dist/components/assets/icons/CrossIcon/index.js +7 -0
- package/dist/components/assets/icons/DeleteIcon/index.d.ts +2 -1
- package/dist/components/assets/icons/DeleteIcon/index.js +2 -2
- package/dist/components/assets/icons/DocumentIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/DocumentIcon/index.js +7 -0
- package/dist/components/assets/icons/ImageIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/ImageIcon/index.js +7 -0
- package/dist/components/assets/icons/MeatBallsIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/MeatBallsIcon/index.js +7 -0
- package/dist/components/assets/icons/SSIAddIcon/index.js +1 -1
- package/dist/components/assets/icons/SSIArrowDownIcon/index.js +1 -1
- package/dist/components/assets/icons/SSIFilterIcon/index.js +1 -1
- package/dist/components/assets/images/WarningImage/index.d.ts +8 -0
- package/dist/components/assets/images/WarningImage/index.js +6 -0
- package/dist/components/assets/placeholders/PersonPlaceholder/index.d.ts +9 -0
- package/dist/components/assets/placeholders/PersonPlaceholder/index.js +7 -0
- package/dist/components/buttons/IconButton/index.d.ts +11 -0
- package/dist/components/buttons/IconButton/index.js +37 -0
- package/dist/components/buttons/{SSISecondaryButton → PrimaryButton}/index.d.ts +3 -3
- package/dist/components/buttons/{SSIPrimaryButton → PrimaryButton}/index.js +5 -4
- package/dist/components/buttons/{SSIPrimaryButton → SecondaryButton}/index.d.ts +3 -3
- package/dist/components/buttons/{SSISecondaryButton → SecondaryButton}/index.js +5 -4
- package/dist/components/fields/ComboBox/index.d.ts +21 -0
- package/dist/components/fields/ComboBox/index.js +51 -0
- package/dist/components/fields/DragAndDropBox/index.d.ts +8 -0
- package/dist/components/fields/DragAndDropBox/index.js +30 -0
- package/dist/components/fields/FileSelection/index.d.ts +12 -0
- package/dist/components/fields/FileSelection/index.js +33 -0
- package/dist/components/fields/JSONForms/PassportPhotoControl/index.d.ts +5 -0
- package/dist/components/fields/JSONForms/PassportPhotoControl/index.js +37 -0
- package/dist/components/fields/SSICheckbox/index.d.ts +2 -1
- package/dist/components/fields/SSICheckbox/index.js +2 -2
- package/dist/components/fields/TextInputField/index.d.ts +12 -0
- package/dist/components/fields/TextInputField/index.js +21 -0
- package/dist/components/indicators/ProgressStepIndicator/index.js +6 -4
- package/dist/components/lists/DropDownList/index.d.ts +10 -0
- package/dist/components/lists/DropDownList/index.js +34 -0
- package/dist/components/lists/DropDownListItem/index.d.ts +13 -0
- package/dist/components/lists/DropDownListItem/index.js +23 -0
- package/dist/components/views/CredentialIssuanceWizardView/index.d.ts +10 -0
- package/dist/components/views/CredentialIssuanceWizardView/index.js +42 -0
- package/dist/components/views/CredentialMiniCardView/index.js +1 -1
- package/dist/components/views/CredentialViewItem/index.d.ts +16 -0
- package/dist/components/views/CredentialViewItem/index.js +17 -0
- package/dist/components/views/FormView/index.d.ts +15 -0
- package/dist/components/views/FormView/index.js +12 -0
- package/dist/components/views/FormView/styles.css +105 -0
- package/dist/components/views/JSONDataView/index.d.ts +8 -0
- package/dist/components/views/JSONDataView/index.js +85 -0
- package/dist/components/views/SSITabView/SSITabViewHeader/index.js +1 -1
- package/dist/components/views/SSITableView/PaginationControls/index.d.ts +8 -0
- package/dist/components/views/SSITableView/PaginationControls/index.js +9 -0
- package/dist/components/views/SSITableView/SSITableViewHeader/index.d.ts +1 -0
- package/dist/components/views/SSITableView/SSITableViewHeader/index.js +9 -7
- package/dist/components/views/SSITableView/index.d.ts +5 -2
- package/dist/components/views/SSITableView/index.js +76 -45
- package/dist/index.d.ts +22 -5
- package/dist/index.js +22 -5
- package/dist/renders/jsonFormsRenders.d.ts +2 -0
- package/dist/renders/jsonFormsRenders.js +6 -0
- package/dist/styles/components/components/CredentialIssuanceWizardView/index.d.ts +9 -0
- package/dist/styles/components/components/CredentialIssuanceWizardView/index.js +55 -0
- package/dist/styles/components/components/CredentialViewItem/index.d.ts +5 -0
- package/dist/styles/components/components/CredentialViewItem/index.js +28 -0
- package/dist/styles/components/components/DragAndDropBox/index.d.ts +4 -0
- package/dist/styles/components/components/DragAndDropBox/index.js +25 -0
- package/dist/styles/components/components/DropDownList/index.d.ts +3 -0
- package/dist/styles/components/components/DropDownList/index.js +21 -0
- package/dist/styles/components/components/DropDownListItem/index.d.ts +3 -0
- package/dist/styles/components/components/DropDownListItem/index.js +21 -0
- package/dist/styles/components/components/FileSelectionField/index.d.ts +10 -0
- package/dist/styles/components/components/FileSelectionField/index.js +64 -0
- package/dist/styles/components/components/IconButton/index.d.ts +1 -0
- package/dist/styles/components/components/{SSIIconButton → IconButton}/index.js +5 -3
- package/dist/styles/components/components/JSONDataView/index.d.ts +7 -0
- package/dist/styles/components/components/JSONDataView/index.js +47 -0
- package/dist/styles/components/components/Pagination/index.d.ts +5 -0
- package/dist/styles/components/components/Pagination/index.js +71 -0
- package/dist/styles/components/components/PassportPhotoControl/index.d.ts +4 -0
- package/dist/styles/components/components/PassportPhotoControl/index.js +27 -0
- package/dist/styles/components/components/PrimaryButton/index.d.ts +1 -0
- package/dist/styles/components/components/{SSIPrimaryButton → PrimaryButton}/index.js +3 -2
- package/dist/styles/components/components/ProgressStepIndicator/index.d.ts +1 -0
- package/dist/styles/components/components/ProgressStepIndicator/index.js +11 -0
- package/dist/styles/components/components/SSICheckbox/index.js +2 -2
- package/dist/styles/components/components/SSICredentialCardView/index.js +1 -0
- package/dist/styles/components/components/SSIStatusLabel/index.js +1 -0
- package/dist/styles/components/components/SSITabView/index.js +1 -1
- package/dist/styles/components/components/SSITabViewHeader/index.d.ts +1 -0
- package/dist/styles/components/components/SSITabViewHeader/index.js +5 -0
- package/dist/styles/components/components/SSITableView/index.d.ts +5 -1
- package/dist/styles/components/components/SSITableView/index.js +21 -3
- package/dist/styles/components/components/SSITableViewHeader/index.d.ts +1 -0
- package/dist/styles/components/components/SSITableViewHeader/index.js +8 -0
- package/dist/styles/components/components/SSIToast/index.js +2 -2
- package/dist/styles/components/components/SecondaryButton/index.d.ts +2 -0
- package/dist/styles/components/components/{SSISecondaryButton → SecondaryButton}/index.js +4 -3
- package/dist/styles/components/components/TextInputField/index.d.ts +2 -0
- package/dist/styles/components/components/TextInputField/index.js +27 -0
- package/dist/styles/components/components/buttons/index.d.ts +1 -0
- package/dist/styles/components/components/buttons/index.js +4 -0
- package/dist/styles/components/components/index.d.ts +14 -5
- package/dist/styles/components/components/index.js +14 -5
- package/dist/styles/css/index.d.ts +2 -0
- package/dist/styles/css/index.js +14 -0
- package/dist/styles/fonts/index.d.ts +1 -1
- package/dist/styles/fonts/index.js +23 -13
- package/dist/styles/typography.js +6 -0
- package/dist/types/button/index.d.ts +2 -1
- package/dist/types/field/index.d.ts +21 -0
- package/dist/types/field/index.js +10 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/indicator/index.d.ts +1 -0
- package/dist/types/table/index.d.ts +24 -14
- package/dist/types/table/index.js +3 -0
- package/dist/types/view/index.d.ts +14 -0
- package/dist/types/view/index.js +1 -0
- package/dist/utils/FileUtils.d.ts +1 -0
- package/dist/utils/FileUtils.js +7 -0
- package/dist/utils/ImageUtils.d.ts +2 -0
- package/dist/utils/ImageUtils.js +12 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +25 -8
- package/dist/components/assets/icons/BitterballenIcon/index.js +0 -7
- package/dist/components/buttons/RowActionMenuButton/index.d.ts +0 -13
- package/dist/components/buttons/RowActionMenuButton/index.js +0 -28
- package/dist/components/buttons/SSIIconButton/index.d.ts +0 -10
- package/dist/components/buttons/SSIIconButton/index.js +0 -29
- package/dist/components/lists/SSIDropDownList/index.d.ts +0 -7
- package/dist/components/lists/SSIDropDownList/index.js +0 -11
- package/dist/styles/components/components/RowActionMenuButton/index.d.ts +0 -4
- package/dist/styles/components/components/RowActionMenuButton/index.js +0 -27
- package/dist/styles/components/components/SSIDropDownList/index.d.ts +0 -2
- package/dist/styles/components/components/SSIDropDownList/index.js +0 -12
- package/dist/styles/components/components/SSIIconButton/index.d.ts +0 -1
- package/dist/styles/components/components/SSIPrimaryButton/index.d.ts +0 -1
- package/dist/styles/components/components/SSISecondaryButton/index.d.ts +0 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { TextFieldInputContainerStyled as Container, TextFieldInputInputStyled as Input, SSITextH2Styled as Label } from '../../../styles';
|
|
4
|
+
const TextInputField = (props) => {
|
|
5
|
+
const { initialValue, label, placeholder, maxLength, onChangeValue, style, } = props;
|
|
6
|
+
const [value, setValue] = React.useState(initialValue);
|
|
7
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
8
|
+
const onChange = async (event) => {
|
|
9
|
+
setValue(event.target.value);
|
|
10
|
+
await onChangeValue?.(event.target.value);
|
|
11
|
+
};
|
|
12
|
+
const onFocus = () => {
|
|
13
|
+
setIsFocused(true);
|
|
14
|
+
};
|
|
15
|
+
const onBlur = () => {
|
|
16
|
+
setIsFocused(false);
|
|
17
|
+
};
|
|
18
|
+
return (_jsxs(Container, { style: { ...style }, children: [label &&
|
|
19
|
+
_jsx(Label, { children: label }), _jsx(Input, { onChange: onChange, value: value, placeholder: isFocused ? '' : placeholder, type: 'text', onFocus: onFocus, onBlur: onBlur, maxLength: maxLength })] }));
|
|
20
|
+
};
|
|
21
|
+
export default TextInputField;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { elementColors, fontColors } from '@sphereon/ui-components.core';
|
|
2
|
+
import { elementColors, fontColors, Localization } from '@sphereon/ui-components.core';
|
|
3
3
|
import StepMarker from '../../assets/markers/StepMarker';
|
|
4
4
|
import { gradientColors } from '../../../styles/colors';
|
|
5
|
-
import { ProgressStepIndicatorContainerStyled as Container, ProgressStepIndicatorContentGridContainerStyled as GridContainer, ProgressStepIndicatorStepMarkerCellStyled as StepMarkerCell, ProgressStepIndicatorStepLineStyled as StepLine, ProgressStepIndicatorStepTextCellStyled as StepTextCell, ProgressStepIndicatorTitleTextStyled as TitleText, ProgressStepIndicatorDescriptionTextStyled as DescriptionText, ProgressStepIndicatorSpacerLineCellStyled as SpacerLineCell, } from '../../../styles';
|
|
5
|
+
import { ProgressStepIndicatorContainerStyled as Container, ProgressStepIndicatorContentGridContainerStyled as GridContainer, ProgressStepIndicatorStepMarkerCellStyled as StepMarkerCell, ProgressStepIndicatorStepLineStyled as StepLine, ProgressStepIndicatorStepTextCellStyled as StepTextCell, ProgressStepIndicatorTitleTextStyled as TitleText, ProgressStepIndicatorDescriptionTextStyled as DescriptionText, ProgressStepIndicatorOptionalTextStyled as OptionalText, ProgressStepIndicatorSpacerLineCellStyled as SpacerLineCell, } from '../../../styles';
|
|
6
6
|
import { StepStatus } from '../../../types';
|
|
7
7
|
const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
8
|
+
const { title, description, required = true } = step;
|
|
8
9
|
const gridRowNumber = stepNumber * 2 - 1;
|
|
9
10
|
return (_jsxs(_Fragment, { children: [_jsxs(StepMarkerCell, { style: { gridRow: gridRowNumber }, children: [_jsx(StepMarker, { stepNumber: stepNumber, status: status }), stepNumber < maxSteps && (_jsx(StepLine, { style: {
|
|
10
11
|
...(status === StepStatus.COMPLETED && {
|
|
11
12
|
backgroundColor: elementColors.purple,
|
|
12
13
|
}),
|
|
13
|
-
} }))] }), _jsxs(StepTextCell, { style: { gridRow: gridRowNumber }, children: [
|
|
14
|
+
} }))] }), _jsxs(StepTextCell, { style: { gridRow: gridRowNumber }, children: [title && (_jsxs(TitleText, { style: {
|
|
14
15
|
...(status === StepStatus.CURRENT && {
|
|
15
16
|
background: gradientColors['100'],
|
|
16
17
|
backgroundClip: 'text',
|
|
@@ -19,7 +20,8 @@ const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
|
19
20
|
}),
|
|
20
21
|
...(status === StepStatus.COMPLETED && { color: fontColors.dark }),
|
|
21
22
|
...(status === StepStatus.NEXT && { color: fontColors.lightGrey }),
|
|
22
|
-
}, children:
|
|
23
|
+
}, children: [_jsx("div", { children: title }), !required &&
|
|
24
|
+
_jsx(OptionalText, { children: Localization.translate('optional_label') })] })), description && (_jsx(DescriptionText, { style: { ...((status === StepStatus.CURRENT || status === StepStatus.COMPLETED) && { color: fontColors.dark }) }, children: description }))] }), stepNumber < maxSteps && (_jsx(SpacerLineCell, { style: { gridRow: gridRowNumber + 1 }, children: _jsx(StepLine, { style: {
|
|
23
25
|
...(status === StepStatus.COMPLETED && {
|
|
24
26
|
backgroundColor: elementColors.purple,
|
|
25
27
|
}),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
import { Button } from '../../../types';
|
|
4
|
+
export type Props = {
|
|
5
|
+
icon: ButtonIcon;
|
|
6
|
+
buttons: Array<Button>;
|
|
7
|
+
showBorder?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const DropDownList: FC<Props>;
|
|
10
|
+
export default DropDownList;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { borderColors } from '@sphereon/ui-components.core';
|
|
4
|
+
import DropDownListItem from '../DropDownListItem';
|
|
5
|
+
import IconButton from '../../buttons/IconButton';
|
|
6
|
+
import { DropDownListContainerStyled as Container, DropDownContainerStyled as DropDownContainer, DropDownListButtonStyled as ListButton, } from '../../../styles/components';
|
|
7
|
+
const DropDownList = (props) => {
|
|
8
|
+
const { icon, buttons, showBorder = false } = props;
|
|
9
|
+
const [showActionsMenu, setShowActionsMenu] = useState(false);
|
|
10
|
+
const dropdownRef = useRef(null);
|
|
11
|
+
const onMore = (event) => {
|
|
12
|
+
setShowActionsMenu(!showActionsMenu);
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
};
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const onClickOutside = (event) => {
|
|
17
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
18
|
+
setShowActionsMenu(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
document.addEventListener('mousedown', onClickOutside);
|
|
22
|
+
return () => {
|
|
23
|
+
document.removeEventListener('mousedown', onClickOutside);
|
|
24
|
+
};
|
|
25
|
+
}, [showActionsMenu]);
|
|
26
|
+
const getItems = () => {
|
|
27
|
+
return buttons.map((item, index) => {
|
|
28
|
+
const showBorder = buttons.length > 1 && index !== buttons.length - 1;
|
|
29
|
+
return (_jsx(DropDownListItem, { showBorder: showBorder, label: item.caption, onClick: item.onClick, icon: item.icon, fontColor: item.fontColor }, index));
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(Container, { ref: dropdownRef, children: [_jsx(ListButton, { children: _jsx(IconButton, { icon: icon, onClick: onMore }) }), showActionsMenu && (_jsx(DropDownContainer, { style: { ...(showBorder && { borderWidth: 2, borderColor: borderColors.lightGrey, borderStyle: 'solid' }) }, children: getItems() }))] }));
|
|
33
|
+
};
|
|
34
|
+
export default DropDownList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: (args?: any) => Promise<void>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: ButtonIcon;
|
|
8
|
+
fontColor?: string;
|
|
9
|
+
showBorder?: boolean;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const DropDownListItem: FC<Props>;
|
|
13
|
+
export default DropDownListItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropDownListItemContainerStyled as Container, DropDownListItemIconContainerStyled as IconContainer, DropDownListItemCaptionContainerStyled as ListItemCaption, } from '../../../styles/components';
|
|
3
|
+
import DeleteIcon from '../../assets/icons/DeleteIcon';
|
|
4
|
+
import { borderColors, ButtonIcon, fontColors } from '@sphereon/ui-components.core';
|
|
5
|
+
const DropDownListItem = (props) => {
|
|
6
|
+
const { disabled, label, icon, showBorder = false, fontColor = fontColors.dark, borderColor = borderColors.light, onClick } = props;
|
|
7
|
+
const getIcon = (icon) => {
|
|
8
|
+
switch (icon) {
|
|
9
|
+
case ButtonIcon.DELETE:
|
|
10
|
+
return _jsx(DeleteIcon, { color: fontColors.dark });
|
|
11
|
+
default:
|
|
12
|
+
return _jsx("div", {});
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const onContainerClick = async (event) => {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
if (onClick) {
|
|
18
|
+
await onClick();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(Container, { onClick: onContainerClick, style: { ...(showBorder && { borderBottomWidth: 2, borderBottomColor: borderColor }) }, children: [_jsx(ListItemCaption, { children: label }), icon && _jsx(IconContainer, { children: getIcon(icon) })] }));
|
|
22
|
+
};
|
|
23
|
+
export default DropDownListItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CredentialFormData, CredentialFormSelectionType } from '../../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
credentialTypes: Array<CredentialFormSelectionType>;
|
|
5
|
+
onSelectCredentialTypeChange?: (credentialType: CredentialFormSelectionType) => Promise<void>;
|
|
6
|
+
onCredentialFormDataChange?: (credentialFormData: CredentialFormData) => Promise<void>;
|
|
7
|
+
credentialData?: Record<any, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const CredentialIssuanceWizardView: FC<Props>;
|
|
10
|
+
export default CredentialIssuanceWizardView;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Autocomplete, TextField } from '@mui/material';
|
|
4
|
+
import { Localization } from '@sphereon/ui-components.core';
|
|
5
|
+
import FileSelection from '../../fields/FileSelection';
|
|
6
|
+
import DragAndDropBox from '../../fields/DragAndDropBox';
|
|
7
|
+
import { CredentialIssuanceWizardViewContainerStyled as Container, CredentialIssuanceWizardViewCredentialTypeContainerStyled as CredentialTypeContainer, CredentialIssuanceWizardViewCredentialTypeTitleStyled as CredentialTypeTitle, CredentialIssuanceWizardViewFormContainerStyled as FormContainer, CredentialIssuanceWizardViewEvidenceContainerStyled as EvidenceContainer, CredentialIssuanceWizardViewEvidenceContentContainerStyled as EvidenceContentContainer, CredentialIssuanceWizardViewEvidenceTitleContainerStyled as EvidenceTitleContainer, SSITextH2SemiBoldStyled as EvidenceTitle, CredentialIssuanceWizardViewEvidenceTitleOptionalStyled as EvidenceTitleOptional, SSITextH2Styled as EvidenceDescription, CredentialIssuanceWizardViewEvidenceFilesContainerStyled as EvidenceFilesContainer } from '../../../styles';
|
|
8
|
+
import FormView from "../FormView";
|
|
9
|
+
const CredentialIssuanceWizardView = (props) => {
|
|
10
|
+
const { credentialData, credentialTypes, onSelectCredentialTypeChange, onCredentialFormDataChange } = props;
|
|
11
|
+
const [selectedCredentialType, setSelectedCredentialType] = useState(null);
|
|
12
|
+
const [credentialInput, setCredentialInput] = useState(null);
|
|
13
|
+
const [evidence, setEvidence] = useState([]);
|
|
14
|
+
const onCredentialTypeChange = (event, value) => {
|
|
15
|
+
setCredentialInput(null);
|
|
16
|
+
setEvidence([]);
|
|
17
|
+
setSelectedCredentialType(value);
|
|
18
|
+
onSelectCredentialTypeChange?.(value);
|
|
19
|
+
};
|
|
20
|
+
const onCredentialFormInputChange = async (state) => {
|
|
21
|
+
setCredentialInput(state);
|
|
22
|
+
onCredentialFormDataChange?.({ ...state, evidence });
|
|
23
|
+
};
|
|
24
|
+
const onAddEvidence = async (file) => {
|
|
25
|
+
const evidenceFiles = [...evidence, file];
|
|
26
|
+
setEvidence(evidenceFiles);
|
|
27
|
+
onCredentialFormDataChange?.({ ...credentialInput, evidence: evidenceFiles });
|
|
28
|
+
};
|
|
29
|
+
const onRemoveEvidence = async (index) => {
|
|
30
|
+
evidence.splice(index, 1);
|
|
31
|
+
const evidenceFiles = [...evidence];
|
|
32
|
+
setEvidence(evidenceFiles);
|
|
33
|
+
onCredentialFormDataChange?.({ ...credentialInput, evidence: evidenceFiles });
|
|
34
|
+
};
|
|
35
|
+
const getEvidenceElements = () => {
|
|
36
|
+
return evidence.map((file, index) => _jsx(FileSelection, { file: file, onRemove: async () => onRemoveEvidence(index) }, index));
|
|
37
|
+
};
|
|
38
|
+
return (_jsxs(Container, { children: [_jsxs(CredentialTypeContainer, { children: [_jsx(CredentialTypeTitle, { children: Localization.translate('credential_issuance_wizard_title') }), _jsx(Autocomplete, { options: credentialTypes, sx: { flexGrow: 1 }, renderInput: (params) => _jsx(TextField, { ...params, label: Localization.translate('credential_issuance_wizard_credential_type_label') }), onChange: onCredentialTypeChange })] }), selectedCredentialType &&
|
|
39
|
+
_jsxs(_Fragment, { children: [_jsx(FormContainer, { children: (selectedCredentialType.schema && selectedCredentialType.uiSchema) &&
|
|
40
|
+
_jsx(FormView, { schema: selectedCredentialType.schema, uiSchema: selectedCredentialType.uiSchema, data: credentialData, onFormStateChange: onCredentialFormInputChange }) }), _jsx(EvidenceContainer, { children: _jsxs(EvidenceContentContainer, { children: [_jsxs("div", { children: [_jsxs(EvidenceTitleContainer, { children: [_jsx(EvidenceTitle, { children: Localization.translate('credential_issuance_wizard_evidence_title') }), _jsx(EvidenceTitleOptional, { children: Localization.translate('optional_label') })] }), _jsx(EvidenceDescription, { children: Localization.translate('credential_issuance_wizard_evidence_description') })] }), _jsxs(EvidenceFilesContainer, { children: [_jsx(DragAndDropBox, { caption: Localization.translate('drag_and_drop_upload_evidence_caption'), description: Localization.translate('credential_attach_evidence_description'), onChangeFile: onAddEvidence }), getEvidenceElements()] })] }) })] })] }));
|
|
41
|
+
};
|
|
42
|
+
export default CredentialIssuanceWizardView;
|
|
@@ -6,6 +6,6 @@ const CredentialMiniCardView = (props) => {
|
|
|
6
6
|
const { backgroundColor = credentialCardColors.default, backgroundImage, logo, logoColor, style } = props;
|
|
7
7
|
return (_jsx(Container, { style: { ...style, backgroundColor }, children: _jsx(BackgroundImage, { style: {
|
|
8
8
|
...(backgroundImage?.uri && { background: `url(${backgroundImage.uri})`, backgroundSize: 'cover' }),
|
|
9
|
-
}, children: (!backgroundImage || logo) && _jsx(SSILogo, { logo: logo, color: logoColor }) }) }));
|
|
9
|
+
}, children: (!backgroundImage || logo) && _jsx(SSILogo, { logo: logo, color: logoColor, size: logo?.style?.height }) }) }));
|
|
10
10
|
};
|
|
11
11
|
export default CredentialMiniCardView;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import { CredentialStatus } from '@sphereon/ui-components.core';
|
|
3
|
+
import { CredentialMiniCardViewProps } from '../CredentialMiniCardView';
|
|
4
|
+
type Props = {
|
|
5
|
+
credentialTitle: string;
|
|
6
|
+
credentialStatus: CredentialStatus;
|
|
7
|
+
issuerName: string;
|
|
8
|
+
issueDate: number;
|
|
9
|
+
expirationDate?: number;
|
|
10
|
+
showTime?: boolean;
|
|
11
|
+
showCard?: boolean;
|
|
12
|
+
credentialBranding?: CredentialMiniCardViewProps;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
declare const CredentialViewItem: FC<Props>;
|
|
16
|
+
export default CredentialViewItem;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Localization, toLocalDateString, toLocalDateTimeString } from '@sphereon/ui-components.core';
|
|
3
|
+
import SSIStatusLabel from '../../labels/SSIStatusLabel';
|
|
4
|
+
import CredentialMiniCardView from '../CredentialMiniCardView';
|
|
5
|
+
import { CredentialViewItemContainerStyled as Container, CredentialViewItemDetailsContainerStyled as DetailsContainer, SSIFlexDirectionRowViewStyled as ContentRowContainer, CredentialViewItemTitleCaptionStyled as TitleCaption, SSITextH4Styled as IssuerCaption, CredentialViewItemStatusContainerStyled as StatusContainer, SSITextH5Styled as IssueDateCaption, CredentialViewItemExpirationDateCaptionStyled as ExpirationDateCaption, } from '../../../styles';
|
|
6
|
+
const CredentialViewItem = (props) => {
|
|
7
|
+
const { credentialStatus, credentialTitle, issuerName, showTime = false, showCard = true, credentialBranding, style } = props;
|
|
8
|
+
const issueDate = showTime ? toLocalDateTimeString(props.issueDate) : toLocalDateString(props.issueDate);
|
|
9
|
+
const expirationDate = props.expirationDate
|
|
10
|
+
? `${Localization.translate('credentials_view_item_expires_on')} ${showTime
|
|
11
|
+
? toLocalDateTimeString(props.expirationDate)
|
|
12
|
+
: toLocalDateString(props.expirationDate)}`
|
|
13
|
+
: Localization.translate('credential_status_never_expires_date_label');
|
|
14
|
+
return (_jsxs(Container, { style: { ...style }, children: [showCard &&
|
|
15
|
+
_jsx(CredentialMiniCardView, { ...credentialBranding }), _jsxs(DetailsContainer, { children: [_jsxs(ContentRowContainer, { children: [_jsxs("div", { children: [_jsx(TitleCaption, { children: credentialTitle }), _jsx(IssuerCaption, { children: issuerName })] }), _jsx(StatusContainer, { children: _jsx(SSIStatusLabel, { status: credentialStatus }) })] }), _jsxs(ContentRowContainer, { children: [_jsx(IssueDateCaption, { children: issueDate }), _jsx(ExpirationDateCaption, { children: expirationDate })] })] })] }));
|
|
16
|
+
};
|
|
17
|
+
export default CredentialViewItem;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonSchema, UISchemaElement, ValidationMode } from '@jsonforms/core';
|
|
3
|
+
import { JSONFormState } from '../../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
schema: JsonSchema;
|
|
6
|
+
uiSchema: UISchemaElement;
|
|
7
|
+
validationMode?: ValidationMode;
|
|
8
|
+
data?: Record<any, any>;
|
|
9
|
+
renderers?: Array<JsonFormsRendererRegistryEntry>;
|
|
10
|
+
cells?: Array<JsonFormsCellRendererRegistryEntry>;
|
|
11
|
+
onFormStateChange?: (state: JSONFormState) => Promise<void>;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
declare const FormView: FC<Props>;
|
|
15
|
+
export default FormView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { JsonForms } from '@jsonforms/react';
|
|
3
|
+
import { materialCells } from '@jsonforms/material-renderers';
|
|
4
|
+
import { jsonFormsMaterialRenderers } from '../../../renders/jsonFormsRenders';
|
|
5
|
+
const FormView = (props) => {
|
|
6
|
+
const { data, schema, uiSchema, validationMode = 'ValidateAndShow', renderers = jsonFormsMaterialRenderers, cells = materialCells, style, onFormStateChange } = props;
|
|
7
|
+
const onFormStateChanged = (state) => {
|
|
8
|
+
void onFormStateChange?.(state);
|
|
9
|
+
};
|
|
10
|
+
return _jsx("div", { style: style, children: _jsx(JsonForms, { schema: schema, uischema: uiSchema, data: data, renderers: renderers, cells: cells, onChange: onFormStateChanged, validationMode: validationMode }) });
|
|
11
|
+
};
|
|
12
|
+
export default FormView;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
2
|
+
border-color: #7276F7 !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
|
|
6
|
+
border-color: #7276F7 !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.MuiTypography-h6 {
|
|
10
|
+
font-size: 16px !important;
|
|
11
|
+
font-style: normal !important;
|
|
12
|
+
font-weight: 600 !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiGrid-container {
|
|
16
|
+
padding: 0 !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MuiFormControl-root {
|
|
20
|
+
padding: 0 !important;
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.MuiCardContent-root {
|
|
25
|
+
padding: 0 !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.MuiCardHeader-root {
|
|
29
|
+
padding: 0 !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.MuiPaper-root {
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
background-color: #FBFBFB !important;
|
|
35
|
+
box-shadow: none !important;
|
|
36
|
+
border-radius: 4px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.MuiCardHeader-title {
|
|
40
|
+
font-family: Poppins, serif !important;
|
|
41
|
+
font-size: 16px !important;
|
|
42
|
+
font-style: normal !important;
|
|
43
|
+
font-weight: 400 !important;
|
|
44
|
+
margin-bottom: 10px !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.MuiGrid-root.MuiGrid-container.MuiGrid-direction-xs-column {
|
|
48
|
+
gap: 24px !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.MuiFormLabel-root.MuiInputLabel-root {
|
|
52
|
+
font-family: 'Poppins', sans-serif !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.MuiInputBase-root.MuiOutlinedInput-root .MuiInputBase-input {
|
|
56
|
+
font-family: 'Poppins', sans-serif !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.MuiInputBase-root.MuiOutlinedInput-root {
|
|
60
|
+
font-family: 'Poppins', sans-serif !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.MuiTypography-root {
|
|
64
|
+
font-family: 'Poppins', sans-serif !important;
|
|
65
|
+
color: #303030 !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.MuiDateCalendar-root {
|
|
69
|
+
background-color: #ECE6F0 !important;
|
|
70
|
+
border-radius: 16px !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.MuiPaper-root.MuiPaper-elevation.MuiPaper-rounded.MuiPaper-elevation8.MuiPickersPopper-paper {
|
|
74
|
+
border-radius: 16px !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.MuiButtonBase-root.MuiPickersDay-root.Mui-selected.MuiPickersDay-dayWithMargin {
|
|
78
|
+
background-color: #7276F7 !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.MuiButtonBase-root.MuiPickersDay-root.MuiPickersDay-dayWithMargin:hover {
|
|
82
|
+
background-color: #B7B8D9 !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.base-Popper-root {
|
|
86
|
+
border-radius: 4px !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.MuiFormGroup-root.MuiFormGroup-row {
|
|
90
|
+
display: grid !important;
|
|
91
|
+
grid-template-columns: repeat(2, 1fr) !important;
|
|
92
|
+
grid-gap: 10px !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.MuiGrid-root.MuiGrid-item.MuiGrid-grid-xs-true:empty {
|
|
96
|
+
display: none !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
textarea.MuiInputBase-input.MuiInputBase-inputMultiline {
|
|
100
|
+
min-height: 112px !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.MuiTabs-scroller.MuiTabs-fixed {
|
|
104
|
+
margin-bottom: 12px !important;
|
|
105
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import { JSONTree } from 'react-json-tree';
|
|
4
|
+
import { backgroundColors, calculateAspectRatio, fontColors, isBase64ImageUri, isBoolean, Localization, parseToBoolean } from '@sphereon/ui-components.core';
|
|
5
|
+
import SSICheckmarkBadge from '../../assets/badges/SSICheckmarkBadge';
|
|
6
|
+
import SSIExclamationMarkBadge from '../../assets/badges/SSIExclamationMarkBadge';
|
|
7
|
+
import { getImageSize } from '../../../utils';
|
|
8
|
+
import { JSONDataViewContainerStyled as Container, JSONDataViewHeaderContainerStyled as HeaderContainer, JSONDataViewColumnHeaderCaptionStyled as ColumnHeaderCaption, JSONDataViewDataContainerCaptionStyled as ContainerCaption, JSONDataViewDataImageValueStyled as ImageValue, JSONDataViewDataTextValueStyled as TextValue, JSONDataViewDataLabelStyled as Label } from '../../../styles';
|
|
9
|
+
const JSONDataView = (props) => {
|
|
10
|
+
const { showHeader = true, shouldExpandNodeInitially = () => false } = props;
|
|
11
|
+
const expandNodeInitially = typeof shouldExpandNodeInitially === 'function' ? shouldExpandNodeInitially : () => shouldExpandNodeInitially;
|
|
12
|
+
const [focused, setFocused] = React.useState(false);
|
|
13
|
+
const [data, setData] = React.useState();
|
|
14
|
+
const preprocessData = async (data) => {
|
|
15
|
+
if (typeof data !== 'object' || data === null) {
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
const processedData = {};
|
|
19
|
+
await Promise.all(Object.entries(data).map(async ([key, value]) => {
|
|
20
|
+
if (typeof value === 'object' && value !== null) {
|
|
21
|
+
processedData[key] = await preprocessData(value);
|
|
22
|
+
}
|
|
23
|
+
else if (typeof value === 'string' && isBase64ImageUri(value)) {
|
|
24
|
+
const base64Uri = value;
|
|
25
|
+
const dimensions = await getImageSize(base64Uri);
|
|
26
|
+
processedData[key] = {
|
|
27
|
+
uri: base64Uri,
|
|
28
|
+
dimensions: {
|
|
29
|
+
height: dimensions.height,
|
|
30
|
+
width: dimensions.width,
|
|
31
|
+
aspectRatio: calculateAspectRatio(dimensions.width, dimensions.height)
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
processedData[key] = value;
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
return processedData;
|
|
40
|
+
};
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
preprocessData(props.data).then((data) => setData(data));
|
|
43
|
+
}, [props.data]);
|
|
44
|
+
const getItemString = () => {
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
const valueRenderer = (valueAsString, value) => {
|
|
48
|
+
if (isBoolean(value)) {
|
|
49
|
+
return parseToBoolean(value) ? _jsx(SSICheckmarkBadge, {}) : _jsx(SSIExclamationMarkBadge, {});
|
|
50
|
+
}
|
|
51
|
+
if (typeof value === 'object'
|
|
52
|
+
&& value !== null
|
|
53
|
+
&& 'uri' in value) {
|
|
54
|
+
const imageData = value;
|
|
55
|
+
return _jsx(ImageValue, { style: {
|
|
56
|
+
aspectRatio: imageData.dimensions?.aspectRatio,
|
|
57
|
+
backgroundImage: `url(${imageData.uri})`,
|
|
58
|
+
} });
|
|
59
|
+
}
|
|
60
|
+
return _jsx(TextValue, { children: value?.toString() });
|
|
61
|
+
};
|
|
62
|
+
const labelRenderer = ([key]) => {
|
|
63
|
+
return _jsx(Label, { children: key });
|
|
64
|
+
};
|
|
65
|
+
const isCustomNode = (value) => {
|
|
66
|
+
return typeof value === 'object' && value !== null && 'uri' in value && 'dimensions' in value;
|
|
67
|
+
};
|
|
68
|
+
return (_jsxs(Container, { children: [showHeader &&
|
|
69
|
+
_jsxs(HeaderContainer, { children: [_jsx(ColumnHeaderCaption, { children: Localization.translate('json_data_view_attribute_column_label') }), _jsx(ColumnHeaderCaption, { children: Localization.translate('json_data_view_value_column_label') })] }), _jsx(ContainerCaption, { onMouseEnter: () => setFocused(true), onMouseLeave: () => setFocused(false), children: data &&
|
|
70
|
+
_jsx(JSONTree, { theme: {
|
|
71
|
+
base0D: fontColors.dark,
|
|
72
|
+
tree: {
|
|
73
|
+
margin: 0,
|
|
74
|
+
backgroundColor: backgroundColors.primaryLight,
|
|
75
|
+
},
|
|
76
|
+
arrowContainer: {
|
|
77
|
+
paddingRight: 6,
|
|
78
|
+
},
|
|
79
|
+
arrow: {
|
|
80
|
+
fontSize: 10,
|
|
81
|
+
...(!focused && { display: 'none' }),
|
|
82
|
+
},
|
|
83
|
+
}, hideRoot: true, shouldExpandNodeInitially: expandNodeInitially, getItemString: getItemString, labelRenderer: labelRenderer, valueRenderer: valueRenderer, isCustomNode: isCustomNode, data: data }) })] }));
|
|
84
|
+
};
|
|
85
|
+
export default JSONDataView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer,
|
|
2
|
+
import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer, SSITabViewHeaderTitleCaptionStyled as TitleCaption, } from '../../../../styles';
|
|
3
3
|
const SSITabViewHeader = (props) => {
|
|
4
4
|
const { navigationState, onIndexChange } = props;
|
|
5
5
|
return (_jsx(Container, { children: navigationState.routes.map((value, index) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import { PaginationProps } from '@mui/material';
|
|
3
|
+
export type PaginationControlsProps = PaginationProps & {
|
|
4
|
+
goToInputId?: string;
|
|
5
|
+
containerStyle?: CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
declare const PaginationControls: FC<PaginationControlsProps>;
|
|
8
|
+
export default PaginationControls;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from '@mui/material';
|
|
3
|
+
import { GoToInputContainer, GoToInputStyled, PaginationContainerStyled, PaginationStyled } from '../../../../styles';
|
|
4
|
+
import { Localization } from '@sphereon/ui-components.core';
|
|
5
|
+
const PaginationControls = (props) => {
|
|
6
|
+
const { onKeyDown, containerStyle, goToInputId = 'goTo' } = props;
|
|
7
|
+
return (_jsxs(PaginationContainerStyled, { style: containerStyle, children: [_jsx(Stack, { children: _jsx(PaginationStyled, { ...props }) }), _jsxs(GoToInputContainer, { children: [Localization.translate('table_pagination_input_caption_go_to'), _jsx(GoToInputStyled, { id: goToInputId, onKeyDown: onKeyDown }), Localization.translate('table_pagination_input_caption_page')] })] }));
|
|
8
|
+
};
|
|
9
|
+
export default PaginationControls;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ButtonIcon, Localization } from '@sphereon/ui-components.core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { SSITableViewHeaderActionsContainerStyled as ActionsContainer, SSITableViewHeaderContainerStyled as Container, SSITableViewHeaderContentContainerStyled as ContentContainer, SSITextH3Styled as FilterCaption, SSITableViewHeaderFilterContainerStyled as FilterContainer, SSITableViewHeaderShowOptionContainerStyled as ShowOptionContainer, } from '../../../../styles';
|
|
2
|
+
import { ButtonIcon, Localization, statusColors } from '@sphereon/ui-components.core';
|
|
3
|
+
import IconButton from '../../../buttons/IconButton';
|
|
4
|
+
import PrimaryButton from '../../../buttons/PrimaryButton';
|
|
5
|
+
import { SSITableViewHeaderActionsContainerStyled as ActionsContainer, SSITableViewHeaderContainerStyled as Container, SSITableViewHeaderContentContainerStyled as ContentContainer, SSITextH3Styled as FilterCaption, SSITableViewHeaderFilterContainerStyled as FilterContainer, TableViewHeaderStaticActionsContainerStyled as StaticActionsContainer, } from '../../../../styles';
|
|
7
6
|
const SSITableViewHeader = (props) => {
|
|
8
|
-
const { enableFiltering = false, enableMostRecent = false, actions = [] } = props;
|
|
9
|
-
|
|
7
|
+
const { enableFiltering = false, enableMostRecent = false, actions = [], onDelete } = props;
|
|
8
|
+
const onDeleteClick = async () => {
|
|
9
|
+
await onDelete?.();
|
|
10
|
+
};
|
|
11
|
+
return (_jsxs(Container, { children: [_jsx(StaticActionsContainer, { children: onDelete && (_jsx(IconButton, { caption: Localization.translate('action_delete_label'), icon: ButtonIcon.DELETE, iconColor: statusColors.error, onClick: onDeleteClick })) }), _jsx(ContentContainer, { style: { width: 'fit-content' }, children: _jsxs(ActionsContainer, { children: [enableFiltering && (_jsxs(FilterContainer, { children: [_jsx(IconButton, { icon: ButtonIcon.FILTER, onClick: async () => console.log('add filter clicked') }), _jsx(FilterCaption, { children: Localization.translate('action_filter_caption') })] })), actions.map((action, index) => (_jsx(PrimaryButton, { caption: action.caption, onClick: action.onClick, icon: action.icon }, index)))] }) })] }));
|
|
10
12
|
};
|
|
11
13
|
export default SSITableViewHeader;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ColumnResizeMode, Row } from '@tanstack/react-table';
|
|
3
|
-
import {
|
|
3
|
+
import { Button, ColumnHeader } from '../../../types';
|
|
4
|
+
import { PaginationControlsProps } from './PaginationControls';
|
|
4
5
|
type Props<T> = {
|
|
5
6
|
data: Array<T>;
|
|
6
7
|
columns: Array<ColumnHeader<T>>;
|
|
7
8
|
onRowClick?: (data: Row<T>) => Promise<void>;
|
|
9
|
+
onDelete?: (rows: Array<T>) => Promise<void>;
|
|
8
10
|
enableRowSelection?: boolean;
|
|
11
|
+
enableRowHover?: boolean;
|
|
9
12
|
enableFiltering?: boolean;
|
|
10
13
|
enableMostRecent?: boolean;
|
|
11
14
|
enableResultCount?: boolean;
|
|
12
15
|
columnResizeMode?: ColumnResizeMode;
|
|
13
16
|
actions?: Array<Button>;
|
|
14
|
-
|
|
17
|
+
pagination?: PaginationControlsProps;
|
|
15
18
|
};
|
|
16
19
|
declare const SSITableView: <T extends {}>(props: Props<T>) => ReactElement;
|
|
17
20
|
export default SSITableView;
|