@evoke-platform/ui-components 1.13.0-dev.4 → 1.13.0-dev.6

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 (32) hide show
  1. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.d.ts +4 -4
  2. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +145 -72
  3. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.test.js +189 -67
  4. package/dist/published/components/custom/CriteriaBuilder/PropertyTree.d.ts +6 -6
  5. package/dist/published/components/custom/CriteriaBuilder/PropertyTree.js +12 -25
  6. package/dist/published/components/custom/CriteriaBuilder/PropertyTreeItem.d.ts +4 -5
  7. package/dist/published/components/custom/CriteriaBuilder/PropertyTreeItem.js +34 -22
  8. package/dist/published/components/custom/CriteriaBuilder/types.d.ts +2 -11
  9. package/dist/published/components/custom/CriteriaBuilder/utils.d.ts +6 -34
  10. package/dist/published/components/custom/CriteriaBuilder/utils.js +18 -89
  11. package/dist/published/components/custom/Form/FormComponents/DocumentComponent/Document.js +1 -1
  12. package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentList.js +6 -3
  13. package/dist/published/components/custom/Form/utils.d.ts +1 -0
  14. package/dist/published/components/custom/FormV2/FormRenderer.d.ts +1 -0
  15. package/dist/published/components/custom/FormV2/FormRendererContainer.d.ts +1 -0
  16. package/dist/published/components/custom/FormV2/FormRendererContainer.js +25 -22
  17. package/dist/published/components/custom/FormV2/components/FormContext.d.ts +1 -0
  18. package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/ActionDialog.d.ts +1 -0
  19. package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/Document.d.ts +3 -2
  20. package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/Document.js +46 -10
  21. package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/DocumentList.d.ts +4 -3
  22. package/dist/published/components/custom/FormV2/components/FormFieldTypes/DocumentFiles/DocumentList.js +29 -23
  23. package/dist/published/components/custom/FormV2/components/RecursiveEntryRenderer.js +4 -2
  24. package/dist/published/components/custom/FormV2/components/types.d.ts +6 -1
  25. package/dist/published/components/custom/FormV2/components/utils.d.ts +5 -7
  26. package/dist/published/components/custom/FormV2/components/utils.js +146 -69
  27. package/dist/published/components/custom/ViewDetailsV2/InstanceEntryRenderer.js +20 -8
  28. package/dist/published/stories/CriteriaBuilder.stories.js +70 -22
  29. package/dist/published/stories/FormRenderer.stories.d.ts +3 -0
  30. package/dist/published/stories/FormRendererContainer.stories.d.ts +5 -0
  31. package/dist/published/theme/hooks.d.ts +2 -1
  32. package/package.json +1 -1
@@ -53,16 +53,28 @@ function ViewOnlyEntryRenderer(props) {
53
53
  useEffect(() => {
54
54
  (async () => {
55
55
  if (object?.properties && !fetchedOptions[`${entryId}NavigationSlug`]) {
56
- const pages = await getDefaultPages(object.properties, defaultPages, findDefaultPageSlugFor);
57
- if (fieldDefinition?.objectId && pages[fieldDefinition.objectId]) {
58
- setNavigationSlug(pages[fieldDefinition.objectId]);
59
- setFetchedOptions({
60
- [`${entryId}NavigationSlug`]: pages[fieldDefinition.objectId],
61
- });
56
+ const property = object.properties.find((prop) => prop.id === entryId);
57
+ if (!property || property.type !== 'object') {
58
+ return;
59
+ }
60
+ if (!property.objectId) {
61
+ property.objectId = instance?.[entryId] && (instance?.[entryId]).objectId;
62
+ }
63
+ try {
64
+ const pages = await getDefaultPages([property], defaultPages, findDefaultPageSlugFor);
65
+ if (property?.objectId && pages[property.objectId]) {
66
+ setNavigationSlug(pages[property.objectId]);
67
+ setFetchedOptions({
68
+ [`${entryId}NavigationSlug`]: pages[property.objectId],
69
+ });
70
+ }
71
+ }
72
+ catch (error) {
73
+ console.error('Error fetching default pages:', error);
62
74
  }
63
75
  }
64
76
  })();
65
- }, [object, defaultPages, findDefaultPageSlugFor, fieldDefinition]);
77
+ }, [object, defaultPages, findDefaultPageSlugFor, instance, entryId, fetchedOptions]);
66
78
  // If the entry is hidden, clear its value and any nested values, and skip rendering
