@strictly/react-form 0.0.8 → 0.0.10

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.
Files changed (44) hide show
  1. package/.out/core/mobx/field_adapter_builder.d.ts +4 -0
  2. package/.out/core/mobx/field_adapter_builder.js +31 -0
  3. package/.out/core/mobx/form_presenter.d.ts +5 -5
  4. package/.out/core/mobx/form_presenter.js +8 -6
  5. package/.out/core/mobx/hooks.d.ts +24 -4
  6. package/.out/core/mobx/hooks.js +24 -3
  7. package/.out/core/mobx/specs/form_presenter.tests.js +10 -5
  8. package/.out/core/mobx/sub_form_field_adapters.d.ts +2 -2
  9. package/.out/field_converters/chain_field_converter.js +3 -3
  10. package/.out/mantine/create_fields_view.d.ts +9 -1
  11. package/.out/mantine/create_fields_view.js +13 -1
  12. package/.out/mantine/error_renderer.d.ts +7 -3
  13. package/.out/mantine/hooks.d.ts +2 -1
  14. package/.out/mantine/hooks.js +1 -1
  15. package/.out/mantine/specs/create_fields_view.tests.js +17 -0
  16. package/.out/mantine/specs/fields_view_hooks.stories.d.ts +6 -2
  17. package/.out/mantine/specs/fields_view_hooks.stories.js +26 -7
  18. package/.out/mantine/specs/fields_view_hooks.tests.js +21 -1
  19. package/.out/tsconfig.tsbuildinfo +1 -1
  20. package/.out/types/specs/error_of_field.tests.d.ts +1 -0
  21. package/.out/types/specs/{error_type_of_field.tests.js → error_of_field.tests.js} +1 -1
  22. package/.turbo/turbo-build.log +8 -8
  23. package/.turbo/turbo-check-types.log +1 -1
  24. package/core/mobx/field_adapter_builder.ts +71 -0
  25. package/core/mobx/form_presenter.ts +15 -14
  26. package/core/mobx/hooks.tsx +196 -0
  27. package/core/mobx/specs/form_presenter.tests.ts +24 -5
  28. package/core/mobx/sub_form_field_adapters.ts +14 -3
  29. package/dist/index.cjs +290 -220
  30. package/dist/index.d.cts +63 -32
  31. package/dist/index.d.ts +63 -32
  32. package/dist/index.js +288 -219
  33. package/field_converters/chain_field_converter.ts +3 -3
  34. package/mantine/create_fields_view.tsx +66 -31
  35. package/mantine/error_renderer.ts +12 -3
  36. package/mantine/hooks.tsx +9 -6
  37. package/mantine/specs/__snapshots__/fields_view_hooks.tests.tsx.snap +194 -197
  38. package/mantine/specs/create_fields_view.tests.ts +29 -0
  39. package/mantine/specs/fields_view_hooks.stories.tsx +58 -15
  40. package/mantine/specs/fields_view_hooks.tests.tsx +26 -0
  41. package/package.json +1 -1
  42. package/types/specs/{error_type_of_field.tests.ts → error_of_field.tests.ts} +1 -1
  43. package/core/mobx/hooks.ts +0 -112
  44. /package/.out/{types/specs/error_type_of_field.tests.d.ts → mantine/specs/create_fields_view.tests.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -52,18 +52,18 @@ function chainAnnotatedFieldConverter(from, to) {
52
52
  return function(value, valuePath, context) {
53
53
  const {
54
54
  required: intermediateRequired,
55
- readonly: intermediateDisabled,
55
+ readonly: intermediateReadonly,
56
56
  value: intermediateValue
57
57
  } = from(value, valuePath, context);
58
58
  const {
59
59
  required: finalRequired,
60
- readonly: finalDisabled,
60
+ readonly: finalReadonly,
61
61
  value: finalValue
62
62
  } = to(intermediateValue, valuePath, context);
63
63
  return {
64
64
  value: finalValue,
65
65
  required: intermediateRequired || finalRequired,
66
- readonly: intermediateDisabled || finalDisabled
66
+ readonly: intermediateReadonly || finalReadonly
67
67
  };
68
68
  };
69
69
  }
@@ -102,6 +102,25 @@ var MaybeIdentityConverter = class {
102
102
  }
103
103
  };
