@sisense/sdk-query-client 1.16.0 → 1.17.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.
|
@@ -22,20 +22,31 @@ export function prepareResultAsColsAndRows(data, metadata) {
|
|
|
22
22
|
*/
|
|
23
23
|
export function setCellsBlur(rows) {
|
|
24
24
|
var _a;
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
// A boolean flag indicating whether highlight is enabled on some column.
|
|
26
|
+
let isHighlightEnabledSomeColumn = false;
|
|
27
|
+
// An array indicating whether highlight is enabled per each column.
|
|
28
|
+
const highlightEnabledPerColumn = (_a = rows[0]) === null || _a === void 0 ? void 0 : _a.map((_value, index) => {
|
|
29
|
+
const isHighlightEnabled = rows.some((r) => 'selected' in r[index]);
|
|
30
|
+
if (isHighlightEnabled) {
|
|
31
|
+
isHighlightEnabledSomeColumn = true;
|
|
32
|
+
}
|
|
33
|
+
return isHighlightEnabled;
|
|
28
34
|
});
|
|
29
35
|
return rows.map((r) => {
|
|
30
36
|
// calculates a single `blur` value for a whole row based on each column (cell) configuration.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
// true: the data value is blurred
|
|
38
|
+
// false: the data value is highlighted
|
|
39
|
+
// undefined: the data value is neutral (neither highlighted nor blurred)
|
|
40
|
+
const blur = !isHighlightEnabledSomeColumn
|
|
41
|
+
? undefined
|
|
42
|
+
: highlightEnabledPerColumn.some((isHighlightEnabled, columnIndex) => isHighlightEnabled && !r[columnIndex].selected);
|
|
43
|
+
return r.map((d) => blur !== undefined
|
|
44
|
+
? {
|
|
45
|
+
data: d.data,
|
|
46
|
+
text: d.text,
|
|
47
|
+
blur,
|
|
48
|
+
}
|
|
49
|
+
: { data: d.data, text: d.text });
|
|
39
50
|
});
|
|
40
51
|
}
|
|
41
52
|
export function getQueryResultValues({ values = [], metadata = [] }) {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Sisense",
|
|
12
12
|
"Compose SDK"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.17.0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": "./dist/index.js",
|
|
17
17
|
"main": "./dist/index.js",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"author": "Sisense",
|
|
21
21
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@sisense/sdk-common": "^1.
|
|
24
|
-
"@sisense/sdk-data": "^1.
|
|
25
|
-
"@sisense/sdk-pivot-client": "^1.
|
|
26
|
-
"@sisense/sdk-rest-client": "^1.
|
|
23
|
+
"@sisense/sdk-common": "^1.17.0",
|
|
24
|
+
"@sisense/sdk-data": "^1.17.0",
|
|
25
|
+
"@sisense/sdk-pivot-client": "^1.17.0",
|
|
26
|
+
"@sisense/sdk-rest-client": "^1.17.0",
|
|
27
27
|
"@sisense/task-manager": "^0.1.0",
|
|
28
28
|
"numeral": "^2.0.6",
|
|
29
29
|
"ts-deepmerge": "6.0.2",
|