@evoke-platform/ui-components 1.0.0-dev.217 → 1.0.0-dev.219
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/Form/Common/Form.d.ts +38 -0
- package/dist/published/components/custom/Form/Common/Form.js +413 -0
- package/dist/published/components/custom/Form/Common/FormComponentWrapper.d.ts +26 -0
- package/dist/published/components/custom/Form/Common/FormComponentWrapper.js +79 -0
- package/dist/published/components/custom/Form/Common/index.d.ts +2 -0
- package/dist/published/components/custom/Form/Common/index.js +2 -0
- package/dist/published/components/custom/Form/FormComponents/ButtonComponent.d.ts +37 -0
- package/dist/published/components/custom/Form/FormComponents/ButtonComponent.js +150 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/Document.d.ts +17 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/Document.js +80 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentComponent.d.ts +23 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentComponent.js +154 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentList.d.ts +15 -0
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentList.js +172 -0
- package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.d.ts +41 -0
- package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.js +409 -0
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.d.ts +15 -0
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.js +111 -0
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.d.ts +23 -0
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.js +112 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/InstanceLookup.d.ts +20 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/InstanceLookup.js +229 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.d.ts +34 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js +150 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.d.ts +3 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +306 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.d.ts +24 -0
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.js +126 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.d.ts +21 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.js +96 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableField.d.ts +15 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableField.js +158 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableFieldInput.d.ts +39 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableFieldInput.js +89 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.d.ts +12 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +369 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableFieldComponent.d.ts +20 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableFieldComponent.js +57 -0
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.d.ts +26 -0
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.js +99 -0
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserProperty.d.ts +23 -0
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserProperty.js +115 -0
- package/dist/published/components/custom/Form/FormComponents/ViewOnlyComponent.d.ts +20 -0
- package/dist/published/components/custom/Form/FormComponents/ViewOnlyComponent.js +83 -0
- package/dist/published/components/custom/Form/FormComponents/index.d.ts +8 -0
- package/dist/published/components/custom/Form/FormComponents/index.js +8 -0
- package/dist/published/components/custom/Form/index.d.ts +3 -0
- package/dist/published/components/custom/Form/index.js +3 -0
- package/dist/published/components/custom/Form/types.d.ts +109 -0
- package/dist/published/components/custom/Form/types.js +1 -0
- package/dist/published/components/custom/Form/utils.d.ts +45 -0
- package/dist/published/components/custom/Form/utils.js +1036 -0
- package/dist/published/components/custom/HistoryLog/DisplayedProperty.d.ts +8 -0
- package/dist/published/components/custom/HistoryLog/DisplayedProperty.js +70 -0
- package/dist/published/components/custom/HistoryLog/Filter.d.ts +11 -0
- package/dist/published/components/custom/HistoryLog/Filter.js +55 -0
- package/dist/published/components/custom/HistoryLog/HistoryData.d.ts +10 -0
- package/dist/published/components/custom/HistoryLog/HistoryData.js +83 -0
- package/dist/published/components/custom/HistoryLog/HistoryLoading.d.ts +3 -0
- package/dist/published/components/custom/HistoryLog/HistoryLoading.js +39 -0
- package/dist/published/components/custom/HistoryLog/index.d.ts +22 -0
- package/dist/published/components/custom/HistoryLog/index.js +92 -0
- package/dist/published/components/custom/RichTextViewer/index.d.ts +15 -0
- package/dist/published/components/custom/RichTextViewer/index.js +47 -0
- package/dist/published/components/custom/index.d.ts +3 -0
- package/dist/published/components/custom/index.js +3 -0
- package/dist/published/index.d.ts +1 -1
- package/dist/published/index.js +1 -1
- package/dist/published/stories/HistoryLog.stories.d.ts +6 -0
- package/dist/published/stories/HistoryLog.stories.js +79 -0
- package/dist/published/stories/RichTextViewer.stories.d.ts +6 -0
- package/dist/published/stories/RichTextViewer.stories.js +12 -0
- package/dist/published/styles/form-component.css +152 -0
- package/dist/published/types.d.ts +20 -0
- package/package.json +21 -5
@@ -0,0 +1,115 @@
|
|
1
|
+
import { ExpandMore } from '@mui/icons-material';
|
2
|
+
import React, { useEffect, useState } from 'react';
|
3
|
+
import { Autocomplete, Paper, TextField, Typography } from '../../../../core';
|
4
|
+
import { getPrefixedUrl } from '../../utils';
|
5
|
+
export const UserProperty = (props) => {
|
6
|
+
const { id, property, apiServices, handleChangeUserProperty, error, filter, value, user, fieldHeight } = props;
|
7
|
+
const [loadingOptions, setLoadingOptions] = useState(false);
|
8
|
+
const [options, setOptions] = useState([]);
|
9
|
+
const [openOptions, setOpenOptions] = useState(false);
|
10
|
+
const [users, setUsers] = useState();
|
11
|
+
const [userValue, setUserValue] = useState();
|
12
|
+
useEffect(() => {
|
13
|
+
if (value === '$_CURRENT' && (user === null || user === void 0 ? void 0 : user.id)) {
|
14
|
+
const loggedInUser = users === null || users === void 0 ? void 0 : users.find((u) => u.id === user.id);
|
15
|
+
if (loggedInUser) {
|
16
|
+
setUserValue({ label: loggedInUser.name, value: loggedInUser.id });
|
17
|
+
handleChangeUserProperty({ label: loggedInUser.name, value: loggedInUser.id });
|
18
|
+
}
|
19
|
+
}
|
20
|
+
else {
|
21
|
+
if (value && typeof value == 'object' && 'name' in value && 'id' in value) {
|
22
|
+
setUserValue({ label: value.name, value: value.id });
|
23
|
+
}
|
24
|
+
else {
|
25
|
+
setUserValue(undefined);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}, [users, value]);
|
29
|
+
useEffect(() => {
|
30
|
+
if (property.type === 'user') {
|
31
|
+
setLoadingOptions(true);
|
32
|
+
apiServices.get(getPrefixedUrl(`/users`), (error, userList) => {
|
33
|
+
setUsers(userList);
|
34
|
+
setOptions((userList !== null && userList !== void 0 ? userList : []).map((user) => ({ label: user.name, value: user.id })));
|
35
|
+
setLoadingOptions(false);
|
36
|
+
});
|
37
|
+
}
|
38
|
+
}, [property, filter]);
|
39
|
+
return (options && (React.createElement(React.Fragment, null,
|
40
|
+
React.createElement(Autocomplete, { id: id, fullWidth: true, open: openOptions, popupIcon: userValue ? '' : React.createElement(ExpandMore, null), PaperComponent: ({ children }) => {
|
41
|
+
return (React.createElement(Paper, { sx: {
|
42
|
+
borderRadius: '12px',
|
43
|
+
boxShadow: '0px 24px 48px 0px rgba(145, 158, 171, 0.2)',
|
44
|
+
'& .MuiAutocomplete-listbox': {
|
45
|
+
maxHeight: '25vh',
|
46
|
+
},
|
47
|
+
'& .MuiAutocomplete-noOptions': {
|
48
|
+
fontFamily: 'sans-serif',
|
49
|
+
fontSize: '14px',
|
50
|
+
paddingLeft: '24px',
|
51
|
+
color: 'rgba(145, 158, 171, 1)',
|
52
|
+
},
|
53
|
+
'& .MuiAutocomplete-loading': {
|
54
|
+
fontFamily: 'sans-serif',
|
55
|
+
fontSize: '14px',
|
56
|
+
paddingLeft: '24px',
|
57
|
+
color: 'rgba(145, 158, 171, 1)',
|
58
|
+
},
|
59
|
+
} }, children));
|
60
|
+
}, sx: {
|
61
|
+
'& button.MuiButtonBase-root': Object.assign({}, (!loadingOptions && value
|
62
|
+
? {
|
63
|
+
visibility: 'visible',
|
64
|
+
}
|
65
|
+
: {})),
|
66
|
+
}, noOptionsText: 'No options available', renderOption: (props, option) => {
|
67
|
+
var _a;
|
68
|
+
return (React.createElement("li", Object.assign({}, props, { key: option.id }),
|
69
|
+
React.createElement(Typography, { sx: { marginLeft: '8px', fontSize: '14px' } },
|
70
|
+
option.label,
|
71
|
+
" ",
|
72
|
+
'',
|
73
|
+
((_a = users === null || users === void 0 ? void 0 : users.find((user) => option.value === user.id)) === null || _a === void 0 ? void 0 : _a.status) === 'Inactive' ? (React.createElement("span", null, "(Inactive)")) : (''))));
|
74
|
+
}, onOpen: () => {
|
75
|
+
setOpenOptions(true);
|
76
|
+
}, onClose: () => setOpenOptions(false), value: userValue !== null && userValue !== void 0 ? userValue : '', options: options, getOptionLabel: (option) => {
|
77
|
+
var _a, _b, _c, _d;
|
78
|
+
if (typeof option === 'string') {
|
79
|
+
return (_b = (_a = options.find((o) => o.value === option)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
|
80
|
+
}
|
81
|
+
else {
|
82
|
+
{
|
83
|
+
if (((_c = users === null || users === void 0 ? void 0 : users.find((user) => option.value === user.id)) === null || _c === void 0 ? void 0 : _c.status) === 'Inactive') {
|
84
|
+
return option.label + ' (Inactive)';
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
return (_d = option.label) !== null && _d !== void 0 ? _d : '';
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}, onKeyDownCapture: (e) => {
|
92
|
+
if (value) {
|
93
|
+
e.preventDefault();
|
94
|
+
}
|
95
|
+
}, loading: loadingOptions, isOptionEqualToValue: (option, value) => {
|
96
|
+
if (typeof value === 'string') {
|
97
|
+
return option.value === value;
|
98
|
+
}
|
99
|
+
return option.value === (value === null || value === void 0 ? void 0 : value.value);
|
100
|
+
}, onChange: (event, value) => {
|
101
|
+
handleChangeUserProperty(value);
|
102
|
+
}, selectOnFocus: false, renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: 'Select', sx: Object.assign({}, (!loadingOptions && value
|
103
|
+
? {
|
104
|
+
'.MuiOutlinedInput-root': {
|
105
|
+
background: 'white',
|
106
|
+
border: 'auto',
|
107
|
+
},
|
108
|
+
'& fieldset': { borderColor: 'auto' },
|
109
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
110
|
+
border: 'auto',
|
111
|
+
},
|
112
|
+
caretColor: 'white',
|
113
|
+
}
|
114
|
+
: {})), size: fieldHeight !== null && fieldHeight !== void 0 ? fieldHeight : 'medium' }))), error: error }))));
|
115
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { ReactComponent } from '@formio/react';
|
2
|
+
import { Root } from 'react-dom/client';
|
3
|
+
import { BaseFormComponentProps } from '../types';
|
4
|
+
export declare class ViewOnlyComponent extends ReactComponent {
|
5
|
+
[x: string]: any;
|
6
|
+
static schema: any;
|
7
|
+
componentRoot?: Root;
|
8
|
+
component: BaseFormComponentProps;
|
9
|
+
/**
|
10
|
+
* Called when the component has been instantiated. This is useful to define
|
11
|
+
* default instance variable values.
|
12
|
+
*
|
13
|
+
* @param component - The JSON representation of the component created.
|
14
|
+
* @param options - The global options for the renderer
|
15
|
+
* @param data - The contextual data object (model) used for this component.
|
16
|
+
*/
|
17
|
+
constructor(component: BaseFormComponentProps, options: any, data: any);
|
18
|
+
showValue(value: unknown): {} | undefined;
|
19
|
+
attachReact(element: Element): void;
|
20
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { ReactComponent } from '@formio/react';
|
2
|
+
import { get, isEmpty } from 'lodash';
|
3
|
+
import { DateTime } from 'luxon';
|
4
|
+
import React from 'react';
|
5
|
+
import ReactDOM from 'react-dom';
|
6
|
+
import { createRoot } from 'react-dom/client';
|
7
|
+
import { Link, Typography } from '../../../core';
|
8
|
+
import { FormComponentWrapper } from '../Common/FormComponentWrapper';
|
9
|
+
export class ViewOnlyComponent extends ReactComponent {
|
10
|
+
/**
|
11
|
+
* Called when the component has been instantiated. This is useful to define
|
12
|
+
* default instance variable values.
|
13
|
+
*
|
14
|
+
* @param component - The JSON representation of the component created.
|
15
|
+
* @param options - The global options for the renderer
|
16
|
+
* @param data - The contextual data object (model) used for this component.
|
17
|
+
*/
|
18
|
+
constructor(component, options, data) {
|
19
|
+
component.property = Object.assign({}, component.property);
|
20
|
+
super(Object.assign(Object.assign({}, component), { hideLabel: true }), options, data);
|
21
|
+
this.showValue = this.showValue.bind(this);
|
22
|
+
}
|
23
|
+
showValue(value) {
|
24
|
+
var _a, _b;
|
25
|
+
if (value == null || value == undefined)
|
26
|
+
return React.createElement("span", null, "\u00A0");
|
27
|
+
switch (this.component.type) {
|
28
|
+
case 'ViewOnlyObject':
|
29
|
+
if (this.component.defaultPages && this.component.property.objectId) {
|
30
|
+
const defaultPagePath = this.component.defaultPages[this.component.property.objectId];
|
31
|
+
return (React.createElement(Link, { sx: { cursor: 'pointer' }, href: defaultPagePath
|
32
|
+
? `${process.env.REACT_APP_API_ROOT ? '' : '/app'}${defaultPagePath.replace(':instanceId', value.id)}`
|
33
|
+
: undefined }, value.name));
|
34
|
+
}
|
35
|
+
return value.name;
|
36
|
+
case 'ViewOnlyMultiSelect':
|
37
|
+
if (isEmpty(this.component.data)) {
|
38
|
+
return value.join(', ');
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
return value
|
42
|
+
.map((v) => {
|
43
|
+
var _a, _b, _c;
|
44
|
+
return (_c = (_b = (_a = this.component.data) === null || _a === void 0 ? void 0 : _a.values.find((val) => val.value === v)) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : v;
|
45
|
+
})
|
46
|
+
.join(', ');
|
47
|
+
}
|
48
|
+
case 'ViewOnlySelect':
|
49
|
+
if (isEmpty(this.component.data)) {
|
50
|
+
return this.component.property.type === 'array' ? value.join(', ') : value;
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
return ((_b = (_a = this.component.data.values.find((val) => val.value === value)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : value);
|
54
|
+
}
|
55
|
+
case 'ViewOnlyUser':
|
56
|
+
return value.name;
|
57
|
+
case 'ViewOnlyDate':
|
58
|
+
return DateTime.fromISO(value).toFormat('MM/dd/yyyy');
|
59
|
+
case 'ViewOnlyDateTime':
|
60
|
+
return DateTime.fromISO(value).toFormat('MM/dd/yyyy hh:mm a');
|
61
|
+
case 'ViewOnlyTime':
|
62
|
+
return DateTime.fromISO(DateTime.now().toISODate() + 'T' + value).toFormat('hh:mm a');
|
63
|
+
case 'ViewOnlyBoolean':
|
64
|
+
return value ? 'Yes' : 'No';
|
65
|
+
default:
|
66
|
+
return value;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
attachReact(element) {
|
70
|
+
let root = ReactDOM.findDOMNode(element);
|
71
|
+
if (!root) {
|
72
|
+
root = element;
|
73
|
+
}
|
74
|
+
if (!this.componentRoot) {
|
75
|
+
this.componentRoot = createRoot(root);
|
76
|
+
}
|
77
|
+
return this.componentRoot.render(React.createElement("div", null,
|
78
|
+
React.createElement(FormComponentWrapper, Object.assign({}, this.component, { viewOnly: true }),
|
79
|
+
React.createElement(Typography, { variant: "body1", key: this.component.key }, this.showValue(this.component.instance
|
80
|
+
? get(this.component.instance, this.component.key)
|
81
|
+
: this.component.defaultValue)))));
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './ButtonComponent';
|
2
|
+
export * from './DocumentComponent/DocumentComponent';
|
3
|
+
export * from './FormFieldComponent';
|
4
|
+
export * from './ImageComponent/ImageComponent';
|
5
|
+
export * from './ObjectComponent/ObjectComponent';
|
6
|
+
export * from './RepeatableFieldComponent/RepeatableFieldComponent';
|
7
|
+
export * from './UserComponent/UserComponent';
|
8
|
+
export * from './ViewOnlyComponent';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './ButtonComponent';
|
2
|
+
export * from './DocumentComponent/DocumentComponent';
|
3
|
+
export * from './FormFieldComponent';
|
4
|
+
export * from './ImageComponent/ImageComponent';
|
5
|
+
export * from './ObjectComponent/ObjectComponent';
|
6
|
+
export * from './RepeatableFieldComponent/RepeatableFieldComponent';
|
7
|
+
export * from './UserComponent/UserComponent';
|
8
|
+
export * from './ViewOnlyComponent';
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { ApiServices, ObjectInstance, Property, Reference, UserAccount } from '@evoke-platform/context';
|
2
|
+
import { AutocompleteOption } from '../../core';
|
3
|
+
export declare type BaseFormComponentProps = {
|
4
|
+
key: string;
|
5
|
+
id: string;
|
6
|
+
type: string;
|
7
|
+
label: string;
|
8
|
+
inputId: string;
|
9
|
+
readOnly?: boolean;
|
10
|
+
instance: ObjectInstance;
|
11
|
+
property: Property;
|
12
|
+
viewOnly: boolean;
|
13
|
+
canUpdateProperty: boolean;
|
14
|
+
hidden?: boolean;
|
15
|
+
defaultPages?: Record<string, string>;
|
16
|
+
data?: {
|
17
|
+
values: AutocompleteOption[];
|
18
|
+
};
|
19
|
+
defaultValue?: unknown;
|
20
|
+
hideLabel?: boolean;
|
21
|
+
objectId?: string;
|
22
|
+
validate: {
|
23
|
+
required?: boolean;
|
24
|
+
criteria?: Record<string, unknown>;
|
25
|
+
minDate?: string;
|
26
|
+
maxDate?: string;
|
27
|
+
minTime?: string;
|
28
|
+
maxTime?: string;
|
29
|
+
min?: string;
|
30
|
+
max?: string;
|
31
|
+
minDocuments?: number;
|
32
|
+
maxDocuments?: number;
|
33
|
+
operator?: 'all' | 'any';
|
34
|
+
regexes?: {
|
35
|
+
regex: string;
|
36
|
+
errorMessage: string;
|
37
|
+
}[];
|
38
|
+
customMessage?: string;
|
39
|
+
};
|
40
|
+
conditional: {
|
41
|
+
when: string;
|
42
|
+
show: boolean;
|
43
|
+
eq: string;
|
44
|
+
};
|
45
|
+
user?: UserAccount;
|
46
|
+
errorMessage?: string;
|
47
|
+
fieldHeight?: 'small' | 'medium';
|
48
|
+
navigateTo: (path?: string) => void;
|
49
|
+
autoSave?: (update: Record<string, unknown>) => void;
|
50
|
+
baseUrl: string;
|
51
|
+
apiServices: ApiServices;
|
52
|
+
};
|
53
|
+
export declare type ObjectPropertyInputProps = {
|
54
|
+
id: string;
|
55
|
+
instance: ObjectInstance;
|
56
|
+
property: Property;
|
57
|
+
user?: UserAccount;
|
58
|
+
apiServices: ApiServices;
|
59
|
+
handleChangeObjectProperty: (propertyId: string, instance?: Reference | null) => void;
|
60
|
+
mode: 'default' | 'existingOnly';
|
61
|
+
displayOption?: 'dropdown' | 'dialogBox';
|
62
|
+
nestedFieldsView?: boolean;
|
63
|
+
canUpdateProperty?: boolean;
|
64
|
+
error?: boolean;
|
65
|
+
defaultPages?: Record<string, string>;
|
66
|
+
navigateTo?: (path: string) => void;
|
67
|
+
setSnackbarError?: (snackbarError: {
|
68
|
+
showAlert: boolean;
|
69
|
+
message?: string;
|
70
|
+
isError?: boolean;
|
71
|
+
}) => void;
|
72
|
+
filter?: Record<string, unknown>;
|
73
|
+
defaultValueCriteria?: Record<string, unknown>;
|
74
|
+
sortBy?: string;
|
75
|
+
orderBy?: string;
|
76
|
+
isModal?: boolean;
|
77
|
+
label?: string;
|
78
|
+
};
|
79
|
+
export declare type Address = {
|
80
|
+
line1?: string;
|
81
|
+
line2?: string;
|
82
|
+
city?: string;
|
83
|
+
county?: string;
|
84
|
+
state?: string;
|
85
|
+
zipCode?: string;
|
86
|
+
};
|
87
|
+
export declare type User = {
|
88
|
+
id: string;
|
89
|
+
name: string;
|
90
|
+
status: string;
|
91
|
+
};
|
92
|
+
export declare type AccessCheck = {
|
93
|
+
result: boolean;
|
94
|
+
};
|
95
|
+
export declare type Document = {
|
96
|
+
id: string;
|
97
|
+
name: string;
|
98
|
+
contentType: string;
|
99
|
+
size: number;
|
100
|
+
uploadedDate: string;
|
101
|
+
metadata: {
|
102
|
+
[field: string]: unknown;
|
103
|
+
};
|
104
|
+
versionId?: string;
|
105
|
+
};
|
106
|
+
export declare type SavedDocumentReference = {
|
107
|
+
id: string;
|
108
|
+
name: string;
|
109
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { ActionInput, ActionInputType, ApiServices, FormEntry, InputParameter, InputParameterReference, Obj, ObjectInstance, Property, PropertyType } from '@evoke-platform/context';
|
2
|
+
import { LocalDateTime } from '@js-joda/core';
|
3
|
+
import { AutocompleteOption } from '../../core';
|
4
|
+
import { ObjectPropertyInputProps } from './types';
|
5
|
+
export declare function determineComponentType(properties: Property[], parameter?: InputParameter): ActionInputType | undefined;
|
6
|
+
export declare function determineParameterType(componentType: string): PropertyType;
|
7
|
+
export declare function getFlattenEntries(entries: FormEntry[]): InputParameterReference[];
|
8
|
+
export declare function convertFormToComponents(entries: FormEntry[], parameters: InputParameter[], object: Obj): ActionInput[];
|
9
|
+
export declare function convertComponentsToForm(components: ActionInput[]): FormEntry[];
|
10
|
+
export declare function getMiddleObjectFilter(property: Property, instance: ObjectInstance): {
|
11
|
+
where: {
|
12
|
+
[x: string]: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
export declare function getMiddleObject(instance: ObjectInstance, property: Property, endObjectId: string, endObjectName: string): {
|
16
|
+
[x: string]: {
|
17
|
+
id: string;
|
18
|
+
name: string;
|
19
|
+
};
|
20
|
+
} | undefined;
|
21
|
+
export declare function getMiddleInstance(instanceId: string, property: Property, middleObjectInstances: ObjectInstance[]): ObjectInstance | undefined;
|
22
|
+
export declare function getPrefixedUrl(url: string): string;
|
23
|
+
export declare function addObjectPropertiesToComponentProps(properties: Property[], formComponents: any[], instance?: ObjectInstance, objectPropertyInputProps?: ObjectPropertyInputProps, autoSave?: (data: Record<string, unknown>) => void, readOnly?: boolean, defaultPages?: Record<string, string>, navigateTo?: (path: string) => void, queryAddresses?: unknown, apiServices?: ApiServices, isModal?: boolean, fieldHeight?: 'small' | 'medium'): Promise<ActionInput[]>;
|
24
|
+
export declare function getDefaultValue(initialValue: unknown, selectOptions?: AutocompleteOption[]): unknown;
|
25
|
+
export declare const buildComponentPropsFromObjectProperties: (properties: Property[], objectId: string, instance?: ObjectInstance, objectPropertyInputProps?: ObjectPropertyInputProps, hasActionPermissions?: boolean, autoSave?: ((data: Record<string, unknown>) => void) | undefined, readOnly?: boolean, queryAddresses?: unknown, isModal?: boolean, fieldHeight?: 'small' | 'medium') => unknown[];
|
26
|
+
export declare const buildComponentPropsFromDocumentProperties: (documentProperties: [string, unknown][], readOnly?: boolean, autoSave?: ((data: Record<string, unknown>) => void) | undefined, fieldHeight?: 'small' | 'medium') => {
|
27
|
+
type: string;
|
28
|
+
key: string;
|
29
|
+
label: string;
|
30
|
+
readOnly: boolean | undefined;
|
31
|
+
defaultValue: unknown;
|
32
|
+
autoSave: ((data: Record<string, unknown>) => void) | undefined;
|
33
|
+
fieldHeight: "medium" | "small" | undefined;
|
34
|
+
}[];
|
35
|
+
export declare const OPERATOR_MAP: Record<string, string>;
|
36
|
+
export declare function transformToWhere(mongoQuery: object): Record<string, unknown>;
|
37
|
+
export declare function updateCriteriaInputs(criteria: Record<string, unknown>, field: string, fieldValue: string, isInputField?: boolean): void;
|
38
|
+
export declare function getAllCriteriaInputs(criteria: Record<string, unknown>): string[];
|
39
|
+
export declare function isPropertyVisible(conditional: {
|
40
|
+
when: string;
|
41
|
+
show: boolean;
|
42
|
+
eq: string;
|
43
|
+
}, formData: Record<string, unknown>): boolean;
|
44
|
+
export declare function normalizeDateTime(dateTime: LocalDateTime): string;
|
45
|
+
export declare function normalizeDates(instances: ObjectInstance[], object?: Obj): void;
|