104
104
 
105
+ // field_converters/trimming_string_converter.ts
106
+ var TrimmingStringConverter = class {
107
+ constructor() {
108
+ }
109
+ convert(to) {
110
+ return {
111
+ value: to.trim(),
112
+ required: false,
113
+ readonly: false
114
+ };
115
+ }
116
+ revert(from) {
117
+ return {
118
+ type: 0 /* Success */,
119
+ value: from.trim()
120
+ };
121
+ }
122
+ };
123
+
105
124
  // field_value_factories/prototyping_field_value_factory.ts
106
125
  function prototypingFieldValueFactory(prototype) {
107
126
  return function() {
@@ -136,6 +155,32 @@ var FieldAdapterBuilder = class _FieldAdapterBuilder {
136
155
  reverter
137
156
  );
138
157
  }
158
+ nullable() {
159
+ return this.or(null);
160
+ }
161
+ optional() {
162
+ return this.or(void 0);
163
+ }
164
+ or(proto) {
165
+ function isFrom(v) {
166
+ return v !== proto;
167
+ }
168
+ function isTo(v) {
169
+ return v !== proto;
170
+ }
171
+ return new _FieldAdapterBuilder(
172
+ (v, valuePath, context) => isFrom(v) ? this.convert(v, valuePath, context) : {
173
+ value: v,
174
+ readonly: false,
175
+ required: false
176
+ },
177
+ this.create,
178
+ (v, valuePath, context) => isTo(v) && this.revert ? this.revert(v, valuePath, context) : {
179
+ type: 0 /* Success */,
180
+ value: proto
181
+ }
182
+ );
183
+ }
139
184
  withIdentity(isFrom) {
140
185
  const identityConverter = new MaybeIdentityConverter({
141
186
  convert: this.convert,
@@ -173,6 +218,12 @@ function identityAdapter(prototype, required) {
173
218
  unreliableIdentityConverter()
174
219
  );
175
220
  }
221
+ function trimmingStringAdapter() {
222
+ return adapterFromTwoWayConverter(
223
+ new TrimmingStringConverter(),
224
+ prototypingFieldValueFactory("")
225
+ );
226
+ }
176
227
  function listAdapter() {
177
228
  return new FieldAdapterBuilder(
178
229
  annotatedIdentityConverter(false),
@@ -400,8 +451,7 @@ var FormPresenter = class {
400
451
  convert,
401
452
  create
402
453
  } = adapter2;
403
- const accessor = model.accessors[valuePath];
404
- const value = accessor == null ? create(valuePath, model.value) : accessor.value;
454
+ const value = create(valuePath, model.value);
405
455
  const {
406
456
  value: displayValue
407
457
  } = convert(value, valuePath, model.value);
@@ -422,7 +472,7 @@ var FormPresenter = class {
422
472
  const keys = new Set(Object.keys(values));
423
473
  return keys.has(valuePath);
424
474
  }
425
- validateField(model, valuePath) {
475
+ validateField(model, valuePath, ignoreDefaultValue = false) {
426
476
  const {
427
477
  convert,
428
478
  revert,
@@ -441,6 +491,14 @@ var FormPresenter = class {
441
491
  const value = fieldOverride != null ? fieldOverride[0] : storedValue;
442
492
  const dirty = storedValue !== value;
443
493
  assertExists(revert, "changing field directly not supported {}", valuePath);
494
+ if (ignoreDefaultValue) {
495
+ const {
496
+ value: defaultDisplayValue
497
+ } = convert(create(valuePath, model.value), valuePath, model.value);
498
+ if (defaultDisplayValue === value) {
499
+ return true;
500
+ }
501
+ }
444
502
  const conversion = revert(value, valuePath, model.value);
445
503
  return runInAction(function() {
446
504
  switch (conversion.type) {
@@ -511,13 +569,6 @@ var FormPresenter = class {
511
569
  );
512
570
  });
513
571
  }
514
- createModel(value) {
515
- return new FormModel(
516
- this.type,
517
- value,
518
- this.adapters
519
- );
520
- }
521
572
  };
522
573
  var FormModel = class {
523
574
  constructor(type, value, adapters) {
@@ -655,16 +706,173 @@ var FormModel = class {
655
706
  }
656
707
  };
657
708
 
658
- // core/mobx/hooks.ts
709
+ // core/mobx/hooks.tsx
659
710
  import {
660
711
  useCallback,
712
+ useMemo as useMemo2
713
+ } from "react";
714
+
715
+ // util/partial.tsx
716
+ import { observer } from "mobx-react";
717
+ import {
718
+ forwardRef,
661
719
  useMemo
662
720
  } from "react";
721
+ import { jsx } from "react/jsx-runtime";
722
+ function createSimplePartialComponent(Component, curriedProps) {
723
+ return forwardRef(
724
+ function(exposedProps, ref) {
725
+ const C = Component;
726
+ return /* @__PURE__ */ jsx(
727
+ C,
728
+ {
729
+ ref,
730
+ ...curriedProps,
731
+ ...exposedProps
732
+ }
733
+ );
734
+ }
735
+ );
736
+ }
737
+ function createPartialComponent(Component, curriedPropsSource, additionalPropKeys = []) {
738
+ return forwardRef(
739
+ function(props, ref) {
740
+ const C = Component;
741
+ const [
742
+ additionalProps,
743
+ exposedProps
744
+ ] = additionalPropKeys.reduce(
745
+ function([
746
+ additionalProps2,
747
+ exposedProps2
748
+ ], key) {
749
+ const value = props[
750
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
751
+ key
752
+ ];
753
+ delete exposedProps2[key];
754
+ additionalProps2[key] = value;
755
+ return [
756
+ additionalProps2,
757
+ exposedProps2
758
+ ];
759
+ },
760
+ [
761
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
762
+ {},
763
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
764
+ { ...props }
765
+ ]
766
+ );
767
+ const curriedProps = curriedPropsSource(additionalProps);
768
+ return /* @__PURE__ */ jsx(
769
+ C,
770
+ {
771
+ ref,
772
+ ...curriedProps,
773
+ ...exposedProps
774
+ }
775
+ );
776
+ }
777
+ );
778
+ }
779
+ function usePartialComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
780
+ return useMemo(
781
+ function() {
782
+ return createPartialComponent(
783
+ Component,
784
+ curriedPropsSource,
785
+ additionalPropKeys
786
+ );
787
+ },
788
+ // eslint-disable-next-line react-hooks/exhaustive-deps
789
+ [
790
+ // eslint-disable-next-line react-hooks/exhaustive-deps
791
+ ...deps,
792
+ Component,
793
+ // eslint-disable-next-line react-hooks/exhaustive-deps
794
+ ...additionalPropKeys
795
+ ]
796
+ );
797
+ }
798
+ function createPartialObserverComponent(Component, curriedPropsSource, additionalPropKeys = []) {
799
+ return createUnsafePartialObserverComponent(
800
+ Component,
801
+ curriedPropsSource,
802
+ additionalPropKeys
803
+ );
804
+ }
805
+ function createUnsafePartialObserverComponent(Component, curriedPropsSource, additionalPropKeys = []) {
806
+ return observer(
807
+ forwardRef(
808
+ function(props, ref) {
809
+ const C = Component;
810
+ const [
811
+ additionalProps,
812
+ exposedProps
813
+ ] = additionalPropKeys.reduce(
814
+ function([
815
+ additionalProps2,
816
+ exposedProps2
817
+ ], key) {
818
+ const value = props[
819
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
820
+ key
821
+ ];
822
+ delete exposedProps2[key];
823
+ additionalProps2[key] = value;
824
+ return [
825
+ additionalProps2,
826
+ exposedProps2
827
+ ];
828
+ },
829
+ [
830
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
831
+ {},
832
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
833
+ { ...props }
834
+ ]
835
+ );
836
+ const curriedProps = curriedPropsSource(additionalProps);
837
+ return /* @__PURE__ */ jsx(
838
+ C,
839
+ {
840
+ ref,
841
+ ...curriedProps,
842
+ ...exposedProps
843
+ }
844
+ );
845
+ }
846
+ )
847
+ );
848
+ }
849
+ function usePartialObserverComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
850
+ return useMemo(
851
+ function() {
852
+ return createPartialObserverComponent(
853
+ Component,
854
+ curriedPropsSource,
855
+ additionalPropKeys
856
+ );
857
+ },
858
+ // eslint-disable-next-line react-hooks/exhaustive-deps
859
+ [
860
+ // eslint-disable-next-line react-hooks/exhaustive-deps
861
+ ...deps,
862
+ Component,
863
+ // eslint-disable-next-line react-hooks/exhaustive-deps
864
+ ...additionalPropKeys
865
+ ]
866
+ );
867
+ }
868
+
869
+ // core/mobx/hooks.tsx
663
870
  function useDefaultMobxFormHooks(presenter, value, {
664
871
  onValidFieldSubmit,
665
- onValidFormSubmit
666
- }) {
667
- const model = useMemo(function() {
872
+ onValidFormSubmit,
873
+ FormFieldsView
874
+ } = {}) {
875
+ const model = useMemo2(function() {
668
876
  return presenter.createModel(value);
669
877
  }, [
670
878
  presenter,
@@ -697,7 +905,7 @@ function useDefaultMobxFormHooks(presenter, value, {
697
905
  function(path) {
698
906
  setTimeout(function() {
699
907
  if (presenter.isValuePathActive(model, path)) {
700
- presenter.validateField(model, path);
908
+ presenter.validateField(model, path, true);
701
909
  }
702
910
  }, 100);
703
911
  },
@@ -718,12 +926,33 @@ function useDefaultMobxFormHooks(presenter, value, {
718
926
  onValidFormSubmit
719
927
  ]
720
928
  );
929
+ const FormFields = useMemo2(() => {
930
+ if (FormFieldsView == null) {
931
+ return void 0;
932
+ }
933
+ return createUnsafePartialObserverComponent(FormFieldsView, () => {
934
+ return {
935
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
936
+ fields: model.fields,
937
+ onFieldBlur,
938
+ onFieldSubmit,
939
+ onFieldValueChange
940
+ };
941
+ });
942
+ }, [
943
+ model,
944
+ FormFieldsView,
945
+ onFieldBlur,
946
+ onFieldSubmit,
947
+ onFieldValueChange
948
+ ]);
721
949
  return {
722
950
  model,
723
951
  onFieldValueChange,
724
952
  onFieldSubmit,
725
953
  onFieldBlur,
726
- onFormSubmit
954
+ onFormSubmit,
955
+ FormFields
727
956
  };
728
957
  }
729
958
 
@@ -1006,25 +1235,6 @@ var SelectStringConverter = class extends AbstractSelectValueTypeConverter {
1006
1235
  }
1007
1236
  };
1008
1237
 
1009
- // field_converters/trimming_string_converter.ts
1010
- var TrimmingStringConverter = class {
1011
- constructor() {
1012
- }
1013
- convert(to) {
1014
- return {
1015
- value: to.trim(),
1016
- required: false,
1017
- readonly: false
1018
- };
1019
- }
1020
- revert(from) {
1021
- return {
1022
- type: 0 /* Success */,
1023
- value: from.trim()
1024
- };
1025
- }
1026
- };
1027
-
1028
1238
  // field_converters/validating_converter.ts
1029
1239
  import {
1030
1240
  validate as validate2
@@ -1081,160 +1291,6 @@ import {
1081
1291
  useMemo as useMemo3
1082
1292
  } from "react";
1083
1293
 
1084
- // util/partial.tsx
1085
- import { observer } from "mobx-react";
1086
- import {
1087
- forwardRef,
1088
- useMemo as useMemo2
1089
- } from "react";
1090
- import { jsx } from "react/jsx-runtime";
1091
- function createSimplePartialComponent(Component, curriedProps) {
1092
- return forwardRef(
1093
- function(exposedProps, ref) {
1094
- const C = Component;
1095
- return /* @__PURE__ */ jsx(
1096
- C,
1097
- {
1098
- ref,
1099
- ...curriedProps,
1100
- ...exposedProps
1101
- }
1102
- );
1103
- }
1104
- );
1105
- }
1106
- function createPartialComponent(Component, curriedPropsSource, additionalPropKeys = []) {
1107
- return forwardRef(
1108
- function(props, ref) {
1109
- const C = Component;
1110
- const [
1111
- additionalProps,
1112
- exposedProps
1113
- ] = additionalPropKeys.reduce(
1114
- function([
1115
- additionalProps2,
1116
- exposedProps2
1117
- ], key) {
1118
- const value = props[
1119
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1120
- key
1121
- ];
1122
- delete exposedProps2[key];
1123
- additionalProps2[key] = value;
1124
- return [
1125
- additionalProps2,
1126
- exposedProps2
1127
- ];
1128
- },
1129
- [
1130
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1131
- {},
1132
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1133
- { ...props }
1134
- ]
1135
- );
1136
- const curriedProps = curriedPropsSource(additionalProps);
1137
- return /* @__PURE__ */ jsx(
1138
- C,
1139
- {
1140
- ref,
1141
- ...curriedProps,
1142
- ...exposedProps
1143
- }
1144
- );
1145
- }
1146
- );
1147
- }
1148
- function usePartialComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
1149
- return useMemo2(
1150
- function() {
1151
- return createPartialComponent(
1152
- Component,
1153
- curriedPropsSource,
1154
- additionalPropKeys
1155
- );
1156
- },
1157
- // eslint-disable-next-line react-hooks/exhaustive-deps
1158
- [
1159
- // eslint-disable-next-line react-hooks/exhaustive-deps
1160
- ...deps,
1161
- Component,
1162
- // eslint-disable-next-line react-hooks/exhaustive-deps
1163
- ...additionalPropKeys
1164
- ]
1165
- );
1166
- }
1167
- function createPartialObserverComponent(Component, curriedPropsSource, additionalPropKeys = []) {
1168
- return createUnsafePartialObserverComponent(
1169
- Component,
1170
- curriedPropsSource,
1171
- additionalPropKeys
1172
- );
1173
- }
1174
- function createUnsafePartialObserverComponent(Component, curriedPropsSource, additionalPropKeys = []) {
1175
- return observer(
1176
- forwardRef(
1177
- function(props, ref) {
1178
- const C = Component;
1179
- const [
1180
- additionalProps,
1181
- exposedProps
1182
- ] = additionalPropKeys.reduce(
1183
- function([
1184
- additionalProps2,
1185
- exposedProps2
1186
- ], key) {
1187
- const value = props[
1188
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1189
- key
1190
- ];
1191
- delete exposedProps2[key];
1192
- additionalProps2[key] = value;
1193
- return [
1194
- additionalProps2,
1195
- exposedProps2
1196
- ];
1197
- },
1198
- [
1199
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1200
- {},
1201
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1202
- { ...props }
1203
- ]
1204
- );
1205
- const curriedProps = curriedPropsSource(additionalProps);
1206
- return /* @__PURE__ */ jsx(
1207
- C,
1208
- {
1209
- ref,
1210
- ...curriedProps,
1211
- ...exposedProps
1212
- }
1213
- );
1214
- }
1215
- )
1216
- );
1217
- }
1218
- function usePartialObserverComponent(curriedPropsSource, deps, Component, additionalPropKeys = []) {
1219
- return useMemo2(
1220
- function() {
1221
- return createPartialObserverComponent(
1222
- Component,
1223
- curriedPropsSource,
1224
- additionalPropKeys
1225
- );
1226
- },
1227
- // eslint-disable-next-line react-hooks/exhaustive-deps
1228
- [
1229
- // eslint-disable-next-line react-hooks/exhaustive-deps
1230
- ...deps,
1231
- Component,
1232
- // eslint-disable-next-line react-hooks/exhaustive-deps
1233
- ...additionalPropKeys
1234
- ]
1235
- );
1236
- }
1237
-
1238
1294
  // mantine/create_checkbox.tsx
1239
1295
  import { jsx as jsx2 } from "react/jsx-runtime";
1240
1296
  function createCheckbox(valuePath, Checkbox) {
@@ -1305,34 +1361,46 @@ function createFieldsView(valuePath, FieldsView, observableProps) {
1305
1361
  function onFieldSubmit(subKey) {
1306
1362
  observableProps.onFieldSubmit?.(toKey(subKey));
1307
1363
  }
1308
- return observer2(function(props) {
1309
- const subFields = Object.entries(observableProps.fields).reduce(
1310
- (acc, [
1311
- fieldKey,
1312
- fieldValue
1313
- ]) => {
1314
- if (fieldKey.startsWith(valuePath)) {
1315
- acc[toSubKey(fieldKey)] = fieldValue;
1364
+ const Component = observer2(
1365
+ function(props) {
1366
+ const subFields = Object.entries(observableProps.fields).reduce(
1367
+ (acc, [
1368
+ fieldKey,
1369
+ fieldValue
1370
+ ]) => {
1371
+ if (fieldKey.startsWith(valuePath)) {
1372
+ acc[toSubKey(fieldKey)] = fieldValue;
1373
+ }
1374
+ return acc;
1375
+ },
1376
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1377
+ {}
1378
+ );
1379
+ return /* @__PURE__ */ jsx3(
1380
+ FieldsView,
1381
+ {
1382
+ // maybe we can do this in a more type safe way
1383
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
1384
+ ...props,
1385
+ fields: subFields,
1386
+ onFieldBlur,
1387
+ onFieldFocus,
1388
+ onFieldSubmit,
1389
+ onFieldValueChange
1316
1390
  }
1317
- return acc;
1318
- },
1319
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1320
- {}
1321
- );
1322
- return /* @__PURE__ */ jsx3(
1323
- FieldsView,
1324
- {
1325
- // maybe we can do this in a more type safe way
1326
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
1327
- ...props,
1328
- fields: subFields,
1329
- onFieldBlur,
1330
- onFieldFocus,
1331
- onFieldSubmit,
1332
- onFieldValueChange
1333
- }
1334
- );
1335
- });
1391
+ );
1392
+ }
1393
+ );
1394
+ const callbackMapper = (callback) => {
1395
+ return (subFormValuePath, ...args) => {
1396
+ const valuePath2 = toKey(subFormValuePath);
1397
+ return callback(valuePath2, ...args);
1398
+ };
1399
+ };
1400
+ return {
1401
+ Component,
1402
+ callbackMapper
1403
+ };
1336
1404
  }
1337
1405
 
1338
1406
  // mantine/create_form.tsx
@@ -1787,6 +1855,7 @@ export {
1787
1855
  mergeValidators,
1788
1856
  prototypingFieldValueFactory,
1789
1857
  subFormFieldAdapters,
1858
+ trimmingStringAdapter,
1790
1859
  useDefaultMobxFormHooks,
1791
1860
  useMantineFormFields,
1792
1861
  usePartialComponent,
@@ -71,18 +71,18 @@ export function chainAnnotatedFieldConverter<
71
71
  return function (value: From, valuePath: ValuePath, context: Context): AnnotatedFieldConversion {
72
72
  const {
73
73
  required: intermediateRequired,
74
- readonly: intermediateDisabled,
74
+ readonly: intermediateReadonly,
75
75
  value: intermediateValue,
76
76
  } = from(value, valuePath, context)
77
77
  const {
78
78
  required: finalRequired,
79
- readonly: finalDisabled,
79
+ readonly: finalReadonly,
80
80
  value: finalValue,
81
81
  } = to(intermediateValue, valuePath, context)
82
82
  return {
83
83
  value: finalValue,
84
84
  required: intermediateRequired || finalRequired,
85
- readonly: intermediateDisabled || finalDisabled,
85
+ readonly: intermediateReadonly || finalReadonly,
86
86
  }
87
87
  }
88
88
  }