@flowgram.ai/form 0.2.12 → 0.2.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/dist/index.js CHANGED
@@ -740,19 +740,16 @@ function createFieldModelState(initialState) {
740
740
  var import_lodash6 = require("lodash");
741
741
  var Store = class {
742
742
  get values() {
743
- return this._values;
743
+ return (0, import_lodash6.clone)(this._values);
744
744
  }
745
745
  set values(v) {
746
- this._values = v;
747
- }
748
- setInitialValues(values) {
749
- this._values = values;
746
+ this._values = (0, import_lodash6.cloneDeep)(v);
750
747
  }
751
748
  setIn(path, value) {
752
749
  this._values = shallowSetIn(this._values || {}, path.toString(), value);
753
750
  }
754
751
  getIn(path) {
755
- return (0, import_lodash6.get)(this._values, path.value);
752
+ return (0, import_lodash6.get)(this.values, path.value);
756
753
  }
757
754
  dispose() {
758
755
  }
@@ -1290,11 +1287,11 @@ var FormModel = class {
1290
1287
  return this._options.initialValues;
1291
1288
  }
1292
1289
  get values() {
1293
- return (0, import_lodash8.clone)(this.store.values) || (0, import_lodash8.clone)(this.initialValues);
1290
+ return this.store.values;
1294
1291
  }
1295
1292
  set values(v) {
1296
1293
  const prevValues = this.values;
1297
- if ((0, import_fast_equals.shallowEqual)(this.store.values || this.initialValues, v)) {
1294
+ if ((0, import_fast_equals.deepEqual)(prevValues, v)) {
1298
1295
  return;
1299
1296
  }
1300
1297
  this.store.values = v;
@@ -1333,7 +1330,7 @@ var FormModel = class {
1333
1330
  this._options = options;
1334
1331
  if (options.initialValues) {
1335
1332
  const prevValues = this.store.values;
1336
- this.store.setInitialValues(options.initialValues);
1333
+ this.store.values = options.initialValues;
1337
1334
  this.fireOnFormValuesInit({
1338
1335
  values: options.initialValues,
1339
1336
  prevValues,