@flowerforce/flower-react 3.1.2-beta.3 → 3.1.2-beta.4
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/README.md
CHANGED
package/dist/index.cjs.js
CHANGED
@@ -45,9 +45,13 @@ const getDataByFlow = (name) => reselect.createSelector(selectFlower(name), flow
|
|
45
45
|
// selettore per recuperare i dati di un flow specifico e id specifico
|
46
46
|
const getDataFromState = (name, id) => reselect.createSelector(getDataByFlow(name), flowerCore.Selectors.getDataFromState(id));
|
47
47
|
const makeSelectNodeErrors = (name, currentNodeId) => reselect.createSelector(selectFlowerFormNode(name, currentNodeId), flowerCore.Selectors.makeSelectNodeErrors);
|
48
|
+
const makeSelectNodeFieldTouched = (name, currentNodeId, fieldId) => reselect.createSelector(selectFlowerFormNode(name, currentNodeId), flowerCore.Selectors.makeSelectNodeFormFieldTouched(fieldId));
|
48
49
|
const makeSelectNodeFormTouched = (name, currentNodeId) => reselect.createSelector(selectFlowerFormNode(name, currentNodeId), flowerCore.Selectors.makeSelectNodeFormTouched);
|
49
50
|
const getAllData = reselect.createSelector(selectGlobal, mapData);
|
50
|
-
const
|
51
|
+
const selectFlowerFormCurrentNode = (name) => reselect.createSelector(selectFlower(name), makeSelectCurrentNodeId(name), (data, current) => {
|
52
|
+
return _get(data, ['form', current]);
|
53
|
+
});
|
54
|
+
const makeSelectFieldError = (name, id, validate) => reselect.createSelector(getAllData, selectFlowerFormCurrentNode(name), flowerCore.Selectors.makeSelectFieldError(name, id, validate));
|
51
55
|
const selectorRulesDisabled = (id, rules, keys, flowName, value, currentNode) => reselect.createSelector(getAllData, makeSelectNodeErrors(flowName, currentNode), flowerCore.Selectors.selectorRulesDisabled(id, rules, keys, flowName, value));
|
52
56
|
|
53
57
|
//TODO check reduxContext type due to remove all any types
|
@@ -399,14 +403,25 @@ function isIntrinsicElement$1(x) {
|
|
399
403
|
//TODO make types for wrapper function props
|
400
404
|
function Wrapper$1({ Component, id, flowName, currentNode, validate, asyncDebounce = 0, asyncValidate, asyncInitialError, asyncWaitingError, destroyValue, onBlur = (val) => null, hidden, onUpdate, defaultValue, ...props }) {
|
401
405
|
const dispatch = useDispatch();
|
402
|
-
const [touched, setTouched] = React.useState();
|
403
406
|
const [customErrors, setCustomErrors] = React.useState(asyncValidate && [asyncInitialError]);
|
404
407
|
const [isValidating, setIsValidating] = React.useState(undefined);
|
405
408
|
const { flowNameFromPath = flowName, path } = React.useMemo(() => flowerCore.CoreUtils.getPath(id), [id]);
|
406
409
|
const value = useSelector(getDataFromState(flowNameFromPath, path));
|
407
410
|
const errors = useSelector(makeSelectFieldError(flowName, id, validate), flowerCore.CoreUtils.allEqual);
|
411
|
+
const touched = useSelector(makeSelectNodeFieldTouched(flowName, currentNode, id));
|
408
412
|
const refValue = React.useRef();
|
409
413
|
const one = React.useRef();
|
414
|
+
const setTouched = React.useCallback((touched) => {
|
415
|
+
dispatch({
|
416
|
+
type: 'flower/formFieldTouch',
|
417
|
+
payload: {
|
418
|
+
name: flowName,
|
419
|
+
id,
|
420
|
+
currentNode,
|
421
|
+
touched
|
422
|
+
}
|
423
|
+
});
|
424
|
+
}, [dispatch, flowName, currentNode, id]);
|
410
425
|
const validateFn = React.useCallback(async (value) => {
|
411
426
|
if (asyncWaitingError) {
|
412
427
|
setCustomErrors([asyncWaitingError]);
|
@@ -466,7 +481,7 @@ function Wrapper$1({ Component, id, flowName, currentNode, validate, asyncDeboun
|
|
466
481
|
errors: allErrors
|
467
482
|
}
|
468
483
|
});
|
469
|
-
}, [id, flowName, allErrors, currentNode]);
|
484
|
+
}, [id, flowName, allErrors, currentNode, touched]);
|
470
485
|
React.useEffect(() => {
|
471
486
|
dispatch({
|
472
487
|
type: 'flower/setFormIsValidating',
|
@@ -823,9 +838,11 @@ const component = React.memo(FlowerComponent);
|
|
823
838
|
*
|
824
839
|
* - replaceData
|
825
840
|
*
|
841
|
+
* - unTouched
|
842
|
+
*
|
826
843
|
* @param {string} flowName - first optional parameter
|
827
844
|
*
|
828
|
-
* @param {string} name - optional parameter, if flowName exist, name is not used
|
845
|
+
* @param {string} name - alias optional parameter, if flowName exist, name is not used
|
829
846
|
*
|
830
847
|
*/
|
831
848
|
const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
@@ -834,7 +851,7 @@ const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
|
834
851
|
const store = useStore();
|
835
852
|
const flowName = customFlowName || name || flowNameDefault || '';
|
836
853
|
const currentNode = useSelector(makeSelectCurrentNodeId(flowName));
|
837
|
-
const { errors, isValid, touched, isValidating } = useSelector(makeSelectNodeErrors(flowName, currentNode));
|
854
|
+
const { errors, customErrors, isValid, touched, isValidating } = useSelector(makeSelectNodeErrors(flowName, currentNode));
|
838
855
|
const getData = React.useCallback((path) => {
|
839
856
|
const { flowNameFromPath = flowName, path: newpath } = flowerCore.CoreUtils.getPath(path);
|
840
857
|
return _get(store.getState(), [
|
@@ -863,15 +880,32 @@ const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
|
863
880
|
const replaceData = React.useCallback((val) => {
|
864
881
|
dispatch(actions.replaceData({ flowName, value: val }));
|
865
882
|
}, [flowName, dispatch]);
|
883
|
+
const reset = React.useCallback((nodeId) => {
|
884
|
+
dispatch(actions.resetForm({ flowName, id: nodeId || currentNode }));
|
885
|
+
}, [flowName, currentNode, dispatch]);
|
886
|
+
const setCustomErrors = React.useCallback((field, errors, nodeId) => {
|
887
|
+
dispatch({
|
888
|
+
type: 'flower/formAddCustomErrors',
|
889
|
+
payload: {
|
890
|
+
name: flowName,
|
891
|
+
id: field,
|
892
|
+
currentNode: nodeId || currentNode,
|
893
|
+
errors
|
894
|
+
}
|
895
|
+
});
|
896
|
+
}, [flowName, currentNode, dispatch]);
|
866
897
|
return {
|
867
898
|
touched,
|
868
899
|
errors,
|
900
|
+
customErrors,
|
869
901
|
isValid,
|
870
902
|
isValidating,
|
871
903
|
getData,
|
872
904
|
setData,
|
873
905
|
unsetData,
|
874
|
-
replaceData
|
906
|
+
replaceData,
|
907
|
+
reset,
|
908
|
+
setCustomErrors
|
875
909
|
};
|
876
910
|
};
|
877
911
|
|
package/dist/index.esm.js
CHANGED
@@ -43,9 +43,13 @@ const getDataByFlow = (name) => createSelector(selectFlower(name), Selectors.get
|
|
43
43
|
// selettore per recuperare i dati di un flow specifico e id specifico
|
44
44
|
const getDataFromState = (name, id) => createSelector(getDataByFlow(name), Selectors.getDataFromState(id));
|
45
45
|
const makeSelectNodeErrors = (name, currentNodeId) => createSelector(selectFlowerFormNode(name, currentNodeId), Selectors.makeSelectNodeErrors);
|
46
|
+
const makeSelectNodeFieldTouched = (name, currentNodeId, fieldId) => createSelector(selectFlowerFormNode(name, currentNodeId), Selectors.makeSelectNodeFormFieldTouched(fieldId));
|
46
47
|
const makeSelectNodeFormTouched = (name, currentNodeId) => createSelector(selectFlowerFormNode(name, currentNodeId), Selectors.makeSelectNodeFormTouched);
|
47
48
|
const getAllData = createSelector(selectGlobal, mapData);
|
48
|
-
const
|
49
|
+
const selectFlowerFormCurrentNode = (name) => createSelector(selectFlower(name), makeSelectCurrentNodeId(name), (data, current) => {
|
50
|
+
return _get(data, ['form', current]);
|
51
|
+
});
|
52
|
+
const makeSelectFieldError = (name, id, validate) => createSelector(getAllData, selectFlowerFormCurrentNode(name), Selectors.makeSelectFieldError(name, id, validate));
|
49
53
|
const selectorRulesDisabled = (id, rules, keys, flowName, value, currentNode) => createSelector(getAllData, makeSelectNodeErrors(flowName, currentNode), Selectors.selectorRulesDisabled(id, rules, keys, flowName, value));
|
50
54
|
|
51
55
|
//TODO check reduxContext type due to remove all any types
|
@@ -397,14 +401,25 @@ function isIntrinsicElement$1(x) {
|
|
397
401
|
//TODO make types for wrapper function props
|
398
402
|
function Wrapper$1({ Component, id, flowName, currentNode, validate, asyncDebounce = 0, asyncValidate, asyncInitialError, asyncWaitingError, destroyValue, onBlur = (val) => null, hidden, onUpdate, defaultValue, ...props }) {
|
399
403
|
const dispatch = useDispatch();
|
400
|
-
const [touched, setTouched] = useState();
|
401
404
|
const [customErrors, setCustomErrors] = useState(asyncValidate && [asyncInitialError]);
|
402
405
|
const [isValidating, setIsValidating] = useState(undefined);
|
403
406
|
const { flowNameFromPath = flowName, path } = useMemo(() => CoreUtils.getPath(id), [id]);
|
404
407
|
const value = useSelector(getDataFromState(flowNameFromPath, path));
|
405
408
|
const errors = useSelector(makeSelectFieldError(flowName, id, validate), CoreUtils.allEqual);
|
409
|
+
const touched = useSelector(makeSelectNodeFieldTouched(flowName, currentNode, id));
|
406
410
|
const refValue = useRef();
|
407
411
|
const one = useRef();
|
412
|
+
const setTouched = useCallback((touched) => {
|
413
|
+
dispatch({
|
414
|
+
type: 'flower/formFieldTouch',
|
415
|
+
payload: {
|
416
|
+
name: flowName,
|
417
|
+
id,
|
418
|
+
currentNode,
|
419
|
+
touched
|
420
|
+
}
|
421
|
+
});
|
422
|
+
}, [dispatch, flowName, currentNode, id]);
|
408
423
|
const validateFn = useCallback(async (value) => {
|
409
424
|
if (asyncWaitingError) {
|
410
425
|
setCustomErrors([asyncWaitingError]);
|
@@ -464,7 +479,7 @@ function Wrapper$1({ Component, id, flowName, currentNode, validate, asyncDeboun
|
|
464
479
|
errors: allErrors
|
465
480
|
}
|
466
481
|
});
|
467
|
-
}, [id, flowName, allErrors, currentNode]);
|
482
|
+
}, [id, flowName, allErrors, currentNode, touched]);
|
468
483
|
useEffect(() => {
|
469
484
|
dispatch({
|
470
485
|
type: 'flower/setFormIsValidating',
|
@@ -821,9 +836,11 @@ const component = memo(FlowerComponent);
|
|
821
836
|
*
|
822
837
|
* - replaceData
|
823
838
|
*
|
839
|
+
* - unTouched
|
840
|
+
*
|
824
841
|
* @param {string} flowName - first optional parameter
|
825
842
|
*
|
826
|
-
* @param {string} name - optional parameter, if flowName exist, name is not used
|
843
|
+
* @param {string} name - alias optional parameter, if flowName exist, name is not used
|
827
844
|
*
|
828
845
|
*/
|
829
846
|
const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
@@ -832,7 +849,7 @@ const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
|
832
849
|
const store = useStore();
|
833
850
|
const flowName = customFlowName || name || flowNameDefault || '';
|
834
851
|
const currentNode = useSelector(makeSelectCurrentNodeId(flowName));
|
835
|
-
const { errors, isValid, touched, isValidating } = useSelector(makeSelectNodeErrors(flowName, currentNode));
|
852
|
+
const { errors, customErrors, isValid, touched, isValidating } = useSelector(makeSelectNodeErrors(flowName, currentNode));
|
836
853
|
const getData = useCallback((path) => {
|
837
854
|
const { flowNameFromPath = flowName, path: newpath } = CoreUtils.getPath(path);
|
838
855
|
return _get(store.getState(), [
|
@@ -861,15 +878,32 @@ const useFlowerForm = ({ flowName: customFlowName, name } = {}) => {
|
|
861
878
|
const replaceData = useCallback((val) => {
|
862
879
|
dispatch(actions.replaceData({ flowName, value: val }));
|
863
880
|
}, [flowName, dispatch]);
|
881
|
+
const reset = useCallback((nodeId) => {
|
882
|
+
dispatch(actions.resetForm({ flowName, id: nodeId || currentNode }));
|
883
|
+
}, [flowName, currentNode, dispatch]);
|
884
|
+
const setCustomErrors = useCallback((field, errors, nodeId) => {
|
885
|
+
dispatch({
|
886
|
+
type: 'flower/formAddCustomErrors',
|
887
|
+
payload: {
|
888
|
+
name: flowName,
|
889
|
+
id: field,
|
890
|
+
currentNode: nodeId || currentNode,
|
891
|
+
errors
|
892
|
+
}
|
893
|
+
});
|
894
|
+
}, [flowName, currentNode, dispatch]);
|
864
895
|
return {
|
865
896
|
touched,
|
866
897
|
errors,
|
898
|
+
customErrors,
|
867
899
|
isValid,
|
868
900
|
isValidating,
|
869
901
|
getData,
|
870
902
|
setData,
|
871
903
|
unsetData,
|
872
|
-
replaceData
|
904
|
+
replaceData,
|
905
|
+
reset,
|
906
|
+
setCustomErrors
|
873
907
|
};
|
874
908
|
};
|
875
909
|
|
@@ -7,6 +7,8 @@ export type UseFlowerForm = (options?: UseFlowerProps) => {
|
|
7
7
|
touched: boolean;
|
8
8
|
/** An object containing all the form errors */
|
9
9
|
errors: Record<string, any>;
|
10
|
+
/** An object containing all the form custom errors */
|
11
|
+
customErrors: Record<string, any>;
|
10
12
|
/** This value is set to true when all the validation rules are satisfied and the form is valid*/
|
11
13
|
isValid: boolean;
|
12
14
|
/** This value is set to true during asynchronous validation.*/
|
@@ -25,6 +27,10 @@ export type UseFlowerForm = (options?: UseFlowerProps) => {
|
|
25
27
|
path: string) => void;
|
26
28
|
/** Use this function to replace a value in the flow's data. */
|
27
29
|
replaceData: (value: any) => void;
|
30
|
+
/**Use this function to reset errors form and touched state */
|
31
|
+
reset: (nodeId?: string) => void;
|
32
|
+
/**this function to set a custom error on a specific field */
|
33
|
+
setCustomErrors: (field: string, errors: string[], nodeId?: string) => void;
|
28
34
|
};
|
29
35
|
type useFlowerActions = {
|
30
36
|
/** Use this function to move to the next node inside the flow*/
|
@@ -11,9 +11,11 @@ import { UseFlowerForm } from './types/FlowerHooks';
|
|
11
11
|
*
|
12
12
|
* - replaceData
|
13
13
|
*
|
14
|
+
* - unTouched
|
15
|
+
*
|
14
16
|
* @param {string} flowName - first optional parameter
|
15
17
|
*
|
16
|
-
* @param {string} name - optional parameter, if flowName exist, name is not used
|
18
|
+
* @param {string} name - alias optional parameter, if flowName exist, name is not used
|
17
19
|
*
|
18
20
|
*/
|
19
21
|
declare const useFlowerForm: UseFlowerForm;
|
package/dist/src/selectors.d.ts
CHANGED
@@ -930,6 +930,7 @@ declare const makeSelectNodeErrors: (name: string, currentNodeId: string) => ((s
|
|
930
930
|
}) => {
|
931
931
|
touched: boolean;
|
932
932
|
errors: any;
|
933
|
+
customErrors: any;
|
933
934
|
isValid: boolean;
|
934
935
|
isValidating?: boolean | undefined;
|
935
936
|
}) & {
|
@@ -940,12 +941,14 @@ declare const makeSelectNodeErrors: (name: string, currentNodeId: string) => ((s
|
|
940
941
|
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => {
|
941
942
|
touched: boolean;
|
942
943
|
errors: any;
|
944
|
+
customErrors: any;
|
943
945
|
isValid: boolean;
|
944
946
|
isValidating?: boolean | undefined;
|
945
947
|
};
|
946
948
|
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => {
|
947
949
|
touched: boolean;
|
948
950
|
errors: any;
|
951
|
+
customErrors: any;
|
949
952
|
isValid: boolean;
|
950
953
|
isValidating?: boolean | undefined;
|
951
954
|
}) & {
|
@@ -956,6 +959,7 @@ declare const makeSelectNodeErrors: (name: string, currentNodeId: string) => ((s
|
|
956
959
|
lastResult: () => {
|
957
960
|
touched: boolean;
|
958
961
|
errors: any;
|
962
|
+
customErrors: any;
|
959
963
|
isValid: boolean;
|
960
964
|
isValidating?: boolean | undefined;
|
961
965
|
};
|
@@ -1026,6 +1030,89 @@ declare const makeSelectNodeErrors: (name: string, currentNodeId: string) => ((s
|
|
1026
1030
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1027
1031
|
memoize: typeof import("reselect").weakMapMemoize;
|
1028
1032
|
};
|
1033
|
+
declare const makeSelectNodeFieldTouched: (name: string, currentNodeId: string, fieldId: string) => ((state: {
|
1034
|
+
flower: {
|
1035
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1036
|
+
};
|
1037
|
+
}) => boolean | undefined) & {
|
1038
|
+
clearCache: () => void;
|
1039
|
+
resultsCount: () => number;
|
1040
|
+
resetResultsCount: () => void;
|
1041
|
+
} & {
|
1042
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => boolean | undefined;
|
1043
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => boolean | undefined) & {
|
1044
|
+
clearCache: () => void;
|
1045
|
+
resultsCount: () => number;
|
1046
|
+
resetResultsCount: () => void;
|
1047
|
+
};
|
1048
|
+
lastResult: () => boolean | undefined;
|
1049
|
+
dependencies: [((state: {
|
1050
|
+
flower: {
|
1051
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1052
|
+
};
|
1053
|
+
}) => import("@flowerforce/flower-core").Form<Record<string, any>>) & {
|
1054
|
+
clearCache: () => void;
|
1055
|
+
resultsCount: () => number;
|
1056
|
+
resetResultsCount: () => void;
|
1057
|
+
} & {
|
1058
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => import("@flowerforce/flower-core").Form<Record<string, any>>;
|
1059
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => import("@flowerforce/flower-core").Form<Record<string, any>>) & {
|
1060
|
+
clearCache: () => void;
|
1061
|
+
resultsCount: () => number;
|
1062
|
+
resetResultsCount: () => void;
|
1063
|
+
};
|
1064
|
+
lastResult: () => import("@flowerforce/flower-core").Form<Record<string, any>>;
|
1065
|
+
dependencies: [((state: {
|
1066
|
+
flower: {
|
1067
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1068
|
+
};
|
1069
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1070
|
+
clearCache: () => void;
|
1071
|
+
resultsCount: () => number;
|
1072
|
+
resetResultsCount: () => void;
|
1073
|
+
} & {
|
1074
|
+
resultFunc: (resultFuncArgs_0: {
|
1075
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1076
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1077
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
1078
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1079
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1080
|
+
clearCache: () => void;
|
1081
|
+
resultsCount: () => number;
|
1082
|
+
resetResultsCount: () => void;
|
1083
|
+
};
|
1084
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1085
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
1086
|
+
flower: {
|
1087
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1088
|
+
};
|
1089
|
+
}) => {
|
1090
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1091
|
+
}];
|
1092
|
+
recomputations: () => number;
|
1093
|
+
resetRecomputations: () => void;
|
1094
|
+
dependencyRecomputations: () => number;
|
1095
|
+
resetDependencyRecomputations: () => void;
|
1096
|
+
} & {
|
1097
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1098
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1099
|
+
}];
|
1100
|
+
recomputations: () => number;
|
1101
|
+
resetRecomputations: () => void;
|
1102
|
+
dependencyRecomputations: () => number;
|
1103
|
+
resetDependencyRecomputations: () => void;
|
1104
|
+
} & {
|
1105
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1106
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1107
|
+
}];
|
1108
|
+
recomputations: () => number;
|
1109
|
+
resetRecomputations: () => void;
|
1110
|
+
dependencyRecomputations: () => number;
|
1111
|
+
resetDependencyRecomputations: () => void;
|
1112
|
+
} & {
|
1113
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1114
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1115
|
+
};
|
1029
1116
|
declare const makeSelectNodeFormTouched: (name: string, currentNodeId: string) => ((state: {
|
1030
1117
|
flower: {
|
1031
1118
|
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
@@ -1153,8 +1240,8 @@ declare const makeSelectFieldError: (name: string, id: string, validate: any) =>
|
|
1153
1240
|
resultsCount: () => number;
|
1154
1241
|
resetResultsCount: () => void;
|
1155
1242
|
} & {
|
1156
|
-
resultFunc: (resultFuncArgs_0: Record<string, any> | undefined) => string[];
|
1157
|
-
memoizedResultFunc: ((resultFuncArgs_0: Record<string, any> | undefined) => string[]) & {
|
1243
|
+
resultFunc: (resultFuncArgs_0: Record<string, any> | undefined, resultFuncArgs_1: import("@flowerforce/flower-core").Form<Record<string, any>>) => string[];
|
1244
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<string, any> | undefined, resultFuncArgs_1: import("@flowerforce/flower-core").Form<Record<string, any>>) => string[]) & {
|
1158
1245
|
clearCache: () => void;
|
1159
1246
|
resultsCount: () => number;
|
1160
1247
|
resetResultsCount: () => void;
|
@@ -1194,6 +1281,180 @@ declare const makeSelectFieldError: (name: string, id: string, validate: any) =>
|
|
1194
1281
|
} & {
|
1195
1282
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1196
1283
|
memoize: typeof import("reselect").weakMapMemoize;
|
1284
|
+
}, ((state: {
|
1285
|
+
flower: {
|
1286
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1287
|
+
};
|
1288
|
+
}) => import("@flowerforce/flower-core").Form<Record<string, any>>) & {
|
1289
|
+
clearCache: () => void;
|
1290
|
+
resultsCount: () => number;
|
1291
|
+
resetResultsCount: () => void;
|
1292
|
+
} & {
|
1293
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => import("@flowerforce/flower-core").Form<Record<string, any>>;
|
1294
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => import("@flowerforce/flower-core").Form<Record<string, any>>) & {
|
1295
|
+
clearCache: () => void;
|
1296
|
+
resultsCount: () => number;
|
1297
|
+
resetResultsCount: () => void;
|
1298
|
+
};
|
1299
|
+
lastResult: () => import("@flowerforce/flower-core").Form<Record<string, any>>;
|
1300
|
+
dependencies: [((state: {
|
1301
|
+
flower: {
|
1302
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1303
|
+
};
|
1304
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1305
|
+
clearCache: () => void;
|
1306
|
+
resultsCount: () => number;
|
1307
|
+
resetResultsCount: () => void;
|
1308
|
+
} & {
|
1309
|
+
resultFunc: (resultFuncArgs_0: {
|
1310
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1311
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1312
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
1313
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1314
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1315
|
+
clearCache: () => void;
|
1316
|
+
resultsCount: () => number;
|
1317
|
+
resetResultsCount: () => void;
|
1318
|
+
};
|
1319
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1320
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
1321
|
+
flower: {
|
1322
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1323
|
+
};
|
1324
|
+
}) => {
|
1325
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1326
|
+
}];
|
1327
|
+
recomputations: () => number;
|
1328
|
+
resetRecomputations: () => void;
|
1329
|
+
dependencyRecomputations: () => number;
|
1330
|
+
resetDependencyRecomputations: () => void;
|
1331
|
+
} & {
|
1332
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1333
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1334
|
+
}, ((state: {
|
1335
|
+
flower: {
|
1336
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1337
|
+
};
|
1338
|
+
}) => string) & {
|
1339
|
+
clearCache: () => void;
|
1340
|
+
resultsCount: () => number;
|
1341
|
+
resetResultsCount: () => void;
|
1342
|
+
} & {
|
1343
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => string;
|
1344
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => string) & {
|
1345
|
+
clearCache: () => void;
|
1346
|
+
resultsCount: () => number;
|
1347
|
+
resetResultsCount: () => void;
|
1348
|
+
};
|
1349
|
+
lastResult: () => string;
|
1350
|
+
dependencies: [((state: {
|
1351
|
+
flower: {
|
1352
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1353
|
+
};
|
1354
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1355
|
+
clearCache: () => void;
|
1356
|
+
resultsCount: () => number;
|
1357
|
+
resetResultsCount: () => void;
|
1358
|
+
} & {
|
1359
|
+
resultFunc: (resultFuncArgs_0: {
|
1360
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1361
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1362
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
1363
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1364
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1365
|
+
clearCache: () => void;
|
1366
|
+
resultsCount: () => number;
|
1367
|
+
resetResultsCount: () => void;
|
1368
|
+
};
|
1369
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1370
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
1371
|
+
flower: {
|
1372
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1373
|
+
};
|
1374
|
+
}) => {
|
1375
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1376
|
+
}];
|
1377
|
+
recomputations: () => number;
|
1378
|
+
resetRecomputations: () => void;
|
1379
|
+
dependencyRecomputations: () => number;
|
1380
|
+
resetDependencyRecomputations: () => void;
|
1381
|
+
} & {
|
1382
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1383
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1384
|
+
}, ((state: {
|
1385
|
+
flower: {
|
1386
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1387
|
+
};
|
1388
|
+
}) => string) & {
|
1389
|
+
clearCache: () => void;
|
1390
|
+
resultsCount: () => number;
|
1391
|
+
resetResultsCount: () => void;
|
1392
|
+
} & {
|
1393
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => string;
|
1394
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => string) & {
|
1395
|
+
clearCache: () => void;
|
1396
|
+
resultsCount: () => number;
|
1397
|
+
resetResultsCount: () => void;
|
1398
|
+
};
|
1399
|
+
lastResult: () => string;
|
1400
|
+
dependencies: [((state: {
|
1401
|
+
flower: {
|
1402
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1403
|
+
};
|
1404
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1405
|
+
clearCache: () => void;
|
1406
|
+
resultsCount: () => number;
|
1407
|
+
resetResultsCount: () => void;
|
1408
|
+
} & {
|
1409
|
+
resultFunc: (resultFuncArgs_0: {
|
1410
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1411
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1412
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
1413
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1414
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
1415
|
+
clearCache: () => void;
|
1416
|
+
resultsCount: () => number;
|
1417
|
+
resetResultsCount: () => void;
|
1418
|
+
};
|
1419
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
1420
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
1421
|
+
flower: {
|
1422
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1423
|
+
};
|
1424
|
+
}) => {
|
1425
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
1426
|
+
}];
|
1427
|
+
recomputations: () => number;
|
1428
|
+
resetRecomputations: () => void;
|
1429
|
+
dependencyRecomputations: () => number;
|
1430
|
+
resetDependencyRecomputations: () => void;
|
1431
|
+
} & {
|
1432
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1433
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1434
|
+
}];
|
1435
|
+
recomputations: () => number;
|
1436
|
+
resetRecomputations: () => void;
|
1437
|
+
dependencyRecomputations: () => number;
|
1438
|
+
resetDependencyRecomputations: () => void;
|
1439
|
+
} & {
|
1440
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1441
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1442
|
+
}];
|
1443
|
+
recomputations: () => number;
|
1444
|
+
resetRecomputations: () => void;
|
1445
|
+
dependencyRecomputations: () => number;
|
1446
|
+
resetDependencyRecomputations: () => void;
|
1447
|
+
} & {
|
1448
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1449
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1450
|
+
}];
|
1451
|
+
recomputations: () => number;
|
1452
|
+
resetRecomputations: () => void;
|
1453
|
+
dependencyRecomputations: () => number;
|
1454
|
+
resetDependencyRecomputations: () => void;
|
1455
|
+
} & {
|
1456
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1457
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
1197
1458
|
}];
|
1198
1459
|
recomputations: () => number;
|
1199
1460
|
resetRecomputations: () => void;
|
@@ -1215,12 +1476,14 @@ export declare const selectorRulesDisabled: (id: string, rules: RulesObject<any>
|
|
1215
1476
|
resultFunc: (resultFuncArgs_0: Record<string, any> | undefined, resultFuncArgs_1: {
|
1216
1477
|
touched: boolean;
|
1217
1478
|
errors: any;
|
1479
|
+
customErrors: any;
|
1218
1480
|
isValid: boolean;
|
1219
1481
|
isValidating?: boolean | undefined;
|
1220
1482
|
}) => boolean;
|
1221
1483
|
memoizedResultFunc: ((resultFuncArgs_0: Record<string, any> | undefined, resultFuncArgs_1: {
|
1222
1484
|
touched: boolean;
|
1223
1485
|
errors: any;
|
1486
|
+
customErrors: any;
|
1224
1487
|
isValid: boolean;
|
1225
1488
|
isValidating?: boolean | undefined;
|
1226
1489
|
}) => boolean) & {
|
@@ -1270,6 +1533,7 @@ export declare const selectorRulesDisabled: (id: string, rules: RulesObject<any>
|
|
1270
1533
|
}) => {
|
1271
1534
|
touched: boolean;
|
1272
1535
|
errors: any;
|
1536
|
+
customErrors: any;
|
1273
1537
|
isValid: boolean;
|
1274
1538
|
isValidating?: boolean | undefined;
|
1275
1539
|
}) & {
|
@@ -1280,12 +1544,14 @@ export declare const selectorRulesDisabled: (id: string, rules: RulesObject<any>
|
|
1280
1544
|
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => {
|
1281
1545
|
touched: boolean;
|
1282
1546
|
errors: any;
|
1547
|
+
customErrors: any;
|
1283
1548
|
isValid: boolean;
|
1284
1549
|
isValidating?: boolean | undefined;
|
1285
1550
|
};
|
1286
1551
|
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Form<Record<string, any>>) => {
|
1287
1552
|
touched: boolean;
|
1288
1553
|
errors: any;
|
1554
|
+
customErrors: any;
|
1289
1555
|
isValid: boolean;
|
1290
1556
|
isValidating?: boolean | undefined;
|
1291
1557
|
}) & {
|
@@ -1296,6 +1562,7 @@ export declare const selectorRulesDisabled: (id: string, rules: RulesObject<any>
|
|
1296
1562
|
lastResult: () => {
|
1297
1563
|
touched: boolean;
|
1298
1564
|
errors: any;
|
1565
|
+
customErrors: any;
|
1299
1566
|
isValid: boolean;
|
1300
1567
|
isValidating?: boolean | undefined;
|
1301
1568
|
};
|
@@ -1374,4 +1641,4 @@ export declare const selectorRulesDisabled: (id: string, rules: RulesObject<any>
|
|
1374
1641
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
1375
1642
|
memoize: typeof import("reselect").weakMapMemoize;
|
1376
1643
|
};
|
1377
|
-
export { selectFlowerHistory, makeSelectNodesIds, makeSelectCurrentNodeId, makeSelectStartNodeId, makeSelectCurrentNodeDisabled, getAllData, getDataByFlow, getDataFromState, makeSelectNodeErrors, makeSelectFieldError, makeSelectNodeFormTouched, makeSelectPrevNodeRetain };
|
1644
|
+
export { selectFlowerHistory, makeSelectNodesIds, makeSelectCurrentNodeId, makeSelectStartNodeId, makeSelectCurrentNodeDisabled, getAllData, getDataByFlow, getDataFromState, makeSelectNodeErrors, makeSelectNodeFieldTouched, makeSelectFieldError, makeSelectNodeFormTouched, makeSelectPrevNodeRetain };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flowerforce/flower-react",
|
3
|
-
"version": "3.1.2-beta.
|
3
|
+
"version": "3.1.2-beta.4",
|
4
4
|
"description": "FlowerJS components, hooks and utils for React.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"typescript": "^5.4.5"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@flowerforce/flower-core": "3.1.2-beta.
|
37
|
+
"@flowerforce/flower-core": "3.1.2-beta.4",
|
38
38
|
"@reduxjs/toolkit": "^2.2.4",
|
39
39
|
"lodash": "^4.17.21",
|
40
40
|
"react-redux": "^9.1.2",
|