@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.
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsonPathPrefix, jsonPathUnprefix, } from '@strictly/define';
2
3
  import { observer } from 'mobx-react';
3
4
  export function createFieldsView(valuePath, FieldsView, observableProps) {
4
5
  function toKey(subKey) {
5
6
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
6
- return subKey.replace('$', valuePath);
7
+ return jsonPathPrefix(valuePath, subKey);
7
8
  }
8
9
  function toSubKey(key) {
9
10
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
10
- return key.replace(valuePath, '$');
11
+ return jsonPathUnprefix(valuePath, key);
11
12
  }
12
13
  function onFieldValueChange(subKey, value) {
13
14
  // convert from subKey to key