@xh/hoist 75.0.0-SNAPSHOT.1752860174147 → 75.0.0-SNAPSHOT.1752891558856

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
@@ -4,27 +4,24 @@
4
4
 
5
5
  ### 🎁 New Features
6
6
 
7
- * New property `GridModel.expandToLevel` governs the expansion state of tree and grouped grids.
8
- Replaces the use of the `agOptions.groupDefaultExpanded` on the component.
9
- * Most recently chosen level is persistable with other grid state.
10
- * Default grid context menu has a menu item to trigger bulk expand/collapse to particular depth
11
- level for multi-level (e.g. depth > 2) grids. To enable, implement the `GridModel.levelLabels`
12
- property for your grid.
13
- * Added new `GroupingChooserModel.sortDimensions` config - can be set to false to respect the order
14
- in which dimensions are provided to the model.
15
-
16
- ### 🐞 Bug Fixes
17
-
18
- * DashCanvas: ensure `allowAdd=false` is not enforced if loadingState
19
- and hide `Add` context menu item in views in if `allowAdd=false`
20
- * DashCanvas: style with `position: relative;` to ensure that the empty state overlay is positioned
21
- within the canvas, not the next parent container up that has `position: relative;`.
22
-
23
- * `useContextModel` is now reactive to a change of an (observable) resolved model when it is set.
24
- Previously this value was cached on first render.
25
-
26
- * Fixes to framework components that bind to grids (e.g. `ColChooserButton`, `ColAutosizeButton`,
27
- `GridFindField`) to rebind to a new observable GridModel available via context.
7
+ * Added new `GridModel.expandToLevel` config to control the expansion state of tree/grouped grids.
8
+ * Replaces the use of the `agOptions.groupDefaultExpanded` on the component.
9
+ * The most recently expanded level is persistable with other grid state.
10
+ * The default grid context menu now supports a new item to allow users to expand/collapse out to
11
+ a specific level/depth. Set `GridModel.levelLabels` to activate this feature.
12
+ * Added new `GroupingChooserModel.sortDimensions` config. Set to `false` to respect the order in
13
+ which `dimensions` are provided to the model.
14
+
15
+ ### 🐞 Bug Fixes
16
+
17
+ * Fixed minor `DashCanvas` issues with `allowAdd: false`, ensuring it does not block additions made
18
+ via `loadState()` and hiding the `Add` context menu item in views as intended.
19
+ * Updated `DashCanvas` CSS to set `position: relative;`, ensuring that the empty state overlay is
20
+ positioned as intended and does not extend beyond the canvas.
21
+ * Improved the core `useContextModel` hook to make it reactive to a change of an (observable)
22
+ resolved model. Previously this value was cached on first render.
23
+ * Fixed framework components that bind to grids (e.g. `ColChooserButton`, `ColAutosizeButton`,
24
+ `GridFindField`), ensuring they automatically rebind to a new observable `GridModel` via context.
28
25
 
29
26
  ## v74.1.2 - 2025-07-03
30
27
 
@@ -140,9 +140,10 @@ export interface GridConfig {
140
140
  */
141
141
  onCellContextMenu?: (e: CellContextMenuEvent) => void;
142
142
  /**
143
- * Array of labels (or a function returning one) that describes the individual depth
144
- * levels in a tree or grouped grid. If provided, will be used to construct expand/collapse
145
- * options in the default context menu.
143
+ * Array of strings (or a function returning one) providing user-facing labels for each depth
144
+ * level in a tree or grouped grid - e.g. `['Country', 'State', 'City']`. If set, the
145
+ * expand/collapse options in the default context menu will be enhanced to allow users to
146
+ * expand/collapse to a specific level.
146
147
  */
147
148
  levelLabels?: Thunkable<string[]>;
148
149
  /**
@@ -63,4 +63,5 @@ export declare abstract class PersistenceProvider<S = any> {
63
63
  protected writeRaw(obj: Record<typeof this.path, S>): void;
64
64
  protected readRaw(): Record<typeof this.path, S>;
65
65
  private static parseProviderClass;
66
+ private ensureValid;
66
67
  }
@@ -280,9 +280,10 @@ export interface GridConfig {
280
280
  onCellContextMenu?: (e: CellContextMenuEvent) => void;
281
281
 
282
282
  /**
283
- * Array of labels (or a function returning one) that describes the individual depth
284
- * levels in a tree or grouped grid. If provided, will be used to construct expand/collapse
285
- * options in the default context menu.
283
+ * Array of strings (or a function returning one) providing user-facing labels for each depth
284
+ * level in a tree or grouped grid - e.g. `['Country', 'State', 'City']`. If set, the
285
+ * expand/collapse options in the default context menu will be enhanced to allow users to
286
+ * expand/collapse to a specific level.
286
287
  */
287
288
  levelLabels?: Thunkable<string[]>;
288
289
 
@@ -12,8 +12,10 @@ import {
12
12
  compact,
13
13
  debounce as lodashDebounce,
14
14
  get,
15
+ isArray,
15
16
  isEmpty,
16
17
  isNumber,
18
+ isObject,
17
19
  isString,
18
20
  isUndefined,
19
21
  omit,
@@ -88,6 +90,7 @@ export abstract class PersistenceProvider<S = any> {
88
90
 
89
91
  const providerClass = this.parseProviderClass<S>(cfg.persistOptions);
90
92
  ret = new providerClass(cfg);
93
+ ret.ensureValid();
91
94
  ret.bindToTarget(cfg.target);
92
95
  return ret;
93
96
  } catch (e) {
@@ -252,4 +255,13 @@ export abstract class PersistenceProvider<S = any> {
252
255
 
253
256
  return ret;
254
257
  }
258
+
259
+ private ensureValid() {
260
+ const data = this.readRaw();
261
+ throwIf(
262
+ !(isObject(data) && !isArray(data)),
263
+ `PersistenceProvider for ${this.path} may not be configured correctly. The provider ` +
264
+ 'should produce a javascript object for reading property values.'
265
+ );
266
+ }
255
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "75.0.0-SNAPSHOT.1752860174147",
3
+ "version": "75.0.0-SNAPSHOT.1752891558856",
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",