@evoke-platform/ui-components 1.8.2-dev.1 → 1.9.0-dev.0

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.
Files changed (22) hide show
  1. package/dist/published/components/custom/FormV2/FormRenderer.js +19 -16
  2. package/dist/published/components/custom/FormV2/FormRendererContainer.js +16 -4
  3. package/dist/published/components/custom/FormV2/components/AccordionSections.js +30 -29
  4. package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/RepeatableField.js +1 -1
  5. package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/Document.js +1 -2
  6. package/dist/published/components/custom/FormV2/components/FormFieldTypes/UserProperty.js +16 -7
  7. package/dist/published/components/custom/FormV2/components/FormFieldTypes/relatedObjectFiles/ObjectPropertyInput.js +88 -39
  8. package/dist/published/components/custom/FormV2/components/FormSections.js +34 -3
  9. package/dist/published/components/custom/FormV2/components/RecursiveEntryRenderer.js +10 -29
  10. package/dist/published/components/custom/FormV2/components/ValidationFiles/Validation.js +2 -2
  11. package/dist/published/components/custom/FormV2/components/types.d.ts +9 -1
  12. package/dist/published/components/custom/FormV2/components/utils.d.ts +18 -2
  13. package/dist/published/components/custom/FormV2/components/utils.js +163 -1
  14. package/dist/published/components/custom/FormV2/tests/FormRenderer.test.js +211 -2
  15. package/dist/published/components/custom/FormV2/tests/test-data.d.ts +9 -0
  16. package/dist/published/components/custom/FormV2/tests/test-data.js +134 -0
  17. package/dist/published/stories/FormRendererContainer.stories.d.ts +22 -0
  18. package/dist/published/stories/FormRendererContainer.stories.js +5 -0
  19. package/dist/published/stories/FormRendererData.d.ts +7 -0
  20. package/dist/published/stories/FormRendererData.js +172 -1
  21. package/dist/published/stories/sharedMswHandlers.js +5 -1
  22. package/package.json +2 -1
@@ -88,3 +88,25 @@ export declare const DocumentForm: import("@storybook/types").AnnotatedStoryFn<i
88
88
  propertyId?: string | undefined;
89
89
  } | undefined;
90
90
  }>;
91
+ export declare const FormWithSections: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../components/custom/FormV2/components/types").BaseProps & {
92
+ formId?: string | undefined;
93
+ instanceId?: string | undefined;
94
+ defaultPages?: Record<string, string> | undefined;
95
+ pageNavigation?: string | undefined;
96
+ documentId?: string | undefined;
97
+ dataType?: "documents" | "objectInstances" | undefined;
98
+ display?: {
99
+ fieldHeight?: "medium" | "small" | undefined;
100
+ } | undefined;
101
+ actionId?: string | undefined;
102
+ stickyFooter?: boolean | undefined;
103
+ hideButtons?: boolean | undefined;
104
+ objectId: string;
105
+ richTextEditor?: React.ComponentType<import("../components/custom/FormV2/components/types").SimpleEditorProps> | undefined;
106
+ onClose?: (() => void) | undefined;
107
+ onSubmit?: ((submission: Record<string, unknown>) => Promise<void>) | undefined;
108
+ associatedObject?: {
109
+ instanceId?: string | undefined;
110
+ propertyId?: string | undefined;
111
+ } | undefined;
112
+ }>;
@@ -54,3 +54,8 @@ DocumentForm.args = {
54
54
  documentId: 'documentInstanceId',
55
55
  dataType: 'documents',
56
56
  };
57
+ export const FormWithSections = Template.bind({});
58
+ FormWithSections.args = {
59
+ ...mockProps,
60
+ formId: 'updateGenericEvokeFormWithSections',
61
+ };
@@ -29,6 +29,7 @@ export declare const mockCustomerUpdateForm: EvokeForm;
29
29
  export declare const mockCustomerCreateForm: EvokeForm;
30
30
  export declare const mockMovieCreateForm: EvokeForm;
31
31
  export declare const mockDocEvokeForm: EvokeForm;
