@sisense/sdk-query-client 0.13.0 → 0.14.0
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.
|
@@ -2,5 +2,11 @@ import { Cell, DataCell, Element, QueryResultData } from '@sisense/sdk-data';
|
|
|
2
2
|
import { JaqlResponse } from '../types.js';
|
|
3
3
|
export declare const getDataFromQueryResult: (result: JaqlResponse, metadata: Element[]) => QueryResultData;
|
|
4
4
|
export declare function prepareResultAsColsAndRows(data: DataCell[][], metadata: Element[]): QueryResultData;
|
|
5
|
+
/**
|
|
6
|
+
* Sets the `blur` property for each cell in a 2D array of data cells based on the `selected` property.
|
|
7
|
+
*
|
|
8
|
+
* @param rows - The 2D array of data cells representing rows and columns.
|
|
9
|
+
* @returns A new 2D array of cells with the `blur` property set.
|
|
10
|
+
*/
|
|
5
11
|
export declare function setCellsBlur(rows: DataCell[][]): Cell[][];
|
|
6
12
|
export declare function getQueryResultValues({ values, metadata }: JaqlResponse): DataCell[][];
|
|
@@ -14,13 +14,29 @@ export function prepareResultAsColsAndRows(data, metadata) {
|
|
|
14
14
|
rows: setCellsBlur(data),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Sets the `blur` property for each cell in a 2D array of data cells based on the `selected` property.
|
|
19
|
+
*
|
|
20
|
+
* @param rows - The 2D array of data cells representing rows and columns.
|
|
21
|
+
* @returns A new 2D array of cells with the `blur` property set.
|
|
22
|
+
*/
|
|
17
23
|
export function setCellsBlur(rows) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
// An array indicating whether `blur` is enabled per each column.
|
|
26
|
+
const blurEnabledPerColumn = (_a = rows[0]) === null || _a === void 0 ? void 0 : _a.map((_value, index) => {
|
|
27
|
+
return rows.some((r) => 'selected' in r[index]);
|
|
28
|
+
});
|
|
29
|
+
return rows.map((r) => {
|
|
30
|
+
// calculates a single `blur` value for a whole row based on each column (cell) configuration.
|
|
31
|
+
const blur = blurEnabledPerColumn.some((isBlurEnabled, columnIndex) => {
|
|
32
|
+
return isBlurEnabled && !r[columnIndex].selected;
|
|
33
|
+
});
|
|
34
|
+
return r.map((d) => ({
|
|
35
|
+
data: d.data,
|
|
36
|
+
text: d.text,
|
|
37
|
+
blur,
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
24
40
|
}
|
|
25
41
|
export function getQueryResultValues({ values = [], metadata = [] }) {
|
|
26
42
|
var _a, _b, _c, _d;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sisense/sdk-query-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"author": "Sisense",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@sisense/sdk-common": "^0.
|
|
13
|
-
"@sisense/sdk-data": "^0.
|
|
14
|
-
"@sisense/sdk-rest-client": "^0.
|
|
12
|
+
"@sisense/sdk-common": "^0.14.0",
|
|
13
|
+
"@sisense/sdk-data": "^0.14.0",
|
|
14
|
+
"@sisense/sdk-rest-client": "^0.14.0",
|
|
15
15
|
"@sisense/task-manager": "^0.1.0",
|
|
16
16
|
"numeral": "^2.0.6",
|
|
17
17
|
"uuid": "^9.0.0"
|