@evoke-platform/ui-components 1.0.0-dev.202 → 1.0.0-dev.204
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/core/Autocomplete/Autocomplete.d.ts +3 -2
- package/dist/published/components/core/Autocomplete/Autocomplete.js +19 -4
- package/dist/published/components/custom/ErrorComponent/ErrorComponent.d.ts +9 -0
- package/dist/published/components/custom/ErrorComponent/ErrorComponent.js +59 -0
- package/dist/published/components/custom/ErrorComponent/index.d.ts +3 -0
- package/dist/published/components/custom/ErrorComponent/index.js +3 -0
- package/dist/published/components/custom/index.d.ts +1 -0
- package/dist/published/components/custom/index.js +1 -0
- package/dist/published/index.d.ts +1 -1
- package/dist/published/index.js +1 -1
- package/dist/published/types.d.ts +4 -0
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { AutocompleteProps as MUIAutocompleteProps } from '@mui/material';
|
2
|
+
import * as React from 'react';
|
3
3
|
export declare type AutocompleteOption = {
|
4
4
|
label: string;
|
5
5
|
value: unknown;
|
@@ -11,9 +11,10 @@ export declare type AutocompleteProps = MUIAutocompleteProps<AutocompleteOption
|
|
11
11
|
label?: string;
|
12
12
|
labelPlacement?: string;
|
13
13
|
required?: boolean;
|
14
|
-
instructionText?: string;
|
14
|
+
instructionText?: string | React.ReactNode;
|
15
15
|
error?: boolean;
|
16
16
|
errorMessage?: string;
|
17
|
+
tooltip?: string;
|
17
18
|
};
|
18
19
|
declare const Autocomplete: (props: AutocompleteProps) => JSX.Element;
|
19
20
|
export default Autocomplete;
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { ExpandMore } from '@mui/icons-material';
|
1
|
+
import { ExpandMore, InfoRounded } from '@mui/icons-material';
|
2
2
|
import { InputLabel, Autocomplete as MUIAutocomplete } from '@mui/material';
|
3
3
|
import * as React from 'react';
|
4
4
|
import UIThemeProvider from '../../../theme';
|
5
5
|
import FieldError from '../FieldError';
|
6
6
|
import Typography from '../Typography';
|
7
|
+
import Tooltip from '../Tooltip';
|
7
8
|
const Autocomplete = (props) => {
|
8
9
|
var _a, _b, _c, _d;
|
9
10
|
const sortedOptions = props.sortBy !== 'NONE'
|
@@ -26,12 +27,26 @@ const Autocomplete = (props) => {
|
|
26
27
|
sortedOptions === null || sortedOptions === void 0 ? void 0 : sortedOptions.sort((a, b) => a.label.localeCompare(b.label));
|
27
28
|
break;
|
28
29
|
}
|
30
|
+
const renderInstructionText = () => {
|
31
|
+
if (typeof props.instructionText === 'string') {
|
32
|
+
return (React.createElement(Typography, { fontSize: '12px', lineHeight: '14px' }, props.instructionText));
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
return props.instructionText;
|
36
|
+
}
|
37
|
+
};
|
29
38
|
if (!!props.label && props.labelPlacement === 'outside-top') {
|
30
39
|
return (React.createElement(UIThemeProvider, null,
|
31
|
-
React.createElement(InputLabel, { htmlFor: (_a = props.id) !== null && _a !== void 0 ? _a : '', sx: { paddingBottom: '0px', fontSize: '14px' } }, (_b = props.label) !== null && _b !== void 0 ? _b : '',
|
40
|
+
React.createElement(InputLabel, { htmlFor: (_a = props.id) !== null && _a !== void 0 ? _a : '', sx: { display: 'flex', paddingBottom: '0px', fontSize: '14px' } }, (_b = props.label) !== null && _b !== void 0 ? _b : '',
|
32
41
|
' ',
|
33
|
-
props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null
|
34
|
-
|
42
|
+
props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null,
|
43
|
+
props.tooltip && (React.createElement(Tooltip, { title: props.tooltip, placement: "right" },
|
44
|
+
React.createElement(InfoRounded, { sx: {
|
45
|
+
fontSize: '14px',
|
46
|
+
margin: '2px 4px 0 8px',
|
47
|
+
color: (theme) => theme.palette.text.secondary,
|
48
|
+
} })))),
|
49
|
+
renderInstructionText(),
|
35
50
|
React.createElement(MUIAutocomplete, Object.assign({}, props, { sx: Object.assign({ '& fieldset': { borderRadius: '8px', borderColor: props.error ? 'red' : undefined }, '& .MuiOutlinedInput-notchedOutline': {
|
36
51
|
border: props.readOnly ? 'none' : 'auto',
|
37
52
|
}, '& .MuiInputBase-input.Mui-disabled': {
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { GridSize } from '@mui/material';
|
3
|
+
export declare type ErrorComponentProps = {
|
4
|
+
code?: 'AccessDenied' | 'NotFound' | 'Misconfigured';
|
5
|
+
message?: string;
|
6
|
+
colspan?: GridSize;
|
7
|
+
styles?: React.CSSProperties;
|
8
|
+
};
|
9
|
+
export default function ErrorComponent(props: ErrorComponentProps): JSX.Element;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Box, Typography, Grid } from '@mui/material';
|
3
|
+
import { LockRounded, ErrorRounded, WarningRounded, BuildRounded } from '@mui/icons-material';
|
4
|
+
export default function ErrorComponent(props) {
|
5
|
+
const { code, message, colspan, styles } = props;
|
6
|
+
const getTitle = () => {
|
7
|
+
switch (code) {
|
8
|
+
case 'AccessDenied':
|
9
|
+
return 'Access Denied';
|
10
|
+
case 'NotFound':
|
11
|
+
return 'Not Found';
|
12
|
+
case 'Misconfigured':
|
13
|
+
return 'Configuration Error';
|
14
|
+
default:
|
15
|
+
return 'Hmm. Something went wrong.';
|
16
|
+
}
|
17
|
+
};
|
18
|
+
const getSubtitle = () => {
|
19
|
+
if (message)
|
20
|
+
return message;
|
21
|
+
switch (code) {
|
22
|
+
case 'AccessDenied':
|
23
|
+
return 'You do not have permission to view this content.';
|
24
|
+
case 'NotFound':
|
25
|
+
return 'The requested content could not be found.';
|
26
|
+
case 'Misconfigured':
|
27
|
+
return `It looks like something is missing.`;
|
28
|
+
default:
|
29
|
+
return 'There was an error while loading.';
|
30
|
+
}
|
31
|
+
};
|
32
|
+
const getIcon = () => {
|
33
|
+
switch (code) {
|
34
|
+
case 'AccessDenied':
|
35
|
+
return React.createElement(LockRounded, { sx: { color: '#0075A7' } });
|
36
|
+
case 'NotFound':
|
37
|
+
return React.createElement(ErrorRounded, { sx: { color: '#A12723' } });
|
38
|
+
case 'Misconfigured':
|
39
|
+
return React.createElement(BuildRounded, { sx: { color: '#ef8228' } });
|
40
|
+
default:
|
41
|
+
return React.createElement(WarningRounded, { sx: { color: '#ef8228' } });
|
42
|
+
}
|
43
|
+
};
|
44
|
+
return (React.createElement(Grid, { item: true, xs: colspan !== null && colspan !== void 0 ? colspan : 12, sm: 12, sx: Object.assign({ background: 'white', display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', boxShadow: '0px 8px 16px 0px rgba(145, 158, 171, 0.12)', borderRadius: '6px', height: 200 }, styles) },
|
45
|
+
React.createElement(Box, { sx: {
|
46
|
+
padding: '8px',
|
47
|
+
height: '36px',
|
48
|
+
width: '36px',
|
49
|
+
borderRadius: '8px',
|
50
|
+
backgroundColor: '#F9FAFB',
|
51
|
+
boxShadow: '0px 1px 2px 0px rgba(0, 0, 0, 0.12)',
|
52
|
+
display: 'flex',
|
53
|
+
justifyContent: 'center',
|
54
|
+
alignItems: 'center',
|
55
|
+
marginBottom: '16px',
|
56
|
+
} }, getIcon()),
|
57
|
+
React.createElement(Typography, { sx: { fontWeight: 700, fontSize: '18px' } }, getTitle()),
|
58
|
+
React.createElement(Typography, { sx: { marginTop: '4px' } }, getSubtitle())));
|
59
|
+
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { BuilderGrid } from './BuilderGrid';
|
2
2
|
export { CriteriaBuilder } from './CriteriaBuilder';
|
3
3
|
export { DataGrid } from './DataGrid';
|
4
|
+
export { ErrorComponent } from './ErrorComponent';
|
4
5
|
export { FormField } from './FormField';
|
5
6
|
export { MenuBar } from './Menubar';
|
6
7
|
export { MultiSelect } from './MultiSelect';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { BuilderGrid } from './BuilderGrid';
|
2
2
|
export { CriteriaBuilder } from './CriteriaBuilder';
|
3
3
|
export { DataGrid } from './DataGrid';
|
4
|
+
export { ErrorComponent } from './ErrorComponent';
|
4
5
|
export { FormField } from './FormField';
|
5
6
|
export { MenuBar } from './Menubar';
|
6
7
|
export { MultiSelect } from './MultiSelect';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export { ClickAwayListener, Toolbar, createTheme, styled } from '@mui/material';
|
2
2
|
export { CalendarPicker, DateTimePicker, MonthPicker, PickersDay, StaticDateTimePicker, StaticTimePicker, TimePicker, YearPicker, } from '@mui/x-date-pickers';
|
3
3
|
export * from './components/core';
|
4
|
-
export { BuilderGrid, CriteriaBuilder, DataGrid, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
4
|
+
export { BuilderGrid, CriteriaBuilder, DataGrid, ErrorComponent, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
5
5
|
export { Box, Container, Grid, Stack } from './components/layout';
|
6
6
|
export * from './util';
|
7
7
|
export * as EVOKE_TYPES from './types';
|
package/dist/published/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
export { ClickAwayListener, Toolbar, createTheme, styled } from '@mui/material';
|
2
2
|
export { CalendarPicker, DateTimePicker, MonthPicker, PickersDay, StaticDateTimePicker, StaticTimePicker, TimePicker, YearPicker, } from '@mui/x-date-pickers';
|
3
3
|
export * from './components/core';
|
4
|
-
export { BuilderGrid, CriteriaBuilder, DataGrid, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
4
|
+
export { BuilderGrid, CriteriaBuilder, DataGrid, ErrorComponent, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
5
5
|
export { Box, Container, Grid, Stack } from './components/layout';
|
6
6
|
export * from './util';
|
7
7
|
export * as EVOKE_TYPES from './types';
|
@@ -36,6 +36,10 @@ export declare type RichTextTemplate = {
|
|
36
36
|
view_permission?: 'Private' | 'Portal' | 'Public';
|
37
37
|
};
|
38
38
|
additionalDatasources?: string[];
|
39
|
+
sort?: {
|
40
|
+
sortBy: string;
|
41
|
+
direction: 'asc' | 'desc' | 'ASC' | 'DESC';
|
42
|
+
};
|
39
43
|
};
|
40
44
|
export declare type App = {
|
41
45
|
id: string;
|