@timeax/form-palette 0.0.22 → 0.0.23
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 +428 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4414,7 +4414,12 @@ function useField(options) {
|
|
|
4414
4414
|
ok = false;
|
|
4415
4415
|
message2 = "This field is required.";
|
|
4416
4416
|
} else if (validate) {
|
|
4417
|
-
const result = validate(
|
|
4417
|
+
const result = validate(
|
|
4418
|
+
current,
|
|
4419
|
+
fieldRef.current,
|
|
4420
|
+
form,
|
|
4421
|
+
!!report
|
|
4422
|
+
);
|
|
4418
4423
|
if (typeof result === "string") {
|
|
4419
4424
|
ok = false;
|
|
4420
4425
|
message2 = result;
|
|
@@ -4675,7 +4680,7 @@ function useOptionalField(options) {
|
|
|
4675
4680
|
ok = false;
|
|
4676
4681
|
message2 = "This field is required.";
|
|
4677
4682
|
} else if (validate) {
|
|
4678
|
-
const result = validate(current, !!report);
|
|
4683
|
+
const result = validate(current, void 0, void 0, !!report);
|
|
4679
4684
|
if (typeof result === "string") {
|
|
4680
4685
|
ok = false;
|
|
4681
4686
|
message2 = result;
|
|
@@ -21111,24 +21116,20 @@ function InputField(props) {
|
|
|
21111
21116
|
const effectiveSize = (_c = size != null ? size : (_b = (_a = module.defaults) == null ? void 0 : _a.layout) == null ? void 0 : _b.defaultSize) != null ? _c : void 0;
|
|
21112
21117
|
const effectiveDensity = (_f = density != null ? density : (_e = (_d = module.defaults) == null ? void 0 : _d.layout) == null ? void 0 : _e.defaultDensity) != null ? _f : void 0;
|
|
21113
21118
|
const validate = React10.useCallback(
|
|
21114
|
-
(value2, _report) => {
|
|
21119
|
+
(value2, field2, form, _report) => {
|
|
21115
21120
|
var _a2;
|
|
21116
21121
|
const messages = [];
|
|
21117
21122
|
if (module.validate) {
|
|
21118
21123
|
const res = module.validate(value2, {
|
|
21119
21124
|
required: !!required,
|
|
21120
21125
|
props,
|
|
21121
|
-
field:
|
|
21122
|
-
form
|
|
21126
|
+
field: field2,
|
|
21127
|
+
form
|
|
21123
21128
|
});
|
|
21124
21129
|
messages.push(...normalizeValidateResult(res));
|
|
21125
21130
|
}
|
|
21126
21131
|
if (onValidate) {
|
|
21127
|
-
const res = onValidate(
|
|
21128
|
-
value2,
|
|
21129
|
-
void 0,
|
|
21130
|
-
void 0
|
|
21131
|
-
);
|
|
21132
|
+
const res = onValidate(value2, field2, form);
|
|
21132
21133
|
messages.push(...normalizeValidateResult(res));
|
|
21133
21134
|
}
|
|
21134
21135
|
if (!messages.length) return true;
|