@strictly/react-form 0.0.5 → 0.0.7
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/.out/core/mobx/hooks.d.ts +10 -0
- package/.out/core/mobx/hooks.js +47 -0
- package/.out/core/mobx/specs/form_presenter.tests.js +3 -6
- package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.js → merge_field_adapters_with_two_way_converter.tests.js} +15 -16
- package/.out/core/mobx/specs/sub_form_field_adapters.tests.js +78 -10
- package/.out/core/mobx/sub_form_field_adapters.d.ts +6 -4
- package/.out/core/mobx/sub_form_field_adapters.js +23 -2
- package/.out/core/props.d.ts +2 -2
- package/.out/index.d.ts +1 -0
- package/.out/index.js +1 -0
- package/.out/mantine/create_fields_view.d.ts +7 -0
- package/.out/mantine/{create_sub_form.js → create_fields_view.js} +4 -5
- package/.out/mantine/create_form.d.ts +7 -0
- package/.out/mantine/create_form.js +13 -0
- package/.out/mantine/hooks.d.ts +6 -4
- package/.out/mantine/hooks.js +17 -7
- package/.out/mantine/specs/checkbox_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/checkbox_hooks.stories.js +2 -2
- package/.out/mantine/specs/{sub_form_hooks.stories.d.ts → fields_view_hooks.stories.d.ts} +2 -2
- package/.out/mantine/specs/{sub_form_hooks.stories.js → fields_view_hooks.stories.js} +9 -8
- package/.out/mantine/specs/fields_view_hooks.tests.d.ts +1 -0
- package/.out/mantine/specs/fields_view_hooks.tests.js +12 -0
- package/.out/mantine/specs/form_hooks.stories.d.ts +12 -0
- package/.out/mantine/specs/form_hooks.stories.js +60 -0
- package/.out/mantine/specs/form_hooks.tests.d.ts +1 -0
- package/.out/mantine/specs/form_hooks.tests.js +12 -0
- package/.out/mantine/specs/list_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/list_hooks.stories.js +2 -2
- package/.out/mantine/specs/radio_group_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/radio_group_hooks.stories.js +2 -2
- package/.out/mantine/specs/select_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/select_hooks.stories.js +2 -2
- package/.out/mantine/specs/text_input_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/text_input_hooks.stories.js +2 -2
- package/.out/mantine/specs/value_input_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/value_input_hooks.stories.js +2 -2
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-check-types.log +1 -1
- package/core/mobx/hooks.ts +94 -0
- package/core/mobx/specs/form_presenter.tests.ts +6 -6
- package/core/mobx/specs/{merge_field_adapters_with_two_way_converter.ts → merge_field_adapters_with_two_way_converter.tests.ts} +16 -16
- package/core/mobx/specs/sub_form_field_adapters.tests.ts +93 -10
- package/core/mobx/sub_form_field_adapters.ts +54 -7
- package/core/props.ts +2 -2
- package/dist/index.cjs +200 -90
- package/dist/index.d.cts +43 -34
- package/dist/index.d.ts +43 -34
- package/dist/index.js +186 -70
- package/index.ts +1 -0
- package/mantine/{create_sub_form.tsx → create_fields_view.tsx} +27 -16
- package/mantine/create_form.tsx +43 -0
- package/mantine/hooks.tsx +48 -14
- package/mantine/specs/__snapshots__/fields_view_hooks.tests.tsx.snap +460 -0
- package/mantine/specs/__snapshots__/form_hooks.tests.tsx.snap +273 -0
- package/mantine/specs/checkbox_hooks.stories.tsx +4 -4
- package/mantine/specs/{sub_form_hooks.stories.tsx → fields_view_hooks.stories.tsx} +23 -11
- package/mantine/specs/fields_view_hooks.tests.tsx +15 -0
- package/mantine/specs/form_hooks.stories.tsx +107 -0
- package/mantine/specs/form_hooks.tests.tsx +15 -0
- package/mantine/specs/list_hooks.stories.tsx +4 -4
- package/mantine/specs/radio_group_hooks.stories.tsx +4 -4
- package/mantine/specs/select_hooks.stories.tsx +4 -4
- package/mantine/specs/text_input_hooks.stories.tsx +4 -4
- package/mantine/specs/value_input_hooks.stories.tsx +4 -4
- package/package.json +1 -1
- package/.out/mantine/create_sub_form.d.ts +0 -6
- /package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.d.ts → merge_field_adapters_with_two_way_converter.tests.d.ts} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -45,7 +45,8 @@ __export(index_exports, {
|
|
|
45
45
|
mergeValidators: () => mergeValidators,
|
|
46
46
|
prototypingFieldValueFactory: () => prototypingFieldValueFactory,
|
|
47
47
|
subFormFieldAdapters: () => subFormFieldAdapters,
|
|
48
|
-
|
|
48
|
+
useDefaultMobxFormHooks: () => useDefaultMobxFormHooks,
|
|
49
|
+
useMantineFormFields: () => useMantineFormFields,
|
|
49
50
|
usePartialComponent: () => usePartialComponent,
|
|
50
51
|
usePartialObserverComponent: () => usePartialObserverComponent,
|
|
51
52
|
validatingConverter: () => validatingConverter
|
|
@@ -687,6 +688,59 @@ var FormModel = class {
|
|
|
687
688
|
}
|
|
688
689
|
};
|
|
689
690
|
|
|
691
|
+
// core/mobx/hooks.ts
|
|
692
|
+
var import_react = require("react");
|
|
693
|
+
function useDefaultMobxFormHooks(presenter, value, onValidSubmit) {
|
|
694
|
+
const model = (0, import_react.useMemo)(function() {
|
|
695
|
+
return presenter.createModel(value);
|
|
696
|
+
}, [
|
|
697
|
+
presenter,
|
|
698
|
+
value
|
|
699
|
+
]);
|
|
700
|
+
const onFieldValueChange = (0, import_react.useCallback)(
|
|
701
|
+
function(path, value2) {
|
|
702
|
+
presenter.clearFieldError(model, path);
|
|
703
|
+
presenter.setFieldValue(model, path, value2);
|
|
704
|
+
},
|
|
705
|
+
[
|
|
706
|
+
presenter,
|
|
707
|
+
model
|
|
708
|
+
]
|
|
709
|
+
);
|
|
710
|
+
const onFieldSubmit = (0, import_react.useCallback)(
|
|
711
|
+
function(valuePath) {
|
|
712
|
+
if (presenter.validateField(model, valuePath)) {
|
|
713
|
+
onValidSubmit?.(model, valuePath);
|
|
714
|
+
}
|
|
715
|
+
return false;
|
|
716
|
+
},
|
|
717
|
+
[
|
|
718
|
+
presenter,
|
|
719
|
+
model,
|
|
720
|
+
onValidSubmit
|
|
721
|
+
]
|
|
722
|
+
);
|
|
723
|
+
const onFieldBlur = (0, import_react.useCallback)(
|
|
724
|
+
function(path) {
|
|
725
|
+
setTimeout(function() {
|
|
726
|
+
if (presenter.isValuePathActive(model, path)) {
|
|
727
|
+
presenter.validateField(model, path);
|
|
728
|
+
}
|
|
729
|
+
}, 100);
|
|
730
|
+
},
|
|
731
|
+
[
|
|
732
|
+
presenter,
|
|
733
|
+
model
|
|
734
|
+
]
|
|
735
|
+
);
|
|
736
|
+
return {
|
|
737
|
+
model,
|
|
738
|
+
onFieldValueChange,
|
|
739
|
+
onFieldSubmit,
|
|
740
|
+
onFieldBlur
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
|
|
690
744
|
// core/mobx/merge_field_adapters_with_two_way_converter.ts
|
|
691
745
|
var import_base3 = require("@strictly/base");
|
|
692
746
|
function mergeFieldAdaptersWithTwoWayConverter(fieldAdapters, converter) {
|
|
@@ -763,13 +817,33 @@ function mergeAdaptersWithValidators(adapters, validators) {
|
|
|
763
817
|
}
|
|
764
818
|
|
|
765
819
|
// core/mobx/sub_form_field_adapters.ts
|
|
766
|
-
|
|
820
|
+
var import_define3 = require("@strictly/define");
|
|
821
|
+
function subFormFieldAdapters(subAdapters, prefix, contextType) {
|
|
822
|
+
function getSubValuePathAndContext(valuePath, context) {
|
|
823
|
+
const subValuePath = valuePath.replace(prefix, "$");
|
|
824
|
+
const subContext = (0, import_define3.flattenValuesOfType)(contextType, context)[prefix];
|
|
825
|
+
return [
|
|
826
|
+
subValuePath,
|
|
827
|
+
subContext
|
|
828
|
+
];
|
|
829
|
+
}
|
|
767
830
|
return Object.entries(subAdapters).reduce((acc, [
|
|
768
831
|
subKey,
|
|
769
832
|
subValue
|
|
770
833
|
]) => {
|
|
771
834
|
const key = subKey.replace("$", prefix);
|
|
772
|
-
|
|
835
|
+
const adaptedAdapter = {
|
|
836
|
+
convert: (from, valuePath, context) => {
|
|
837
|
+
return subValue.convert(from, ...getSubValuePathAndContext(valuePath, context));
|
|
838
|
+
},
|
|
839
|
+
create: (valuePath, context) => {
|
|
840
|
+
return subValue.create(...getSubValuePathAndContext(valuePath, context));
|
|
841
|
+
},
|
|
842
|
+
revert: subValue.revert && ((from, valuePath, context) => {
|
|
843
|
+
return subValue.revert(from, ...getSubValuePathAndContext(valuePath, context));
|
|
844
|
+
})
|
|
845
|
+
};
|
|
846
|
+
acc[key] = adaptedAdapter;
|
|
773
847
|
return acc;
|
|
774
848
|
}, {});
|
|
775
849
|
}
|
|
@@ -806,7 +880,7 @@ var IntegerToStringConverter = class {
|
|
|
806
880
|
};
|
|
807
881
|
|
|
808
882
|
// field_converters/nullable_to_boolean_converter.ts
|
|
809
|
-
var
|
|
883
|
+
var import_define4 = require("@strictly/define");
|
|
810
884
|
var NullableToBooleanConverter = class {
|
|
811
885
|
constructor(typeDef, prototype, nullType, defaultToNull = true) {
|
|
812
886
|
this.typeDef = typeDef;
|
|
@@ -824,7 +898,7 @@ var NullableToBooleanConverter = class {
|
|
|
824
898
|
}
|
|
825
899
|
revert(from) {
|
|
826
900
|
if (from) {
|
|
827
|
-
const value = (0,
|
|
901
|
+
const value = (0, import_define4.copy)(this.typeDef, this.prototype);
|
|
828
902
|
return {
|
|
829
903
|
type: 0 /* Success */,
|
|
830
904
|
value
|
|
@@ -842,7 +916,7 @@ var NullableToBooleanConverter = class {
|
|
|
842
916
|
|
|
843
917
|
// field_converters/select_value_type_converter.ts
|
|
844
918
|
var import_base5 = require("@strictly/base");
|
|
845
|
-
var
|
|
919
|
+
var import_define5 = require("@strictly/define");
|
|
846
920
|
var AbstractSelectValueTypeConverter = class {
|
|
847
921
|
constructor(typeDef, values, defaultValueKey, noSuchValueError, required) {
|
|
848
922
|
this.typeDef = typeDef;
|
|
@@ -860,7 +934,7 @@ var AbstractSelectValueTypeConverter = class {
|
|
|
860
934
|
value: null
|
|
861
935
|
};
|
|
862
936
|
}
|
|
863
|
-
const value = prototype == null ? prototype : (0,
|
|
937
|
+
const value = prototype == null ? prototype : (0, import_define5.copy)(this.typeDef, prototype);
|
|
864
938
|
return {
|
|
865
939
|
type: 0 /* Success */,
|
|
866
940
|
value
|
|
@@ -953,13 +1027,13 @@ var TrimmingStringConverter = class {
|
|
|
953
1027
|
};
|
|
954
1028
|
|
|
955
1029
|
// field_converters/validating_converter.ts
|
|
956
|
-
var
|
|
1030
|
+
var import_define6 = require("@strictly/define");
|
|
957
1031
|
function validatingConverter(validators = []) {
|
|
958
1032
|
return function(value, valuePath, context) {
|
|
959
1033
|
return validators.reduce(
|
|
960
1034
|
function(acc, validator) {
|
|
961
1035
|
if (acc.type === 0 /* Success */) {
|
|
962
|
-
const error = (0,
|
|
1036
|
+
const error = (0, import_define6.validate)(validator, value, valuePath, context);
|
|
963
1037
|
if (error != null) {
|
|
964
1038
|
return {
|
|
965
1039
|
type: 1 /* Failure */,
|
|
@@ -990,14 +1064,14 @@ function DefaultErrorRenderer({
|
|
|
990
1064
|
var import_core = require("@mantine/core");
|
|
991
1065
|
var import_base6 = require("@strictly/base");
|
|
992
1066
|
var import_mobx2 = require("mobx");
|
|
993
|
-
var
|
|
1067
|
+
var import_react4 = require("react");
|
|
994
1068
|
|
|
995
1069
|
// util/partial.tsx
|
|
996
1070
|
var import_mobx_react = require("mobx-react");
|
|
997
|
-
var
|
|
1071
|
+
var import_react2 = require("react");
|
|
998
1072
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
999
1073
|
function createSimplePartialComponent(Component, curriedProps) {
|
|
1000
|
-
return (0,
|
|
1074
|
+
return (0, import_react2.forwardRef)(
|
|
1001
1075
|
function(exposedProps, ref) {
|
|
1002
1076
|
const C = Component;
|
|
1003
1077
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1012,7 +1086,7 @@ function createSimplePartialComponent(Component, curriedProps) {
|
|
|
1012
1086
|
);
|
|
1013
1087
|
}
|
|
1014
1088
|
function createPartialComponent(Component, curriedPropsSource, additionalPropKeys = []) {
|
|
1015
|
-
return (0,
|
|
1089
|
+
return (0, import_react2.forwardRef)(
|
|
1016
1090
|
function(props, ref) {
|
|
1017
1091
|
const C = Component;
|
|
1018
1092
|
const [
|
|
@@ -1054,7 +1128,7 @@ function createPartialComponent(Component, curriedPropsSource, additionalPropKey
|
|
|
1054
1128
|
);
|
|
1055
1129
|
}
|
|
1056
1130
|
function usePartialComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
|
|
1057
|
-
return (0,
|
|
1131
|
+
return (0, import_react2.useMemo)(
|
|
1058
1132
|
function() {
|
|
1059
1133
|
return createPartialComponent(
|
|
1060
1134
|
Component,
|
|
@@ -1081,7 +1155,7 @@ function createPartialObserverComponent(Component, curriedPropsSource, additiona
|
|
|
1081
1155
|
}
|
|
1082
1156
|
function createUnsafePartialObserverComponent(Component, curriedPropsSource, additionalPropKeys = []) {
|
|
1083
1157
|
return (0, import_mobx_react.observer)(
|
|
1084
|
-
(0,
|
|
1158
|
+
(0, import_react2.forwardRef)(
|
|
1085
1159
|
function(props, ref) {
|
|
1086
1160
|
const C = Component;
|
|
1087
1161
|
const [
|
|
@@ -1124,7 +1198,7 @@ function createUnsafePartialObserverComponent(Component, curriedPropsSource, add
|
|
|
1124
1198
|
);
|
|
1125
1199
|
}
|
|
1126
1200
|
function usePartialObserverComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
|
|
1127
|
-
return (0,
|
|
1201
|
+
return (0, import_react2.useMemo)(
|
|
1128
1202
|
function() {
|
|
1129
1203
|
return createPartialObserverComponent(
|
|
1130
1204
|
Component,
|
|
@@ -1191,8 +1265,79 @@ function createCheckbox(valuePath, Checkbox) {
|
|
|
1191
1265
|
);
|
|
1192
1266
|
}
|
|
1193
1267
|
|
|
1194
|
-
// mantine/
|
|
1268
|
+
// mantine/create_fields_view.tsx
|
|
1269
|
+
var import_mobx_react2 = require("mobx-react");
|
|
1195
1270
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1271
|
+
function createFieldsView(valuePath, FieldsView, observableProps) {
|
|
1272
|
+
function toKey(subKey) {
|
|
1273
|
+
return subKey.replace("$", valuePath);
|
|
1274
|
+
}
|
|
1275
|
+
function toSubKey(key) {
|
|
1276
|
+
return key.replace(valuePath, "$");
|
|
1277
|
+
}
|
|
1278
|
+
function onFieldValueChange(subKey, value) {
|
|
1279
|
+
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
1280
|
+
}
|
|
1281
|
+
function onFieldBlur(subKey) {
|
|
1282
|
+
observableProps.onFieldBlur?.(toKey(subKey));
|
|
1283
|
+
}
|
|
1284
|
+
function onFieldFocus(subKey) {
|
|
1285
|
+
observableProps.onFieldFocus?.(toKey(subKey));
|
|
1286
|
+
}
|
|
1287
|
+
function onFieldSubmit(subKey) {
|
|
1288
|
+
observableProps.onFieldSubmit?.(toKey(subKey));
|
|
1289
|
+
}
|
|
1290
|
+
return (0, import_mobx_react2.observer)(function(props) {
|
|
1291
|
+
const subFields = Object.entries(observableProps.fields).reduce((acc, [
|
|
1292
|
+
fieldKey,
|
|
1293
|
+
fieldValue
|
|
1294
|
+
]) => {
|
|
1295
|
+
if (fieldKey.startsWith(valuePath)) {
|
|
1296
|
+
acc[toSubKey(fieldKey)] = fieldValue;
|
|
1297
|
+
}
|
|
1298
|
+
return acc;
|
|
1299
|
+
}, {});
|
|
1300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1301
|
+
FieldsView,
|
|
1302
|
+
{
|
|
1303
|
+
// maybe we can do this in a more type safe way
|
|
1304
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
|
|
1305
|
+
...props,
|
|
1306
|
+
fields: subFields,
|
|
1307
|
+
onFieldBlur,
|
|
1308
|
+
onFieldFocus,
|
|
1309
|
+
onFieldSubmit,
|
|
1310
|
+
onFieldValueChange
|
|
1311
|
+
}
|
|
1312
|
+
);
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
// mantine/create_form.tsx
|
|
1317
|
+
var import_mobx_react3 = require("mobx-react");
|
|
1318
|
+
var import_react3 = require("react");
|
|
1319
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1320
|
+
function createForm(valuePath, Form, observableProps) {
|
|
1321
|
+
return (0, import_mobx_react3.observer)((props) => {
|
|
1322
|
+
const { value } = observableProps.fields[valuePath];
|
|
1323
|
+
const onValueChange = (0, import_react3.useCallback)((value2) => {
|
|
1324
|
+
observableProps.onFieldValueChange(valuePath, value2);
|
|
1325
|
+
}, []);
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1327
|
+
Form,
|
|
1328
|
+
{
|
|
1329
|
+
// maybe we can do this in a more type safe way
|
|
1330
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
|
|
1331
|
+
...props,
|
|
1332
|
+
onValueChange,
|
|
1333
|
+
value
|
|
1334
|
+
}
|
|
1335
|
+
);
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
// mantine/create_list.tsx
|
|
1340
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1196
1341
|
function createList(valuePath, List) {
|
|
1197
1342
|
const propSource = () => {
|
|
1198
1343
|
const values = [...this.fields[valuePath].value];
|
|
@@ -1208,7 +1353,7 @@ function DefaultList({
|
|
|
1208
1353
|
listPath,
|
|
1209
1354
|
children
|
|
1210
1355
|
}) {
|
|
1211
|
-
return /* @__PURE__ */ (0,
|
|
1356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: values.map(function(value, index) {
|
|
1212
1357
|
const valuePath = `${listPath}.${index}`;
|
|
1213
1358
|
return children(valuePath, value, index);
|
|
1214
1359
|
}) });
|
|
@@ -1247,7 +1392,7 @@ function createRadio(valuePath, value, Radio) {
|
|
|
1247
1392
|
}
|
|
1248
1393
|
|
|
1249
1394
|
// mantine/create_radio_group.tsx
|
|
1250
|
-
var
|
|
1395
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1251
1396
|
function createRadioGroup(valuePath, RadioGroup) {
|
|
1252
1397
|
const onChange = (value) => {
|
|
1253
1398
|
this.onFieldValueChange?.(valuePath, value);
|
|
@@ -1275,7 +1420,7 @@ function createRadioGroup(valuePath, RadioGroup) {
|
|
|
1275
1420
|
name: valuePath,
|
|
1276
1421
|
value,
|
|
1277
1422
|
required,
|
|
1278
|
-
error: error && /* @__PURE__ */ (0,
|
|
1423
|
+
error: error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorRenderer, { error }),
|
|
1279
1424
|
onChange,
|
|
1280
1425
|
onFocus,
|
|
1281
1426
|
onBlur,
|
|
@@ -1285,53 +1430,8 @@ function createRadioGroup(valuePath, RadioGroup) {
|
|
|
1285
1430
|
return createUnsafePartialObserverComponent(RadioGroup, propSource, ["ErrorRenderer"]);
|
|
1286
1431
|
}
|
|
1287
1432
|
|
|
1288
|
-
// mantine/create_sub_form.tsx
|
|
1289
|
-
var import_mobx_react2 = require("mobx-react");
|
|
1290
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1291
|
-
function createSubForm(valuePath, SubForm, observableProps) {
|
|
1292
|
-
function toKey(subKey) {
|
|
1293
|
-
return subKey.replace("$", valuePath);
|
|
1294
|
-
}
|
|
1295
|
-
function toSubKey(key) {
|
|
1296
|
-
return key.replace(valuePath, "$");
|
|
1297
|
-
}
|
|
1298
|
-
function onFieldValueChange(subKey, value) {
|
|
1299
|
-
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
1300
|
-
}
|
|
1301
|
-
function onFieldBlur(subKey) {
|
|
1302
|
-
observableProps.onFieldBlur?.(toKey(subKey));
|
|
1303
|
-
}
|
|
1304
|
-
function onFieldFocus(subKey) {
|
|
1305
|
-
observableProps.onFieldFocus?.(toKey(subKey));
|
|
1306
|
-
}
|
|
1307
|
-
function onFieldSubmit(subKey) {
|
|
1308
|
-
observableProps.onFieldSubmit?.(toKey(subKey));
|
|
1309
|
-
}
|
|
1310
|
-
return (0, import_mobx_react2.observer)(function() {
|
|
1311
|
-
const subFields = Object.entries(observableProps.fields).reduce((acc, [
|
|
1312
|
-
fieldKey,
|
|
1313
|
-
fieldValue
|
|
1314
|
-
]) => {
|
|
1315
|
-
if (fieldKey.startsWith(valuePath)) {
|
|
1316
|
-
acc[toSubKey(fieldKey)] = fieldValue;
|
|
1317
|
-
}
|
|
1318
|
-
return acc;
|
|
1319
|
-
}, {});
|
|
1320
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1321
|
-
SubForm,
|
|
1322
|
-
{
|
|
1323
|
-
fields: subFields,
|
|
1324
|
-
onFieldBlur,
|
|
1325
|
-
onFieldFocus,
|
|
1326
|
-
onFieldSubmit,
|
|
1327
|
-
onFieldValueChange
|
|
1328
|
-
}
|
|
1329
|
-
);
|
|
1330
|
-
});
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
1433
|
// mantine/create_text_input.tsx
|
|
1334
|
-
var
|
|
1434
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1335
1435
|
function createTextInput(valuePath, TextInput) {
|
|
1336
1436
|
const onChange = (e) => {
|
|
1337
1437
|
this.onFieldValueChange?.(valuePath, e.target.value);
|
|
@@ -1365,7 +1465,7 @@ function createTextInput(valuePath, TextInput) {
|
|
|
1365
1465
|
value,
|
|
1366
1466
|
disabled: readonly,
|
|
1367
1467
|
required,
|
|
1368
|
-
error: error && /* @__PURE__ */ (0,
|
|
1468
|
+
error: error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorRenderer, { error }),
|
|
1369
1469
|
onChange,
|
|
1370
1470
|
onFocus,
|
|
1371
1471
|
onBlur,
|
|
@@ -1380,7 +1480,7 @@ function createTextInput(valuePath, TextInput) {
|
|
|
1380
1480
|
}
|
|
1381
1481
|
|
|
1382
1482
|
// mantine/create_value_input.tsx
|
|
1383
|
-
var
|
|
1483
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1384
1484
|
function createValueInput(valuePath, ValueInput) {
|
|
1385
1485
|
const onChange = (value) => {
|
|
1386
1486
|
this.onFieldValueChange?.(valuePath, value);
|
|
@@ -1414,7 +1514,7 @@ function createValueInput(valuePath, ValueInput) {
|
|
|
1414
1514
|
value,
|
|
1415
1515
|
disabled: readonly,
|
|
1416
1516
|
required,
|
|
1417
|
-
error: error && /* @__PURE__ */ (0,
|
|
1517
|
+
error: error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorRenderer, { error }),
|
|
1418
1518
|
onChange,
|
|
1419
1519
|
onFocus,
|
|
1420
1520
|
onBlur,
|
|
@@ -1429,18 +1529,18 @@ function createValueInput(valuePath, ValueInput) {
|
|
|
1429
1529
|
}
|
|
1430
1530
|
|
|
1431
1531
|
// mantine/hooks.tsx
|
|
1432
|
-
var
|
|
1532
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1433
1533
|
function SimpleSelect(props) {
|
|
1434
|
-
return /* @__PURE__ */ (0,
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core.Select, { ...props });
|
|
1435
1535
|
}
|
|
1436
|
-
function
|
|
1536
|
+
function useMantineFormFields({
|
|
1437
1537
|
onFieldValueChange,
|
|
1438
1538
|
onFieldBlur,
|
|
1439
1539
|
onFieldFocus,
|
|
1440
1540
|
onFieldSubmit,
|
|
1441
1541
|
fields
|
|
1442
1542
|
}) {
|
|
1443
|
-
const form = (0,
|
|
1543
|
+
const form = (0, import_react4.useMemo)(
|
|
1444
1544
|
function() {
|
|
1445
1545
|
return new MantineFormImpl(fields);
|
|
1446
1546
|
},
|
|
@@ -1448,7 +1548,7 @@ function useMantineForm({
|
|
|
1448
1548
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1449
1549
|
[]
|
|
1450
1550
|
);
|
|
1451
|
-
(0,
|
|
1551
|
+
(0, import_react4.useEffect)(function() {
|
|
1452
1552
|
(0, import_mobx2.runInAction)(function() {
|
|
1453
1553
|
form.fields = fields;
|
|
1454
1554
|
});
|
|
@@ -1456,25 +1556,25 @@ function useMantineForm({
|
|
|
1456
1556
|
form,
|
|
1457
1557
|
fields
|
|
1458
1558
|
]);
|
|
1459
|
-
(0,
|
|
1559
|
+
(0, import_react4.useEffect)(function() {
|
|
1460
1560
|
form.onFieldValueChange = onFieldValueChange;
|
|
1461
1561
|
}, [
|
|
1462
1562
|
form,
|
|
1463
1563
|
onFieldValueChange
|
|
1464
1564
|
]);
|
|
1465
|
-
(0,
|
|
1565
|
+
(0, import_react4.useEffect)(function() {
|
|
1466
1566
|
form.onFieldBlur = onFieldBlur;
|
|
1467
1567
|
}, [
|
|
1468
1568
|
form,
|
|
1469
1569
|
onFieldBlur
|
|
1470
1570
|
]);
|
|
1471
|
-
(0,
|
|
1571
|
+
(0, import_react4.useEffect)(function() {
|
|
1472
1572
|
form.onFieldFocus = onFieldFocus;
|
|
1473
1573
|
}, [
|
|
1474
1574
|
form,
|
|
1475
1575
|
onFieldFocus
|
|
1476
1576
|
]);
|
|
1477
|
-
(0,
|
|
1577
|
+
(0, import_react4.useEffect)(function() {
|
|
1478
1578
|
form.onFieldSubmit = onFieldSubmit;
|
|
1479
1579
|
}, [
|
|
1480
1580
|
form,
|
|
@@ -1504,9 +1604,10 @@ var MantineFormImpl = class {
|
|
|
1504
1604
|
listCache = new import_base6.Cache(
|
|
1505
1605
|
createList.bind(this)
|
|
1506
1606
|
);
|
|
1507
|
-
|
|
1508
|
-
|
|
1607
|
+
fieldsViewCache = new import_base6.Cache(
|
|
1608
|
+
createFieldsView.bind(this)
|
|
1509
1609
|
);
|
|
1610
|
+
formCache = new import_base6.Cache(createForm.bind(this));
|
|
1510
1611
|
@import_mobx2.observable.ref
|
|
1511
1612
|
accessor fields;
|
|
1512
1613
|
onFieldValueChange;
|
|
@@ -1572,20 +1673,28 @@ var MantineFormImpl = class {
|
|
|
1572
1673
|
DefaultList
|
|
1573
1674
|
);
|
|
1574
1675
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
return this.subFormCache.retrieveOrCreate(
|
|
1676
|
+
fieldsView(valuePath, FieldsView) {
|
|
1677
|
+
return this.fieldsViewCache.retrieveOrCreate(
|
|
1578
1678
|
valuePath,
|
|
1579
1679
|
// strip props from component since we lose information in the cache
|
|
1580
1680
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
1581
|
-
|
|
1681
|
+
FieldsView,
|
|
1682
|
+
this
|
|
1683
|
+
);
|
|
1684
|
+
}
|
|
1685
|
+
form(valuePath, Form) {
|
|
1686
|
+
return this.formCache.retrieveOrCreate(
|
|
1687
|
+
valuePath,
|
|
1688
|
+
// strip props from component since we lose information in the cache
|
|
1689
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
1690
|
+
Form,
|
|
1582
1691
|
this
|
|
1583
1692
|
);
|
|
1584
1693
|
}
|
|
1585
1694
|
};
|
|
1586
1695
|
|
|
1587
1696
|
// types/merge_validators.ts
|
|
1588
|
-
var
|
|
1697
|
+
var import_define7 = require("@strictly/define");
|
|
1589
1698
|
function mergeValidators(validators1, validators2) {
|
|
1590
1699
|
const validators = {
|
|
1591
1700
|
...validators1,
|
|
@@ -1600,16 +1709,16 @@ function mergeValidators(validators1, validators2) {
|
|
|
1600
1709
|
validators3[key] = {
|
|
1601
1710
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1602
1711
|
validate: function(value, valuePath, context) {
|
|
1603
|
-
const error = (0,
|
|
1712
|
+
const error = (0, import_define7.validate)(validator1, value, valuePath, context);
|
|
1604
1713
|
if (error != null) {
|
|
1605
1714
|
return error;
|
|
1606
1715
|
}
|
|
1607
|
-
return (0,
|
|
1716
|
+
return (0, import_define7.validate)(validator2, value, valuePath, context);
|
|
1608
1717
|
},
|
|
1609
1718
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1610
1719
|
annotations: function(valuePath, context) {
|
|
1611
|
-
const annotations1 = (0,
|
|
1612
|
-
const annotations22 = (0,
|
|
1720
|
+
const annotations1 = (0, import_define7.annotations)(validator1, valuePath, context);
|
|
1721
|
+
const annotations22 = (0, import_define7.annotations)(validator2, valuePath, context);
|
|
1613
1722
|
return {
|
|
1614
1723
|
readonly: annotations1.readonly || annotations22.readonly,
|
|
1615
1724
|
required: annotations1.required || annotations22.required
|
|
@@ -1649,7 +1758,8 @@ function mergeValidators(validators1, validators2) {
|
|
|
1649
1758
|
mergeValidators,
|
|
1650
1759
|
prototypingFieldValueFactory,
|
|
1651
1760
|
subFormFieldAdapters,
|
|
1652
|
-
|
|
1761
|
+
useDefaultMobxFormHooks,
|
|
1762
|
+
useMantineFormFields,
|
|
1653
1763
|
usePartialComponent,
|
|
1654
1764
|
usePartialObserverComponent,
|
|
1655
1765
|
validatingConverter
|
package/dist/index.d.cts
CHANGED
|
@@ -149,29 +149,17 @@ declare class FormModel<T extends Type, ValueToTypePaths extends Readonly<Record
|
|
|
149
149
|
get accessors(): Readonly<Record<string, Accessor>>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
type
|
|
153
|
-
|
|
152
|
+
type FieldsViewProps<F extends Fields> = {
|
|
153
|
+
fields: F;
|
|
154
|
+
onFieldValueChange<K extends keyof F>(this: void, key: K, value: F[K]['value']): void;
|
|
155
|
+
onFieldFocus?(this: void, key: keyof F): void;
|
|
156
|
+
onFieldBlur?(this: void, key: keyof F): void;
|
|
157
|
+
onFieldSubmit?(this: void, key: keyof F): boolean | void;
|
|
154
158
|
};
|
|
155
|
-
type
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
type TosOfFieldAdapters<FieldAdapters extends Readonly<Record<string, FieldAdapter>>> = {
|
|
159
|
-
[K in keyof FieldAdapters]: ToOfFieldAdapter<FieldAdapters[K]>;
|
|
160
|
-
}[keyof FieldAdapters];
|
|
161
|
-
declare function mergeFieldAdaptersWithTwoWayConverter<FieldAdapters extends Readonly<Record<string, FieldAdapter>>, E, Context>(fieldAdapters: FieldAdapters, converter: TwoWayFieldConverter<TosOfFieldAdapters<FieldAdapters>, TosOfFieldAdapters<FieldAdapters>, E, ValuePathsOfFieldAdapters<FieldAdapters>, Context>): MergedOfFieldAdaptersWithTwoWayConverter<FieldAdapters, E, Context>;
|
|
162
|
-
|
|
163
|
-
type MergedOfFieldAdaptersWithValidators<FieldAdapters extends Readonly<Record<Key, FieldAdapter>>, Validators extends Partial<Readonly<Record<string, Validator>>>, Key extends keyof Validators = keyof Validators> = Simplify<{
|
|
164
|
-
readonly [K in Key]: MergedOfFieldAdapterWithValidator<FieldAdapters[K], Validators[K]>;
|
|
165
|
-
} & {
|
|
166
|
-
readonly [K in Exclude<keyof FieldAdapters, Key>]: FieldAdapters[K];
|
|
167
|
-
}>;
|
|
168
|
-
type MergedOfFieldAdapterWithValidator<A extends FieldAdapter, V extends Validator | undefined> = undefined extends V ? A : A extends FieldAdapter<infer From, infer To, infer E1, infer P1, infer C1> ? V extends Validator<From, infer E2, infer P2, infer C2> ? FieldAdapter<From, To, E1 | E2, P1 | P2, C1 | C2> : never : never;
|
|
169
|
-
declare function mergeAdaptersWithValidators<FieldAdapters extends Readonly<Record<Key, FieldAdapter>>, Validators extends Readonly<Record<string, Validator>>, Key extends keyof Validators = keyof Validators>(adapters: FieldAdapters, validators: Validators): MergedOfFieldAdaptersWithValidators<FieldAdapters, Validators, Key>;
|
|
170
|
-
|
|
171
|
-
type SubFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, P extends string> = {
|
|
172
|
-
[K in keyof SubAdapters as K extends StringConcatOf<'$', infer S> ? `${P}${S}` : never]: SubAdapters[K];
|
|
159
|
+
type FormProps<O> = {
|
|
160
|
+
value: O;
|
|
161
|
+
onValueChange: (value: O) => void;
|
|
173
162
|
};
|
|
174
|
-
declare function subFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, P extends string>(subAdapters: SubAdapters, prefix: P): SubFormFieldAdapters<SubAdapters, P>;
|
|
175
163
|
|
|
176
164
|
/**
|
|
177
165
|
* Used to extract the supported value paths from a presenter
|
|
@@ -191,17 +179,36 @@ type ToValueOfPresenterValuePath<Presenter extends FormPresenter<any, any, any,
|
|
|
191
179
|
*/
|
|
192
180
|
type FormFieldsOfPresenter<Presenter extends FormPresenter<any, any, any, any>> = Presenter extends FormPresenter<infer _1, infer _2, infer _3, infer ValuePathsToAdapters> ? FlattenedConvertedFieldsOf<ValuePathsToAdapters> : never;
|
|
193
181
|
|
|
194
|
-
type
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
182
|
+
type ValueOfPresenter<P extends FormPresenter<any, any, any, any>> = P extends FormPresenter<infer T, any, any, any> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
|
|
183
|
+
type ModelOfPresenter<P extends FormPresenter<any, any, any, any>> = ReturnType<P['createModel']>;
|
|
184
|
+
declare function useDefaultMobxFormHooks<P extends FormPresenter<any, any, any, any>>(presenter: P, value: ValueOfPresenter<P>, onValidSubmit?: <Path extends ValuePathsOfPresenter<P>>(model: ModelOfPresenter<P>, valuePath: Path) => void): {
|
|
185
|
+
model: ModelOfPresenter<P>;
|
|
186
|
+
} & Omit<FieldsViewProps<ModelOfPresenter<P>['fields']>, 'fields'>;
|
|
187
|
+
|
|
188
|
+
type MergedOfFieldAdaptersWithTwoWayConverter<FieldAdapters extends Readonly<Record<string, FieldAdapter>>, E, Context> = {
|
|
189
|
+
[K in keyof FieldAdapters]: FieldAdapter<FromOfFieldAdapter<FieldAdapters[K]>, ToOfFieldAdapter<FieldAdapters[K]>, ErrorOfFieldAdapter<FieldAdapters[K]> | E, ValuePathOfFieldAdapter<FieldAdapters[K]>, Context>;
|
|
200
190
|
};
|
|
201
|
-
type
|
|
202
|
-
|
|
203
|
-
|
|
191
|
+
type ValuePathsOfFieldAdapters<FieldAdapters extends Readonly<Record<string, FieldAdapter>>> = {
|
|
192
|
+
[K in keyof FieldAdapters]: ValuePathOfFieldAdapter<FieldAdapters[K]>;
|
|
193
|
+
}[keyof FieldAdapters];
|
|
194
|
+
type TosOfFieldAdapters<FieldAdapters extends Readonly<Record<string, FieldAdapter>>> = {
|
|
195
|
+
[K in keyof FieldAdapters]: ToOfFieldAdapter<FieldAdapters[K]>;
|
|
196
|
+
}[keyof FieldAdapters];
|
|
197
|
+
declare function mergeFieldAdaptersWithTwoWayConverter<FieldAdapters extends Readonly<Record<string, FieldAdapter>>, E, Context>(fieldAdapters: FieldAdapters, converter: TwoWayFieldConverter<TosOfFieldAdapters<FieldAdapters>, TosOfFieldAdapters<FieldAdapters>, E, ValuePathsOfFieldAdapters<FieldAdapters>, Context>): MergedOfFieldAdaptersWithTwoWayConverter<FieldAdapters, E, Context>;
|
|
198
|
+
|
|
199
|
+
type MergedOfFieldAdaptersWithValidators<FieldAdapters extends Readonly<Record<Key, FieldAdapter>>, Validators extends Partial<Readonly<Record<string, Validator>>>, Key extends keyof Validators = keyof Validators> = Simplify<{
|
|
200
|
+
readonly [K in Key]: MergedOfFieldAdapterWithValidator<FieldAdapters[K], Validators[K]>;
|
|
201
|
+
} & {
|
|
202
|
+
readonly [K in Exclude<keyof FieldAdapters, Key>]: FieldAdapters[K];
|
|
203
|
+
}>;
|
|
204
|
+
type MergedOfFieldAdapterWithValidator<A extends FieldAdapter, V extends Validator | undefined> = undefined extends V ? A : A extends FieldAdapter<infer From, infer To, infer E1, infer P1, infer C1> ? V extends Validator<From, infer E2, infer P2, infer C2> ? FieldAdapter<From, To, E1 | E2, P1 | P2, C1 | C2> : never : never;
|
|
205
|
+
declare function mergeAdaptersWithValidators<FieldAdapters extends Readonly<Record<Key, FieldAdapter>>, Validators extends Readonly<Record<string, Validator>>, Key extends keyof Validators = keyof Validators>(adapters: FieldAdapters, validators: Validators): MergedOfFieldAdaptersWithValidators<FieldAdapters, Validators, Key>;
|
|
206
|
+
|
|
207
|
+
type SubFormFieldAdapter<F extends FieldAdapter, P extends string, Context> = FieldAdapter<FromOfFieldAdapter<F>, ToOfFieldAdapter<F>, ErrorOfFieldAdapter<F>, P, Context>;
|
|
208
|
+
type SubFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, P extends string, Context> = {
|
|
209
|
+
[K in keyof SubAdapters as K extends StringConcatOf<'$', infer S> ? `${P}${S}` : never]: K extends StringConcatOf<'$', infer S> ? SubFormFieldAdapter<SubAdapters[K], `${P}${S}`, Context> : never;
|
|
204
210
|
};
|
|
211
|
+
declare function subFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, P extends string, ContextType extends Type>(subAdapters: SubAdapters, prefix: P, contextType: ContextType): SubFormFieldAdapters<SubAdapters, P, ValueOfType<ContextType>>;
|
|
205
212
|
|
|
206
213
|
declare class IntegerToStringConverter<E, ValuePath extends string, Context> implements TwoWayFieldConverter<number, string, E, ValuePath, Context> {
|
|
207
214
|
private readonly isNanError;
|
|
@@ -360,7 +367,7 @@ type SuppliedValueInputProps<V, T extends Element = Element> = Partial<{
|
|
|
360
367
|
declare function SimpleSelect(props: SelectProps & {
|
|
361
368
|
onChange?: (value: string | null) => void;
|
|
362
369
|
}): react_jsx_runtime.JSX.Element;
|
|
363
|
-
declare function
|
|
370
|
+
declare function useMantineFormFields<F extends Fields>({ onFieldValueChange, onFieldBlur, onFieldFocus, onFieldSubmit, fields, }: FieldsViewProps<F>): MantineFormImpl<F>;
|
|
364
371
|
declare class MantineFormImpl<F extends Fields> implements MantineForm<F> {
|
|
365
372
|
private readonly textInputCache;
|
|
366
373
|
private readonly valueInputCache;
|
|
@@ -369,7 +376,8 @@ declare class MantineFormImpl<F extends Fields> implements MantineForm<F> {
|
|
|
369
376
|
private readonly radioCache;
|
|
370
377
|
private readonly pillCache;
|
|
371
378
|
private readonly listCache;
|
|
372
|
-
private readonly
|
|
379
|
+
private readonly fieldsViewCache;
|
|
380
|
+
private readonly formCache;
|
|
373
381
|
accessor fields: F;
|
|
374
382
|
onFieldValueChange: <K extends keyof F>(this: void, key: K, value: F[K]['value']) => void;
|
|
375
383
|
onFieldFocus: ((this: void, key: keyof F) => void) | undefined;
|
|
@@ -389,7 +397,8 @@ declare class MantineFormImpl<F extends Fields> implements MantineForm<F> {
|
|
|
389
397
|
pill<K extends keyof AllFieldsOfFields<F>>(valuePath: K): MantineFieldComponent<SuppliedPillProps, PillProps, ErrorOfField<F[K]>>;
|
|
390
398
|
pill<K extends keyof AllFieldsOfFields<F>, P extends SuppliedPillProps>(valuePath: K, Pill: ComponentType<P>): MantineFieldComponent<SuppliedPillProps, P>;
|
|
391
399
|
list<K extends keyof ListFieldsOfFields<F>>(valuePath: K): MantineFieldComponent<SuppliedListProps<`${K}.${number}`>, ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>>;
|
|
392
|
-
|
|
400
|
+
fieldsView<K extends keyof AllFieldsOfFields<F>, P extends FieldsViewProps<Fields> = FieldsViewProps<SubFormFields<F, K>>>(valuePath: K, FieldsView: ComponentType<P>): MantineFieldComponent<FieldsViewProps<P['fields']>, P>;
|
|
401
|
+
form<K extends keyof AllFieldsOfFields<F>, P extends FormProps<ValueTypeOfField<F[K]>> = FormProps<ValueTypeOfField<F[K]>>>(valuePath: K, Form: ComponentType<P>): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P>;
|
|
393
402
|
}
|
|
394
403
|
|
|
395
404
|
type MergedOfValidators<Validators1 extends Partial<Readonly<Record<Keys, Validator>>>, Validators2 extends Partial<Readonly<Record<Keys, Validator>>>, Keys extends string = Extract<keyof Validators1 | keyof Validators2, string>> = Simplify<{
|
|
@@ -398,4 +407,4 @@ type MergedOfValidators<Validators1 extends Partial<Readonly<Record<Keys, Valida
|
|
|
398
407
|
type MergedOfValidator<Validator1 extends Validator, Validator2 extends Validator> = Validator1 extends Validator<infer V, infer E1, infer P, infer C> ? Validator2 extends Validator<V, infer E2, P, C> ? Validator<V, E1 | E2, P, C> : never : never;
|
|
399
408
|
declare function mergeValidators<Validators1 extends Partial<Readonly<Record<Keys, Validator>>>, Validators2 extends Partial<Readonly<Record<Keys, Validator>>>, Keys extends string = Extract<keyof Validators1 | keyof Validators2, string>>(validators1: Validators1, validators2: Validators2): MergedOfValidators<Validators1, Validators2, Keys>;
|
|
400
409
|
|
|
401
|
-
export { AbstractSelectValueTypeConverter, type AnnotatedFieldConversion, type AnnotatedFieldConverter, type Annotation, DefaultErrorRenderer, type
|
|
410
|
+
export { AbstractSelectValueTypeConverter, type AnnotatedFieldConversion, type AnnotatedFieldConverter, type Annotation, DefaultErrorRenderer, type ErrorOfField, type ErrorOfFieldAdapter, type ErrorRenderer, type ErrorRendererProps, type Field, type FieldAdapter, type FieldAdaptersOfValues, type FieldValueFactory, type Fields, type FieldsViewProps, type FlattenedAdaptersOfFields, type FlattenedConvertedFieldsOf, type FlattenedTypePathsToAdaptersOf, type FormFieldsOfFieldAdapters, type FormFieldsOfPresenter, FormModel, FormPresenter, type FormProps, type FromOfFieldAdapter, IntegerToStringConverter, type MergedOfFieldAdaptersWithTwoWayConverter, type MergedOfFieldAdaptersWithValidators, type MergedOfValidator, type MergedOfValidators, NullableToBooleanConverter, type PartialComponent, SelectDiscriminatedUnionConverter, SelectLiteralConverter, SelectStringConverter, type ToOfFieldAdapter, type ToValueOfPresenterValuePath, TrimmingStringConverter, type TwoWayFieldConverter, type TwoWayFieldConverterWithValueFactory, type UnreliableFieldConversion, UnreliableFieldConversionType, type UnreliableFieldConverter, type UnsafePartialComponent, type ValuePathOfFieldAdapter, type ValuePathsOfPresenter, type ValuePathsToAdaptersOf, adapter, adapterFromPrototype, adapterFromTwoWayConverter, createPartialComponent, createPartialObserverComponent, createSimplePartialComponent, createUnsafePartialObserverComponent, identityAdapter, listAdapter, mergeAdaptersWithValidators, mergeFieldAdaptersWithTwoWayConverter, mergeValidators, prototypingFieldValueFactory, subFormFieldAdapters, useDefaultMobxFormHooks, useMantineFormFields, usePartialComponent, usePartialObserverComponent, validatingConverter };
|