@mantine/form 6.0.0-alpha.4 → 6.0.0-alpha.6

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/cjs/index.js CHANGED
@@ -15,6 +15,7 @@ var matches = require('./validators/matches/matches.js');
15
15
  var isEmail = require('./validators/is-email/is-email.js');
16
16
  var hasLength = require('./validators/has-length/has-length.js');
17
17
  var isInRange = require('./validators/is-in-range/is-in-range.js');
18
+ var matchesField = require('./validators/matches-field/matches-field.js');
18
19
 
19
20
 
20
21
 
@@ -31,4 +32,5 @@ exports.matches = matches.matches;
31
32
  exports.isEmail = isEmail.isEmail;
32
33
  exports.hasLength = hasLength.hasLength;
33
34
  exports.isInRange = isInRange.isInRange;
35
+ exports.matchesField = matchesField.matchesField;
34
36
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function matchesField(field, error) {
6
+ const _error = error || true;
7
+ return (value, values) => {
8
+ if (!values || !(field in values)) {
9
+ return _error;
10
+ }
11
+ return value === values[field] ? null : _error;
12
+ };
13
+ }
14
+
15
+ exports.matchesField = matchesField;
16
+ //# sourceMappingURL=matches-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matches-field.js","sources":["../../../src/validators/matches-field/matches-field.ts"],"sourcesContent":["import React from 'react';\n\nexport function matchesField(field: string, error?: React.ReactNode) {\n const _error = error || true;\n\n return (value: unknown, values: Record<string, unknown>) => {\n if (!values || !(field in values)) {\n return _error;\n }\n\n return value === values[field] ? null : _error;\n };\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;AAC3C,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC;AAC/B,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,KAAK;AAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC,EAAE;AACvC,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;AACnD,GAAG,CAAC;AACJ;;;;"}
package/esm/index.js CHANGED
@@ -11,4 +11,5 @@ export { matches } from './validators/matches/matches.js';
11
11
  export { isEmail } from './validators/is-email/is-email.js';
12
12
  export { hasLength } from './validators/has-length/has-length.js';
13
13
  export { isInRange } from './validators/is-in-range/is-in-range.js';
14
+ export { matchesField } from './validators/matches-field/matches-field.js';
14
15
  //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ function matchesField(field, error) {
2
+ const _error = error || true;
3
+ return (value, values) => {
4
+ if (!values || !(field in values)) {
5
+ return _error;
6
+ }
7
+ return value === values[field] ? null : _error;
8
+ };
9
+ }
10
+
11
+ export { matchesField };
12
+ //# sourceMappingURL=matches-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matches-field.js","sources":["../../../src/validators/matches-field/matches-field.ts"],"sourcesContent":["import React from 'react';\n\nexport function matchesField(field: string, error?: React.ReactNode) {\n const _error = error || true;\n\n return (value: unknown, values: Record<string, unknown>) => {\n if (!values || !(field in values)) {\n return _error;\n }\n\n return value === values[field] ? null : _error;\n };\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;AAC3C,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC;AAC/B,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,KAAK;AAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC,EAAE;AACvC,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;AACnD,GAAG,CAAC;AACJ;;;;"}
@@ -3,4 +3,5 @@ export { matches } from './matches/matches';
3
3
  export { isEmail } from './is-email/is-email';
4
4
  export { hasLength } from './has-length/has-length';
5
5
  export { isInRange } from './is-in-range/is-in-range';
6
+ export { matchesField } from './matches-field/matches-field';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare function matchesField(field: string, error?: React.ReactNode): (value: unknown, values: Record<string, unknown>) => string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment;
3
+ //# sourceMappingURL=matches-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matches-field.d.ts","sourceRoot":"","sources":["../../../src/validators/matches-field/matches-field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,WAGlD,OAAO,UAAU,OAAO,MAAM,EAAE,OAAO,CAAC,uHAOxD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mantine/form",
3
3
  "description": "Mantine form management library",
4
- "version": "6.0.0-alpha.4",
4
+ "version": "6.0.0-alpha.6",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
7
7
  "types": "lib/index.d.ts",