67
79
  if (!entryIsVisible(entry, instance)) {
68
80
  return null;
@@ -131,7 +143,7 @@ function ViewOnlyEntryRenderer(props) {
131
143
  }
132
144
  else if (fieldDefinition.type === 'document' || fieldDefinition.type === 'file') {
133
145
  return (React.createElement(FieldWrapper, { inputId: entryId, inputType: fieldDefinition.type, label: display?.label || fieldDefinition?.name || 'default', value: fieldValue, required: display?.required || false, prefix: display?.prefix, suffix: display?.suffix, viewOnly: true },
134
- React.createElement(Document, { id: entryId, error: false, value: fieldValue, canUpdateProperty: false })));
146
+ React.createElement(Document, { id: entryId, fieldType: fieldDefinition.type, error: false, value: fieldValue, canUpdateProperty: false })));
135
147
  }
136
148
  else if (fieldDefinition.type === 'collection') {
137
149
  return fieldDefinition?.manyToManyPropertyId ? (middleObject && initialMiddleObjectInstances && (React.createElement(FieldWrapper, { inputId: entryId, inputType: 'collection', label: display?.label || fieldDefinition?.name || 'default', value: fieldValue, required: display?.required || false, viewOnly: true },
@@ -256,19 +256,26 @@ CriteriaBuilderRelatedObject.args = {
256
256
  ],
257
257
  },
258
258
  {
259
- id: 'dynamic.id',
260
- name: 'Dynamic ID',
261
- type: 'string',
262
- },
263
- {
264
- id: 'dynamic.name',
265
- name: 'Dynamic Name',
266
- type: 'string',
267
- },
268
- {
269
- id: 'dynamic.objectId',
270
- name: 'Dynamic Object ID',
271
- type: 'string',
259
+ id: 'dynamic',
260
+ name: 'Dynamic',
261
+ type: 'object',
262
+ children: [
263
+ {
264
+ id: 'id',
265
+ name: 'ID',
266
+ type: 'string',
267
+ },
268
+ {
269
+ id: 'name',
270
+ name: 'Name',
271
+ type: 'string',
272
+ },
273
+ {
274
+ id: 'objectId',
275
+ name: 'Object Id',
276
+ type: 'string',
277
+ },
278
+ ],
272
279
  },
273
280
  {
274
281
  id: 'name',
@@ -552,19 +559,48 @@ CriteriaBuilderRelatedObject.args = {
552
559
  required: false,
553
560
  },
554
561
  {
555
- id: 'dynamic.id',
556
- name: 'Dynamic ID',
557
- type: 'string',
562
+ id: 'dynamic',
563
+ name: 'Dynamic',
564
+ type: 'object',
565
+ children: [
566
+ {
567
+ id: 'id',
568
+ name: 'ID',
569
+ type: 'string',
570
+ },
571
+ {
572
+ id: 'name',
573
+ name: 'Name',
574
+ type: 'string',
575
+ },
576
+ {
577
+ id: 'objectId',
578
+ name: 'Object Id',
579
+ type: 'string',
580
+ },
581
+ ],
558
582
  },
559
583
  {
560
- id: 'dynamic.name',
561
- name: 'Dynamic Name',
562
- type: 'string',
584
+ id: 'dynamic2',
585
+ name: 'Dynamic2',
586
+ type: 'object',
563
587
  },
564
588
  {
565
- id: 'dynamic.objectId',
566
- name: 'Dynamic Object Id',
567
- type: 'string',
589
+ id: 'address',
590
+ name: 'Address',
591
+ type: 'address',
592
+ children: [
593
+ {
594
+ id: 'line1',
595
+ name: 'Line 1',
596
+ type: 'string',
597
+ },
598
+ {
599
+ id: 'line2',
600
+ name: 'Line 2',
601
+ type: 'string',
602
+ },
603
+ ],
568
604
  },
569
605
  ],
570
606
  },
@@ -716,6 +752,18 @@ CriteriaBuilderRelatedObject.args = {
716
752
  {
717
753
  'applicationType.status': 'DNP',
718
754
  },
755
+ {
756
+ 'applicant.deleted': '1',
757
+ },
758
+ {
759
+ deleted: '1',
760
+ },
761
+ {
762
+ 'applicant.license.expirationDate': '2025-01-16',
763
+ },
764
+ {
765
+ dynamic2: '1',
766
+ },
719
767
  ],
720
768
  },
721
769
  enablePresetValues: false,
@@ -14,6 +14,7 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
14
14
  associatedObject?: {
15
15
  instanceId: string;
16
16
  propertyId: string;
17
+ objectId?: string | undefined;
17
18
  } | undefined;
18
19
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
19
20
  renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
@@ -35,6 +36,7 @@ export declare const Editable: import("@storybook/types").AnnotatedStoryFn<impor
35
36
  associatedObject?: {
36
37
  instanceId: string;
37
38
  propertyId: string;
39
+ objectId?: string | undefined;
38
40
  } | undefined;
39
41
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
40
42
  renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
@@ -55,6 +57,7 @@ export declare const NoButtons: import("@storybook/types").AnnotatedStoryFn<impo
55
57
  associatedObject?: {
56
58
  instanceId: string;
57
59
  propertyId: string;
60
+ objectId?: string | undefined;
58
61
  } | undefined;
59
62
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
60
63
  renderBody?: ((props: import("../components/custom").BodyProps) => React.ReactNode) | undefined;
@@ -17,6 +17,7 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
17
17
  associatedObject?: {
18
18
  instanceId: string;
19
19
  propertyId: string;
20
+ objectId?: string | undefined;
20
21
  } | undefined;
21
22
  renderContainer?: ((state: import("../components/custom/FormV2/FormRendererContainer").FormRendererState) => React.ReactNode) | undefined;
22
23
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
@@ -43,6 +44,7 @@ export declare const Editable: import("@storybook/types").AnnotatedStoryFn<impor
43
44
  associatedObject?: {
44
45
  instanceId: string;
45
46
  propertyId: string;
47
+ objectId?: string | undefined;
46
48
  } | undefined;
47
49
  renderContainer?: ((state: import("../components/custom/FormV2/FormRendererContainer").FormRendererState) => React.ReactNode) | undefined;
48
50
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
@@ -68,6 +70,7 @@ export declare const DefaultForm: import("@storybook/types").AnnotatedStoryFn<im
68
70
  associatedObject?: {
69
71
  instanceId: string;
70
72
  propertyId: string;
73
+ objectId?: string | undefined;
71
74
  } | undefined;
72
75
  renderContainer?: ((state: import("../components/custom/FormV2/FormRendererContainer").FormRendererState) => React.ReactNode) | undefined;
73
76
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
@@ -93,6 +96,7 @@ export declare const NoButtons: import("@storybook/types").AnnotatedStoryFn<impo
93
96
  associatedObject?: {
94
97
  instanceId: string;
95
98
  propertyId: string;
99
+ objectId?: string | undefined;
96
100
  } | undefined;
97
101
  renderContainer?: ((state: import("../components/custom/FormV2/FormRendererContainer").FormRendererState) => React.ReactNode) | undefined;
98
102
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
@@ -118,6 +122,7 @@ export declare const FormWithSections: import("@storybook/types").AnnotatedStory
118
122
  associatedObject?: {
119
123
  instanceId: string;
120
124
  propertyId: string;
125
+ objectId?: string | undefined;
121
126
  } | undefined;
122
127
  renderContainer?: ((state: import("../components/custom/FormV2/FormRendererContainer").FormRendererState) => React.ReactNode) | undefined;
123
128
  renderHeader?: ((props: import("../components/custom").HeaderProps) => React.ReactNode) | undefined;
@@ -155,7 +155,8 @@ export declare function useFormContext(): {
155
155
  associatedObject?: {
156
156
  instanceId: string;
157
157
  propertyId: string; /** Extra large screens (1536px and up) */
158
- } | undefined; /** Extra large screens (1536px and up) */
158
+ objectId?: string | undefined;
159
+ } | undefined;
159
160
  form?: import("@evoke-platform/context").EvokeForm | undefined;
160
161
  width: number;
161
162
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.13.0-dev.4",
3
+ "version": "1.13.0-dev.6",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",