@polygrid/core 1.0.463 → 1.0.465

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":"set-external-loading.d.ts","sourceRoot":"","sources":["../../src/api/set-external-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,QAUlE"}
1
+ {"version":3,"file":"set-external-loading.d.ts","sourceRoot":"","sources":["../../src/api/set-external-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,QAIlE"}
@@ -1,12 +1,5 @@
1
- import { recomputeVirtualRows } from "../engine/services/row/methods/recompute-virtual-rows";
2
1
  export function setExternalLoading(grid, visible) {
3
2
  grid._store.update((draft) => {
4
- if (visible) {
5
- draft.view.rows = [];
6
- draft.view.viewRows = [];
7
- draft.ui.virtualRows.totalRowCount = 0;
8
- recomputeVirtualRows(draft.ui.virtualRows);
9
- }
10
3
  draft.view.externalLoading = visible;
11
4
  });
12
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"set-external-loading.js","sourceRoot":"","sources":["../../src/api/set-external-loading.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAE7F,MAAM,UAAU,kBAAkB,CAAC,IAAc,EAAE,OAAgB;IACjE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACzB,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,aAAa,GAAG,CAAC,CAAC;YACvC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"set-external-loading.js","sourceRoot":"","sources":["../../src/api/set-external-loading.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,IAAc,EAAE,OAAgB;IACjE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -7,6 +7,9 @@ export declare class LoadingService {
7
7
  destroy$: ObservableLike<void>;
8
8
  gridDom: GridDOM;
9
9
  grid: PolyGrid;
10
+ externalLoading$: ObservableLike<boolean>;
11
+ internalLoading$: ObservableLike<boolean>;
12
+ loading$: ObservableLike<boolean>;
10
13
  constructor(grid: PolyGrid);
11
14
  initApiSubscriptions(): void;
12
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,qBAAa,cAAc;IACzB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;gBAEH,IAAI,EAAE,QAAQ;IAO1B,oBAAoB;CACrB"}
1
+ {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,qBAAa,cAAc;IACzB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IAEf,gBAAgB,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1C,gBAAgB,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1C,QAAQ,EAAG,cAAc,CAAC,OAAO,CAAC,CAAC;gBAEvB,IAAI,EAAE,QAAQ;IAgB1B,oBAAoB;CAYrB"}
@@ -1,10 +1,23 @@
1
+ import { distinctUntilChanged } from "../../rx-lite/operators/distinct-until-changed";
2
+ import { map } from "../../rx-lite/operators/map";
3
+ import * as methods from "./methods/index";
1
4
  export class LoadingService {
2
5
  constructor(grid) {
3
6
  this.store = grid._store;
4
7
  this.destroy$ = grid._destroy$;
5
8
  this.gridDom = grid._gridDom;
6
9
  this.grid = grid;
10
+ this.externalLoading$ = this.store.selectKeyed("view.externalLoading", (s) => s.view.externalLoading);
11
+ this.internalLoading$ = this.store.selectKeyed("view.internalLoading", (s) => s.view.internalLoading);
12
+ }
13
+ initApiSubscriptions() {
14
+ this.loading$ = this.store
15
+ .merge(this.externalLoading$, this.internalLoading$)
16
+ .pipe(map(() => {
17
+ const s = this.store.getState();
18
+ return s.view.externalLoading || s.view.internalLoading;
19
+ }), distinctUntilChanged());
20
+ methods.toggleLoading(this, this.destroy$);
7
21
  }
8
- initApiSubscriptions() { }
9
22
  }
10
23
  //# sourceMappingURL=loading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,cAAc;IAMzB,YAAY,IAAc;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,oBAAoB,KAAI,CAAC;CAC1B"}
1
+ {"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAElD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,MAAM,OAAO,cAAc;IAUzB,YAAY,IAAc;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAC5C,sBAAsB,EACtB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAC9B,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAC5C,sBAAsB,EACtB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAC9B,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK;aACvB,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC;aACnD,IAAI,CACH,GAAG,CAAC,GAAG,EAAE;YACP,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChC,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;QAC1D,CAAC,CAAC,EACF,oBAAoB,EAAE,CACvB,CAAC;QACJ,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -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;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAC3B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,QAC5B"}
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,2 +1,22 @@
1
- export function toggleLoading(loadingService, destroy$) { }
1
+ import { takeUntil } from "../../../rx-lite/operators/takeuntil";
2
+ import { recomputeVirtualRows } from "../../row/methods/recompute-virtual-rows";
3
+ export function toggleLoading(loadingService, destroy$) {
4
+ const grid = loadingService.grid;
5
+ loadingService.loading$.pipe(takeUntil(destroy$)).subscribe((visible) => {
6
+ grid._store.update((draft) => {
7
+ if (visible) {
8
+ // loading ON → clear rows
9
+ draft.view.rows = [];
10
+ draft.view.viewRows = [];
11
+ draft.ui.virtualRows.totalRowCount = 0;
12
+ recomputeVirtualRows(draft.ui.virtualRows);
13
+ }
14
+ else {
15
+ // loading OFF → force RowPool.update
16
+ const v = draft.ui.virtualRows;
17
+ v.renderStartIndex = v.renderStartIndex;
18
+ }
19
+ });
20
+ }, "TOGGLE-LOADING");
21
+ }
2
22
  //# sourceMappingURL=toggle-loading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-loading.js","sourceRoot":"","sources":["../../../../../src/engine/services/loading/methods/toggle-loading.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,aAAa,CAC3B,cAA8B,EAC9B,QAA8B,IAC7B,CAAC"}
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,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.463",
3
+ "version": "1.0.465",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",