@polygrid/core 1.0.476 → 1.0.478
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/dist/api/set-external-loading.d.ts.map +1 -1
- package/dist/api/set-external-loading.js +1 -3
- package/dist/api/set-external-loading.js.map +1 -1
- package/dist/engine/core/interfaces/grid-event-map.d.ts +3 -0
- package/dist/engine/core/interfaces/grid-event-map.d.ts.map +1 -1
- package/dist/engine/services/loading/loading.d.ts +0 -3
- package/dist/engine/services/loading/loading.d.ts.map +1 -1
- package/dist/engine/services/loading/loading.js +19 -14
- package/dist/engine/services/loading/loading.js.map +1 -1
- package/dist/engine/services/loading/methods/toggle-loading.d.ts.map +1 -1
- package/dist/engine/services/loading/methods/toggle-loading.js +1 -60
- package/dist/engine/services/loading/methods/toggle-loading.js.map +1 -1
- package/package.json +1 -1
|
@@ -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;AAEpD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,
|
|
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,QAElE"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,SAAS,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-event-map.d.ts","sourceRoot":"","sources":["../../../../src/engine/core/interfaces/grid-event-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,mBAAmB,EAAE,EAAE,CAAC;IACxB,gBAAgB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,gBAAgB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"grid-event-map.d.ts","sourceRoot":"","sources":["../../../../src/engine/core/interfaces/grid-event-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,mBAAmB,EAAE,EAAE,CAAC;IACxB,gBAAgB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,gBAAgB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,UAAU,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAClC"}
|
|
@@ -7,9 +7,6 @@ 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>;
|
|
13
10
|
constructor(grid: PolyGrid);
|
|
14
11
|
initApiSubscriptions(): void;
|
|
15
12
|
}
|
|
@@ -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;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
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;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,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;IAwB1B,oBAAoB;CACrB"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { map } from "../../rx-lite/operators/map";
|
|
3
|
-
import * as methods from "./methods/index";
|
|
1
|
+
import { recomputeVirtualRows } from "../row/methods/recompute-virtual-rows";
|
|
4
2
|
export class LoadingService {
|
|
5
3
|
constructor(grid) {
|
|
6
4
|
this.store = grid._store;
|
|
7
5
|
this.destroy$ = grid._destroy$;
|
|
8
6
|
this.gridDom = grid._gridDom;
|
|
9
7
|
this.grid = grid;
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
this.store.on("setLoading", (payload) => {
|
|
9
|
+
grid._store.update((draft) => {
|
|
10
|
+
draft.view.externalLoading = payload.visible;
|
|
11
|
+
if (payload.visible) {
|
|
12
|
+
draft.view.rows = [];
|
|
13
|
+
draft.view.viewRows = [];
|
|
14
|
+
draft.ui.virtualRows.totalRowCount = 0;
|
|
15
|
+
recomputeVirtualRows(draft.ui.virtualRows);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
draft.ui.virtualRows = {
|
|
19
|
+
...draft.ui.virtualRows,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
console.log("TOGGLE LOADING");
|
|
24
|
+
});
|
|
21
25
|
}
|
|
26
|
+
initApiSubscriptions() { }
|
|
22
27
|
}
|
|
23
28
|
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../../src/engine/services/loading/loading.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,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;QAEjB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;YACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC3B,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;gBAC7C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;oBACpB,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;oBACrB,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;oBACzB,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,aAAa,GAAG,CAAC,CAAC;oBACvC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;gBAC7C,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;wBACrB,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW;qBACxB,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,KAAI,CAAC;CAC1B"}
|
|
@@ -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;AAM7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAC3B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,
|
|
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;AAM7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAC3B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,QAC5B"}
|
|
@@ -1,61 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { updateColumnWidths } from "../../layout/methods";
|
|
3
|
-
import { RowPool } from "../../row/classes/row-pool";
|
|
4
|
-
import { recomputeVirtualRows } from "../../row/methods/recompute-virtual-rows";
|
|
5
|
-
import { applyCurrentSort, applyInitSort } from "../../sort/methods";
|
|
6
|
-
export function toggleLoading(loadingService, destroy$) {
|
|
7
|
-
const grid = loadingService.grid;
|
|
8
|
-
loadingService.loading$.pipe(takeUntil(destroy$)).subscribe((visible) => {
|
|
9
|
-
const state = grid._store.getState();
|
|
10
|
-
grid._store.update((draft) => {
|
|
11
|
-
if (visible) {
|
|
12
|
-
// loading ON → clear rows
|
|
13
|
-
draft.view.rows = [];
|
|
14
|
-
draft.view.viewRows = [];
|
|
15
|
-
draft.ui.virtualRows.totalRowCount = 0;
|
|
16
|
-
recomputeVirtualRows(draft.ui.virtualRows);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
// loading OFF - if loading is still visible, remove it and create a new row pool
|
|
20
|
-
// this is needed, because in angular setting visible to false happens for some reason as the last step
|
|
21
|
-
if (grid._runtime.loadingContainer) {
|
|
22
|
-
grid._runtime.loadingContainer.remove();
|
|
23
|
-
grid._runtime.loadingContainer = null;
|
|
24
|
-
// Destroy dynamic template if any
|
|
25
|
-
grid._runtime.loadingHandle?.destroy();
|
|
26
|
-
grid._runtime.loadingHandle = null;
|
|
27
|
-
// create a new row pool
|
|
28
|
-
const rowHeight = state.view.rowHeight;
|
|
29
|
-
const columns = state.view.internalColumns;
|
|
30
|
-
const viewportHeight = state.view.viewportHeight;
|
|
31
|
-
const rowPool = new RowPool(grid._gridDom, columns, rowHeight, grid, viewportHeight);
|
|
32
|
-
grid._runtime.rowPool = rowPool;
|
|
33
|
-
// use fresh virtualRows
|
|
34
|
-
const v = state.ui.virtualRows;
|
|
35
|
-
recomputeVirtualRows(v);
|
|
36
|
-
const data = state.view.rows;
|
|
37
|
-
rowPool.update(v, data);
|
|
38
|
-
// update col widths (for body cells)
|
|
39
|
-
updateColumnWidths(loadingService.gridDom, state, state.view.resolvedColumnWidths, loadingService.grid);
|
|
40
|
-
// apply any sorting
|
|
41
|
-
const logService = grid._services.log;
|
|
42
|
-
const columnService = grid._services.column;
|
|
43
|
-
if (data.length > 0) {
|
|
44
|
-
columnService.checkFields(columnService.store, logService);
|
|
45
|
-
if (!state.view.userHasSorted) {
|
|
46
|
-
applyInitSort(grid);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
applyCurrentSort(grid, state.view.currentSortSettings);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// trigger a virtual rows update
|
|
53
|
-
draft.ui.virtualRows = {
|
|
54
|
-
...draft.ui.virtualRows,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}, "TOGGLE-LOADING");
|
|
60
|
-
}
|
|
1
|
+
export function toggleLoading(loadingService, destroy$) { }
|
|
61
2
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"toggle-loading.js","sourceRoot":"","sources":["../../../../../src/engine/services/loading/methods/toggle-loading.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,aAAa,CAC3B,cAA8B,EAC9B,QAA8B,IAC7B,CAAC"}
|