@evoke-platform/ui-components 1.0.0-dev.221 → 1.0.0-dev.223
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/published/components/custom/HistoryLog/DisplayedProperty.d.ts +2 -2
- package/dist/published/components/custom/HistoryLog/DisplayedProperty.js +2 -2
- package/dist/published/components/custom/HistoryLog/Filter.d.ts +2 -2
- package/dist/published/components/custom/HistoryLog/Filter.js +5 -5
- package/dist/published/components/custom/HistoryLog/HistoryData.d.ts +3 -2
- package/dist/published/components/custom/HistoryLog/HistoryData.js +4 -4
- package/dist/published/components/custom/HistoryLog/index.d.ts +3 -2
- package/dist/published/components/custom/HistoryLog/index.js +3 -4
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { Property } from '@evoke-platform/context';
|
3
3
|
declare type DisplayedPropertyProps = {
|
4
|
-
property:
|
4
|
+
property: Property;
|
5
5
|
value: unknown;
|
6
6
|
};
|
7
7
|
declare const DisplayedProperty: (props: DisplayedPropertyProps) => JSX.Element;
|
@@ -1,7 +1,7 @@
|
|
1
|
+
import { DateTime } from 'luxon';
|
1
2
|
import React from 'react';
|
2
|
-
import { Grid } from '../../layout';
|
3
3
|
import { CardMedia, Typography } from '../../core';
|
4
|
-
import {
|
4
|
+
import { Grid } from '../../layout';
|
5
5
|
import { RichTextViewer } from '../RichTextViewer';
|
6
6
|
const DisplayedProperty = (props) => {
|
7
7
|
const { property, value } = props;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { Obj } from '@evoke-platform/context';
|
3
3
|
declare type HistoryFilterProps = {
|
4
4
|
filter: string[];
|
5
5
|
setFilter: (filter: string[]) => void;
|
6
|
-
object:
|
6
|
+
object: Obj;
|
7
7
|
order?: 'desc' | 'asc';
|
8
8
|
setOrder: (order: 'desc' | 'asc') => void;
|
9
9
|
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Box } from '../../layout';
|
3
|
-
import { Button, Checkbox, MenuItem, Select, Typography } from '../../core';
|
4
1
|
import { SwapVert } from '@mui/icons-material';
|
5
2
|
import { isArray, startCase } from 'lodash';
|
3
|
+
import React from 'react';
|
4
|
+
import { Button, Checkbox, MenuItem, Select, Typography } from '../../core';
|
5
|
+
import { Box } from '../../layout';
|
6
6
|
const HistoryFilter = (props) => {
|
7
7
|
const { order, setOrder, filter, setFilter, object } = props;
|
8
8
|
return (React.createElement(Box, { sx: { display: 'flex', width: '100%' } },
|
@@ -21,7 +21,7 @@ const HistoryFilter = (props) => {
|
|
21
21
|
borderRadius: '8px',
|
22
22
|
margin: '0 4px 16px 0',
|
23
23
|
maxWidth: '400px',
|
24
|
-
'@media (min-width: 600px)': { width: '
|
24
|
+
'@media (min-width: 600px)': { width: '70%' },
|
25
25
|
}, MenuProps: {
|
26
26
|
PaperProps: {
|
27
27
|
sx: {
|
@@ -45,7 +45,7 @@ const HistoryFilter = (props) => {
|
|
45
45
|
border: '1px solid #cbcbcb',
|
46
46
|
maxWidth: '135px',
|
47
47
|
'@media (min-width: 600px)': {
|
48
|
-
width: '
|
48
|
+
width: '30%',
|
49
49
|
},
|
50
50
|
}, onClick: () => (order === 'asc' ? setOrder('desc') : setOrder('asc')) },
|
51
51
|
React.createElement(Box, { display: 'flex', alignItems: 'center' },
|
@@ -1,10 +1,11 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { Obj } from '@evoke-platform/context';
|
3
|
+
import { History } from '../../../types';
|
3
4
|
export declare const nanoid: (size?: number | undefined) => string;
|
4
5
|
declare type HistoryDataProps = {
|
5
6
|
records: History[];
|
6
7
|
documentHistory?: Record<string, History[]>;
|
7
|
-
object:
|
8
|
+
object: Obj;
|
8
9
|
};
|
9
10
|
declare const HistoricalData: (props: HistoryDataProps) => JSX.Element;
|
10
11
|
export default HistoricalData;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Box, Grid } from '../../layout';
|
3
|
-
import { Typography } from '../../core';
|
4
1
|
import { ArrowForward } from '@mui/icons-material';
|
2
|
+
import { lowerCase } from 'lodash';
|
5
3
|
import { customAlphabet } from 'nanoid';
|
6
4
|
import { lowercase, uppercase } from 'nanoid-dictionary';
|
7
|
-
import
|
5
|
+
import React from 'react';
|
6
|
+
import { Typography } from '../../core';
|
7
|
+
import { Box, Grid } from '../../layout';
|
8
8
|
import DisplayedProperty from './DisplayedProperty';
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
10
10
|
const { format } = require('small-date');
|
@@ -1,8 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { Obj } from '@evoke-platform/context';
|
3
|
+
import { History } from '../../../types';
|
3
4
|
export declare type HistoryLogProps = {
|
4
5
|
/** The object instance associated with the history log */
|
5
|
-
object:
|
6
|
+
object: Obj;
|
6
7
|
/** An array of history entries representing the log. */
|
7
8
|
history: History[];
|
8
9
|
/** Indicates whether the history data is loading */
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { Box, Typography } from '../../../index';
|
2
1
|
import { Circle } from '@mui/icons-material';
|
3
2
|
import { DateTime } from 'luxon';
|
4
3
|
import React, { useEffect, useState } from 'react';
|
4
|
+
import Typography from '../../core/Typography';
|
5
|
+
import Box from '../../layout/Box';
|
5
6
|
import HistoryFilter from './Filter';
|
6
7
|
import HistoricalData from './HistoryData';
|
7
8
|
import HistoryLoading from './HistoryLoading';
|
@@ -16,13 +17,12 @@ const { format } = require('small-date');
|
|
16
17
|
* @returns {JSX.Element} A timeline view representing the instance's history.
|
17
18
|
*/
|
18
19
|
export const HistoryLog = (props) => {
|
19
|
-
const { object, history, loading
|
20
|
+
const { object, history, loading, title } = props;
|
20
21
|
const [historyMap, setHistoryMap] = useState({});
|
21
22
|
const [documentHistory, setDocumentHistory] = useState({});
|
22
23
|
const [filteredHistory, setFilteredHistory] = useState({});
|
23
24
|
const [filter, setFilter] = useState([]);
|
24
25
|
const [order, setOrder] = useState('desc');
|
25
|
-
const [loading, setLoading] = useState(initialLoading !== null && initialLoading !== void 0 ? initialLoading : true);
|
26
26
|
const sortHistoryByTimestamp = (historicalData, order) => {
|
27
27
|
return historicalData.sort((a, b) => order === 'desc' ? b.timestamp.localeCompare(a.timestamp) : a.timestamp.localeCompare(b.timestamp));
|
28
28
|
};
|
@@ -45,7 +45,6 @@ export const HistoryLog = (props) => {
|
|
45
45
|
setHistoryMap(sortGroupedHistoryByDate(groupedHistory, 'desc'));
|
46
46
|
setFilteredHistory(sortGroupedHistoryByDate(groupedHistory, 'desc'));
|
47
47
|
setDocumentHistory(sortGroupedHistoryByDate(documentHistory, 'asc'));
|
48
|
-
setLoading(false);
|
49
48
|
}, [history]);
|
50
49
|
useEffect(() => {
|
51
50
|
if (!filter.length) {
|