@xh/hoist 73.0.0-SNAPSHOT.1738339904337 → 73.0.0-SNAPSHOT.1738687983846

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
@@ -11,6 +11,8 @@
11
11
  * Introduced a new "JSON Search" feature to the Hoist Admin Console, accessible from the Config,
12
12
  User Preference, and JSON Blob tabs. Supports searching JSON values stored within these objects
13
13
  to filter and match data using JSON Path expressions.
14
+ * New aliases `StoreRecord.isDirty`, `Store.dirtyRecords`, and `Store.isDirty` provide a more
15
+ consistent API in the data package.
14
16
 
15
17
  ### 🐞 Bug Fixes
16
18
 
@@ -46,9 +46,9 @@ export class RoleFormModel extends HoistModel {
46
46
  @computed
47
47
  get hasDirtyMembers(): boolean {
48
48
  return (
49
- this.usersGridModel.store.isModified ||
50
- this.directoryGroupsGridModel.store.isModified ||
51
- this.rolesGridModel.store.isModified
49
+ this.usersGridModel.store.isDirty ||
50
+ this.directoryGroupsGridModel.store.isDirty ||
51
+ this.rolesGridModel.store.isDirty
52
52
  );
53
53
  }
54
54
 
@@ -275,6 +275,8 @@ export declare class Store extends HoistBase {
275
275
  /** Records removed locally which have not been committed.*/
276
276
  get removedRecords(): StoreRecord[];
277
277
  /** Records modified locally since they were last loaded. */
278
+ get dirtyRecords(): StoreRecord[];
279
+ /** Alias for {@link Store.dirtyRecords} */
278
280
  get modifiedRecords(): StoreRecord[];
279
281
  /**
280
282
  * Root records in this store, respecting any filter (if applied).
@@ -292,6 +294,8 @@ export declare class Store extends HoistBase {
292
294
  */
293
295
  get summaryRecord(): StoreRecord;
294
296
  /** True if the store has changes which need to be committed. */
297
+ get isDirty(): boolean;
298
+ /** Alias for {@link Store.isDirty} */
295
299
  get isModified(): boolean;
296
300
  /**
297
301
  * Set a filter on this store.
@@ -51,6 +51,8 @@ export declare class StoreRecord {
51
51
  /** True if the StoreRecord has never been committed. */
52
52
  get isAdd(): boolean;
53
53
  /** True if the StoreRecord has been modified since it was last committed. */
54
+ get isDirty(): boolean;
55
+ /** Alias for {@link StoreRecord.isDirty} */
54
56
  get isModified(): boolean;
55
57
  /** False if the StoreRecord has been added or modified. */
56
58
  get isCommitted(): boolean;
package/data/Store.ts CHANGED
@@ -435,7 +435,7 @@ export class Store extends HoistBase {
435
435
  // sourced from the server / source of record and are coming in as committed.
436
436
  this._committed = this._committed.withTransaction(rsTransaction);
437
437
 
438
- if (this.isModified) {
438
+ if (this.isDirty) {
439
439
  // If this store had pre-existing local modifications, apply the updates over that
440
440
  // local state. This might (or might not) effectively overwrite those local changes,
441
441
  // so we normalize against the newly updated committed state to verify if any local
@@ -662,8 +662,13 @@ export class Store extends HoistBase {
662
662
  }
663
663
 
664
664
  /** Records modified locally since they were last loaded. */
665
+ get dirtyRecords(): StoreRecord[] {
666
+ return this.allRecords.filter(it => it.isDirty);
667
+ }
668
+
669
+ /** Alias for {@link Store.dirtyRecords} */
665
670
  get modifiedRecords(): StoreRecord[] {
666
- return this.allRecords.filter(it => it.isModified);
671
+ return this.dirtyRecords;
667
672
  }
668
673
 
669
674
  /**
@@ -696,10 +701,15 @@ export class Store extends HoistBase {
696
701
 
697
702
  /** True if the store has changes which need to be committed. */
698
703
  @computed
699
- get isModified(): boolean {
704
+ get isDirty(): boolean {
700
705
  return this._current !== this._committed;
701
706
  }
702
707
 
708
+ /** Alias for {@link Store.isDirty} */
709
+ get isModified(): boolean {
710
+ return this.isDirty;
711
+ }
712
+
703
713
  /**
704
714
  * Set a filter on this store.
705
715
  *
@@ -71,10 +71,15 @@ export class StoreRecord {
71
71
  }
72
72
 
73
73
  /** True if the StoreRecord has been modified since it was last committed. */
74
- get isModified(): boolean {
74
+ get isDirty(): boolean {
75
75
  return this.committedData && this.committedData !== this.data;
76
76
  }
77
77
 
78
+ /** Alias for {@link StoreRecord.isDirty} */
79
+ get isModified(): boolean {
80
+ return this.isDirty;
81
+ }
82
+
78
83
  /** False if the StoreRecord has been added or modified. */
79
84
  get isCommitted(): boolean {
80
85
  return this.committedData === this.data;
@@ -7,7 +7,7 @@
7
7
 
8
8
  import {PlainObject, Some} from '@xh/hoist/core';
9
9
  import {BucketSpec} from '@xh/hoist/data/cube/BucketSpec';
10
- import {isEmpty, reduce} from 'lodash';
10
+ import {compact, isEmpty, reduce} from 'lodash';
11
11
  import {View} from '../View';
12
12
  import {RowUpdate} from './RowUpdate';
13
13
 
@@ -97,7 +97,8 @@ export abstract class BaseRow {
97
97
  }
98
98
 
99
99
  // Recurse
100
- return children.flatMap(it => it.getVisibleDatas());
100
+ const ret = compact(children.flatMap(it => it.getVisibleDatas()));
101
+ return !isEmpty(ret) ? ret : null;
101
102
  }
102
103
 
103
104
  private isRedundantChild(parent: any, child: any) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1738339904337",
3
+ "version": "73.0.0-SNAPSHOT.1738687983846",
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",