@awesome-flow/noise 0.5.0 → 0.6.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/dist/abstract/index.cjs +40 -37
- package/dist/abstract/index.js +50 -47
- package/dist/nodes/index.cjs +40 -37
- package/dist/nodes/index.js +50 -47
- package/dist/nodes/modifiers/index.cjs +40 -37
- package/dist/nodes/modifiers/index.js +50 -47
- package/package.json +3 -3
package/dist/nodes/index.cjs
CHANGED
|
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
));
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
|
|
32
|
-
// ../../node_modules/fast-deep-equal/index.js
|
|
32
|
+
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
33
33
|
var require_fast_deep_equal = __commonJS({
|
|
34
|
-
"../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
|
34
|
+
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
|
35
35
|
"use strict";
|
|
36
36
|
module2.exports = function equal(a, b) {
|
|
37
37
|
if (a === b)
|
|
@@ -646,10 +646,10 @@ var import_layout16 = require("@awesome-flow/core/layout");
|
|
|
646
646
|
var import_core6 = require("@mantine/core");
|
|
647
647
|
var import_hooks16 = require("@awesome-flow/core/hooks");
|
|
648
648
|
|
|
649
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
649
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
650
650
|
var import_react23 = require("react");
|
|
651
651
|
|
|
652
|
-
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
652
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
653
653
|
var import_react17 = require("react");
|
|
654
654
|
function validateFormName(name) {
|
|
655
655
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
@@ -730,7 +730,7 @@ function useFormActions(name, form) {
|
|
|
730
730
|
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
731
731
|
}
|
|
732
732
|
|
|
733
|
-
// ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
733
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
734
734
|
function getInputOnChange(setValue) {
|
|
735
735
|
return (val) => {
|
|
736
736
|
if (!val) {
|
|
@@ -754,10 +754,10 @@ function getInputOnChange(setValue) {
|
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
757
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
758
758
|
var import_react18 = require("react");
|
|
759
759
|
|
|
760
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
760
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
761
761
|
function filterErrors(errors) {
|
|
762
762
|
if (errors === null || typeof errors !== "object") {
|
|
763
763
|
return {};
|
|
@@ -771,18 +771,21 @@ function filterErrors(errors) {
|
|
|
771
771
|
}, {});
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
774
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
775
775
|
function useFormErrors(initialErrors) {
|
|
776
776
|
const [errorsState, setErrorsState] = (0, import_react18.useState)(filterErrors(initialErrors));
|
|
777
|
+
const errorsRef = (0, import_react18.useRef)(errorsState);
|
|
777
778
|
const setErrors = (0, import_react18.useCallback)((errors) => {
|
|
778
|
-
setErrorsState(
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
setErrorsState((current) => {
|
|
780
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
781
|
+
errorsRef.current = newErrors;
|
|
782
|
+
return newErrors;
|
|
783
|
+
});
|
|
781
784
|
}, []);
|
|
782
|
-
const clearErrors = (0, import_react18.useCallback)(() =>
|
|
785
|
+
const clearErrors = (0, import_react18.useCallback)(() => setErrors({}), []);
|
|
783
786
|
const clearFieldError = (0, import_react18.useCallback)(
|
|
784
787
|
(path) => {
|
|
785
|
-
if (
|
|
788
|
+
if (errorsRef.current[path] === void 0) {
|
|
786
789
|
return;
|
|
787
790
|
}
|
|
788
791
|
setErrors((current) => {
|
|
@@ -797,7 +800,7 @@ function useFormErrors(initialErrors) {
|
|
|
797
800
|
(path, error) => {
|
|
798
801
|
if (error == null || error === false) {
|
|
799
802
|
clearFieldError(path);
|
|
800
|
-
} else if (
|
|
803
|
+
} else if (errorsRef.current[path] !== error) {
|
|
801
804
|
setErrors((current) => ({ ...current, [path]: error }));
|
|
802
805
|
}
|
|
803
806
|
},
|
|
@@ -812,10 +815,10 @@ function useFormErrors(initialErrors) {
|
|
|
812
815
|
};
|
|
813
816
|
}
|
|
814
817
|
|
|
815
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
818
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
816
819
|
var import_react19 = require("react");
|
|
817
820
|
|
|
818
|
-
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
821
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
819
822
|
function clearListState(field, state) {
|
|
820
823
|
if (state === null || typeof state !== "object") {
|
|
821
824
|
return {};
|
|
@@ -829,7 +832,7 @@ function clearListState(field, state) {
|
|
|
829
832
|
return clone;
|
|
830
833
|
}
|
|
831
834
|
|
|
832
|
-
// ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
835
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
833
836
|
function getIndexFromKeyAfterPath(key, path) {
|
|
834
837
|
const split = key.substring(path.length + 1).split(".")[0];
|
|
835
838
|
return parseInt(split, 10);
|
|
@@ -869,7 +872,7 @@ function changeErrorIndices(path, index, errors, change) {
|
|
|
869
872
|
return cloned;
|
|
870
873
|
}
|
|
871
874
|
|
|
872
|
-
// ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
875
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
873
876
|
function reorderErrors(path, { from, to }, errors) {
|
|
874
877
|
const oldKeyStart = `${path}.${from}`;
|
|
875
878
|
const newKeyStart = `${path}.${to}`;
|
|
@@ -897,7 +900,7 @@ function reorderErrors(path, { from, to }, errors) {
|
|
|
897
900
|
return clone;
|
|
898
901
|
}
|
|
899
902
|
|
|
900
|
-
// ../../node_modules/klona/full/index.mjs
|
|
903
|
+
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
901
904
|
function set(obj, key, val) {
|
|
902
905
|
if (typeof val.value === "object")
|
|
903
906
|
val.value = klona(val.value);
|
|
@@ -948,7 +951,7 @@ function klona(x) {
|
|
|
948
951
|
return tmp || x;
|
|
949
952
|
}
|
|
950
953
|
|
|
951
|
-
// ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
954
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
952
955
|
function getSplittedPath(path) {
|
|
953
956
|
if (typeof path !== "string") {
|
|
954
957
|
return [];
|
|
@@ -956,7 +959,7 @@ function getSplittedPath(path) {
|
|
|
956
959
|
return path.split(".");
|
|
957
960
|
}
|
|
958
961
|
|
|
959
|
-
// ../../node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
962
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
960
963
|
function getPath(path, values) {
|
|
961
964
|
const splittedPath = getSplittedPath(path);
|
|
962
965
|
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
@@ -972,7 +975,7 @@ function getPath(path, values) {
|
|
|
972
975
|
return value;
|
|
973
976
|
}
|
|
974
977
|
|
|
975
|
-
// ../../node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
978
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
976
979
|
function setPath(path, value, values) {
|
|
977
980
|
const splittedPath = getSplittedPath(path);
|
|
978
981
|
if (splittedPath.length === 0) {
|
|
@@ -994,7 +997,7 @@ function setPath(path, value, values) {
|
|
|
994
997
|
return cloned;
|
|
995
998
|
}
|
|
996
999
|
|
|
997
|
-
// ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
1000
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
998
1001
|
function reorderPath(path, { from, to }, values) {
|
|
999
1002
|
const currentValue = getPath(path, values);
|
|
1000
1003
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1007,7 +1010,7 @@ function reorderPath(path, { from, to }, values) {
|
|
|
1007
1010
|
return setPath(path, cloned, values);
|
|
1008
1011
|
}
|
|
1009
1012
|
|
|
1010
|
-
// ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
1013
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
1011
1014
|
function insertPath(path, value, index, values) {
|
|
1012
1015
|
const currentValue = getPath(path, values);
|
|
1013
1016
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1018,7 +1021,7 @@ function insertPath(path, value, index, values) {
|
|
|
1018
1021
|
return setPath(path, cloned, values);
|
|
1019
1022
|
}
|
|
1020
1023
|
|
|
1021
|
-
// ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1024
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1022
1025
|
function removePath(path, index, values) {
|
|
1023
1026
|
const currentValue = getPath(path, values);
|
|
1024
1027
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1031,7 +1034,7 @@ function removePath(path, index, values) {
|
|
|
1031
1034
|
);
|
|
1032
1035
|
}
|
|
1033
1036
|
|
|
1034
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1037
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1035
1038
|
function useFormList({
|
|
1036
1039
|
$values,
|
|
1037
1040
|
$errors,
|
|
@@ -1064,11 +1067,11 @@ function useFormList({
|
|
|
1064
1067
|
return { reorderListItem, removeListItem, insertListItem };
|
|
1065
1068
|
}
|
|
1066
1069
|
|
|
1067
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1070
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1068
1071
|
var import_react20 = require("react");
|
|
1069
1072
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1070
1073
|
|
|
1071
|
-
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1074
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1072
1075
|
function getStatus(status, path) {
|
|
1073
1076
|
const paths = Object.keys(status);
|
|
1074
1077
|
if (typeof path === "string") {
|
|
@@ -1078,7 +1081,7 @@ function getStatus(status, path) {
|
|
|
1078
1081
|
return paths.some((statusPath) => status[statusPath]);
|
|
1079
1082
|
}
|
|
1080
1083
|
|
|
1081
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1084
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1082
1085
|
function useFormStatus({
|
|
1083
1086
|
initialDirty,
|
|
1084
1087
|
initialTouched,
|
|
@@ -1182,7 +1185,7 @@ function useFormStatus({
|
|
|
1182
1185
|
};
|
|
1183
1186
|
}
|
|
1184
1187
|
|
|
1185
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1188
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1186
1189
|
var import_react21 = require("react");
|
|
1187
1190
|
function useFormValues({
|
|
1188
1191
|
initialValues,
|
|
@@ -1255,7 +1258,7 @@ function useFormValues({
|
|
|
1255
1258
|
};
|
|
1256
1259
|
}
|
|
1257
1260
|
|
|
1258
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1261
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1259
1262
|
var import_react22 = require("react");
|
|
1260
1263
|
function useFormWatch({
|
|
1261
1264
|
$status
|
|
@@ -1292,12 +1295,12 @@ function useFormWatch({
|
|
|
1292
1295
|
};
|
|
1293
1296
|
}
|
|
1294
1297
|
|
|
1295
|
-
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1298
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1296
1299
|
function getDataPath(formName, fieldPath) {
|
|
1297
1300
|
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1298
1301
|
}
|
|
1299
1302
|
|
|
1300
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1303
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1301
1304
|
function getValidationResults(errors) {
|
|
1302
1305
|
const filteredErrors = filterErrors(errors);
|
|
1303
1306
|
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
@@ -1335,7 +1338,7 @@ function validateValues(validate, values) {
|
|
|
1335
1338
|
return getValidationResults(validateRulesRecord(validate, values));
|
|
1336
1339
|
}
|
|
1337
1340
|
|
|
1338
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1341
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1339
1342
|
function validateFieldValue(path, rules, values) {
|
|
1340
1343
|
if (typeof path !== "string") {
|
|
1341
1344
|
return { hasError: false, error: null };
|
|
@@ -1347,10 +1350,10 @@ function validateFieldValue(path, rules, values) {
|
|
|
1347
1350
|
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
1348
1351
|
}
|
|
1349
1352
|
|
|
1350
|
-
// ../../node_modules/@mantine/form/esm/form-index.mjs
|
|
1353
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
|
|
1351
1354
|
var FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
1352
1355
|
|
|
1353
|
-
// ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1356
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1354
1357
|
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
1355
1358
|
if (!validateInputOnChange) {
|
|
1356
1359
|
return false;
|
|
@@ -1364,7 +1367,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
|
|
|
1364
1367
|
return false;
|
|
1365
1368
|
}
|
|
1366
1369
|
|
|
1367
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
1370
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
1368
1371
|
function useForm({
|
|
1369
1372
|
name,
|
|
1370
1373
|
mode = "controlled",
|
package/dist/nodes/index.js
CHANGED
|
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/fast-deep-equal/index.js
|
|
27
|
+
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
28
28
|
var require_fast_deep_equal = __commonJS({
|
|
29
|
-
"../../node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
29
|
+
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
30
30
|
"use strict";
|
|
31
31
|
module.exports = function equal(a, b) {
|
|
32
32
|
if (a === b)
|
|
@@ -626,10 +626,10 @@ import {
|
|
|
626
626
|
useUpdateNodeData as useUpdateNodeData6
|
|
627
627
|
} from "@awesome-flow/core/hooks";
|
|
628
628
|
|
|
629
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
629
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
630
630
|
import { useState as useState8, useCallback as useCallback14 } from "react";
|
|
631
631
|
|
|
632
|
-
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
632
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
633
633
|
import { useLayoutEffect, useEffect as useEffect10 } from "react";
|
|
634
634
|
function validateFormName(name) {
|
|
635
635
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
@@ -710,7 +710,7 @@ function useFormActions(name, form) {
|
|
|
710
710
|
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
711
711
|
}
|
|
712
712
|
|
|
713
|
-
// ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
713
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
714
714
|
function getInputOnChange(setValue) {
|
|
715
715
|
return (val) => {
|
|
716
716
|
if (!val) {
|
|
@@ -734,10 +734,10 @@ function getInputOnChange(setValue) {
|
|
|
734
734
|
};
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
738
|
-
import { useState as useState5, useCallback as useCallback9 } from "react";
|
|
737
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
738
|
+
import { useState as useState5, useRef, useCallback as useCallback9 } from "react";
|
|
739
739
|
|
|
740
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
740
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
741
741
|
function filterErrors(errors) {
|
|
742
742
|
if (errors === null || typeof errors !== "object") {
|
|
743
743
|
return {};
|
|
@@ -751,18 +751,21 @@ function filterErrors(errors) {
|
|
|
751
751
|
}, {});
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
754
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
755
755
|
function useFormErrors(initialErrors) {
|
|
756
756
|
const [errorsState, setErrorsState] = useState5(filterErrors(initialErrors));
|
|
757
|
+
const errorsRef = useRef(errorsState);
|
|
757
758
|
const setErrors = useCallback9((errors) => {
|
|
758
|
-
setErrorsState(
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
setErrorsState((current) => {
|
|
760
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
761
|
+
errorsRef.current = newErrors;
|
|
762
|
+
return newErrors;
|
|
763
|
+
});
|
|
761
764
|
}, []);
|
|
762
|
-
const clearErrors = useCallback9(() =>
|
|
765
|
+
const clearErrors = useCallback9(() => setErrors({}), []);
|
|
763
766
|
const clearFieldError = useCallback9(
|
|
764
767
|
(path) => {
|
|
765
|
-
if (
|
|
768
|
+
if (errorsRef.current[path] === void 0) {
|
|
766
769
|
return;
|
|
767
770
|
}
|
|
768
771
|
setErrors((current) => {
|
|
@@ -777,7 +780,7 @@ function useFormErrors(initialErrors) {
|
|
|
777
780
|
(path, error) => {
|
|
778
781
|
if (error == null || error === false) {
|
|
779
782
|
clearFieldError(path);
|
|
780
|
-
} else if (
|
|
783
|
+
} else if (errorsRef.current[path] !== error) {
|
|
781
784
|
setErrors((current) => ({ ...current, [path]: error }));
|
|
782
785
|
}
|
|
783
786
|
},
|
|
@@ -792,10 +795,10 @@ function useFormErrors(initialErrors) {
|
|
|
792
795
|
};
|
|
793
796
|
}
|
|
794
797
|
|
|
795
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
798
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
796
799
|
import { useCallback as useCallback10 } from "react";
|
|
797
800
|
|
|
798
|
-
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
801
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
799
802
|
function clearListState(field, state) {
|
|
800
803
|
if (state === null || typeof state !== "object") {
|
|
801
804
|
return {};
|
|
@@ -809,7 +812,7 @@ function clearListState(field, state) {
|
|
|
809
812
|
return clone;
|
|
810
813
|
}
|
|
811
814
|
|
|
812
|
-
// ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
815
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
813
816
|
function getIndexFromKeyAfterPath(key, path) {
|
|
814
817
|
const split = key.substring(path.length + 1).split(".")[0];
|
|
815
818
|
return parseInt(split, 10);
|
|
@@ -849,7 +852,7 @@ function changeErrorIndices(path, index, errors, change) {
|
|
|
849
852
|
return cloned;
|
|
850
853
|
}
|
|
851
854
|
|
|
852
|
-
// ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
855
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
853
856
|
function reorderErrors(path, { from, to }, errors) {
|
|
854
857
|
const oldKeyStart = `${path}.${from}`;
|
|
855
858
|
const newKeyStart = `${path}.${to}`;
|
|
@@ -877,7 +880,7 @@ function reorderErrors(path, { from, to }, errors) {
|
|
|
877
880
|
return clone;
|
|
878
881
|
}
|
|
879
882
|
|
|
880
|
-
// ../../node_modules/klona/full/index.mjs
|
|
883
|
+
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
881
884
|
function set(obj, key, val) {
|
|
882
885
|
if (typeof val.value === "object")
|
|
883
886
|
val.value = klona(val.value);
|
|
@@ -928,7 +931,7 @@ function klona(x) {
|
|
|
928
931
|
return tmp || x;
|
|
929
932
|
}
|
|
930
933
|
|
|
931
|
-
// ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
934
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
932
935
|
function getSplittedPath(path) {
|
|
933
936
|
if (typeof path !== "string") {
|
|
934
937
|
return [];
|
|
@@ -936,7 +939,7 @@ function getSplittedPath(path) {
|
|
|
936
939
|
return path.split(".");
|
|
937
940
|
}
|
|
938
941
|
|
|
939
|
-
// ../../node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
942
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
940
943
|
function getPath(path, values) {
|
|
941
944
|
const splittedPath = getSplittedPath(path);
|
|
942
945
|
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
@@ -952,7 +955,7 @@ function getPath(path, values) {
|
|
|
952
955
|
return value;
|
|
953
956
|
}
|
|
954
957
|
|
|
955
|
-
// ../../node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
958
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
956
959
|
function setPath(path, value, values) {
|
|
957
960
|
const splittedPath = getSplittedPath(path);
|
|
958
961
|
if (splittedPath.length === 0) {
|
|
@@ -974,7 +977,7 @@ function setPath(path, value, values) {
|
|
|
974
977
|
return cloned;
|
|
975
978
|
}
|
|
976
979
|
|
|
977
|
-
// ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
980
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
978
981
|
function reorderPath(path, { from, to }, values) {
|
|
979
982
|
const currentValue = getPath(path, values);
|
|
980
983
|
if (!Array.isArray(currentValue)) {
|
|
@@ -987,7 +990,7 @@ function reorderPath(path, { from, to }, values) {
|
|
|
987
990
|
return setPath(path, cloned, values);
|
|
988
991
|
}
|
|
989
992
|
|
|
990
|
-
// ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
993
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
991
994
|
function insertPath(path, value, index, values) {
|
|
992
995
|
const currentValue = getPath(path, values);
|
|
993
996
|
if (!Array.isArray(currentValue)) {
|
|
@@ -998,7 +1001,7 @@ function insertPath(path, value, index, values) {
|
|
|
998
1001
|
return setPath(path, cloned, values);
|
|
999
1002
|
}
|
|
1000
1003
|
|
|
1001
|
-
// ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1004
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1002
1005
|
function removePath(path, index, values) {
|
|
1003
1006
|
const currentValue = getPath(path, values);
|
|
1004
1007
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1011,7 +1014,7 @@ function removePath(path, index, values) {
|
|
|
1011
1014
|
);
|
|
1012
1015
|
}
|
|
1013
1016
|
|
|
1014
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1017
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1015
1018
|
function useFormList({
|
|
1016
1019
|
$values,
|
|
1017
1020
|
$errors,
|
|
@@ -1044,11 +1047,11 @@ function useFormList({
|
|
|
1044
1047
|
return { reorderListItem, removeListItem, insertListItem };
|
|
1045
1048
|
}
|
|
1046
1049
|
|
|
1047
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1050
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1048
1051
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1049
|
-
import { useState as useState6, useRef, useCallback as useCallback11 } from "react";
|
|
1052
|
+
import { useState as useState6, useRef as useRef2, useCallback as useCallback11 } from "react";
|
|
1050
1053
|
|
|
1051
|
-
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1054
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1052
1055
|
function getStatus(status, path) {
|
|
1053
1056
|
const paths = Object.keys(status);
|
|
1054
1057
|
if (typeof path === "string") {
|
|
@@ -1058,7 +1061,7 @@ function getStatus(status, path) {
|
|
|
1058
1061
|
return paths.some((statusPath) => status[statusPath]);
|
|
1059
1062
|
}
|
|
1060
1063
|
|
|
1061
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1064
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1062
1065
|
function useFormStatus({
|
|
1063
1066
|
initialDirty,
|
|
1064
1067
|
initialTouched,
|
|
@@ -1067,8 +1070,8 @@ function useFormStatus({
|
|
|
1067
1070
|
}) {
|
|
1068
1071
|
const [touchedState, setTouchedState] = useState6(initialTouched);
|
|
1069
1072
|
const [dirtyState, setDirtyState] = useState6(initialDirty);
|
|
1070
|
-
const touchedRef =
|
|
1071
|
-
const dirtyRef =
|
|
1073
|
+
const touchedRef = useRef2(initialTouched);
|
|
1074
|
+
const dirtyRef = useRef2(initialDirty);
|
|
1072
1075
|
const setTouched = useCallback11((values) => {
|
|
1073
1076
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1074
1077
|
touchedRef.current = resolvedValues;
|
|
@@ -1162,17 +1165,17 @@ function useFormStatus({
|
|
|
1162
1165
|
};
|
|
1163
1166
|
}
|
|
1164
1167
|
|
|
1165
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1166
|
-
import { useRef as
|
|
1168
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1169
|
+
import { useRef as useRef3, useState as useState7, useCallback as useCallback12 } from "react";
|
|
1167
1170
|
function useFormValues({
|
|
1168
1171
|
initialValues,
|
|
1169
1172
|
onValuesChange,
|
|
1170
1173
|
mode
|
|
1171
1174
|
}) {
|
|
1172
|
-
const initialized =
|
|
1175
|
+
const initialized = useRef3(false);
|
|
1173
1176
|
const [stateValues, setStateValues] = useState7(initialValues || {});
|
|
1174
|
-
const refValues =
|
|
1175
|
-
const valuesSnapshot =
|
|
1177
|
+
const refValues = useRef3(stateValues);
|
|
1178
|
+
const valuesSnapshot = useRef3(stateValues);
|
|
1176
1179
|
const setValues = useCallback12(
|
|
1177
1180
|
({
|
|
1178
1181
|
values,
|
|
@@ -1235,12 +1238,12 @@ function useFormValues({
|
|
|
1235
1238
|
};
|
|
1236
1239
|
}
|
|
1237
1240
|
|
|
1238
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1239
|
-
import { useRef as
|
|
1241
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1242
|
+
import { useRef as useRef4, useCallback as useCallback13, useEffect as useEffect11 } from "react";
|
|
1240
1243
|
function useFormWatch({
|
|
1241
1244
|
$status
|
|
1242
1245
|
}) {
|
|
1243
|
-
const subscribers =
|
|
1246
|
+
const subscribers = useRef4(
|
|
1244
1247
|
{}
|
|
1245
1248
|
);
|
|
1246
1249
|
const watch = useCallback13((path, callback) => {
|
|
@@ -1272,12 +1275,12 @@ function useFormWatch({
|
|
|
1272
1275
|
};
|
|
1273
1276
|
}
|
|
1274
1277
|
|
|
1275
|
-
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1278
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1276
1279
|
function getDataPath(formName, fieldPath) {
|
|
1277
1280
|
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1278
1281
|
}
|
|
1279
1282
|
|
|
1280
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1283
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1281
1284
|
function getValidationResults(errors) {
|
|
1282
1285
|
const filteredErrors = filterErrors(errors);
|
|
1283
1286
|
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
@@ -1315,7 +1318,7 @@ function validateValues(validate, values) {
|
|
|
1315
1318
|
return getValidationResults(validateRulesRecord(validate, values));
|
|
1316
1319
|
}
|
|
1317
1320
|
|
|
1318
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1321
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1319
1322
|
function validateFieldValue(path, rules, values) {
|
|
1320
1323
|
if (typeof path !== "string") {
|
|
1321
1324
|
return { hasError: false, error: null };
|
|
@@ -1327,10 +1330,10 @@ function validateFieldValue(path, rules, values) {
|
|
|
1327
1330
|
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
1328
1331
|
}
|
|
1329
1332
|
|
|
1330
|
-
// ../../node_modules/@mantine/form/esm/form-index.mjs
|
|
1333
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
|
|
1331
1334
|
var FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
1332
1335
|
|
|
1333
|
-
// ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1336
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1334
1337
|
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
1335
1338
|
if (!validateInputOnChange) {
|
|
1336
1339
|
return false;
|
|
@@ -1344,7 +1347,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
|
|
|
1344
1347
|
return false;
|
|
1345
1348
|
}
|
|
1346
1349
|
|
|
1347
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
1350
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
1348
1351
|
function useForm({
|
|
1349
1352
|
name,
|
|
1350
1353
|
mode = "controlled",
|