@polygrid/core 1.0.465 → 1.0.466

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 +1 @@
1
- {"version":3,"file":"toggle-loading.d.ts","sourceRoot":"","sources":["../../../../../src/engine/services/loading/methods/toggle-loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAI7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAC3B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,QAkB/B"}
1
+ {"version":3,"file":"toggle-loading.d.ts","sourceRoot":"","sources":["../../../../../src/engine/services/loading/methods/toggle-loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAK7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAC3B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,QAqC/B"}
@@ -1,8 +1,10 @@
1
1
  import { takeUntil } from "../../../rx-lite/operators/takeuntil";
2
+ import { RowPool } from "../../row/classes/row-pool";
2
3
  import { recomputeVirtualRows } from "../../row/methods/recompute-virtual-rows";
3
4
  export function toggleLoading(loadingService, destroy$) {
4
5
  const grid = loadingService.grid;
5
6
  loadingService.loading$.pipe(takeUntil(destroy$)).subscribe((visible) => {
7
+ const state = grid._store.getState();
6
8
  grid._store.update((draft) => {
7
9
  if (visible) {
8
10
  // loading ON → clear rows
@@ -12,7 +14,19 @@ export function toggleLoading(loadingService, destroy$) {
12
14
  recomputeVirtualRows(draft.ui.virtualRows);
13
15
  }
14
16
  else {
15
- // loading OFF → force RowPool.update
17
+ // loading OFF → create row pool, if not yet exists
18
+ if (!loadingService.grid._runtime.rowPool) {
19
+ const rowHeight = state.view.rowHeight;
20
+ const columns = state.view.internalColumns;
21
+ const viewportHeight = state.view.viewportHeight;
22
+ const rowPool = new RowPool(grid._gridDom, columns, rowHeight, grid, viewportHeight);
23
+ grid._runtime.rowPool = rowPool;
24
+ // use fresh virtualRows
25
+ const v = state.ui.virtualRows;
26
+ recomputeVirtualRows(v);
27
+ const data = state.view.rows;
28
+ rowPool.update(v, data);
29
+ }
16
30
  const v = draft.ui.virtualRows;
17
31
  v.renderStartIndex = v.renderStartIndex;
18
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-loading.js","sourceRoot":"","sources":["../../../../../src/engine/services/loading/methods/toggle-loading.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGhF,MAAM,UAAU,aAAa,CAC3B,cAA8B,EAC9B,QAA8B;IAE9B,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACjC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE;QACtE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3B,IAAI,OAAO,EAAE,CAAC;gBACZ,0BAA0B;gBAC1B,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;gBACzB,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,aAAa,GAAG,CAAC,CAAC;gBACvC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,qCAAqC;gBACrC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;gBAC/B,CAAC,CAAC,gBAAgB,GAAG,C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AAe,CAAC;oBAC3C,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;oBACjD,MAAM,OAAO,GAAG,IAAI,OAAO,CACzB,IAAI,CAAC,QAAQ,EACb,OAAO,EACP,SAAS,EACT,IAAI,EACJ,cAAc,CACf,CAAC;oBACF,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;oBAChC,wBAAwB;oBACxB,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;oBAC/B,oBAAoB,CAAC,CAAC,CAAC,CAAC;oBACxB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC7B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBAC1B,CAAC;gBACD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;gBAC/B,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,gBAAgB,CAAC;YAC1C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polygrid/core",
3
- "version": "1.0.465",
3
+ "version": "1.0.466",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",