@xh/hoist 52.0.1 → 52.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v52.0.2 - 2022-10-13
4
+
5
+ ### 🐞 Bug Fixes
6
+
7
+ * Form field dirty checking now uses lodash `isEqual` to compare initial and current values,
8
+ avoiding false positives with Array values.
9
+
3
10
  ## v52.0.1 - 2022-10-10
4
11
 
5
12
  ### 🎁 New Features
@@ -4,13 +4,13 @@
4
4
  *
5
5
  * Copyright © 2022 Extremely Heavy Industries Inc.
6
6
  */
7
- import {managed, HoistModel, TaskObserver} from '@xh/hoist/core';
8
- import {Rule, ValidationState, genDisplayName, required} from '@xh/hoist/data';
9
- import {action, computed, observable, runInAction, makeObservable} from '@xh/hoist/mobx';
7
+ import {HoistModel, managed, TaskObserver} from '@xh/hoist/core';
8
+ import {genDisplayName, required, Rule, ValidationState} from '@xh/hoist/data';
9
+ import {action, computed, makeObservable, observable, runInAction} from '@xh/hoist/mobx';
10
10
  import {wait} from '@xh/hoist/promise';
11
- import {withDefault, executeIfFunction} from '@xh/hoist/utils/js';
12
- import {compact, flatten, isEmpty, isFunction, isNil} from 'lodash';
11
+ import {executeIfFunction, withDefault} from '@xh/hoist/utils/js';
13
12
  import {createObservableRef} from '@xh/hoist/utils/react';
13
+ import {compact, flatten, isEmpty, isEqual, isFunction, isNil} from 'lodash';
14
14
 
15
15
  /**
16
16
  * Abstract Base class for FieldModels.
@@ -210,7 +210,7 @@ export class BaseFieldModel extends HoistModel {
210
210
 
211
211
  /** @member {boolean} - true if value has been changed since last reset/init. */
212
212
  get isDirty() {
213
- return this.value !== this.initialValue;
213
+ return !isEqual(this.value, this.initialValue);
214
214
  }
215
215
 
216
216
  //-------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "52.0.1",
3
+ "version": "52.0.2",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",