@strictly/react-form 0.0.12 → 0.0.13
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/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@ $ tsup
|
|
|
7
7
|
[34mCLI[39m Target: es6
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m55.38 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 141ms
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m59.16 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 145ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 9581ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m36.50 KB[39m
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m36.50 KB[39m
|
|
18
|
-
Done in
|
|
18
|
+
Done in 10.72s.
|
package/dist/index.cjs
CHANGED
|
@@ -1369,14 +1369,15 @@ function createCheckbox(valuePath, Checkbox) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
1371
|
// mantine/create_fields_view.tsx
|
|
1372
|
+
var import_define7 = require("@strictly/define");
|
|
1372
1373
|
var import_mobx_react2 = require("mobx-react");
|
|
1373
1374
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1374
1375
|
function createFieldsView(valuePath, FieldsView, observableProps) {
|
|
1375
1376
|
function toKey(subKey) {
|
|
1376
|
-
return
|
|
1377
|
+
return (0, import_define7.jsonPathPrefix)(valuePath, subKey);
|
|
1377
1378
|
}
|
|
1378
1379
|
function toSubKey(key) {
|
|
1379
|
-
return
|
|
1380
|
+
return (0, import_define7.jsonPathUnprefix)(valuePath, key);
|
|
1380
1381
|
}
|
|
1381
1382
|
function onFieldValueChange(subKey, value) {
|
|
1382
1383
|
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
@@ -1831,7 +1832,7 @@ __decorateElement(_init2, 4, "fields", _fields_dec2, MantineFormImpl, _fields);
|
|
|
1831
1832
|
__decoratorMetadata(_init2, MantineFormImpl);
|
|
1832
1833
|
|
|
1833
1834
|
// types/merge_validators.ts
|
|
1834
|
-
var
|
|
1835
|
+
var import_define8 = require("@strictly/define");
|
|
1835
1836
|
function mergeValidators(validators1, validators2) {
|
|
1836
1837
|
const validators = __spreadValues(__spreadValues({}, validators1), validators2);
|
|
1837
1838
|
const keys1 = new Set(Object.keys(validators1));
|
|
@@ -1843,16 +1844,16 @@ function mergeValidators(validators1, validators2) {
|
|
|
1843
1844
|
validators3[key] = {
|
|
1844
1845
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1845
1846
|
validate: function(value, valuePath, context) {
|
|
1846
|
-
const error = (0,
|
|
1847
|
+
const error = (0, import_define8.validate)(validator1, value, valuePath, context);
|
|
1847
1848
|
if (error != null) {
|
|
1848
1849
|
return error;
|
|
1849
1850
|
}
|
|
1850
|
-
return (0,
|
|
1851
|
+
return (0, import_define8.validate)(validator2, value, valuePath, context);
|
|
1851
1852
|
},
|
|
1852
1853
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1853
1854
|
annotations: function(valuePath, context) {
|
|
1854
|
-
const annotations1 = (0,
|
|
1855
|
-
const annotations22 = (0,
|
|
1855
|
+
const annotations1 = (0, import_define8.annotations)(validator1, valuePath, context);
|
|
1856
|
+
const annotations22 = (0, import_define8.annotations)(validator2, valuePath, context);
|
|
1856
1857
|
return {
|
|
1857
1858
|
readonly: annotations1.readonly || annotations22.readonly,
|
|
1858
1859
|
required: annotations1.required || annotations22.required
|
package/dist/index.js
CHANGED
|
@@ -1372,14 +1372,18 @@ function createCheckbox(valuePath, Checkbox) {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
|
|
1374
1374
|
// mantine/create_fields_view.tsx
|
|
1375
|
+
import {
|
|
1376
|
+
jsonPathPrefix,
|
|
1377
|
+
jsonPathUnprefix
|
|
1378
|
+
} from "@strictly/define";
|
|
1375
1379
|
import { observer as observer2 } from "mobx-react";
|
|
1376
1380
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1377
1381
|
function createFieldsView(valuePath, FieldsView, observableProps) {
|
|
1378
1382
|
function toKey(subKey) {
|
|
1379
|
-
return
|
|
1383
|
+
return jsonPathPrefix(valuePath, subKey);
|
|
1380
1384
|
}
|
|
1381
1385
|
function toSubKey(key) {
|
|
1382
|
-
return
|
|
1386
|
+
return jsonPathUnprefix(valuePath, key);
|
|
1383
1387
|
}
|
|
1384
1388
|
function onFieldValueChange(subKey, value) {
|
|
1385
1389
|
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type StringConcatOf } from '@strictly/base'
|
|
2
|
+
import {
|
|
3
|
+
jsonPathPrefix,
|
|
4
|
+
jsonPathUnprefix,
|
|
5
|
+
} from '@strictly/define'
|
|
2
6
|
import type { FieldsViewProps } from 'core/props'
|
|
3
7
|
import { observer } from 'mobx-react'
|
|
4
8
|
import type {
|
|
@@ -42,12 +46,12 @@ export function createFieldsView<
|
|
|
42
46
|
): FieldsView<K, MantineFieldComponent<FieldsViewProps<P['fields']>, P, never>> {
|
|
43
47
|
function toKey(subKey: string | number | symbol): string {
|
|
44
48
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
45
|
-
return (
|
|
49
|
+
return jsonPathPrefix(valuePath, subKey as string)
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
function toSubKey(key: string | number | symbol): string {
|
|
49
53
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
50
|
-
return (key as string)
|
|
54
|
+
return jsonPathUnprefix(valuePath, key as string)
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
function onFieldValueChange<SubK extends keyof P['fields']>(
|