@evoke-platform/ui-components 1.10.0-dev.3 → 1.10.0-dev.31
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.js +4 -2
- package/dist/published/components/core/Autocomplete/Autocomplete.test.js +112 -3
- package/dist/published/components/core/TextField/TextField.js +1 -1
- package/dist/published/components/core/TextField/TextField.test.js +0 -2
- 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 +428 -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/tests/Form.test.js +0 -2
- 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/InputFieldComponent/InputFieldComponent.test.js +0 -2
- package/dist/published/components/custom/FormField/Select/Select.test.js +0 -2
- 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 +19 -7
- package/dist/published/components/custom/FormV2/FormRendererContainer.js +117 -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 +8 -5
- 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 +2 -2
- 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 +5 -3
- package/dist/published/components/custom/FormV2/components/Header.js +47 -9
- package/dist/published/components/custom/FormV2/components/RecursiveEntryRenderer.js +46 -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 +4 -4
- package/dist/published/components/custom/FormV2/components/utils.js +13 -16
- package/dist/published/components/custom/FormV2/tests/FormRenderer.test.js +289 -45
- package/dist/published/components/custom/FormV2/tests/FormRendererContainer.test.js +664 -16
- 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 +144 -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 +29 -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 +12 -8
|
@@ -10,7 +10,7 @@ export declare function isAddressProperty(key: string): boolean;
|
|
|
10
10
|
/**
|
|
11
11
|
* Determine if a form entry is visible or not.
|
|
12
12
|
*/
|
|
13
|
-
export declare const entryIsVisible: (entry: FormEntry,
|
|
13
|
+
export declare const entryIsVisible: (entry: FormEntry, instance?: FieldValues, formValues?: FieldValues) => boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Recursively retrieves all parameter IDs from a given entry of type Sections or Columns.
|
|
16
16
|
*
|
|
@@ -86,8 +86,8 @@ export declare function formatSubmission(submission: FieldValues, apiServices?:
|
|
|
86
86
|
message?: string;
|
|
87
87
|
isError: boolean;
|
|
88
88
|
}>>): Promise<FieldValues>;
|
|
89
|
-
export declare function filterEmptySections(entry: Sections | Columns,
|
|
90
|
-
export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], object
|
|
89
|
+
export declare function filterEmptySections(entry: Sections | Columns, instance?: FieldValues, formData?: FieldValues): Sections | Columns | null;
|
|
90
|
+
export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], object: Obj, parameters?: InputParameter[]): FormEntry[];
|
|
91
91
|
/**
|
|
92
92
|
* Converts a plain text string to RTF format suitable for a RichTextEditor.
|
|
93
93
|
*
|
|
@@ -101,4 +101,4 @@ export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], obj
|
|
|
101
101
|
* This ensures that any plain text input will be safely represented in RTF without losing formatting or characters.
|
|
102
102
|
*/
|
|
103
103
|
export declare function plainTextToRtf(plainText: string): string;
|
|
104
|
-
export declare function getFieldDefinition(entry: FormEntry, object
|
|
104
|
+
export declare function getFieldDefinition(entry: FormEntry, object: Obj, parameters?: InputParameter[], isDocument?: boolean): InputParameter | Property | undefined;
|
|
@@ -68,7 +68,7 @@ export function isAddressProperty(key) {
|
|
|
68
68
|
/**
|
|
69
69
|
* Determine if a form entry is visible or not.
|
|
70
70
|
*/
|
|
71
|
-
export const entryIsVisible = (entry,
|
|
71
|
+
export const entryIsVisible = (entry, instance, formValues) => {
|
|
72
72
|
const display = 'display' in entry ? entry.display : undefined;
|
|
73
73
|
const { visibility } = display ?? ('visibility' in entry ? entry : {});
|
|
74
74
|
if (isObject(visibility) && 'conditions' in visibility && isArray(visibility.conditions)) {
|
|
@@ -482,11 +482,6 @@ export function convertDocToEntries(document) {
|
|
|
482
482
|
sortBy: 'ASC',
|
|
483
483
|
},
|
|
484
484
|
},
|
|
485
|
-
enumWithLabels: [
|
|
486
|
-
{ label: 'Public', value: 'Public' },
|
|
487
|
-
{ label: 'Private', value: 'Private' },
|
|
488
|
-
{ label: 'Portal', value: 'Portal' },
|
|
489
|
-
],
|
|
490
485
|
});
|
|
491
486
|
}
|
|
492
487
|
entries.push({
|
|
@@ -507,8 +502,8 @@ export function formatDataToDoc(data) {
|
|
|
507
502
|
uploadedDate: data.uploadedDate,
|
|
508
503
|
versionId: data.versionId,
|
|
509
504
|
metadata: {
|
|
510
|
-
type: data.type,
|
|
511
|
-
view_permission: data.view_permission,
|
|
505
|
+
type: data.type ?? '',
|
|
506
|
+
view_permission: data.view_permission ?? '',
|
|
512
507
|
},
|
|
513
508
|
};
|
|
514
509
|
}
|
|
@@ -567,6 +562,7 @@ export const uploadDocuments = async (files, metadata, apiServices, instanceId,
|
|
|
567
562
|
const allDocuments = [];
|
|
568
563
|
const formData = new FormData();
|
|
569
564
|
for (const [index, file] of files.entries()) {
|
|
565
|
+
// Only upload File instances; SavedDocumentReference objects are already uploaded
|
|
570
566
|
if ('size' in file) {
|
|
571
567
|
formData.append(`files[${index}]`, file);
|
|
572
568
|
}
|
|
@@ -628,6 +624,7 @@ export const deleteDocuments = async (submittedFields, requestSuccess, apiServic
|
|
|
628
624
|
export async function formatSubmission(submission, apiServices, objectId, instanceId, form, setSnackbarError) {
|
|
629
625
|
for (const [key, value] of Object.entries(submission)) {
|
|
630
626
|
if (isArray(value)) {
|
|
627
|
+
// Only upload if array contains File instances (not SavedDocumentReference)
|
|
631
628
|
const fileInArray = value.some((item) => item instanceof File);
|
|
632
629
|
if (fileInArray && instanceId && apiServices && objectId) {
|
|
633
630
|
try {
|
|
@@ -672,21 +669,21 @@ export async function formatSubmission(submission, apiServices, objectId, instan
|
|
|
672
669
|
}
|
|
673
670
|
return submission;
|
|
674
671
|
}
|
|
675
|
-
export function filterEmptySections(entry,
|
|
672
|
+
export function filterEmptySections(entry, instance, formData) {
|
|
676
673
|
if (entry.type === 'sections' && isArray(entry.sections)) {
|
|
677
674
|
const visibleSections = entry.sections.filter((section) => {
|
|
678
675
|
if (!section.entries || section.entries.length === 0)
|
|
679
676
|
return false;
|
|
680
677
|
for (const sectionEntry of section.entries) {
|
|
681
678
|
if (sectionEntry.type === 'sections' || sectionEntry.type === 'columns') {
|
|
682
|
-
if (sectionEntry.visibility && !entryIsVisible(sectionEntry,
|
|
679
|
+
if (sectionEntry.visibility && !entryIsVisible(sectionEntry, instance, formData)) {
|
|
683
680
|
return false;
|
|
684
681
|
}
|
|
685
|
-
else if (filterEmptySections(sectionEntry,
|
|
682
|
+
else if (filterEmptySections(sectionEntry, instance, formData)) {
|
|
686
683
|
return true;
|
|
687
684
|
}
|
|
688
685
|
}
|
|
689
|
-
else if (entryIsVisible(sectionEntry,
|
|
686
|
+
else if (entryIsVisible(sectionEntry, instance, formData)) {
|
|
690
687
|
return true;
|
|
691
688
|
}
|
|
692
689
|
}
|
|
@@ -706,13 +703,13 @@ export function filterEmptySections(entry, formData, instance) {
|
|
|
706
703
|
let hasVisibleEntry = false;
|
|
707
704
|
for (const columnEntry of column.entries) {
|
|
708
705
|
if (columnEntry.type === 'sections' || columnEntry.type === 'columns') {
|
|
709
|
-
if (filterEmptySections(columnEntry,
|
|
706
|
+
if (filterEmptySections(columnEntry, instance, formData)) {
|
|
710
707
|
hasVisibleEntry = true;
|
|
711
708
|
break;
|
|
712
709
|
}
|
|
713
710
|
}
|
|
714
711
|
else {
|
|
715
|
-
if (entryIsVisible(columnEntry,
|
|
712
|
+
if (entryIsVisible(columnEntry, instance, formData)) {
|
|
716
713
|
hasVisibleEntry = true;
|
|
717
714
|
break;
|
|
718
715
|
}
|
|
@@ -813,8 +810,8 @@ export function getFieldDefinition(entry, object, parameters, isDocument) {
|
|
|
813
810
|
def = isDocument
|
|
814
811
|
? docProperties.find((prop) => prop.id === entry.propertyId)
|
|
815
812
|
: isAddressProperty(entry.propertyId)
|
|
816
|
-
? object
|
|
817
|
-
: object
|
|
813
|
+
? object.properties?.find((prop) => prop.id === entry.propertyId.split('.')[0])
|
|
814
|
+
: object.properties?.find((prop) => prop.id === entry.propertyId);
|
|
818
815
|
}
|
|
819
816
|
else if (entry.type === 'inputField') {
|
|
820
817
|
def = entry.input;
|