@mantine/form 4.1.4 → 4.1.5

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.
@@ -9,7 +9,7 @@ function validateListValues(values, key, rules) {
9
9
  if (typeof item === "object" && item !== null) {
10
10
  Object.keys(item).forEach((listItemKey) => {
11
11
  if (typeof rules[key][listItemKey] === "function") {
12
- const error = rules[key][listItemKey](item[listItemKey]);
12
+ const error = rules[key][listItemKey](item[listItemKey], values);
13
13
  if (error) {
14
14
  results[`${key}.${itemIndex}.${listItemKey}`] = error;
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate-list-values.js","sources":["../../src/validate-values/validate-list-values.ts"],"sourcesContent":["import type { FormList } from '../form-list/form-list';\nimport type { FormRulesRecord, FormErrors } from '../types';\n\nexport function validateListValues<T>(values: T, key: string, rules: FormRulesRecord<T>) {\n const list: FormList<any> = values[key] as any;\n const results: FormErrors = {};\n\n list.forEach((item, itemIndex) => {\n if (typeof item === 'object' && item !== null) {\n Object.keys(item).forEach((listItemKey) => {\n if (typeof rules[key][listItemKey] === 'function') {\n const error = rules[key][listItemKey](item[listItemKey]);\n if (error) {\n results[`${key}.${itemIndex}.${listItemKey}`] = error;\n }\n }\n });\n }\n });\n\n return results;\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE;AACvD,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAG,EAAE,CAAC;AACrB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK;AACpC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AACnD,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK;AACjD,QAAQ,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,KAAK,UAAU,EAAE;AAC3D,UAAU,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnE,UAAU,IAAI,KAAK,EAAE;AACrB,YAAY,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAClE,WAAW;AACX,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}
1
+ {"version":3,"file":"validate-list-values.js","sources":["../../src/validate-values/validate-list-values.ts"],"sourcesContent":["import type { FormList } from '../form-list/form-list';\nimport type { FormRulesRecord, FormErrors } from '../types';\n\nexport function validateListValues<T>(values: T, key: string, rules: FormRulesRecord<T>) {\n const list: FormList<any> = values[key] as any;\n const results: FormErrors = {};\n\n list.forEach((item, itemIndex) => {\n if (typeof item === 'object' && item !== null) {\n Object.keys(item).forEach((listItemKey) => {\n if (typeof rules[key][listItemKey] === 'function') {\n const error = rules[key][listItemKey](item[listItemKey], values);\n if (error) {\n results[`${key}.${itemIndex}.${listItemKey}`] = error;\n }\n }\n });\n }\n });\n\n return results;\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE;AACvD,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAG,EAAE,CAAC;AACrB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK;AACpC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AACnD,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK;AACjD,QAAQ,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,KAAK,UAAU,EAAE;AAC3D,UAAU,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3E,UAAU,IAAI,KAAK,EAAE;AACrB,YAAY,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAClE,WAAW;AACX,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}
@@ -5,7 +5,7 @@ function validateListValues(values, key, rules) {
5
5
  if (typeof item === "object" && item !== null) {
6
6
  Object.keys(item).forEach((listItemKey) => {
7
7
  if (typeof rules[key][listItemKey] === "function") {
8
- const error = rules[key][listItemKey](item[listItemKey]);
8
+ const error = rules[key][listItemKey](item[listItemKey], values);
9
9
  if (error) {
10
10
  results[`${key}.${itemIndex}.${listItemKey}`] = error;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate-list-values.js","sources":["../../src/validate-values/validate-list-values.ts"],"sourcesContent":["import type { FormList } from '../form-list/form-list';\nimport type { FormRulesRecord, FormErrors } from '../types';\n\nexport function validateListValues<T>(values: T, key: string, rules: FormRulesRecord<T>) {\n const list: FormList<any> = values[key] as any;\n const results: FormErrors = {};\n\n list.forEach((item, itemIndex) => {\n if (typeof item === 'object' && item !== null) {\n Object.keys(item).forEach((listItemKey) => {\n if (typeof rules[key][listItemKey] === 'function') {\n const error = rules[key][listItemKey](item[listItemKey]);\n if (error) {\n results[`${key}.${itemIndex}.${listItemKey}`] = error;\n }\n }\n });\n }\n });\n\n return results;\n}\n"],"names":[],"mappings":"AAAO,SAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE;AACvD,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAG,EAAE,CAAC;AACrB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK;AACpC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AACnD,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK;AACjD,QAAQ,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,KAAK,UAAU,EAAE;AAC3D,UAAU,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnE,UAAU,IAAI,KAAK,EAAE;AACrB,YAAY,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAClE,WAAW;AACX,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}
1
+ {"version":3,"file":"validate-list-values.js","sources":["../../src/validate-values/validate-list-values.ts"],"sourcesContent":["import type { FormList } from '../form-list/form-list';\nimport type { FormRulesRecord, FormErrors } from '../types';\n\nexport function validateListValues<T>(values: T, key: string, rules: FormRulesRecord<T>) {\n const list: FormList<any> = values[key] as any;\n const results: FormErrors = {};\n\n list.forEach((item, itemIndex) => {\n if (typeof item === 'object' && item !== null) {\n Object.keys(item).forEach((listItemKey) => {\n if (typeof rules[key][listItemKey] === 'function') {\n const error = rules[key][listItemKey](item[listItemKey], values);\n if (error) {\n results[`${key}.${itemIndex}.${listItemKey}`] = error;\n }\n }\n });\n }\n });\n\n return results;\n}\n"],"names":[],"mappings":"AAAO,SAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE;AACvD,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAG,EAAE,CAAC;AACrB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK;AACpC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AACnD,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK;AACjD,QAAQ,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,KAAK,UAAU,EAAE;AAC3D,UAAU,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3E,UAAU,IAAI,KAAK,EAAE;AACrB,YAAY,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAClE,WAAW;AACX,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mantine/form",
3
3
  "description": "Mantine form management library",
4
- "version": "4.1.4",
4
+ "version": "4.1.5",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
7
7
  "types": "lib/index.d.ts",