@visiion/forms-library 1.4.10 → 1.4.12
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/index.esm.js +6 -2
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -10165,7 +10165,7 @@ var RadioOption = function (_a) {
|
|
|
10165
10165
|
|
|
10166
10166
|
var TextInput = function (_a) {
|
|
10167
10167
|
var field = _a.field, value = _a.value, onChange = _a.onChange, error = _a.error;
|
|
10168
|
-
return (jsx(TextInputField, { id: field.id, name: field.name, label: field.label, type: "text", placeholder: field.placeholder, value: value, onChange: onChange, helperText: error, disabled: field.disabled, color: error ? "failure" : undefined, addon: field.addon, required: field.required }));
|
|
10168
|
+
return (jsx(TextInputField, __assign({ id: field.id, name: field.name, label: field.label, type: field.type || "text", placeholder: field.placeholder, value: value, onChange: onChange, helperText: error, disabled: field.disabled, color: error ? "failure" : undefined, addon: field.addon, required: field.required }, field.props)));
|
|
10169
10169
|
};
|
|
10170
10170
|
|
|
10171
10171
|
// THIS FILE IS AUTO GENERATED
|
|
@@ -22800,6 +22800,7 @@ var createValidationSchema = function (fields) {
|
|
|
22800
22800
|
return true;
|
|
22801
22801
|
});
|
|
22802
22802
|
validFields.forEach(function (field) {
|
|
22803
|
+
var _a, _b, _c;
|
|
22803
22804
|
if (field.validations && field.validations.length > 0) {
|
|
22804
22805
|
// Determinar el tipo de esquema basado en el tipo de campo
|
|
22805
22806
|
var fieldSchema_1;
|
|
@@ -22808,7 +22809,7 @@ var createValidationSchema = function (fields) {
|
|
|
22808
22809
|
case "checklist":
|
|
22809
22810
|
fieldSchema_1 = create$2()
|
|
22810
22811
|
.of(create$6())
|
|
22811
|
-
.min(1, field.validations[0].params[0] ||
|
|
22812
|
+
.min(1, ((_c = (_b = (_a = field.validations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c[0]) ||
|
|
22812
22813
|
"El campo ".concat(field.label || field.name || "sin nombre", " es requerido"));
|
|
22813
22814
|
break;
|
|
22814
22815
|
case "declaration":
|
|
@@ -22859,6 +22860,9 @@ var createValidationSchema = function (fields) {
|
|
|
22859
22860
|
else if (customValidator === "otra-medida") {
|
|
22860
22861
|
fieldSchema_1 = fieldSchema_1.test("otra-medida", validation.params[1] ||
|
|
22861
22862
|
"Debe detallar cuál es la medida de resguardo", function (value) {
|
|
22863
|
+
// Verificar que value sea un array
|
|
22864
|
+
if (!Array.isArray(value))
|
|
22865
|
+
return true;
|
|
22862
22866
|
// Si no incluye "otra-medida", la validación pasa
|
|
22863
22867
|
if (!value.includes("otra-medida"))
|
|
22864
22868
|
return true;
|
package/dist/index.js
CHANGED
|
@@ -10184,7 +10184,7 @@ var RadioOption = function (_a) {
|
|
|
10184
10184
|
|
|
10185
10185
|
var TextInput = function (_a) {
|
|
10186
10186
|
var field = _a.field, value = _a.value, onChange = _a.onChange, error = _a.error;
|
|
10187
|
-
return (jsxRuntime.jsx(TextInputField, { id: field.id, name: field.name, label: field.label, type: "text", placeholder: field.placeholder, value: value, onChange: onChange, helperText: error, disabled: field.disabled, color: error ? "failure" : undefined, addon: field.addon, required: field.required }));
|
|
10187
|
+
return (jsxRuntime.jsx(TextInputField, __assign({ id: field.id, name: field.name, label: field.label, type: field.type || "text", placeholder: field.placeholder, value: value, onChange: onChange, helperText: error, disabled: field.disabled, color: error ? "failure" : undefined, addon: field.addon, required: field.required }, field.props)));
|
|
10188
10188
|
};
|
|
10189
10189
|
|
|
10190
10190
|
// THIS FILE IS AUTO GENERATED
|
|
@@ -22819,6 +22819,7 @@ var createValidationSchema = function (fields) {
|
|
|
22819
22819
|
return true;
|
|
22820
22820
|
});
|
|
22821
22821
|
validFields.forEach(function (field) {
|
|
22822
|
+
var _a, _b, _c;
|
|
22822
22823
|
if (field.validations && field.validations.length > 0) {
|
|
22823
22824
|
// Determinar el tipo de esquema basado en el tipo de campo
|
|
22824
22825
|
var fieldSchema_1;
|
|
@@ -22827,7 +22828,7 @@ var createValidationSchema = function (fields) {
|
|
|
22827
22828
|
case "checklist":
|
|
22828
22829
|
fieldSchema_1 = create$2()
|
|
22829
22830
|
.of(create$6())
|
|
22830
|
-
.min(1, field.validations[0].params[0] ||
|
|
22831
|
+
.min(1, ((_c = (_b = (_a = field.validations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c[0]) ||
|
|
22831
22832
|
"El campo ".concat(field.label || field.name || "sin nombre", " es requerido"));
|
|
22832
22833
|
break;
|
|
22833
22834
|
case "declaration":
|
|
@@ -22878,6 +22879,9 @@ var createValidationSchema = function (fields) {
|
|
|
22878
22879
|
else if (customValidator === "otra-medida") {
|
|
22879
22880
|
fieldSchema_1 = fieldSchema_1.test("otra-medida", validation.params[1] ||
|
|
22880
22881
|
"Debe detallar cuál es la medida de resguardo", function (value) {
|
|
22882
|
+
// Verificar que value sea un array
|
|
22883
|
+
if (!Array.isArray(value))
|
|
22884
|
+
return true;
|
|
22881
22885
|
// Si no incluye "otra-medida", la validación pasa
|
|
22882
22886
|
if (!value.includes("otra-medida"))
|
|
22883
22887
|
return true;
|