32
+ export declare const mockEvokeFormWithSections: EvokeForm;
32
33
  export declare const mockPropertiesForCriteria: ({
33
34
  id: string;
34
35
  name: string;
@@ -114,3 +115,9 @@ export declare const mockPeopleGenericObjectInstances: {
114
115
  };
115
116
  objectId: string;
116
117
  }[];
118
+ export declare const users: {
119
+ id: string;
120
+ status: string;
121
+ email: string;
122
+ name: string;
123
+ }[];
@@ -88,6 +88,11 @@ export const mockGenericEvokeFormObject = {
88
88
  manyToManyPropertyId: 'people',
89
89
  required: false,
90
90
  },
91
+ {
92
+ id: 'user',
93
+ name: 'User',
94
+ type: 'user',
95
+ },
91
96
  ],
92
97
  actions: [
93
98
  {
@@ -150,6 +155,18 @@ export const mockGenericEvokeFormObject = {
150
155
  relatedPropertyId: 'genericEvokeForm',
151
156
  manyToManyPropertyId: 'people',
152
157
  },
158
+ {
159
+ id: 'documentUpload',
160
+ type: 'document',
161
+ name: 'Document Upload',
162
+ required: false,
163
+ },
164
+ {
165
+ id: 'user',
166
+ name: 'User',
167
+ type: 'user',
168
+ required: false,
169
+ },
153
170
  ],
154
171
  outputEvent: 'Update Generic Evoke Form 2',
155
172
  preconditions: {},
@@ -489,7 +506,7 @@ export const mockPeopleObject = {
489
506
  };
490
507
  // Form definitions for FormRenderer and FormRendererContainer stories
491
508
  export const mockEvokeForm = {
492
- id: 'UpdateGenericEvokeForm',
509
+ id: 'updateGenericEvokeForm',
493
510
  name: 'Update a Generic Evoke Form',
494
511
  entries: [
495
512
  {
@@ -563,6 +580,24 @@ export const mockEvokeForm = {
563
580
  label: 'Many to Many',
564
581
  },
565
582
  },
583
+ {
584
+ type: 'input',
585
+ parameterId: 'documentUpload',
586
+ display: {
587
+ label: 'Document Upload',
588
+ },
589
+ documentMetadata: {
590
+ view_permission: 'Portal',
591
+ type: 'PDF',
592
+ },
593
+ },
594
+ {
595
+ type: 'input',
596
+ parameterId: 'user',
597
+ display: {
598
+ label: 'User',
599
+ },
600
+ },
566
601
  ],
567
602
  objectId: 'genericEvokeForm',
568
603
  actionId: '_update',
@@ -806,6 +841,128 @@ export const mockDocEvokeForm = {
806
841
  ],
807
842
  objectId: 'genericEvokeForm',
808
843
  };
844
+ export const mockEvokeFormWithSections = {
845
+ id: 'updateGenericEvokeFormWithSections',
846
+ name: 'Update a Generic Evoke Form With Sections',
847
+ entries: [
848
+ {
849
+ type: 'sections',
850
+ label: 'Section',
851
+ sections: [
852
+ {
853
+ label: 'Section 1',
854
+ entries: [
855
+ {
856
+ type: 'input',
857
+ parameterId: 'name',
858
+ display: {
859
+ label: 'Name',
860
+ prefix: 'Dr',
861
+ suffix: 'Jr',
862
+ required: true,
863
+ charCount: true,
864
+ },
865
+ },
866
+ {
867
+ type: 'input',
868
+ parameterId: 'documentUpload',
869
+ display: {
870
+ label: 'Document Upload',
871
+ },
872
+ documentMetadata: {
873
+ view_permission: 'Portal',
874
+ type: 'PDF',
875
+ },
876
+ },
877
+ {
878
+ type: 'input',
879
+ parameterId: 'criteria',
880
+ display: {
881
+ label: 'Criteria',
882
+ },
883
+ },
884
+ {
885
+ type: 'input',
886
+ parameterId: 'multiSelect',
887
+ display: {
888
+ label: 'Multi-Select',
889
+ },
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
+ },
905
+ {
906
+ type: 'input',
907
+ parameterId: 'address.city',
908
+ display: {
909
+ label: 'Address City',
910
+ description: 'address city description',
911
+ },
912
+ },
913
+ {
914
+ type: 'input',
915
+ parameterId: 'relatedObject',
916
+ display: {
917
+ label: 'Related Object',
918
+ mode: 'default',
919
+ description: 'related Object description',
920
+ relatedObjectDisplay: 'dropdown',
921
+ },
922
+ },
923
+ ],
924
+ },
925
+ {
926
+ label: 'Section 2',
927
+ entries: [
928
+ {
929
+ type: 'sections',
930
+ label: 'Section',
931
+ sections: [
932
+ {
933
+ label: 'Nested Section 1',
934
+ entries: [
935
+ {
936
+ type: 'input',
937
+ parameterId: 'collection',
938
+ display: {
939
+ label: 'Collection',
940
+ },
941
+ },
942
+ ],
943
+ },
944
+ {
945
+ label: 'Nested Section 2',
946
+ entries: [
947
+ {
948
+ type: 'input',
949
+ parameterId: 'manyToMany',
950
+ display: {
951
+ label: 'Many to Many',
952
+ },
953
+ },
954
+ ],
955
+ },
956
+ ],
957
+ },
958
+ ],
959
+ },
960
+ ],
961
+ },
962
+ ],
963
+ objectId: 'genericEvokeForm',
964
+ actionId: '_update',
965
+ };
809
966
  // Additional data for criteria field and instance fetches
810
967
  export const mockPropertiesForCriteria = [
811
968
  {
@@ -923,3 +1080,17 @@ export const mockPeopleGenericObjectInstances = [
923
1080
  objectId: 'peopleGenericObject',
924
1081
  },
925
1082
  ];
1083
+ export const users = [
1084
+ {
1085
+ id: 'user1',
1086
+ status: 'Active',
1087
+ email: 'user1@systemautomation.com',
1088
+ name: 'User 1',
1089
+ },
1090
+ {
1091
+ id: 'user2',
1092
+ status: 'Active',
1093
+ email: 'user2@systemautomation.com',
1094
+ name: 'User 2',
1095
+ },
1096
+ ];
@@ -1,5 +1,5 @@
1
1
  import { http, HttpResponse } from 'msw';
2
- import { instance, mockCustomerCreateForm, mockCustomerObject, mockCustomerUpdateForm, mockEvokeForm, mockGenericEvokeFormObject, mockInstancesForCollection, mockInstancesForRelatedObject, mockMovieCreateForm, mockMovieObject, mockPeopleGenericObject, mockPeopleGenericObjectInstances, mockPeopleObject, mockPropertiesForCriteria, } from './FormRendererData';
2
+ import { instance, mockCustomerCreateForm, mockCustomerObject, mockCustomerUpdateForm, mockEvokeForm, mockEvokeFormWithSections, mockGenericEvokeFormObject, mockInstancesForCollection, mockInstancesForRelatedObject, mockMovieCreateForm, mockMovieObject, mockPeopleGenericObject, mockPeopleGenericObjectInstances, mockPeopleObject, mockPropertiesForCriteria, users, } from './FormRendererData';
3
3
  export const sharedObjectHandlers = [
4
4
  // Object fetches
5
5
  http.get('/api/data/objects/:objectId/effective', ({ params, request }) => {
@@ -43,6 +43,8 @@ export const sharedObjectHandlers = [
43
43
  }),
44
44
  // Property fetch for criteria field properties
45
45
  http.get('/api/data/objects/genericEvokeForm/effective/properties?fields', () => HttpResponse.json(mockPropertiesForCriteria)),
46
+ // User fetches
47
+ http.get('/api/accessManagement/users', () => HttpResponse.json(users)),
46
48
  // Permission fetches
47
49
  http.get(/\/checkAccess$/, () => HttpResponse.json({ result: true })),
48
50
  // General instance fetches
@@ -84,6 +86,8 @@ export const sharedObjectHandlers = [
84
86
  return HttpResponse.json(mockMovieCreateForm);
85
87
  case 'updateGenericEvokeForm':
86
88
  return HttpResponse.json(mockEvokeForm);
89
+ case 'updateGenericEvokeFormWithSections':
90
+ return HttpResponse.json(mockEvokeFormWithSections);
87
91
  default:
88
92
  return HttpResponse.json({});
89
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.8.2-dev.1",
3
+ "version": "1.9.0-dev.0",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",
@@ -119,6 +119,7 @@
119
119
  "devexpress-richedit": "^23.1.5",
120
120
  "devextreme": "^23.1.5",
121
121
  "devextreme-dist": "^23.1.5",
122
+ "dompurify": "^3.2.6",
122
123
  "eslint-plugin-no-inline-styles": "^1.0.5",
123
124
  "flat": "^6.0.1",
124
125
  "formiojs": "^4.21.7",