@websolutespa/bom-mixer-forms 0.3.3 → 0.3.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/CHANGELOG.md +6 -0
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/package.json +1 -1
- package/src/forms/validators/required-if.validator.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -967,7 +967,6 @@ function patternToRegEx(pattern) {
|
|
|
967
967
|
var import_bom_core3 = require("@websolutespa/bom-core");
|
|
968
968
|
function RequiredIfValidator(condition) {
|
|
969
969
|
return function(value, rootValue, control, root) {
|
|
970
|
-
console.log("RequiredIfValidator", value, Boolean(condition(value, rootValue, control, root)));
|
|
971
970
|
if (Boolean(condition(value, rootValue, control, root)) === true) {
|
|
972
971
|
if ((0, import_bom_core3.isArray)(value) || typeof value === "string") {
|
|
973
972
|
return value.length === 0 ? { required: true } : null;
|
package/dist/index.mjs
CHANGED
|
@@ -919,7 +919,6 @@ function patternToRegEx(pattern) {
|
|
|
919
919
|
import { isArray } from "@websolutespa/bom-core";
|
|
920
920
|
function RequiredIfValidator(condition) {
|
|
921
921
|
return function(value, rootValue, control, root) {
|
|
922
|
-
console.log("RequiredIfValidator", value, Boolean(condition(value, rootValue, control, root)));
|
|
923
922
|
if (Boolean(condition(value, rootValue, control, root)) === true) {
|
|
924
923
|
if (isArray(value) || typeof value === "string") {
|
|
925
924
|
return value.length === 0 ? { required: true } : null;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import { FormValidator, FormValue } from '../types';
|
|
|
7
7
|
*/
|
|
8
8
|
export function RequiredIfValidator(condition: (value: FormValue, rootValue: FormValue, control?: FormAbstract, root?: FormAbstract) => boolean): FormValidator {
|
|
9
9
|
return function (value, rootValue, control, root) {
|
|
10
|
-
console.log('RequiredIfValidator', value, Boolean(condition(value, rootValue, control, root)));
|
|
10
|
+
// console.log('RequiredIfValidator', value, Boolean(condition(value, rootValue, control, root)));
|
|
11
11
|
if (Boolean(condition(value, rootValue, control, root)) === true) {
|
|
12
12
|
if (isArray(value) || typeof value === 'string') {
|
|
13
13
|
return (value.length === 0) ? { required: true } : null;
|