blixify-ui-web 1.2.149 → 1.2.150
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/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +11 -2
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/unionPagination.d.ts +20 -0
- package/lib/components/data/dataTemplate/unionPagination.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/unionPagination.js +37 -0
- package/lib/components/data/dataTemplate/unionPagination.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Sort } from "../readQuery";
|
|
2
|
+
/**
|
|
3
|
+
* The offset a union list page is read from.
|
|
4
|
+
*
|
|
5
|
+
* INFO: a union request sends only `skip` (ReadQuery drops `cursor` for unions), so the
|
|
6
|
+
* page offset has to travel as `skip`. Without `organise.unionPagination` the DTW keeps
|
|
7
|
+
* sending `skip: 0`, which is what it always did.
|
|
8
|
+
*/
|
|
9
|
+
export declare const handleGetUnionPageSkip: (pageIndex: number, limit: number | undefined) => number;
|
|
10
|
+
/**
|
|
11
|
+
* The sort a paged union list sends: the sort it already had, then `_id` in the same
|
|
12
|
+
* direction.
|
|
13
|
+
*
|
|
14
|
+
* INFO: each page is a separate request. Two rows that tie on the sort value have no
|
|
15
|
+
* fixed order between requests, so a row could show on two pages or on none. `_id` is
|
|
16
|
+
* unique and present on every union row, which makes the order total. The server
|
|
17
|
+
* accepts a list of sorts for a union and applies them in order.
|
|
18
|
+
*/
|
|
19
|
+
export declare const handleBuildUnionPageSort: (sort?: Sort) => Sort[];
|
|
20
|
+
//# sourceMappingURL=unionPagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unionPagination.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/unionPagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOpC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,cACtB,MAAM,SACV,MAAM,GAAG,SAAS,KACxB,MAGF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,UAAW,IAAI,KAAG,IAAI,EAI1D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleBuildUnionPageSort = exports.handleGetUnionPageSkip = void 0;
|
|
4
|
+
// INFO: what the server (MongoWrapper union list) sorts by when the request carries no
|
|
5
|
+
// sort at all. Repeated here so the tie-break can be added after it instead of
|
|
6
|
+
// replacing it.
|
|
7
|
+
var UNION_DEFAULT_SORT = { sortId: "date", type: "desc" };
|
|
8
|
+
/**
|
|
9
|
+
* The offset a union list page is read from.
|
|
10
|
+
*
|
|
11
|
+
* INFO: a union request sends only `skip` (ReadQuery drops `cursor` for unions), so the
|
|
12
|
+
* page offset has to travel as `skip`. Without `organise.unionPagination` the DTW keeps
|
|
13
|
+
* sending `skip: 0`, which is what it always did.
|
|
14
|
+
*/
|
|
15
|
+
var handleGetUnionPageSkip = function (pageIndex, limit) {
|
|
16
|
+
if (!limit || limit <= 0 || pageIndex <= 0)
|
|
17
|
+
return 0;
|
|
18
|
+
return pageIndex * limit;
|
|
19
|
+
};
|
|
20
|
+
exports.handleGetUnionPageSkip = handleGetUnionPageSkip;
|
|
21
|
+
/**
|
|
22
|
+
* The sort a paged union list sends: the sort it already had, then `_id` in the same
|
|
23
|
+
* direction.
|
|
24
|
+
*
|
|
25
|
+
* INFO: each page is a separate request. Two rows that tie on the sort value have no
|
|
26
|
+
* fixed order between requests, so a row could show on two pages or on none. `_id` is
|
|
27
|
+
* unique and present on every union row, which makes the order total. The server
|
|
28
|
+
* accepts a list of sorts for a union and applies them in order.
|
|
29
|
+
*/
|
|
30
|
+
var handleBuildUnionPageSort = function (sort) {
|
|
31
|
+
var primary = (sort === null || sort === void 0 ? void 0 : sort.sortId) ? sort : UNION_DEFAULT_SORT;
|
|
32
|
+
if (primary.sortId === "_id")
|
|
33
|
+
return [primary];
|
|
34
|
+
return [primary, { sortId: "_id", type: primary.type }];
|
|
35
|
+
};
|
|
36
|
+
exports.handleBuildUnionPageSort = handleBuildUnionPageSort;
|
|
37
|
+
//# sourceMappingURL=unionPagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unionPagination.js","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/unionPagination.ts"],"names":[],"mappings":";;;AAEA,uFAAuF;AACvF,+EAA+E;AAC/E,gBAAgB;AAChB,IAAM,kBAAkB,GAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAElE;;;;;;GAMG;AACI,IAAM,sBAAsB,GAAG,UACpC,SAAiB,EACjB,KAAyB;IAEzB,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrD,OAAO,SAAS,GAAG,KAAK,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,sBAAsB,0BAMjC;AAEF;;;;;;;;GAQG;AACI,IAAM,wBAAwB,GAAG,UAAC,IAAW;IAClD,IAAM,OAAO,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;IACzD,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC;AAJW,QAAA,wBAAwB,4BAInC"}
|