df-ae-forms-package 1.0.49 → 1.0.51
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/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +70 -26
- package/dist/index.esm.js +30 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/ComponentActionFeatures.d.ts +0 -19
- package/dist/ComponentActionFeatures.d.ts.map +0 -1
- package/dist/DfFormPreview.d.ts +0 -24
- package/dist/DfFormPreview.d.ts.map +0 -1
- package/dist/ThresholdAlert.d.ts +0 -15
- package/dist/ThresholdAlert.d.ts.map +0 -1
- package/dist/components/ComponentSubmissionActions.d.ts +0 -9
- package/dist/components/ComponentSubmissionActions.d.ts.map +0 -1
- package/dist/components/RaiseIssueModal.d.ts +0 -24
- package/dist/components/RaiseIssueModal.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-checkbox/DfFormCheckbox.d.ts +0 -22
- package/dist/df-form-controls/df-form-checkbox/DfFormCheckbox.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-checkbox/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-checkbox/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-comments/DfFormComments.d.ts +0 -12
- package/dist/df-form-controls/df-form-comments/DfFormComments.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-comments/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-comments/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-date-time/DfFormDateTime.d.ts +0 -21
- package/dist/df-form-controls/df-form-date-time/DfFormDateTime.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-date-time/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-date-time/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-error-msg/DfFormErrorMsg.d.ts +0 -5
- package/dist/df-form-controls/df-form-error-msg/DfFormErrorMsg.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-error-msg/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-error-msg/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-file-upload/DfFormFileUpload.d.ts +0 -33
- package/dist/df-form-controls/df-form-file-upload/DfFormFileUpload.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-file-upload/example.d.ts +0 -8
- package/dist/df-form-controls/df-form-file-upload/example.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-file-upload/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-file-upload/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-grid/df-form-grid.d.ts +0 -41
- package/dist/df-form-controls/df-form-grid/df-form-grid.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-heading/DfFormHeading.d.ts +0 -12
- package/dist/df-form-controls/df-form-heading/DfFormHeading.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-heading/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-heading/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-input/DfFormInput.d.ts +0 -25
- package/dist/df-form-controls/df-form-input/DfFormInput.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-input/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-input/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-instruction/DfFormInstruction.d.ts +0 -13
- package/dist/df-form-controls/df-form-instruction/DfFormInstruction.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-instruction/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-instruction/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-location/DfFormLocation.d.ts +0 -31
- package/dist/df-form-controls/df-form-location/DfFormLocation.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-location/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-location/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-preview-interfaces.d.ts +0 -389
- package/dist/df-form-controls/df-form-preview-interfaces.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-radio/DfFormRadio.d.ts +0 -22
- package/dist/df-form-controls/df-form-radio/DfFormRadio.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-radio/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-radio/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-section/df-form-section.d.ts +0 -35
- package/dist/df-form-controls/df-form-section/df-form-section.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-segment/DfFormSegment.d.ts +0 -23
- package/dist/df-form-controls/df-form-segment/DfFormSegment.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-segment/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-segment/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-select/DfFormSelect.d.ts +0 -22
- package/dist/df-form-controls/df-form-select/DfFormSelect.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-select/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-select/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-signature/DfFormSignature.d.ts +0 -21
- package/dist/df-form-controls/df-form-signature/DfFormSignature.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-signature/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-signature/index.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-table/df-form-table.d.ts +0 -43
- package/dist/df-form-controls/df-form-table/df-form-table.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-textarea/DfFormTextarea.d.ts +0 -21
- package/dist/df-form-controls/df-form-textarea/DfFormTextarea.d.ts.map +0 -1
- package/dist/df-form-controls/df-form-textarea/index.d.ts +0 -3
- package/dist/df-form-controls/df-form-textarea/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/services/conditionalLogicService.d.ts +0 -47
- package/dist/services/conditionalLogicService.d.ts.map +0 -1
- package/dist/services/toast.service.d.ts +0 -27
- package/dist/services/toast.service.d.ts.map +0 -1
- package/dist/types/form-builder-schema.model.d.ts +0 -75
- package/dist/types/form-builder-schema.model.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
interface ICondition {
|
|
4
4
|
id: string;
|
|
5
5
|
when: string;
|
|
6
|
-
operator: 'equals' | 'notEquals' | 'isEmpty' | 'isNotEmpty' | 'contains' | 'notContains' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual';
|
|
6
|
+
operator: 'equals' | 'notEquals' | 'isEmpty' | 'isNotEmpty' | 'contains' | 'notContains' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'checked' | 'notChecked';
|
|
7
7
|
value: string | number | boolean;
|
|
8
8
|
}
|
|
9
9
|
interface IConditionalLogic {
|
|
@@ -36,6 +36,11 @@ interface IBaseFormComponent {
|
|
|
36
36
|
description?: string;
|
|
37
37
|
collapsed?: boolean;
|
|
38
38
|
showLabel?: boolean;
|
|
39
|
+
enableNotes?: boolean;
|
|
40
|
+
enableAttachment?: boolean;
|
|
41
|
+
enableRaiseIssue?: boolean;
|
|
42
|
+
enableSendEmail?: boolean;
|
|
43
|
+
horizontalView?: boolean;
|
|
39
44
|
};
|
|
40
45
|
validation: {
|
|
41
46
|
required: boolean;
|
|
@@ -307,6 +312,7 @@ interface IDataGridComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'
|
|
|
307
312
|
addAnotherText: string;
|
|
308
313
|
removeText: string;
|
|
309
314
|
displayAsGrid: boolean;
|
|
315
|
+
columnView?: boolean;
|
|
310
316
|
};
|
|
311
317
|
templateComponents: FormComponentType[];
|
|
312
318
|
entries: DataGridEntry[];
|
|
@@ -317,6 +323,8 @@ interface IDataGridComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'
|
|
|
317
323
|
borderRadius: string;
|
|
318
324
|
padding: string;
|
|
319
325
|
margin: string;
|
|
326
|
+
headerBackgroundColor?: string;
|
|
327
|
+
headerTextColor?: string;
|
|
320
328
|
};
|
|
321
329
|
}
|
|
322
330
|
interface DataGridEntry {
|
|
@@ -708,45 +716,27 @@ declare const DfFormSection: React.FC<DfFormSectionProps>;
|
|
|
708
716
|
interface DfFormDataGridProps {
|
|
709
717
|
id: string;
|
|
710
718
|
properties: IDataGridComponent;
|
|
711
|
-
validationErrors?: Record<string, any>;
|
|
712
|
-
formValue?: any;
|
|
713
|
-
formData?: Record<string, any>;
|
|
714
|
-
readonly?: boolean;
|
|
715
|
-
disabled?: boolean;
|
|
716
|
-
touchedFields?: Record<string, boolean>;
|
|
717
|
-
formSubmitted?: boolean;
|
|
718
719
|
mode?: 'edit' | 'preview' | 'test';
|
|
720
|
+
formData?: any;
|
|
719
721
|
onValueChange?: (change: IFormControlChange) => void;
|
|
720
|
-
onBlur?: () => void;
|
|
721
|
-
onFocus?: () => void;
|
|
722
722
|
onSelect?: () => void;
|
|
723
723
|
isSelected?: boolean;
|
|
724
724
|
className?: string;
|
|
725
|
-
onDataGridSelect?: (
|
|
726
|
-
onDataGridDelete?: (dataGridId: string) => void;
|
|
727
|
-
onEntryChange?: (entryIndex: number, components: FormComponentType[]) => void;
|
|
725
|
+
onDataGridSelect?: (component: IDataGridComponent) => void;
|
|
728
726
|
onComponentSelect?: (component: FormComponentType) => void;
|
|
729
727
|
onComponentDelete?: (component: FormComponentType, event: React.MouseEvent) => void;
|
|
730
728
|
onComponentEdit?: (component: FormComponentType) => void;
|
|
731
729
|
onComponentUpdate?: (componentId: string, updates: Partial<FormComponentType>) => void;
|
|
732
730
|
selectedComponent?: FormComponentType | null;
|
|
733
|
-
renderFormComponent?: (
|
|
734
|
-
onDataGridUpdate?: (dataGridId: string, updates: Partial<IDataGridComponent>) => void;
|
|
731
|
+
renderFormComponent?: (component: FormComponentType, hideLabel?: boolean) => React.ReactNode;
|
|
735
732
|
onEntryAdd?: () => void;
|
|
736
|
-
onEntryRemove?: (
|
|
733
|
+
onEntryRemove?: (index: number) => void;
|
|
737
734
|
formTemplateId?: string;
|
|
738
735
|
onThresholdActionCompletion?: (conditionId: string, action: 'notes' | 'attachments' | 'email', completed: boolean) => void;
|
|
739
736
|
onThresholdIssueRaised?: (conditionId: string) => void;
|
|
740
737
|
onNotesChange?: (componentId: string, notes: string) => void;
|
|
741
738
|
onAttachmentChange?: (componentId: string, attachments: File[] | null) => void;
|
|
742
|
-
|
|
743
|
-
assetNumber?: string;
|
|
744
|
-
user?: {
|
|
745
|
-
firstName?: string;
|
|
746
|
-
lastName?: string;
|
|
747
|
-
};
|
|
748
|
-
onCreateIssue?: (issueData: any, attachments: File[]) => Promise<any>;
|
|
749
|
-
onUpdateIssue?: (issueId: string, updateData: any) => Promise<void>;
|
|
739
|
+
shouldShowComponent?: (componentId: string) => boolean;
|
|
750
740
|
}
|
|
751
741
|
declare const DfFormDataGrid: React.FC<DfFormDataGridProps>;
|
|
752
742
|
|
|
@@ -858,7 +848,6 @@ interface IIssue {
|
|
|
858
848
|
component?: FormComponentType;
|
|
859
849
|
priority?: 'High' | 'Medium' | 'Low';
|
|
860
850
|
status?: string;
|
|
861
|
-
assignee?: string;
|
|
862
851
|
assignTo?: string;
|
|
863
852
|
comments?: string;
|
|
864
853
|
attachments?: any[];
|
|
@@ -941,6 +930,10 @@ interface IAvailableComponent {
|
|
|
941
930
|
label: string;
|
|
942
931
|
type: string;
|
|
943
932
|
key: string;
|
|
933
|
+
options?: Array<{
|
|
934
|
+
label: string;
|
|
935
|
+
value: string;
|
|
936
|
+
}>;
|
|
944
937
|
}
|
|
945
938
|
interface IConditionalEvaluationResult {
|
|
946
939
|
shouldShow: boolean;
|
|
@@ -954,17 +947,68 @@ declare class ConditionalLogicService {
|
|
|
954
947
|
private static instance;
|
|
955
948
|
private constructor();
|
|
956
949
|
static getInstance(): ConditionalLogicService;
|
|
950
|
+
/**
|
|
951
|
+
* Get all available components in the form for conditional logic
|
|
952
|
+
* @param formSchema - The current form schema containing all components
|
|
953
|
+
* @param excludeComponentId - Optional component ID to exclude from the list
|
|
954
|
+
* @returns Array of available components with their metadata
|
|
955
|
+
*/
|
|
957
956
|
getAvailableComponentsForConditional(formSchema: FormComponentType[], excludeComponentId?: string): IAvailableComponent[];
|
|
958
957
|
getApplicableOperators(componentType: string): string[];
|
|
958
|
+
/**
|
|
959
|
+
* Recursively find a component in the form schema
|
|
960
|
+
*/
|
|
961
|
+
findComponent(formSchema: any[], componentId: string): any | undefined;
|
|
962
|
+
/**
|
|
963
|
+
* Get all components from schema (including nested ones) - for smart fallback
|
|
964
|
+
*/
|
|
965
|
+
private getAllComponents;
|
|
959
966
|
validateConditionalLogic(conditional: IConditionalLogic, formSchema: FormComponentType[]): {
|
|
960
967
|
isValid: boolean;
|
|
961
968
|
errors: string[];
|
|
962
969
|
};
|
|
963
|
-
|
|
970
|
+
/**
|
|
971
|
+
* Evaluate whether a component should be shown based on conditional logic
|
|
972
|
+
* @param conditional - The conditional logic to evaluate
|
|
973
|
+
* @param formSchema - The current form schema
|
|
974
|
+
* @param formValues - Current form values (component values)
|
|
975
|
+
* @returns Evaluation result with details
|
|
976
|
+
*/
|
|
977
|
+
evaluateConditionalLogic(conditional: IConditionalLogic, formSchema: any[], formValues: Record<string, any>): IConditionalEvaluationResult;
|
|
978
|
+
/**
|
|
979
|
+
* Get the current value of a component
|
|
980
|
+
* @param componentId - The component ID to get value for
|
|
981
|
+
* @param formSchema - The current form schema
|
|
982
|
+
* @param formValues - Current form values
|
|
983
|
+
* @returns The component value or undefined if not found
|
|
984
|
+
*/
|
|
964
985
|
private getComponentValue;
|
|
986
|
+
/**
|
|
987
|
+
* Evaluate a single condition
|
|
988
|
+
* @param condition - The condition to evaluate
|
|
989
|
+
* @param componentValue - The current value of the component
|
|
990
|
+
* @returns Boolean result of the condition evaluation
|
|
991
|
+
*/
|
|
965
992
|
private evaluateCondition;
|
|
993
|
+
/**
|
|
994
|
+
* Evaluate checkbox-specific conditions (checked/notChecked)
|
|
995
|
+
* @param componentValue - The current value of the checkbox component
|
|
996
|
+
* @param expectedValue - Either 'checked' or 'notChecked'
|
|
997
|
+
* @returns Boolean result of the checkbox condition evaluation
|
|
998
|
+
*/
|
|
966
999
|
private evaluateCheckboxCondition;
|
|
1000
|
+
/**
|
|
1001
|
+
* Determine if a checkbox component is checked based on its value
|
|
1002
|
+
* @param componentValue - The current value of the checkbox component
|
|
1003
|
+
* @returns Boolean indicating if checkbox is checked
|
|
1004
|
+
*/
|
|
967
1005
|
private isCheckboxChecked;
|
|
1006
|
+
/**
|
|
1007
|
+
* Determine final result based on 'when' condition (all/any) and action (show/hide)
|
|
1008
|
+
* @param conditional - The conditional logic configuration
|
|
1009
|
+
* @param evaluatedConditions - Array of evaluated conditions
|
|
1010
|
+
* @returns Final boolean result
|
|
1011
|
+
*/
|
|
968
1012
|
private determineFinalResult;
|
|
969
1013
|
private isEqual;
|
|
970
1014
|
private isEmpty;
|