@arquimedes.co/eureka-forms 3.0.0-refactor → 3.0.1-refactor
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/@Types/@Types.d.ts +2 -0
- package/dist/@Types/AYFFormStep.d.ts +19 -0
- package/dist/@Types/Branding.d.ts +13 -0
- package/dist/@Types/CBRFormStep.d.ts +74 -0
- package/dist/@Types/Condition.d.ts +143 -0
- package/dist/@Types/Draft/Draft.d.ts +12 -0
- package/dist/@Types/Draft/DraftEntityData.d.ts +54 -0
- package/dist/@Types/Entity.d.ts +36 -0
- package/dist/@Types/Form.d.ts +75 -0
- package/dist/@Types/FormStep.d.ts +219 -0
- package/dist/@Types/GenericFormSteps.d.ts +84 -0
- package/dist/@Types/MapperElement.d.ts +8 -0
- package/dist/@Types/Organization.d.ts +11 -0
- package/dist/@Types/Time.d.ts +6 -0
- package/dist/@Types/index.d.ts +1 -0
- package/dist/App/App.d.ts +57 -0
- package/dist/App/AppFunctions.d.ts +23 -0
- package/dist/App/AppFunctions.test.d.ts +1 -0
- package/dist/App/AppHooks.d.ts +10 -0
- package/dist/App/AppHooks.test.d.ts +1 -0
- package/dist/Contexts/CustomContext.d.ts +11 -0
- package/dist/Contexts/FormContext.d.ts +6 -0
- package/dist/Contexts/SectionContext.d.ts +2 -0
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +11 -0
- package/dist/Form/Form.d.ts +39 -0
- package/dist/Form/FormFunctions.d.ts +12 -0
- package/dist/Form/FormFunctions.test.d.ts +1 -0
- package/dist/Form/FormHooks.d.ts +2 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +3 -0
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +3 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +3 -0
- package/dist/Form/Section/Section.d.ts +5 -0
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +3 -0
- package/dist/Form/Terms/Term/Term.d.ts +7 -0
- package/dist/Form/Terms/Terms.d.ts +2 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +7 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +8 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +7 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +10 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +7 -0
- package/dist/FormSteps/AYFStepMapper.d.ts +11 -0
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +14 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +3 -0
- package/dist/FormSteps/CBRStepMapper.d.ts +12 -0
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +8 -0
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +3 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +8 -0
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +3 -0
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +8 -0
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +3 -0
- package/dist/FormSteps/CustomStep.d.ts +26 -0
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +10 -0
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +3 -0
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +14 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +11 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +3 -0
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +8 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +13 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +16 -0
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +17 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +4 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.d.ts +15 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +4 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +4 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +20 -0
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +3 -0
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +10 -0
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +3 -0
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +8 -0
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +3 -0
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +8 -0
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +3 -0
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +8 -0
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +4 -0
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +35 -0
- package/dist/FormSteps/Step.d.ts +7 -0
- package/dist/FormSteps/StepFunctions.d.ts +27 -0
- package/dist/FormSteps/StepFunctions.test.d.ts +1 -0
- package/dist/FormSteps/StepHooks.d.ts +109 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +9 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +7 -0
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +9 -0
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +3 -0
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +16 -0
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +3 -0
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +11 -0
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +3 -0
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +8 -0
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +9 -0
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +11 -0
- package/dist/Icons/@IconTypes.d.ts +6 -0
- package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
- package/dist/Icons/ArrowRightIcon.d.ts +3 -0
- package/dist/Icons/CalendarIcon.d.ts +3 -0
- package/dist/Icons/CheckCircleIcon.d.ts +3 -0
- package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
- package/dist/Icons/ClockIcon.d.ts +3 -0
- package/dist/Icons/CloseIcon.d.ts +3 -0
- package/dist/Icons/Construction/LeakIcon.d.ts +3 -0
- package/dist/Icons/Construction/ProjectIcon.d.ts +3 -0
- package/dist/Icons/Construction/PropertyIcon.d.ts +3 -0
- package/dist/Icons/Construction/SpaceIcon.d.ts +3 -0
- package/dist/Icons/DeleteIcon.d.ts +3 -0
- package/dist/Icons/DocumentIcon.d.ts +3 -0
- package/dist/Icons/Entities/CheckListIcon.d.ts +3 -0
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +3 -0
- package/dist/Icons/Entities/HandshakeIcon.d.ts +3 -0
- package/dist/Icons/Entities/SupplierIcon.d.ts +3 -0
- package/dist/Icons/ErrorIcon.d.ts +3 -0
- package/dist/Icons/ExpandLessIcon.d.ts +3 -0
- package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
- package/dist/Icons/FileIcon.d.ts +3 -0
- package/dist/Icons/InfoIcon.d.ts +3 -0
- package/dist/Icons/LocationIcon.d.ts +3 -0
- package/dist/Icons/PersonIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
- package/dist/Icons/WarningIcon.d.ts +3 -0
- package/dist/Init.d.ts +1 -0
- package/dist/Services/FileService.d.ts +5 -0
- package/dist/Services/FormService.d.ts +5 -0
- package/dist/Services/OrganizationService.d.ts +2 -0
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +17 -0
- package/dist/Shared/ErkButton/ErkButton.d.ts +31 -0
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +23 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +16 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +16 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +16 -0
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +39 -0
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +18 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.d.ts +26 -0
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +26 -0
- package/dist/Shared/ErkTextField/ErkTextField.stories.d.ts +24 -0
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +31 -0
- package/dist/Shared/InputIcon/InputIcon.d.ts +7 -0
- package/dist/Shared/Loader/Loader.d.ts +17 -0
- package/dist/Shared/Navbar/Navbar.d.ts +8 -0
- package/dist/Shared/Navbar/Navbar.stories.d.ts +13 -0
- package/dist/Shared/Rating/Rating.d.ts +13 -0
- package/dist/Shared/Rating/Rating.stories.d.ts +15 -0
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +3 -0
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +3 -0
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +3 -0
- package/dist/Shared/Toggle/Toggle.d.ts +8 -0
- package/dist/States/GlobalSlice.d.ts +46 -0
- package/dist/States/SiteSlice.d.ts +77 -0
- package/dist/States/WidthStatsSlice.d.ts +7 -0
- package/dist/Utils/AxiosAPI.d.ts +2 -0
- package/dist/Utils/AxiosWidget.d.ts +2 -0
- package/dist/Utils/CBRFunctions.d.ts +8 -0
- package/dist/Utils/DraftFunctions.d.ts +56 -0
- package/dist/Utils/FormStepFunctions.d.ts +15 -0
- package/dist/Utils/LocaleUtils.d.ts +2 -0
- package/dist/Utils/MaterialProviders.d.ts +25 -0
- package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
- package/dist/Utils/PhoneFunctions.d.ts +2 -0
- package/dist/Utils/TestUtils.d.ts +70 -0
- package/dist/Utils/store.d.ts +29 -0
- package/dist/Widget.d.ts +1 -0
- package/dist/__tests__/setup.d.ts +1 -0
- package/dist/constants/AYFFormStepTypes.d.ts +9 -0
- package/dist/constants/CBRFormStepTypes.d.ts +21 -0
- package/dist/constants/ConditionTypes.d.ts +27 -0
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +11 -0
- package/dist/constants/Draft/DraftEntityTypes.d.ts +3 -0
- package/dist/constants/Draft/DraftStyleTypes.d.ts +7 -0
- package/dist/constants/EntityPropertyTypes.d.ts +10 -0
- package/dist/constants/Files/FileExtensions.d.ts +3 -0
- package/dist/constants/Files/FileMaxSize.d.ts +2 -0
- package/dist/constants/FormStepTypes.d.ts +64 -0
- package/dist/constants/IconTypes.d.ts +15 -0
- package/dist/constants/InternalFormStyle.d.ts +3 -0
- package/dist/constants/TicketPropertyTypes.d.ts +3 -0
- package/dist/hooks.d.ts +7 -0
- package/dist/index.lib.d.ts +7 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Mapper } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
import { MapperElement } from '../../@Types/MapperElement';
|
|
4
|
+
interface CustomMapperElementModifiers<Type> {
|
|
5
|
+
calcName?: (element: MapperElement<Type>) => string;
|
|
6
|
+
isDeleted?: (element: MapperElement<Type>) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface MapperStepProps<Type> extends StepProps {
|
|
9
|
+
/** The MapperStep to display */
|
|
10
|
+
step: Mapper;
|
|
11
|
+
customAdd?: (ref: React.RefObject<HTMLDivElement>, disabled: boolean, handleAddElement: (value?: any) => void) => JSX.Element;
|
|
12
|
+
customElementRender?: (element: MapperElement<Type>, index: number, renderElement: (renderElementButtons?: (element: MapperElement<any>) => JSX.Element) => JSX.Element) => JSX.Element;
|
|
13
|
+
customElementModifiers?: CustomMapperElementModifiers<Type>;
|
|
14
|
+
calcCustomStepProps?: (element: MapperElement<Type>, customStepProps: Record<string, any>) => Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
declare function MapperStep<Type>(props: MapperStepProps<Type>): JSX.Element;
|
|
17
|
+
export default MapperStep;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MapperStepProps } from '../../../MapperStep';
|
|
2
|
+
import { MapperElementComponentProps } from '../MapperElementComponent';
|
|
3
|
+
declare function ListMapperElement<Type = any>({ step, num, loading, element, children, editable, handleDelete, customElementModifiers, }: MapperStepProps<Type> & MapperElementComponentProps<Type>): JSX.Element;
|
|
4
|
+
export default ListMapperElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MapperStepProps } from '../../MapperStep';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MapperElement } from '../../../../@Types/MapperElement';
|
|
4
|
+
import { MapperValue } from '../MaterialMapperStep';
|
|
5
|
+
export interface MapperElementComponentProps<Type> {
|
|
6
|
+
num: number;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
element: MapperElement<Type>;
|
|
9
|
+
onChange: (value: MapperValue<Type>) => void;
|
|
10
|
+
value: MapperValue<Type>;
|
|
11
|
+
handleDelete: () => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare function MapperElementComponent<Type = any>(props: MapperStepProps<Type> & MapperElementComponentProps<Type>): JSX.Element;
|
|
15
|
+
export default MapperElementComponent;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MapperStepProps } from '../../../MapperStep';
|
|
2
|
+
import { MapperElementComponentProps } from '../MapperElementComponent';
|
|
3
|
+
declare function PagedMapperElement<Type = any>({ step, num, loading, element, children, editable, onChange, value, handleDelete, customElementModifiers, customElementRender, }: MapperStepProps<Type> & MapperElementComponentProps<Type>): JSX.Element;
|
|
4
|
+
export default PagedMapperElement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MapperStepProps } from '../../../MapperStep';
|
|
2
|
+
import { MapperElementComponentProps } from '../MapperElementComponent';
|
|
3
|
+
declare function PillMapperElement<Type = any>({ step, num, loading, element, children, editable, handleDelete, customElementModifiers, customElementRender, }: MapperStepProps<Type> & MapperElementComponentProps<Type>): JSX.Element;
|
|
4
|
+
export default PillMapperElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MapperStepProps } from '../MapperStep';
|
|
2
|
+
import { FieldError } from 'react-hook-form';
|
|
3
|
+
import { MapperElement } from '../../../@Types/MapperElement';
|
|
4
|
+
import { Form } from '../../../@Types';
|
|
5
|
+
export interface MapperValue<Type> {
|
|
6
|
+
elements: MapperElement<Type>[];
|
|
7
|
+
page: number;
|
|
8
|
+
}
|
|
9
|
+
export interface MapperComponentProps<Type> extends MapperStepProps<Type> {
|
|
10
|
+
form: Form;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
error: FieldError | undefined;
|
|
13
|
+
onChange: (value: MapperValue<Type>) => void;
|
|
14
|
+
handleAddElement: (elementValue?: Type) => void;
|
|
15
|
+
value: MapperValue<Type>;
|
|
16
|
+
inputRef: any;
|
|
17
|
+
}
|
|
18
|
+
declare function MapperStep<Type>(props: MapperStepProps<Type>): JSX.Element;
|
|
19
|
+
export declare function CustomMapperStep<Type>(props: Omit<MapperComponentProps<Type>, 'form' | 'handleAddElement'>): JSX.Element;
|
|
20
|
+
export default MapperStep;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextInput } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface PhoneInputStepProps extends StepProps {
|
|
4
|
+
/** The TextInputStep to display */
|
|
5
|
+
step: TextInput;
|
|
6
|
+
/** Default value to display */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function PhoneInputStep(props: PhoneInputStepProps): JSX.Element;
|
|
10
|
+
export default PhoneInputStep;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Rating } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface RatingStepProps extends StepProps {
|
|
4
|
+
/** The RatingStep to display */
|
|
5
|
+
step: Rating;
|
|
6
|
+
}
|
|
7
|
+
declare function RatingStep(props: RatingStepProps): JSX.Element;
|
|
8
|
+
export default RatingStep;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormSelector } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface SelectorStepProps extends StepProps {
|
|
4
|
+
/** The SelectorStep to display */
|
|
5
|
+
step: FormSelector;
|
|
6
|
+
}
|
|
7
|
+
declare function SelectorStep(props: SelectorStepProps): JSX.Element;
|
|
8
|
+
export default SelectorStep;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Separator } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface SeparatorStepProps extends StepProps {
|
|
4
|
+
/** The TitleStep to display */
|
|
5
|
+
step: Separator;
|
|
6
|
+
}
|
|
7
|
+
declare function SeparatorStep(props: SeparatorStepProps): JSX.Element;
|
|
8
|
+
export default SeparatorStep;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SmartSelectStepProps } from '../SmartSelectStep';
|
|
2
|
+
import { GSmartSelect } from '../../../@Types/GenericFormSteps';
|
|
3
|
+
declare function SmartSelectStep<StepType extends GSmartSelect>({ step, editable, getOptions, calcDepError, defaultValue, filterOptions, IconComponent, valueOverwrite, getValueString, changeListener, getValueWarning, getOptionSelected, getOptionsConditionsIdSteps, renderNestedSteps, }: SmartSelectStepProps<StepType>): JSX.Element;
|
|
4
|
+
export default SmartSelectStep;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StepProps } from '../Step';
|
|
2
|
+
import { GSmartSelect } from '../../@Types/GenericFormSteps';
|
|
3
|
+
import { FormStep } from '../../@Types/FormStep';
|
|
4
|
+
import { DependencyStore } from '../../Form/Form';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface SmartSelectStepProps<StepType extends GSmartSelect = GSmartSelect> extends Omit<StepProps, 'step'> {
|
|
7
|
+
/** The SmartSelectStep to display */
|
|
8
|
+
step: StepType;
|
|
9
|
+
/** The icon to display */
|
|
10
|
+
IconComponent?: React.ElementType;
|
|
11
|
+
/** Function to call to get the options of the selector, return null if dependency is not met */
|
|
12
|
+
getOptions: (idOrganization: string | undefined, step: StepType, dependencyStore: DependencyStore) => Promise<any[] | null>;
|
|
13
|
+
/** Function to call to filter the options of the selector */
|
|
14
|
+
filterOptions?: (options: any[], dependencyStore: DependencyStore) => any[];
|
|
15
|
+
/** Function to determine the currently selected option */
|
|
16
|
+
getOptionSelected: (option: any, value: any) => boolean;
|
|
17
|
+
/** Function to determine the current value in string format */
|
|
18
|
+
getValueString: (value: any) => string;
|
|
19
|
+
/** Function to if currently selected option has warning */
|
|
20
|
+
getValueWarning?: (value: any) => string | null;
|
|
21
|
+
/** Function called to get the idSteps of the step's conditions for better refreshing */
|
|
22
|
+
getOptionsConditionsIdSteps?: (step: StepType) => string[];
|
|
23
|
+
/** Function that returns the error message based on the steps of the missing Dependencies, undefined if no error msg */
|
|
24
|
+
calcDepError?: (steps: FormStep[]) => string | undefined;
|
|
25
|
+
/** Function that overwrites the value before setting it */
|
|
26
|
+
valueOverwrite?: (value: any) => any;
|
|
27
|
+
/** Function called on each value change */
|
|
28
|
+
changeListener?: (value: any) => void;
|
|
29
|
+
/** default Value to select */
|
|
30
|
+
defaultValue?: any;
|
|
31
|
+
/** function called to render nested elements when selected */
|
|
32
|
+
renderNestedSteps?: (value: any) => JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
declare function SmartSelectStep(props: SmartSelectStepProps): JSX.Element;
|
|
35
|
+
export default SmartSelectStep;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormSize } from '../@Types/Form';
|
|
2
|
+
import { ApiSelector, CheckBox, ClassifierSelector, EntityValuePicker, FormSelector, FormStep } from '../@Types/FormStep';
|
|
3
|
+
import { AYFFormStep } from '../@Types/AYFFormStep';
|
|
4
|
+
import { CBRFormStep } from '../@Types/CBRFormStep';
|
|
5
|
+
import { Condition } from '../@Types/Condition';
|
|
6
|
+
import { DependencyStore } from '../Form/Form';
|
|
7
|
+
import { Entity } from '../@Types/Entity';
|
|
8
|
+
export type FillerSteps = FormSelector | ClassifierSelector | EntityValuePicker | ApiSelector | CheckBox;
|
|
9
|
+
export declare function calcFillerSize(step: FillerSteps, steps: Record<string, FormStep>, values: Record<string, unknown>, size: FormSize): number;
|
|
10
|
+
export declare const calcStepWidth: (stepSize: 1 | 2 | 3 | 4, size: FormSize) => number;
|
|
11
|
+
export declare const calcDefaultValue: (step: FormStep | CBRFormStep) => any;
|
|
12
|
+
export declare const iterateNestedSteps: (idStep: string, steps: Record<string, FormStep>, iteration: (step: FormStep) => void) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Utility function to calc the substeps of a step
|
|
15
|
+
* @param step step to calc the substeps
|
|
16
|
+
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
17
|
+
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
18
|
+
*/
|
|
19
|
+
export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: (idSubStep: string) => string) => string[];
|
|
20
|
+
export declare const evaluateCondition: (condition: Condition, dependencies: DependencyStore, entityValue?: {
|
|
21
|
+
entity?: Entity;
|
|
22
|
+
entityValue: {
|
|
23
|
+
_id: string;
|
|
24
|
+
value: string;
|
|
25
|
+
} & Record<string, any>;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
export declare function getRelativeDate(nDays?: number, nHours?: number, nMinutes?: number, subtract?: boolean, date?: Date): Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { GBaseStep } from '../@Types/GenericFormSteps';
|
|
2
|
+
import { ValuesStore } from '../States/SiteSlice';
|
|
3
|
+
import { RootState } from '../Utils/store';
|
|
4
|
+
import { Form } from '../@Types';
|
|
5
|
+
import { DependencyStore } from '../Form/Form';
|
|
6
|
+
import { FormStep } from '../@Types/FormStep';
|
|
7
|
+
import { FieldError, RefCallBack, UseControllerProps, useController } from 'react-hook-form';
|
|
8
|
+
import { Condition } from '../@Types/Condition';
|
|
9
|
+
import { CBRFormStep } from '../@Types/CBRFormStep';
|
|
10
|
+
export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
} & {
|
|
15
|
+
resultFunc: (resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any;
|
|
16
|
+
memoizedResultFunc: ((resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any) & {
|
|
17
|
+
clearCache: () => void;
|
|
18
|
+
resultsCount: () => number;
|
|
19
|
+
resetResultsCount: () => void;
|
|
20
|
+
};
|
|
21
|
+
lastResult: () => any;
|
|
22
|
+
dependencies: [(state: RootState) => ValuesStore, (_state: RootState, step: GBaseStep) => GBaseStep];
|
|
23
|
+
recomputations: () => number;
|
|
24
|
+
resetRecomputations: () => void;
|
|
25
|
+
dependencyRecomputations: () => number;
|
|
26
|
+
resetDependencyRecomputations: () => void;
|
|
27
|
+
} & {
|
|
28
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
29
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
30
|
+
};
|
|
31
|
+
export interface StepDependency {
|
|
32
|
+
originalValue: any;
|
|
33
|
+
isDependency: boolean;
|
|
34
|
+
handleStepDep: (value: any) => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
|
|
37
|
+
export declare const selectStepDependencies: ((state: RootState, _step: GBaseStep, form: Form) => {
|
|
38
|
+
invalids: string[];
|
|
39
|
+
emptyDep: boolean;
|
|
40
|
+
}) & {
|
|
41
|
+
clearCache: () => void;
|
|
42
|
+
resultsCount: () => number;
|
|
43
|
+
resetResultsCount: () => void;
|
|
44
|
+
} & {
|
|
45
|
+
resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
|
|
46
|
+
invalids: string[];
|
|
47
|
+
emptyDep: boolean;
|
|
48
|
+
};
|
|
49
|
+
memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
|
|
50
|
+
invalids: string[];
|
|
51
|
+
emptyDep: boolean;
|
|
52
|
+
}) & {
|
|
53
|
+
clearCache: () => void;
|
|
54
|
+
resultsCount: () => number;
|
|
55
|
+
resetResultsCount: () => void;
|
|
56
|
+
};
|
|
57
|
+
lastResult: () => {
|
|
58
|
+
invalids: string[];
|
|
59
|
+
emptyDep: boolean;
|
|
60
|
+
};
|
|
61
|
+
dependencies: [(state: RootState) => DependencyStore, (_state: RootState, step: GBaseStep) => GBaseStep, (_state: RootState, _step: GBaseStep, form: Form) => Form];
|
|
62
|
+
recomputations: () => number;
|
|
63
|
+
resetRecomputations: () => void;
|
|
64
|
+
dependencyRecomputations: () => number;
|
|
65
|
+
resetDependencyRecomputations: () => void;
|
|
66
|
+
} & {
|
|
67
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
68
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
69
|
+
};
|
|
70
|
+
export interface UseFormStepOptions<ValueType> {
|
|
71
|
+
defaultValue: ValueType;
|
|
72
|
+
/** If true, will not trigger onChange until the user has finished typing */
|
|
73
|
+
debounce?: boolean;
|
|
74
|
+
rules?: UseControllerProps['rules'];
|
|
75
|
+
/** If the step should trigger a filler(root StepFiller) size change */
|
|
76
|
+
sizeChange?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface FormStepFunctions<ValueType = unknown> {
|
|
79
|
+
value: ValueType;
|
|
80
|
+
ref: RefCallBack;
|
|
81
|
+
onChange: (value: ValueType) => void;
|
|
82
|
+
error: FieldError | undefined;
|
|
83
|
+
field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
|
|
84
|
+
}
|
|
85
|
+
export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue }: UseFormStepOptions<ValueType>) => FormStepFunctions<ValueType>;
|
|
86
|
+
export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & {
|
|
87
|
+
clearCache: () => void;
|
|
88
|
+
resultsCount: () => number;
|
|
89
|
+
resetResultsCount: () => void;
|
|
90
|
+
} & {
|
|
91
|
+
resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore;
|
|
92
|
+
memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore) & {
|
|
93
|
+
clearCache: () => void;
|
|
94
|
+
resultsCount: () => number;
|
|
95
|
+
resetResultsCount: () => void;
|
|
96
|
+
};
|
|
97
|
+
lastResult: () => DependencyStore;
|
|
98
|
+
dependencies: [(state: RootState) => DependencyStore, (_state: RootState, idDeps: string[] | undefined) => string[]];
|
|
99
|
+
recomputations: () => number;
|
|
100
|
+
resetRecomputations: () => void;
|
|
101
|
+
dependencyRecomputations: () => number;
|
|
102
|
+
resetDependencyRecomputations: () => void;
|
|
103
|
+
} & {
|
|
104
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
105
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
106
|
+
};
|
|
107
|
+
export declare const useCondition: (condition?: Condition) => boolean;
|
|
108
|
+
export declare const calcStepDeps: (step: FormStep | CBRFormStep) => string[];
|
|
109
|
+
export declare const recursivelyCalcConditionSteps: (condition: Condition | undefined) => string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
|
|
2
|
+
import './DraftEditor.css';
|
|
3
|
+
import { TextAreaStepProps } from '../TextAreaStep';
|
|
4
|
+
export interface Payload {
|
|
5
|
+
text: string;
|
|
6
|
+
draft: any;
|
|
7
|
+
}
|
|
8
|
+
declare function TextAreaStep({ step, editable }: TextAreaStepProps): JSX.Element;
|
|
9
|
+
export default TextAreaStep;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextArea } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface TextAreaStepProps extends StepProps {
|
|
4
|
+
/** The TextAreaStep to display */
|
|
5
|
+
step: TextArea;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
}
|
|
8
|
+
declare function TextAreaStep(props: TextAreaStepProps): JSX.Element;
|
|
9
|
+
export default TextAreaStep;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TextInput } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface TextInputStepProps extends StepProps {
|
|
4
|
+
/** The TextInputStep to display */
|
|
5
|
+
step: TextInput;
|
|
6
|
+
/** The icon to display */
|
|
7
|
+
IconComponent?: React.ElementType;
|
|
8
|
+
/** Default value to display */
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
/** Custom Validation to display */
|
|
11
|
+
validation?: TextInput['validation'];
|
|
12
|
+
/** Custom step Max char length */
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
}
|
|
15
|
+
declare function TextInputStep(props: TextInputStepProps): JSX.Element;
|
|
16
|
+
export default TextInputStep;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TimePicker } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
import { Time } from '../../@Types/Time';
|
|
4
|
+
export interface TimePickerStepProps extends StepProps {
|
|
5
|
+
/** The TimePickerStep to display */
|
|
6
|
+
step: TimePicker;
|
|
7
|
+
/** Default value to display */
|
|
8
|
+
defaultValue?: Time;
|
|
9
|
+
}
|
|
10
|
+
declare function TimePickerStep(props: TimePickerStepProps): JSX.Element;
|
|
11
|
+
export default TimePickerStep;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Title } from '../../@Types/FormStep';
|
|
2
|
+
import { StepProps } from '../Step';
|
|
3
|
+
export interface TitleStepProps extends StepProps {
|
|
4
|
+
/** The TitleStep to display */
|
|
5
|
+
step: Title;
|
|
6
|
+
}
|
|
7
|
+
declare function TitleStep(props: TitleStepProps): JSX.Element;
|
|
8
|
+
export default TitleStep;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FillerSteps } from '../../StepFunctions';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const SizeChangeContext: React.Context<(() => void) | undefined>;
|
|
4
|
+
export interface StepFillerContainerProps {
|
|
5
|
+
step: FillerSteps;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function StepFillerContainer({ step, children }: StepFillerContainerProps): JSX.Element;
|
|
9
|
+
export default StepFillerContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GSmartSelect } from '../../../@Types/GenericFormSteps';
|
|
2
|
+
import { CheckBox, DatePicker, ClassifierSelector, FormSelector, TimePicker } from '../../../@Types/FormStep';
|
|
3
|
+
interface MaterialInputProps {
|
|
4
|
+
step: GSmartSelect | CheckBox | ClassifierSelector | DatePicker | TimePicker | FormSelector;
|
|
5
|
+
editable: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
maxHeight?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function MaterialInputContainer({ step, editable, children, onClick, maxHeight, }: MaterialInputProps): JSX.Element;
|
|
11
|
+
export default MaterialInputContainer;
|