@things-factory/meta-ui 7.0.43 → 7.0.44
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.
|
@@ -321,9 +321,12 @@ export class MetaUiUtil {
|
|
|
321
321
|
gridRow.classifier = function (recordData, rowIdx) {
|
|
322
322
|
let settings = pageView.gridEmphasized.row;
|
|
323
323
|
for (let idx = 0; idx < settings.length; idx++) {
|
|
324
|
-
const logic = settings[idx].logic
|
|
325
|
-
const c = new Compartment();
|
|
326
|
-
|
|
324
|
+
const logic = settings[idx].logic;
|
|
325
|
+
const c = new Compartment({ record: recordData, rowIdx });
|
|
326
|
+
const evalFunc = c.evaluate(`(record, rowIdx) => {
|
|
327
|
+
return ${logic}
|
|
328
|
+
}`);
|
|
329
|
+
if (evalFunc(recordData, rowIdx)) {
|
|
327
330
|
return {
|
|
328
331
|
emphasized: [settings[idx].backgroundColor, settings[idx].fontColor]
|
|
329
332
|
};
|
|
@@ -341,11 +344,12 @@ export class MetaUiUtil {
|
|
|
341
344
|
gridColumns[colIdx].record = {};
|
|
342
345
|
gridColumns[colIdx].record.classifier = function (recordData, rowIdx) {
|
|
343
346
|
for (let idx = 0; idx < settings.length; idx++) {
|
|
344
|
-
const logic = settings[idx].logic
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
const logic = settings[idx].logic;
|
|
348
|
+
const c = new Compartment({ record: recordData, rowIdx });
|
|
349
|
+
const evalFunc = c.evaluate(`(record, rowIdx) => {
|
|
350
|
+
return ${logic}
|
|
351
|
+
}`);
|
|
352
|
+
if (evalFunc(recordData, rowIdx)) {
|
|
349
353
|
return {
|
|
350
354
|
emphasized: [settings[idx].backgroundColor, settings[idx].fontColor]
|
|
351
355
|
};
|