@m4l/components 9.6.0 → 9.6.1-beta-feature-671-shared-reports-viewer-mf.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.
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/constants.js +7 -7
- package/components/DynamicForm/dictionary.d.ts +2 -0
- package/components/DynamicForm/dictionary.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.js +2 -0
- package/components/DynamicForm/helpers/applyRequiredValidation/applyRequiredValidation.d.ts +1 -1
- package/components/DynamicForm/helpers/applyRequiredValidation/applyRequiredValidation.js +1 -1
- package/components/DynamicForm/helpers/createFieldValidationSchema/strategies/baseSchema/baseSchemaStrategies.js +29 -29
- package/components/DynamicForm/helpers/createFieldValidationSchema/strategies/validation/validationStrategies.d.ts.map +1 -1
- package/components/DynamicForm/helpers/createFieldValidationSchema/strategies/validation/validationStrategies.js +128 -91
- package/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.d.ts +4 -3
- package/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.d.ts.map +1 -1
- package/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.js +9 -3
- package/components/DynamicForm/helpers/index.d.ts +4 -0
- package/components/DynamicForm/helpers/index.d.ts.map +1 -1
- package/components/DynamicForm/helpers/isPositiveInteger.d.ts +7 -0
- package/components/DynamicForm/helpers/isPositiveInteger.d.ts.map +1 -0
- package/components/DynamicForm/helpers/isPositiveInteger.js +6 -0
- package/components/DynamicForm/helpers/isRecord.d.ts +7 -0
- package/components/DynamicForm/helpers/isRecord.d.ts.map +1 -0
- package/components/DynamicForm/helpers/isRecord.js +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveAssetSrcWithBase.d.ts +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveAssetSrcWithBase.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveAssetSrcWithBase.js +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveRemoteOrAbsoluteAssetSrc.d.ts +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveRemoteOrAbsoluteAssetSrc.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/helpers/resolveRemoteOrAbsoluteAssetSrc.js +8 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/resolveFieldComponent.d.ts +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/resolveFieldComponent.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/resolveFieldComponent.js +8 -17
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/autocompleteStrategy.d.ts +3 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/autocompleteStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/autocompleteStrategy.js +52 -24
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/createAutocompleteAsyncOnChangeFilterParms.d.ts +8 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/createAutocompleteAsyncOnChangeFilterParms.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/createAutocompleteAsyncOnChangeFilterParms.js +22 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/normalizeAutocompletePropsFromBackend.d.ts +29 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/normalizeAutocompletePropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/normalizeAutocompletePropsFromBackend.js +52 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/checkableListStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/checkableListStrategy.js +27 -19
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/fieldPropsNormalizers/fieldPropNormalizers.d.ts +13 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/fieldPropsNormalizers/fieldPropNormalizers.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/fieldPropsNormalizers/fieldPropNormalizers.js +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/groupNormalization/groupNormalization.d.ts +20 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/groupNormalization/groupNormalization.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/groupNormalization/groupNormalization.js +49 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/guards/guards.d.ts +32 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/guards/guards.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/guards/guards.js +39 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/whitelist/propertyNormalizers.d.ts +18 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/whitelist/propertyNormalizers.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/whitelist/propertyNormalizers.js +39 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeCheckableListPropsFromBackend.d.ts +17 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeCheckableListPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeCheckableListPropsFromBackend.js +16 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeFieldOptionsForCheckableList.d.ts +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeFieldOptionsForCheckableList.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/normalizeFieldOptionsForCheckableList.js +29 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/types.d.ts +32 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/checkboxStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/checkboxStrategy.js +13 -12
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/normalizeCheckboxPropsFromBackend.d.ts +11 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/normalizeCheckboxPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/normalizeCheckboxPropsFromBackend.js +15 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/types.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/dateRangePickerStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/dateRangePickerStrategy.js +15 -14
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/normalizeDateRangePickerPropsFromBackend.d.ts +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/normalizeDateRangePickerPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/normalizeDateRangePickerPropsFromBackend.js +15 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/types.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/daysOfWeekPickerStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/daysOfWeekPickerStrategy.js +14 -13
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/helpers/normalizeDisabledDays/normalizeDisabledDays.d.ts +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/helpers/normalizeDisabledDays/normalizeDisabledDays.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/helpers/normalizeDisabledDays/normalizeDisabledDays.js +11 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/normalizeDaysOfWeekPickerPropsFromBackend.d.ts +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/normalizeDaysOfWeekPickerPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/normalizeDaysOfWeekPickerPropsFromBackend.js +18 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/types.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/normalizeRhfLabelRelatedPropsFromBackend.d.ts +16 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/normalizeRhfLabelRelatedPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/helpers/isFiniteNumber/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/helpers/isFiniteNumber/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/helpers/isFiniteNumber/isFiniteNumber.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/helpers/isFiniteNumber/isFiniteNumber.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/helpers/isFiniteNumber/isFiniteNumber.js +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/normalizeNumberInputPropsFromBackend.d.ts +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/normalizeNumberInputPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/normalizeNumberInputPropsFromBackend.js +16 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/numberInputStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/numberInputStrategy.js +14 -13
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/types.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionLabel/buildGetOptionLabel.d.ts +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionLabel/buildGetOptionLabel.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionLabel/buildGetOptionLabel.js +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionLabel/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionLabel/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionValue/buildGetOptionValue.d.ts +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionValue/buildGetOptionValue.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionValue/buildGetOptionValue.js +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionValue/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/buildGetOptionValue/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionLabel/defaultGetOptionLabel.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionLabel/defaultGetOptionLabel.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionLabel/defaultGetOptionLabel.js +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionLabel/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionLabel/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionValue/defaultGetOptionValue.d.ts +5 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionValue/defaultGetOptionValue.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionValue/defaultGetOptionValue.js +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionValue/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/helpers/defaultGetOptionValue/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/normalizeRadioGroupPropsFromBackend.d.ts +17 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/normalizeRadioGroupPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/normalizeRadioGroupPropsFromBackend.js +31 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/radioGroupStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/radioGroupStrategy.js +17 -18
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/types.d.ts +13 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/helpers/resolveSelectOptionIconSrc/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/helpers/resolveSelectOptionIconSrc/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/helpers/resolveSelectOptionIconSrc/resolveSelectOptionIconSrc.d.ts +6 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/helpers/resolveSelectOptionIconSrc/resolveSelectOptionIconSrc.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/helpers/resolveSelectOptionIconSrc/resolveSelectOptionIconSrc.js +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeFieldOptionsForSelect.d.ts +8 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeFieldOptionsForSelect.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeFieldOptionsForSelect.js +43 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeSelectPropsFromBackend.d.ts +14 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeSelectPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/normalizeSelectPropsFromBackend.js +17 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/selectStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/selectStrategy.js +17 -16
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/types.d.ts +9 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/normalizeTextFieldPropsFromBackend.d.ts +15 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/normalizeTextFieldPropsFromBackend.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/normalizeTextFieldPropsFromBackend.js +29 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/textFieldStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/textFieldStrategy.js +17 -14
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/types.d.ts +12 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/types.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/types.d.ts +0 -6
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/types.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/types.d.ts +7 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/types.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldInputLabel/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldInputLabel/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldInputLabel/resolveFieldInputLabel.d.ts +9 -0
- package/components/DynamicForm/helpers/resolveFieldInputLabel/resolveFieldInputLabel.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldInputLabel/resolveFieldInputLabel.js +8 -0
- package/components/DynamicForm/helpers/resolveInitialValue/resolveInitialValue.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveInitialValue/resolveInitialValue.js +34 -50
- package/components/DynamicForm/helpers/resolveValidationErrorMessage/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveValidationErrorMessage/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveValidationErrorMessage/resolveValidationErrorMessage.d.ts +10 -0
- package/components/DynamicForm/helpers/resolveValidationErrorMessage/resolveValidationErrorMessage.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveValidationErrorMessage/resolveValidationErrorMessage.js +11 -0
- package/components/DynamicForm/hooks/useDynamicForm/useDynamicForm.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useDynamicForm/useDynamicForm.js +38 -37
- package/components/DynamicForm/hooks/useDynamicFormConditionals/useDynamicFormConditionals.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useDynamicFormConditionals/useDynamicFormConditionals.js +15 -14
- package/components/DynamicForm/hooks/useDynamicFormCoupled/useDynamicFormCoupled.d.ts +1 -1
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/normalizeOptionsResponse.d.ts +3 -2
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/normalizeOptionsResponse.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/normalizeOptionsResponse.js +9 -16
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.d.ts +1 -1
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.js +24 -24
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +38 -32
- package/components/DynamicForm/types.d.ts +148 -50
- package/components/DynamicForm/types.d.ts.map +1 -1
- package/components/ImageText/ImageText.js +31 -31
- package/components/SideBar/subcomponents/ContentComponent/style.js +1 -1
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts.map +1 -1
- package/components/extended/mui/Avatar/styles.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,iBAiF7B,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { getComponentClasses as o } from "../../utils/getComponentSlotRoot.js";
|
|
2
2
|
import { DynamicFormSlots as e } from "./slots/DynamicFormEnum.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const r = "M4LDynamicForm", i = o(
|
|
4
|
+
r,
|
|
5
5
|
e
|
|
6
|
-
),
|
|
7
|
-
form: { id: 0, name: "", version: 0,
|
|
6
|
+
), m = {
|
|
7
|
+
form: { id: 0, name: "", version: 0, labelForm: "", descriptionForm: "" },
|
|
8
8
|
fields: [],
|
|
9
9
|
instance: { id: 0, name: null, createdAt: "", updatedAt: "", resourceTypeId: "", resourceSerialId: "" },
|
|
10
10
|
conditionalRules: []
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
i as DYNAMIC_FORM_CLASSES,
|
|
14
|
+
r as DYNAMIC_FORM_KEY_COMPONENT,
|
|
15
|
+
m as EMPTY_DATA
|
|
16
16
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const DYNAMIC_FORM_DICTIONARY_KEY = "dynamic_form";
|
|
2
2
|
export declare const getDynamicFormComponentsDictionary: () => string[];
|
|
3
3
|
export declare const DYNAMIC_FORM_DICTIONARY: {
|
|
4
|
+
/** Shown when `field.fieldLabel` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
|
|
5
|
+
LABEL_NOT_FOUND_MESSAGE: string;
|
|
4
6
|
IS_REQUIRED_MESSAGE: string;
|
|
5
7
|
DATE_RANGE_REQUIRED_MESSAGE: string;
|
|
6
8
|
MAX_LENGTH_MESSAGE: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/dictionary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAE1D,eAAO,MAAM,kCAAkC,gBAE9C,CAAC;AAEF,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/dictionary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAE1D,eAAO,MAAM,kCAAkC,gBAE9C,CAAC;AAEF,eAAO,MAAM,uBAAuB;IAClC,gHAAgH;;;;;;;;;;;;CAYjH,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const _ = "dynamic_form", e = {
|
|
2
|
+
/** Shown when `field.fieldLabel` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
|
|
3
|
+
LABEL_NOT_FOUND_MESSAGE: `${_}.label_not_found_message`,
|
|
2
4
|
IS_REQUIRED_MESSAGE: `${_}.is_required_message`,
|
|
3
5
|
DATE_RANGE_REQUIRED_MESSAGE: `${_}.date_range_required_message`,
|
|
4
6
|
MAX_LENGTH_MESSAGE: `${_}.max_length_message`,
|
|
@@ -3,7 +3,7 @@ import { YupFieldSchema } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Applies "required" validation to a Yup schema based on component type and base schema type.
|
|
5
5
|
* Component type takes precedence for array/object semantics (e.g. date range = length 2, checkable list = min 1).
|
|
6
|
-
* @param field - Field with fieldType.
|
|
6
|
+
* @param field - Field with fieldType.componentId and fieldType.id
|
|
7
7
|
* @param schema - Current Yup schema to mutate
|
|
8
8
|
* @param baseSchema - Base schema used to determine primitive/array/object type
|
|
9
9
|
* @param errorMessage - Custom error message or default
|
|
@@ -5,30 +5,30 @@ const n = () => t.object().shape({
|
|
|
5
5
|
}).nullable(), a = () => t.array().of(t.mixed()), o = {
|
|
6
6
|
/**
|
|
7
7
|
* Returns true if this strategy applies to the field (i.e. field is a date range).
|
|
8
|
-
* @param field - Form field to check (uses fieldType.
|
|
8
|
+
* @param field - Form field to check (uses fieldType.componentId and fieldType.id).
|
|
9
9
|
* @returns True if the field is a date range field (RHFDateRangePicker or fft_date_range).
|
|
10
10
|
*/
|
|
11
11
|
applies(e) {
|
|
12
|
-
return e.fieldType.
|
|
12
|
+
return e.fieldType.componentId === "RHFDateRangePicker" || e.fieldType.id === "fft_date_range";
|
|
13
13
|
},
|
|
14
14
|
create() {
|
|
15
15
|
return n();
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, c = {
|
|
18
18
|
/**
|
|
19
19
|
* Returns true if this strategy applies to the field (checkable list or days of week).
|
|
20
20
|
* @param field - Form field to check.
|
|
21
21
|
* @returns True if the field is RHFCheckableList, RHFDaysOfWeekPicker, or fft_checkable_list.
|
|
22
22
|
*/
|
|
23
23
|
applies(e) {
|
|
24
|
-
const r = e.fieldType.
|
|
24
|
+
const r = e.fieldType.componentId;
|
|
25
25
|
return r === "RHFCheckableList" || r === "RHFDaysOfWeekPicker" || e.fieldType.id === "fft_checkable_list";
|
|
26
26
|
},
|
|
27
27
|
/** Returns a Yup array-of-mixed schema for the field. */
|
|
28
28
|
create() {
|
|
29
29
|
return a();
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, p = {
|
|
32
32
|
/**
|
|
33
33
|
* Returns true if this strategy applies to the field (number/integer/double type).
|
|
34
34
|
* @param field - Form field to check.
|
|
@@ -36,47 +36,47 @@ const n = () => t.object().shape({
|
|
|
36
36
|
*/
|
|
37
37
|
applies(e) {
|
|
38
38
|
const r = e.fieldType.id;
|
|
39
|
-
return e.fieldType.
|
|
39
|
+
return e.fieldType.componentId === "RHFNumberInput" || r === "fft_number" || r === "fft_integer" || r === "fft_double";
|
|
40
40
|
},
|
|
41
41
|
/** Returns a Yup number schema for the field. */
|
|
42
42
|
create() {
|
|
43
43
|
return t.number();
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, l = {
|
|
46
46
|
/**
|
|
47
47
|
* Returns true if this strategy applies to the field (checkbox/boolean type).
|
|
48
|
-
* @param field - Form field to check (uses fieldType.
|
|
48
|
+
* @param field - Form field to check (uses fieldType.componentId and fieldType.id).
|
|
49
49
|
* @returns True if the field is RHFCheckbox or fft_boolean or fft_checkbox.
|
|
50
50
|
*/
|
|
51
51
|
applies(e) {
|
|
52
52
|
const r = e.fieldType.id;
|
|
53
|
-
return e.fieldType.
|
|
53
|
+
return e.fieldType.componentId === "RHFCheckbox" || r === "fft_boolean" || r === "fft_checkbox";
|
|
54
54
|
},
|
|
55
55
|
/** Returns a Yup boolean schema for the field. */
|
|
56
56
|
create() {
|
|
57
57
|
return t.boolean();
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, i = {
|
|
60
60
|
/**
|
|
61
61
|
* Returns true if this strategy applies to the field (RHFRadioGroup).
|
|
62
62
|
* @param field - Form field to check.
|
|
63
63
|
* @returns True if the field is RHFRadioGroup.
|
|
64
64
|
*/
|
|
65
65
|
applies(e) {
|
|
66
|
-
return e.fieldType.
|
|
66
|
+
return e.fieldType.componentId === "RHFRadioGroup";
|
|
67
67
|
},
|
|
68
68
|
/** Returns a Yup mixed schema for string or number (selected option value). */
|
|
69
69
|
create() {
|
|
70
70
|
return t.mixed();
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, s = {
|
|
73
73
|
/**
|
|
74
74
|
* Returns true if this strategy applies to the field (RHFSelect).
|
|
75
75
|
* @param field - Form field to check.
|
|
76
76
|
* @returns True if the field is RHFSelect.
|
|
77
77
|
*/
|
|
78
78
|
applies(e) {
|
|
79
|
-
return e.fieldType.
|
|
79
|
+
return e.fieldType.componentId === "RHFSelect";
|
|
80
80
|
},
|
|
81
81
|
/** Returns a Yup string or array schema depending on isMultiple. */
|
|
82
82
|
create(e) {
|
|
@@ -89,46 +89,46 @@ const n = () => t.object().shape({
|
|
|
89
89
|
* @returns True if the field is RHFAutoComplete.
|
|
90
90
|
*/
|
|
91
91
|
applies(e) {
|
|
92
|
-
return e.fieldType.
|
|
92
|
+
return e.fieldType.componentId === "RHFAutoComplete";
|
|
93
93
|
},
|
|
94
94
|
/** Returns a Yup mixed/array schema depending on isMultiple. */
|
|
95
95
|
create(e) {
|
|
96
96
|
return e.fieldType.rhfComponentProps?.isMultiple === !0 ? t.array().of(t.mixed()) : t.mixed().nullable();
|
|
97
97
|
}
|
|
98
|
-
},
|
|
98
|
+
}, d = {
|
|
99
99
|
applies(e) {
|
|
100
|
-
return e.fieldType.
|
|
100
|
+
return e.fieldType.componentId === "RHFTextField";
|
|
101
101
|
},
|
|
102
102
|
create() {
|
|
103
103
|
return t.string();
|
|
104
104
|
}
|
|
105
|
-
},
|
|
105
|
+
}, m = {
|
|
106
106
|
applies() {
|
|
107
107
|
return !0;
|
|
108
108
|
},
|
|
109
109
|
create() {
|
|
110
110
|
return t.string();
|
|
111
111
|
}
|
|
112
|
-
},
|
|
112
|
+
}, f = [
|
|
113
113
|
o,
|
|
114
|
+
c,
|
|
114
115
|
p,
|
|
115
116
|
l,
|
|
116
117
|
i,
|
|
117
118
|
s,
|
|
118
|
-
c,
|
|
119
119
|
u,
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
d,
|
|
121
|
+
m
|
|
122
122
|
];
|
|
123
123
|
export {
|
|
124
|
-
|
|
124
|
+
f as BASE_SCHEMA_STRATEGIES,
|
|
125
125
|
u as autocompleteBaseSchemaStrategy,
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
l as booleanBaseSchemaStrategy,
|
|
127
|
+
c as checkableListBaseSchemaStrategy,
|
|
128
128
|
o as dateRangeBaseSchemaStrategy,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
m as defaultStringBaseSchemaStrategy,
|
|
130
|
+
p as numberBaseSchemaStrategy,
|
|
131
|
+
i as radioGroupBaseSchemaStrategy,
|
|
132
|
+
s as selectBaseSchemaStrategy,
|
|
133
|
+
d as textFieldBaseSchemaStrategy
|
|
134
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validationStrategies.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/DynamicForm/helpers/createFieldValidationSchema/strategies/validation/validationStrategies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validationStrategies.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/DynamicForm/helpers/createFieldValidationSchema/strategies/validation/validationStrategies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,oGAAoG;AACpG,eAAO,MAAM,0BAA0B,EAAE,kBAuBxC,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,2BAA2B,EAAE,kBAwBzC,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,2BAA2B,EAAE,kBAwBzC,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,qBAAqB,EAAE,kBAwBnC,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,qBAAqB,EAAE,kBAwBnC,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,uBAAuB,EAAE,kBAmBrC,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,qBAAqB,EAAE,kBAmBnC,CAAC;AAEF,8BAA8B;AAC9B,eAAO,MAAM,yBAAyB,EAAE,kBA2BvC,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,EAAE,kBAmEtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAU3E,CAAC"}
|
|
@@ -1,70 +1,83 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { DYNAMIC_FORM_DICTIONARY as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import * as m from "yup";
|
|
2
|
+
import { DYNAMIC_FORM_DICTIONARY as c } from "../../../../dictionary.js";
|
|
3
|
+
import { resolveValidationErrorMessage as u } from "../../../resolveValidationErrorMessage/resolveValidationErrorMessage.js";
|
|
4
|
+
import { applyRequiredValidation as E } from "../../../applyRequiredValidation/applyRequiredValidation.js";
|
|
5
|
+
const p = {
|
|
5
6
|
validationTypeId: "fvl_required",
|
|
6
7
|
/**
|
|
7
8
|
* Applies required validation when the field is required; otherwise returns the schema unchanged.
|
|
8
9
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
9
10
|
* @returns Schema with required validation applied, or unchanged schema
|
|
10
11
|
*/
|
|
11
|
-
apply(
|
|
12
|
-
const { field: e, getLabel:
|
|
12
|
+
apply(r) {
|
|
13
|
+
const { field: e, getLabel: a, baseSchema: i, schema: t, validation: s } = r;
|
|
13
14
|
if (!e.isRequired)
|
|
14
15
|
return t;
|
|
15
|
-
const
|
|
16
|
-
return
|
|
16
|
+
const n = e.fieldType.componentId === "RHFDateRangePicker", o = n && e.helperText ? e.helperText : a(n ? c.DATE_RANGE_REQUIRED_MESSAGE : c.IS_REQUIRED_MESSAGE), l = u(s, a, o);
|
|
17
|
+
return E(e, t, i, l);
|
|
17
18
|
}
|
|
18
|
-
},
|
|
19
|
+
}, v = {
|
|
19
20
|
validationTypeId: "fvl_max_length",
|
|
20
21
|
/**
|
|
21
22
|
* Applies max length constraint to string schema when validation value is present.
|
|
22
23
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
23
24
|
* @returns Schema with `.max(length)` applied, or unchanged schema if not applicable
|
|
24
25
|
*/
|
|
25
|
-
apply(
|
|
26
|
-
const { validation: e, getLabel:
|
|
27
|
-
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(
|
|
26
|
+
apply(r) {
|
|
27
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
28
|
+
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(i instanceof m.StringSchema))
|
|
28
29
|
return t;
|
|
29
|
-
const
|
|
30
|
-
if (isNaN(
|
|
30
|
+
const n = parseInt(e.value, 10);
|
|
31
|
+
if (isNaN(n))
|
|
31
32
|
return t;
|
|
32
|
-
const
|
|
33
|
-
|
|
33
|
+
const o = u(
|
|
34
|
+
e,
|
|
35
|
+
a,
|
|
36
|
+
a(c.MAX_LENGTH_MESSAGE, n)
|
|
37
|
+
);
|
|
38
|
+
return t.max(n, o);
|
|
34
39
|
}
|
|
35
|
-
},
|
|
40
|
+
}, S = {
|
|
36
41
|
validationTypeId: "fvl_min_length",
|
|
37
42
|
/**
|
|
38
43
|
* Applies min length constraint to string schema when validation value is present.
|
|
39
44
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
40
45
|
* @returns Schema with `.min(length)` applied, or unchanged schema if not applicable
|
|
41
46
|
*/
|
|
42
|
-
apply(
|
|
43
|
-
const { validation: e, getLabel:
|
|
44
|
-
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(
|
|
47
|
+
apply(r) {
|
|
48
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
49
|
+
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(i instanceof m.StringSchema))
|
|
45
50
|
return t;
|
|
46
|
-
const
|
|
47
|
-
if (isNaN(
|
|
51
|
+
const n = parseInt(e.value, 10);
|
|
52
|
+
if (isNaN(n))
|
|
48
53
|
return t;
|
|
49
|
-
const
|
|
50
|
-
|
|
54
|
+
const o = u(
|
|
55
|
+
e,
|
|
56
|
+
a,
|
|
57
|
+
a(c.MIN_LENGTH_MESSAGE, n)
|
|
58
|
+
);
|
|
59
|
+
return t.min(n, o);
|
|
51
60
|
}
|
|
52
|
-
},
|
|
61
|
+
}, y = {
|
|
53
62
|
validationTypeId: "fvl_max",
|
|
54
63
|
/**
|
|
55
64
|
* Applies maximum numeric value constraint when validation value is present.
|
|
56
65
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
57
66
|
* @returns Schema with `.max(value)` applied, or unchanged schema if not applicable
|
|
58
67
|
*/
|
|
59
|
-
apply(
|
|
60
|
-
const { validation: e, getLabel:
|
|
61
|
-
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(
|
|
68
|
+
apply(r) {
|
|
69
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
70
|
+
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(i instanceof m.NumberSchema))
|
|
62
71
|
return t;
|
|
63
|
-
const
|
|
64
|
-
if (isNaN(
|
|
72
|
+
const n = parseFloat(e.value);
|
|
73
|
+
if (isNaN(n))
|
|
65
74
|
return t;
|
|
66
|
-
const
|
|
67
|
-
|
|
75
|
+
const o = u(
|
|
76
|
+
e,
|
|
77
|
+
a,
|
|
78
|
+
a(c.MAX_VALUE_MESSAGE, n)
|
|
79
|
+
);
|
|
80
|
+
return t.max(n, o);
|
|
68
81
|
}
|
|
69
82
|
}, g = {
|
|
70
83
|
validationTypeId: "fvl_min",
|
|
@@ -73,29 +86,37 @@ const d = {
|
|
|
73
86
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
74
87
|
* @returns Schema with `.min(value)` applied, or unchanged schema if not applicable
|
|
75
88
|
*/
|
|
76
|
-
apply(
|
|
77
|
-
const { validation: e, getLabel:
|
|
78
|
-
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(
|
|
89
|
+
apply(r) {
|
|
90
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
91
|
+
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(i instanceof m.NumberSchema))
|
|
79
92
|
return t;
|
|
80
|
-
const
|
|
81
|
-
if (isNaN(
|
|
93
|
+
const n = parseFloat(e.value);
|
|
94
|
+
if (isNaN(n))
|
|
82
95
|
return t;
|
|
83
|
-
const
|
|
84
|
-
|
|
96
|
+
const o = u(
|
|
97
|
+
e,
|
|
98
|
+
a,
|
|
99
|
+
a(c.MIN_VALUE_MESSAGE, n)
|
|
100
|
+
);
|
|
101
|
+
return t.min(n, o);
|
|
85
102
|
}
|
|
86
|
-
},
|
|
103
|
+
}, I = {
|
|
87
104
|
validationTypeId: "fvl_email",
|
|
88
105
|
/**
|
|
89
106
|
* Applies email format validation to string schema.
|
|
90
107
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
91
108
|
* @returns Schema with `.email()` applied, or unchanged schema if base is not string
|
|
92
109
|
*/
|
|
93
|
-
apply(
|
|
94
|
-
const { validation: e, getLabel:
|
|
95
|
-
if (!(
|
|
110
|
+
apply(r) {
|
|
111
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
112
|
+
if (!(i instanceof m.StringSchema))
|
|
96
113
|
return t;
|
|
97
|
-
const
|
|
98
|
-
|
|
114
|
+
const s = u(
|
|
115
|
+
e,
|
|
116
|
+
a,
|
|
117
|
+
a(c.EMAIL_INVALID_MESSAGE)
|
|
118
|
+
);
|
|
119
|
+
return t.email(s);
|
|
99
120
|
}
|
|
100
121
|
}, f = {
|
|
101
122
|
validationTypeId: "fvl_url",
|
|
@@ -104,14 +125,18 @@ const d = {
|
|
|
104
125
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
105
126
|
* @returns Schema with `.url()` applied, or unchanged schema if base is not string
|
|
106
127
|
*/
|
|
107
|
-
apply(
|
|
108
|
-
const { validation: e, getLabel:
|
|
109
|
-
if (!(
|
|
128
|
+
apply(r) {
|
|
129
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
130
|
+
if (!(i instanceof m.StringSchema))
|
|
110
131
|
return t;
|
|
111
|
-
const
|
|
112
|
-
|
|
132
|
+
const s = u(
|
|
133
|
+
e,
|
|
134
|
+
a,
|
|
135
|
+
a(c.URL_INVALID_MESSAGE)
|
|
136
|
+
);
|
|
137
|
+
return t.url(s);
|
|
113
138
|
}
|
|
114
|
-
},
|
|
139
|
+
}, T = {
|
|
115
140
|
validationTypeId: "fvl_pattern",
|
|
116
141
|
/**
|
|
117
142
|
* Applies regex pattern validation to string schema when validation value is present.
|
|
@@ -119,18 +144,22 @@ const d = {
|
|
|
119
144
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
120
145
|
* @returns Schema with `.matches(regex)` applied, or unchanged schema if not applicable
|
|
121
146
|
*/
|
|
122
|
-
apply(
|
|
123
|
-
const { validation: e, getLabel:
|
|
124
|
-
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(
|
|
147
|
+
apply(r) {
|
|
148
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r;
|
|
149
|
+
if (!(e.validationType || e.type)?.requiresValue || !e.value || !(i instanceof m.StringSchema))
|
|
125
150
|
return t;
|
|
126
151
|
try {
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
152
|
+
const n = new RegExp(e.value), o = u(
|
|
153
|
+
e,
|
|
154
|
+
a,
|
|
155
|
+
a(c.PATTERN_INVALID_MESSAGE)
|
|
156
|
+
);
|
|
157
|
+
return t.matches(n, o);
|
|
158
|
+
} catch (n) {
|
|
159
|
+
return console.warn(`Invalid regex pattern: ${e.value}`, n), t;
|
|
131
160
|
}
|
|
132
161
|
}
|
|
133
|
-
},
|
|
162
|
+
}, h = {
|
|
134
163
|
validationTypeId: "fvl_custom",
|
|
135
164
|
/**
|
|
136
165
|
* Applies custom validation: for string, regex or exact match; for number, exact value match.
|
|
@@ -138,63 +167,71 @@ const d = {
|
|
|
138
167
|
* @param ctx - Context with field, getLabel, baseSchema, schema, and validation
|
|
139
168
|
* @returns Schema with custom `.test()` applied, or unchanged schema if base type not supported
|
|
140
169
|
*/
|
|
141
|
-
apply(
|
|
142
|
-
const { validation: e, getLabel:
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
|
|
170
|
+
apply(r) {
|
|
171
|
+
const { validation: e, getLabel: a, baseSchema: i, schema: t } = r, n = (e.validationType || e.type)?.requiresValue && e.value;
|
|
172
|
+
if (i instanceof m.StringSchema) {
|
|
173
|
+
const o = u(
|
|
174
|
+
e,
|
|
175
|
+
a,
|
|
176
|
+
a(c.CUSTOM_VALIDATION_MESSAGE)
|
|
177
|
+
);
|
|
178
|
+
return n ? t.test(
|
|
146
179
|
"custom",
|
|
147
|
-
|
|
148
|
-
(
|
|
149
|
-
if (!
|
|
180
|
+
o,
|
|
181
|
+
(l) => {
|
|
182
|
+
if (!l)
|
|
150
183
|
return !0;
|
|
151
184
|
try {
|
|
152
|
-
return new RegExp(e.value).test(
|
|
185
|
+
return new RegExp(e.value).test(l);
|
|
153
186
|
} catch {
|
|
154
|
-
return
|
|
187
|
+
return l === e.value;
|
|
155
188
|
}
|
|
156
189
|
}
|
|
157
190
|
) : t.test(
|
|
158
191
|
"custom",
|
|
159
|
-
|
|
160
|
-
(
|
|
192
|
+
o,
|
|
193
|
+
(l) => !l || !0
|
|
161
194
|
);
|
|
162
195
|
}
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
196
|
+
if (i instanceof m.NumberSchema && n) {
|
|
197
|
+
const o = u(
|
|
198
|
+
e,
|
|
199
|
+
a,
|
|
200
|
+
a(c.CUSTOM_VALIDATION_MESSAGE)
|
|
201
|
+
);
|
|
165
202
|
return t.test(
|
|
166
203
|
"custom",
|
|
167
|
-
|
|
168
|
-
(
|
|
169
|
-
if (
|
|
204
|
+
o,
|
|
205
|
+
(l) => {
|
|
206
|
+
if (l == null)
|
|
170
207
|
return !0;
|
|
171
|
-
const
|
|
172
|
-
return isNaN(
|
|
208
|
+
const d = parseFloat(e.value);
|
|
209
|
+
return isNaN(d) ? !0 : l === d;
|
|
173
210
|
}
|
|
174
211
|
);
|
|
175
212
|
}
|
|
176
213
|
return t;
|
|
177
214
|
}
|
|
178
|
-
},
|
|
179
|
-
[d.validationTypeId]: d,
|
|
215
|
+
}, N = {
|
|
180
216
|
[p.validationTypeId]: p,
|
|
181
217
|
[v.validationTypeId]: v,
|
|
182
218
|
[S.validationTypeId]: S,
|
|
183
|
-
[g.validationTypeId]: g,
|
|
184
219
|
[y.validationTypeId]: y,
|
|
185
|
-
[
|
|
220
|
+
[g.validationTypeId]: g,
|
|
186
221
|
[I.validationTypeId]: I,
|
|
187
|
-
[
|
|
222
|
+
[f.validationTypeId]: f,
|
|
223
|
+
[T.validationTypeId]: T,
|
|
224
|
+
[h.validationTypeId]: h
|
|
188
225
|
};
|
|
189
226
|
export {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
227
|
+
N as VALIDATION_STRATEGY_REGISTRY,
|
|
228
|
+
h as customValidationStrategy,
|
|
229
|
+
I as emailValidationStrategy,
|
|
230
|
+
v as maxLengthValidationStrategy,
|
|
231
|
+
y as maxValidationStrategy,
|
|
232
|
+
S as minLengthValidationStrategy,
|
|
196
233
|
g as minValidationStrategy,
|
|
197
|
-
|
|
198
|
-
|
|
234
|
+
T as patternValidationStrategy,
|
|
235
|
+
p as requiredValidationStrategy,
|
|
199
236
|
f as urlValidationStrategy
|
|
200
237
|
};
|
package/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Creates isOptionEqualToValue comparator for RHFAutocomplete given
|
|
3
|
-
*
|
|
2
|
+
* Creates isOptionEqualToValue comparator for RHFAutocomplete given a property path to compare.
|
|
3
|
+
* Supports dot-separated paths (e.g. "id", "user.id") via getPropertyByString.
|
|
4
|
+
* @param comparePath - Property path on T (top-level key or nested, e.g. "user.name")
|
|
4
5
|
* @returns Comparator (option, value) => boolean
|
|
5
6
|
*/
|
|
6
|
-
export declare function createIsOptionEqualToValue<T extends Record<string, unknown>>(
|
|
7
|
+
export declare function createIsOptionEqualToValue<T extends Record<string, unknown>>(comparePath: string): (option: T | T[], value: T | null) => boolean;
|
|
7
8
|
//# sourceMappingURL=createIsOptionEqualToValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIsOptionEqualToValue.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createIsOptionEqualToValue.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1E,WAAW,EAAE,MAAM,GAClB,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,CAW/C"}
|
package/components/DynamicForm/helpers/createIsOptionEqualToValue/createIsOptionEqualToValue.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getPropertyByString as n } from "@m4l/core";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return (e, t) => {
|
|
4
|
+
if (t == null)
|
|
5
|
+
return !1;
|
|
6
|
+
const u = n(t, r);
|
|
7
|
+
return Array.isArray(e) ? e.some((i) => n(i, r) === u) : n(e, r) === u;
|
|
8
|
+
};
|
|
3
9
|
}
|
|
4
10
|
export {
|
|
5
|
-
|
|
11
|
+
o as createIsOptionEqualToValue
|
|
6
12
|
};
|
|
@@ -2,8 +2,12 @@ export * from './applyRequiredValidation';
|
|
|
2
2
|
export * from './createFieldValidationSchema';
|
|
3
3
|
export * from './createIsOptionEqualToValue';
|
|
4
4
|
export * from './evaluateConditionalRule';
|
|
5
|
+
export * from './isPositiveInteger';
|
|
6
|
+
export * from './isRecord';
|
|
5
7
|
export * from './normalizeValidation';
|
|
8
|
+
export * from './resolveValidationErrorMessage';
|
|
6
9
|
export * from './resolveFieldComponent';
|
|
10
|
+
export * from './resolveFieldInputLabel';
|
|
7
11
|
export * from './resolveInitialValue';
|
|
8
12
|
export * from './stringifyJsonFieldsForSubmit';
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` is a finite integer ≥ 1 (e.g. row counts, positive dimensions from the API).
|
|
3
|
+
* @param value - Unknown input from `rhfComponentProps` or similar.
|
|
4
|
+
* @returns True if `value` is a positive integer.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isPositiveInteger(value: unknown): value is number;
|
|
7
|
+
//# sourceMappingURL=isPositiveInteger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPositiveInteger.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/helpers/isPositiveInteger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEjE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` is a non-null plain object (not an array).
|
|
3
|
+
* @param value - Unknown input from the API or form metadata.
|
|
4
|
+
* @returns True if `value` is a plain object record.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
7
|
+
//# sourceMappingURL=isRecord.d.ts.map
|