@evoke-platform/ui-components 1.10.0-dev.2 → 1.10.0-dev.21
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/CriteriaBuilder/CriteriaBuilder.js +1 -1
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.test.d.ts +1 -0
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.test.js +430 -0
- package/dist/published/components/custom/CriteriaBuilder/ValueEditor.js +19 -6
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +1 -1
- package/dist/published/components/custom/Form/utils.js +1 -0
- package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.js +14 -1
- package/dist/published/components/custom/FormField/DateTimePickerSelect/DateTimePickerSelect.js +14 -1
- package/dist/published/components/custom/FormField/TimePickerSelect/TimePickerSelect.js +14 -1
- package/dist/published/components/custom/FormV2/FormRenderer.d.ts +2 -1
- package/dist/published/components/custom/FormV2/FormRenderer.js +17 -4
- package/dist/published/components/custom/FormV2/FormRendererContainer.js +116 -74
- package/dist/published/components/custom/FormV2/components/AccordionSections.js +7 -2
- package/dist/published/components/custom/FormV2/components/Body.d.ts +1 -1
- package/dist/published/components/custom/FormV2/components/FieldWrapper.js +1 -1
- package/dist/published/components/custom/FormV2/components/Footer.d.ts +1 -0
- package/dist/published/components/custom/FormV2/components/Footer.js +3 -3
- package/dist/published/components/custom/FormV2/components/FormContext.d.ts +3 -2
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/AddressFields.d.ts +9 -0
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/AddressFields.js +32 -15
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/ActionDialog.js +1 -1
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/RepeatableField.d.ts +0 -3
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/RepeatableField.js +36 -49
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/Criteria.js +16 -3
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/Document.js +16 -4
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/DocumentList.d.ts +2 -1
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/DocumentList.js +16 -3
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/Image.js +31 -5
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/UserProperty.js +15 -3
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/relatedObjectFiles/ObjectPropertyInput.js +109 -81
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/relatedObjectFiles/RelatedObjectInstance.js +38 -16
- package/dist/published/components/custom/FormV2/components/Header.d.ts +13 -3
- package/dist/published/components/custom/FormV2/components/Header.js +47 -8
- package/dist/published/components/custom/FormV2/components/RecursiveEntryRenderer.js +44 -35
- package/dist/published/components/custom/FormV2/components/ValidationFiles/ValidationErrors.js +1 -1
- package/dist/published/components/custom/FormV2/components/types.d.ts +1 -0
- package/dist/published/components/custom/FormV2/components/utils.d.ts +2 -2
- package/dist/published/components/custom/FormV2/components/utils.js +11 -14
- package/dist/published/components/custom/FormV2/tests/FormRenderer.test.js +433 -4
- package/dist/published/components/custom/FormV2/tests/FormRendererContainer.test.js +662 -13
- package/dist/published/components/custom/FormV2/tests/test-data.d.ts +1 -0
- package/dist/published/components/custom/FormV2/tests/test-data.js +140 -0
- package/dist/published/components/custom/ViewDetailsV2/InstanceEntryRenderer.d.ts +3 -0
- package/dist/published/components/custom/ViewDetailsV2/InstanceEntryRenderer.js +155 -0
- package/dist/published/components/custom/ViewDetailsV2/ViewDetailsV2Container.d.ts +13 -0
- package/dist/published/components/custom/ViewDetailsV2/ViewDetailsV2Container.js +140 -0
- package/dist/published/components/custom/ViewDetailsV2/index.d.ts +3 -0
- package/dist/published/components/custom/ViewDetailsV2/index.js +2 -0
- package/dist/published/components/custom/index.d.ts +2 -0
- package/dist/published/components/custom/index.js +1 -0
- package/dist/published/index.d.ts +6 -6
- package/dist/published/index.js +1 -1
- package/dist/published/stories/FormRenderer.stories.d.ts +8 -4
- package/dist/published/stories/FormRendererContainer.stories.d.ts +26 -0
- package/dist/published/stories/FormRendererContainer.stories.js +5 -0
- package/dist/published/stories/FormRendererData.d.ts +12 -0
- package/dist/published/stories/FormRendererData.js +27 -44
- package/dist/published/stories/ViewDetailsV2Container.stories.d.ts +26 -0
- package/dist/published/stories/ViewDetailsV2Container.stories.js +37 -0
- package/dist/published/stories/ViewDetailsV2Data.d.ts +4 -0
- package/dist/published/stories/ViewDetailsV2Data.js +203 -0
- package/dist/published/stories/sharedMswHandlers.js +49 -10
- package/dist/published/theme/hooks.d.ts +4 -3
- package/package.json +4 -2
|
@@ -93,6 +93,11 @@ export const mockGenericEvokeFormObject = {
|
|
|
93
93
|
name: 'User',
|
|
94
94
|
type: 'user',
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
id: 'boolean',
|
|
98
|
+
name: 'Boolean',
|
|
99
|
+
type: 'boolean',
|
|
100
|
+
},
|
|
96
101
|
],
|
|
97
102
|
actions: [
|
|
98
103
|
{
|
|
@@ -170,7 +175,7 @@ export const mockGenericEvokeFormObject = {
|
|
|
170
175
|
],
|
|
171
176
|
outputEvent: 'Update Generic Evoke Form 2',
|
|
172
177
|
preconditions: {},
|
|
173
|
-
defaultFormId: '
|
|
178
|
+
defaultFormId: 'updateGenericEvokeForm',
|
|
174
179
|
},
|
|
175
180
|
{
|
|
176
181
|
id: '_delete',
|
|
@@ -196,7 +201,7 @@ export const mockMovieObject = {
|
|
|
196
201
|
id: 'customers',
|
|
197
202
|
name: 'Customers',
|
|
198
203
|
type: 'collection',
|
|
199
|
-
objectId: '
|
|
204
|
+
objectId: 'customerMovie',
|
|
200
205
|
relatedPropertyId: 'movie',
|
|
201
206
|
manyToManyPropertyId: 'customer',
|
|
202
207
|
},
|
|
@@ -533,20 +538,6 @@ export const mockEvokeForm = {
|
|
|
533
538
|
display: {
|
|
534
539
|
label: 'Multi-Select',
|
|
535
540
|
},
|
|
536
|
-
enumWithLabels: [
|
|
537
|
-
{
|
|
538
|
-
label: '1',
|
|
539
|
-
value: '1',
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
label: '2',
|
|
543
|
-
value: '2',
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
label: '3',
|
|
547
|
-
value: '3',
|
|
548
|
-
},
|
|
549
|
-
],
|
|
550
541
|
},
|
|
551
542
|
{
|
|
552
543
|
type: 'input',
|
|
@@ -571,6 +562,8 @@ export const mockEvokeForm = {
|
|
|
571
562
|
parameterId: 'collection',
|
|
572
563
|
display: {
|
|
573
564
|
label: 'Collection',
|
|
565
|
+
createActionId: '_create',
|
|
566
|
+
createFormId: 'customerCreateForm',
|
|
574
567
|
},
|
|
575
568
|
},
|
|
576
569
|
{
|
|
@@ -815,20 +808,6 @@ export const mockDocEvokeForm = {
|
|
|
815
808
|
sortBy: 'ASC',
|
|
816
809
|
},
|
|
817
810
|
},
|
|
818
|
-
enumWithLabels: [
|
|
819
|
-
{
|
|
820
|
-
label: 'Public',
|
|
821
|
-
value: 'Public',
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
label: 'Private',
|
|
825
|
-
value: 'Private',
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
label: 'Portal',
|
|
829
|
-
value: 'Portal',
|
|
830
|
-
},
|
|
831
|
-
],
|
|
832
811
|
},
|
|
833
812
|
{
|
|
834
813
|
type: 'readonlyField',
|
|
@@ -887,20 +866,6 @@ export const mockEvokeFormWithSections = {
|
|
|
887
866
|
display: {
|
|
888
867
|
label: 'Multi-Select',
|
|
889
868
|
},
|
|
890
|
-
enumWithLabels: [
|
|
891
|
-
{
|
|
892
|
-
label: '1',
|
|
893
|
-
value: '1',
|
|
894
|
-
},
|
|
895
|
-
{
|
|
896
|
-
label: '2',
|
|
897
|
-
value: '2',
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
label: '3',
|
|
901
|
-
value: '3',
|
|
902
|
-
},
|
|
903
|
-
],
|
|
904
869
|
},
|
|
905
870
|
{
|
|
906
871
|
type: 'input',
|
|
@@ -1094,3 +1059,21 @@ export const users = [
|
|
|
1094
1059
|
name: 'User 2',
|
|
1095
1060
|
},
|
|
1096
1061
|
];
|
|
1062
|
+
// Layouts
|
|
1063
|
+
export const customerLayout = {
|
|
1064
|
+
id: 'layoutId',
|
|
1065
|
+
name: 'Generic Layout 3',
|
|
1066
|
+
properties: [
|
|
1067
|
+
{
|
|
1068
|
+
id: 'name',
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
id: 'document',
|
|
1072
|
+
},
|
|
1073
|
+
],
|
|
1074
|
+
sort: {
|
|
1075
|
+
colId: 'name',
|
|
1076
|
+
sort: 'asc',
|
|
1077
|
+
},
|
|
1078
|
+
objectId: 'customers',
|
|
1079
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("../components/custom/FormV2/components/types").BaseProps & {
|
|
3
|
+
panelLayoutId?: string | undefined;
|
|
4
|
+
instanceId?: string | undefined;
|
|
5
|
+
objectId: string;
|
|
6
|
+
richTextEditor?: React.ComponentType<import("../components/custom/FormV2/components/types").SimpleEditorProps> | undefined;
|
|
7
|
+
renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
|
|
8
|
+
renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const ViewDetails: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../components/custom/FormV2/components/types").BaseProps & {
|
|
12
|
+
panelLayoutId?: string | undefined;
|
|
13
|
+
instanceId?: string | undefined;
|
|
14
|
+
objectId: string;
|
|
15
|
+
richTextEditor?: React.ComponentType<import("../components/custom/FormV2/components/types").SimpleEditorProps> | undefined;
|
|
16
|
+
renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
|
|
17
|
+
renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const ViewWithSections: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../components/custom/FormV2/components/types").BaseProps & {
|
|
20
|
+
panelLayoutId?: string | undefined;
|
|
21
|
+
instanceId?: string | undefined;
|
|
22
|
+
objectId: string;
|
|
23
|
+
richTextEditor?: React.ComponentType<import("../components/custom/FormV2/components/types").SimpleEditorProps> | undefined;
|
|
24
|
+
renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
|
|
25
|
+
renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
import { ViewDetailsV2Container } from '../components/custom';
|
|
5
|
+
import { sharedObjectHandlers } from './sharedMswHandlers';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Custom/ViewDetailsV2Container',
|
|
8
|
+
component: ViewDetailsV2Container,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
msw: {
|
|
12
|
+
handlers: [sharedObjectHandlers],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => (React.createElement(Box, { sx: { padding: '2rem', paddingBottom: 0, '& .css-x8wy7h': { bottom: -1 } } },
|
|
17
|
+
React.createElement(Story, null))),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
const mockProps = {
|
|
21
|
+
panelLayoutId: 'genericEvokeView',
|
|
22
|
+
instanceId: 'genericEvokeViewInstanceId',
|
|
23
|
+
objectId: 'genericEvokeForm',
|
|
24
|
+
};
|
|
25
|
+
const Template = (args) => {
|
|
26
|
+
return (React.createElement(MemoryRouter, null,
|
|
27
|
+
React.createElement(ViewDetailsV2Container, { ...args })));
|
|
28
|
+
};
|
|
29
|
+
export const ViewDetails = Template.bind({});
|
|
30
|
+
ViewDetails.args = {
|
|
31
|
+
...mockProps,
|
|
32
|
+
};
|
|
33
|
+
export const ViewWithSections = Template.bind({});
|
|
34
|
+
ViewWithSections.args = {
|
|
35
|
+
...mockProps,
|
|
36
|
+
panelLayoutId: 'genericEvokeViewWithSections',
|
|
37
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export const viewInstance = {
|
|
2
|
+
id: 'instanceId',
|
|
3
|
+
name: 'Ren Foreman',
|
|
4
|
+
multiSelect: ['2', '1', '3'],
|
|
5
|
+
address: {
|
|
6
|
+
city: 'Baltimore',
|
|
7
|
+
},
|
|
8
|
+
objectId: 'genericEvokeForm',
|
|
9
|
+
criteria: { name: 'Value' },
|
|
10
|
+
relatedObject: { id: 'mbSzyE9gpmRx9uMBEmnbh', name: 'A Phantom Menace' },
|
|
11
|
+
user: { id: 'user1', name: 'User 1' },
|
|
12
|
+
boolean: false,
|
|
13
|
+
};
|
|
14
|
+
// View definitions for ViewDetailsV2Container stories
|
|
15
|
+
export const mockGenericEvokeView = {
|
|
16
|
+
id: 'genericEvokeView',
|
|
17
|
+
name: 'Generic Evoke View',
|
|
18
|
+
entries: [
|
|
19
|
+
{
|
|
20
|
+
type: 'readonlyField',
|
|
21
|
+
propertyId: 'name',
|
|
22
|
+
display: {
|
|
23
|
+
label: 'Name',
|
|
24
|
+
prefix: 'Dr',
|
|
25
|
+
suffix: 'Jr',
|
|
26
|
+
required: true,
|
|
27
|
+
charCount: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'readonlyField',
|
|
32
|
+
propertyId: 'criteria',
|
|
33
|
+
display: {
|
|
34
|
+
label: 'Criteria',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'readonlyField',
|
|
39
|
+
propertyId: 'multiSelect',
|
|
40
|
+
display: {
|
|
41
|
+
label: 'Multi-Select',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'readonlyField',
|
|
46
|
+
propertyId: 'address.city',
|
|
47
|
+
display: {
|
|
48
|
+
label: 'Address City',
|
|
49
|
+
description: 'address city description',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'readonlyField',
|
|
54
|
+
propertyId: 'relatedObject',
|
|
55
|
+
display: {
|
|
56
|
+
label: 'Related Object',
|
|
57
|
+
mode: 'default',
|
|
58
|
+
description: 'related Object description',
|
|
59
|
+
relatedObjectDisplay: 'dropdown',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'readonlyField',
|
|
64
|
+
propertyId: 'collection',
|
|
65
|
+
display: {
|
|
66
|
+
label: 'Collection',
|
|
67
|
+
viewLayout: {
|
|
68
|
+
id: 'layoutId',
|
|
69
|
+
objectId: 'customers',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'readonlyField',
|
|
75
|
+
propertyId: 'manyToMany',
|
|
76
|
+
display: {
|
|
77
|
+
label: 'Many to Many',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'readonlyField',
|
|
82
|
+
propertyId: 'documentUpload',
|
|
83
|
+
display: {
|
|
84
|
+
label: 'Document Upload',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'readonlyField',
|
|
89
|
+
propertyId: 'user',
|
|
90
|
+
display: {
|
|
91
|
+
label: 'User',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'readonlyField',
|
|
96
|
+
propertyId: 'boolean',
|
|
97
|
+
display: {
|
|
98
|
+
label: 'Boolean',
|
|
99
|
+
booleanDisplay: 'checkbox',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
objectId: 'genericEvokeForm',
|
|
104
|
+
};
|
|
105
|
+
export const mockGenericEvokeViewWithSections = {
|
|
106
|
+
id: 'genericEvokeViewWithSections',
|
|
107
|
+
name: 'Generic Evoke View With Sections',
|
|
108
|
+
entries: [
|
|
109
|
+
{
|
|
110
|
+
type: 'sections',
|
|
111
|
+
label: 'Section',
|
|
112
|
+
sections: [
|
|
113
|
+
{
|
|
114
|
+
label: 'Section 1',
|
|
115
|
+
entries: [
|
|
116
|
+
{
|
|
117
|
+
type: 'readonlyField',
|
|
118
|
+
propertyId: 'name',
|
|
119
|
+
display: {
|
|
120
|
+
label: 'Name',
|
|
121
|
+
prefix: 'Dr',
|
|
122
|
+
suffix: 'Jr',
|
|
123
|
+
required: true,
|
|
124
|
+
charCount: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: 'readonlyField',
|
|
129
|
+
propertyId: 'documentUpload',
|
|
130
|
+
display: {
|
|
131
|
+
label: 'Document Upload',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'readonlyField',
|
|
136
|
+
propertyId: 'criteria',
|
|
137
|
+
display: {
|
|
138
|
+
label: 'Criteria',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: 'readonlyField',
|
|
143
|
+
propertyId: 'multiSelect',
|
|
144
|
+
display: {
|
|
145
|
+
label: 'Multi-Select',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: 'readonlyField',
|
|
150
|
+
propertyId: 'address.city',
|
|
151
|
+
display: {
|
|
152
|
+
label: 'Address City',
|
|
153
|
+
description: 'address city description',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'readonlyField',
|
|
158
|
+
propertyId: 'relatedObject',
|
|
159
|
+
display: {
|
|
160
|
+
label: 'Related Object',
|
|
161
|
+
mode: 'default',
|
|
162
|
+
description: 'related Object description',
|
|
163
|
+
relatedObjectDisplay: 'dropdown',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: 'Section 2',
|
|
170
|
+
entries: [
|
|
171
|
+
{
|
|
172
|
+
type: 'readonlyField',
|
|
173
|
+
propertyId: 'boolean',
|
|
174
|
+
display: {
|
|
175
|
+
label: 'Boolean',
|
|
176
|
+
booleanDisplay: 'checkbox',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'sections',
|
|
181
|
+
label: 'Section',
|
|
182
|
+
sections: [
|
|
183
|
+
{
|
|
184
|
+
label: 'Nested Section 2',
|
|
185
|
+
entries: [
|
|
186
|
+
{
|
|
187
|
+
type: 'readonlyField',
|
|
188
|
+
propertyId: 'people',
|
|
189
|
+
display: {
|
|
190
|
+
label: 'Many to Many',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
objectId: 'genericEvokeForm',
|
|
203
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { http, HttpResponse } from 'msw';
|
|
2
|
-
import { instance, mockCustomerCreateForm, mockCustomerObject, mockCustomerUpdateForm, mockEvokeForm, mockEvokeFormWithSections, mockGenericEvokeFormObject, mockInstancesForCollection, mockInstancesForRelatedObject, mockMovieCreateForm, mockMovieObject, mockPeopleGenericObject, mockPeopleGenericObjectInstances, mockPeopleObject, mockPropertiesForCriteria, users, } from './FormRendererData';
|
|
2
|
+
import { customerLayout, instance, mockCustomerCreateForm, mockCustomerObject, mockCustomerUpdateForm, mockEvokeForm, mockEvokeFormWithSections, mockGenericEvokeFormObject, mockInstancesForCollection, mockInstancesForRelatedObject, mockMovieCreateForm, mockMovieObject, mockPeopleGenericObject, mockPeopleGenericObjectInstances, mockPeopleObject, mockPropertiesForCriteria, users, } from './FormRendererData';
|
|
3
|
+
import { mockGenericEvokeView, mockGenericEvokeViewWithSections, viewInstance } from './ViewDetailsV2Data';
|
|
3
4
|
export const sharedObjectHandlers = [
|
|
4
5
|
// Object fetches
|
|
5
6
|
http.get('/api/data/objects/:objectId/effective', ({ params, request }) => {
|
|
@@ -30,8 +31,13 @@ export const sharedObjectHandlers = [
|
|
|
30
31
|
http.get('/api/data/objects/:objectId/instances/:instanceId/object', ({ params }) => {
|
|
31
32
|
const { objectId, instanceId } = params;
|
|
32
33
|
let data;
|
|
33
|
-
if (objectId === 'genericEvokeForm'
|
|
34
|
-
|
|
34
|
+
if (objectId === 'genericEvokeForm') {
|
|
35
|
+
if (instanceId === 'updateGenericEvokeFormInstanceId') {
|
|
36
|
+
data = mockGenericEvokeFormObject;
|
|
37
|
+
}
|
|
38
|
+
else if (instanceId === 'genericEvokeViewInstanceId') {
|
|
39
|
+
data = mockGenericEvokeFormObject;
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
else if (objectId === 'customers' && instanceId === 'collectionInstance') {
|
|
37
43
|
data = mockCustomerObject;
|
|
@@ -47,24 +53,47 @@ export const sharedObjectHandlers = [
|
|
|
47
53
|
http.get('/api/accessManagement/users', () => HttpResponse.json(users)),
|
|
48
54
|
// Permission fetches
|
|
49
55
|
http.get(/\/checkAccess$/, () => HttpResponse.json({ result: true })),
|
|
56
|
+
// Layout fetches
|
|
57
|
+
http.get('/api/data/objects/customers/tableLayouts/layoutId', () => HttpResponse.json(customerLayout)),
|
|
50
58
|
// General instance fetches
|
|
51
|
-
http.get('/api/data/objects/:objectId/instances/:
|
|
52
|
-
const { objectId,
|
|
59
|
+
http.get('/api/data/objects/:objectId/instances/:instanceId?', ({ params }) => {
|
|
60
|
+
const { objectId, instanceId } = params;
|
|
53
61
|
let data;
|
|
54
62
|
switch (objectId) {
|
|
55
63
|
case 'genericEvokeForm':
|
|
56
|
-
data =
|
|
64
|
+
data =
|
|
65
|
+
instanceId === 'updateGenericEvokeFormInstanceId'
|
|
66
|
+
? instance
|
|
67
|
+
: instanceId === 'genericEvokeViewInstanceId'
|
|
68
|
+
? viewInstance
|
|
69
|
+
: {};
|
|
57
70
|
break;
|
|
58
71
|
case 'movies':
|
|
59
|
-
data =
|
|
60
|
-
? mockInstancesForRelatedObject.find((inst) => inst.id ===
|
|
72
|
+
data = instanceId
|
|
73
|
+
? mockInstancesForRelatedObject.find((inst) => inst.id === instanceId)
|
|
61
74
|
: mockInstancesForRelatedObject;
|
|
62
75
|
break;
|
|
63
76
|
case 'customers':
|
|
64
|
-
data =
|
|
77
|
+
data = instanceId
|
|
78
|
+
? mockInstancesForCollection.find((inst) => inst.id === instanceId)
|
|
79
|
+
: mockInstancesForCollection;
|
|
65
80
|
break;
|
|
66
81
|
case 'peopleGenericObject':
|
|
67
|
-
data = [
|
|
82
|
+
data = [
|
|
83
|
+
{
|
|
84
|
+
id: 'cgf2',
|
|
85
|
+
name: 'Jane Doe',
|
|
86
|
+
people: {
|
|
87
|
+
id: 'person1',
|
|
88
|
+
name: 'Jane Doe',
|
|
89
|
+
},
|
|
90
|
+
genericEvokeForm: {
|
|
91
|
+
id: 'gEV7frl7i1aUEEfkp5dAT',
|
|
92
|
+
name: 'Form Guy',
|
|
93
|
+
},
|
|
94
|
+
objectId: 'peopleGenericObject',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
68
97
|
break;
|
|
69
98
|
case 'people':
|
|
70
99
|
data = mockPeopleGenericObjectInstances;
|
|
@@ -92,6 +121,16 @@ export const sharedObjectHandlers = [
|
|
|
92
121
|
return HttpResponse.json({});
|
|
93
122
|
}
|
|
94
123
|
}),
|
|
124
|
+
// View fetches
|
|
125
|
+
http.get('/api/data/objects/genericEvokeForm/panelLayouts/:viewId?', ({ params, request }) => {
|
|
126
|
+
const viewId = Array.isArray(params.viewId) ? params.viewId[0] : params.viewId;
|
|
127
|
+
switch (viewId) {
|
|
128
|
+
case 'genericEvokeView':
|
|
129
|
+
return HttpResponse.json(mockGenericEvokeView);
|
|
130
|
+
case 'genericEvokeViewWithSections':
|
|
131
|
+
return HttpResponse.json(mockGenericEvokeViewWithSections);
|
|
132
|
+
}
|
|
133
|
+
}),
|
|
95
134
|
// Action fetches
|
|
96
135
|
// Fetch for many-to-many create action when adding a value to the field
|
|
97
136
|
http.post('api/data/objects/peopleGenericObject/instances/actions', async (req) => {
|
|
@@ -137,7 +137,7 @@ export declare function useFormContext(): {
|
|
|
137
137
|
* @returns Object with boolean flags for different breakpoints
|
|
138
138
|
*/
|
|
139
139
|
setFetchedOptions: (newData: import("react-hook-form").FieldValues) => void;
|
|
140
|
-
getValues
|
|
140
|
+
getValues?: import("react-hook-form").UseFormGetValues<import("react-hook-form").FieldValues> | undefined;
|
|
141
141
|
object?: import("@evoke-platform/context").Obj | undefined;
|
|
142
142
|
errors?: import("react-hook-form").FieldValues | undefined;
|
|
143
143
|
instance?: import("react-hook-form").FieldValues | undefined;
|
|
@@ -147,13 +147,14 @@ export declare function useFormContext(): {
|
|
|
147
147
|
setExpandedSections?: import("react").Dispatch<import("react").SetStateAction<import("../components/custom/FormV2/components/types").ExpandedSection[]>> | undefined;
|
|
148
148
|
setExpandAll?: import("react").Dispatch<import("react").SetStateAction<boolean | null | undefined>> | undefined;
|
|
149
149
|
parameters?: import("@evoke-platform/context").InputParameter[] | undefined;
|
|
150
|
-
handleChange
|
|
150
|
+
handleChange?: ((name: string, value: unknown) => void | Promise<void>) | undefined;
|
|
151
|
+
onAutosave?: ((fieldId: string) => void | Promise<void>) | undefined;
|
|
151
152
|
fieldHeight?: "medium" | "small" | undefined;
|
|
152
153
|
triggerFieldReset?: boolean | undefined;
|
|
153
154
|
showSubmitError?: boolean | undefined;
|
|
154
155
|
associatedObject?: {
|
|
155
156
|
instanceId?: string | undefined;
|
|
156
|
-
propertyId?: string | undefined;
|
|
157
|
+
propertyId?: string | undefined; /** Extra large screens (1536px and up) */
|
|
157
158
|
} | undefined;
|
|
158
159
|
form?: import("@evoke-platform/context").EvokeForm | undefined;
|
|
159
160
|
width: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evoke-platform/ui-components",
|
|
3
|
-
"version": "1.10.0-dev.
|
|
3
|
+
"version": "1.10.0-dev.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/published/index.js",
|
|
6
6
|
"module": "dist/published/index.js",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test": "vitest",
|
|
22
22
|
"test:ui": "vitest --ui",
|
|
23
|
+
"test:preview": "vitest-preview",
|
|
23
24
|
"copy-styles": "copyfiles -u 1 src/styles/*.css dist/published/",
|
|
24
25
|
"build": "rm -rf ./dist && tsc && npm run copy-styles",
|
|
25
26
|
"build:cjs": "tsc --module CommonJS --outDir dist/cjs",
|
|
@@ -88,11 +89,12 @@
|
|
|
88
89
|
"storybook": "^7.6.20",
|
|
89
90
|
"typescript": "^4.7.3",
|
|
90
91
|
"vitest": "^1.6.0",
|
|
92
|
+
"vitest-preview": "^0.0.3",
|
|
91
93
|
"webpack": "^5.74.0",
|
|
92
94
|
"yalc": "^1.0.0-pre.53"
|
|
93
95
|
},
|
|
94
96
|
"peerDependencies": {
|
|
95
|
-
"@evoke-platform/context": "^1.5.0-
|
|
97
|
+
"@evoke-platform/context": "^1.5.0-testing.4",
|
|
96
98
|
"react": "^18.1.0",
|
|
97
99
|
"react-dom": "^18.1.0"
|
|
98
100
|
},
|