@crystaldesign/diva-backoffice 26.5.0-beta.10 → 26.5.0-beta.12
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/build/esm/index.js +33 -7
- package/package.json +9 -9
package/build/esm/index.js
CHANGED
|
@@ -27741,21 +27741,47 @@ function StringCell (_ref) {
|
|
|
27741
27741
|
});
|
|
27742
27742
|
}
|
|
27743
27743
|
}
|
|
27744
|
+
function matchesColorCondition(record, value, operation, field, onValue) {
|
|
27745
|
+
if (onValue === undefined) {
|
|
27746
|
+
return false;
|
|
27747
|
+
}
|
|
27748
|
+
var currentValue = field ? record === null || record === void 0 ? void 0 : record[field] : value;
|
|
27749
|
+
if (operation === 'ct') {
|
|
27750
|
+
var _JSON$stringify$inclu, _JSON$stringify;
|
|
27751
|
+
return (_JSON$stringify$inclu = (_JSON$stringify = JSON.stringify(currentValue)) === null || _JSON$stringify === void 0 ? void 0 : _JSON$stringify.includes(String(onValue))) !== null && _JSON$stringify$inclu !== void 0 ? _JSON$stringify$inclu : false;
|
|
27752
|
+
}
|
|
27753
|
+
return currentValue === onValue;
|
|
27754
|
+
}
|
|
27744
27755
|
function getColor(column, record, value) {
|
|
27745
27756
|
if (column.color && record) {
|
|
27746
27757
|
var _iterator = _createForOfIteratorHelper$b(column.color),
|
|
27747
27758
|
_step;
|
|
27748
27759
|
try {
|
|
27749
27760
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27761
|
+
var _col$fields;
|
|
27750
27762
|
var col = _step.value;
|
|
27751
|
-
|
|
27752
|
-
var
|
|
27753
|
-
var
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
|
|
27763
|
+
if ((_col$fields = col.fields) !== null && _col$fields !== void 0 && _col$fields.length) {
|
|
27764
|
+
var hasAllMatches = true;
|
|
27765
|
+
for (var idx = 0; idx < col.fields.length; idx++) {
|
|
27766
|
+
var _ref2, _col$operations$idx, _col$operations, _col$operations2, _col$onValues;
|
|
27767
|
+
var field = col.fields[idx];
|
|
27768
|
+
var operation = (_ref2 = (_col$operations$idx = (_col$operations = col.operations) === null || _col$operations === void 0 ? void 0 : _col$operations[idx]) !== null && _col$operations$idx !== void 0 ? _col$operations$idx : (_col$operations2 = col.operations) === null || _col$operations2 === void 0 ? void 0 : _col$operations2[0]) !== null && _ref2 !== void 0 ? _ref2 : 'eq';
|
|
27769
|
+
var onValue = (_col$onValues = col.onValues) === null || _col$onValues === void 0 ? void 0 : _col$onValues[idx];
|
|
27770
|
+
if (!field || !matchesColorCondition(record, value, operation, field, onValue)) {
|
|
27771
|
+
hasAllMatches = false;
|
|
27772
|
+
break;
|
|
27773
|
+
}
|
|
27774
|
+
}
|
|
27775
|
+
if (hasAllMatches) {
|
|
27757
27776
|
return col.color;
|
|
27758
|
-
}
|
|
27777
|
+
}
|
|
27778
|
+
continue;
|
|
27779
|
+
}
|
|
27780
|
+
for (var _idx = 0; _idx < col.onValues.length; _idx++) {
|
|
27781
|
+
var _ref3, _col$operations$_idx, _col$operations3, _col$operations4, _col$onValues2;
|
|
27782
|
+
var _operation = (_ref3 = (_col$operations$_idx = (_col$operations3 = col.operations) === null || _col$operations3 === void 0 ? void 0 : _col$operations3[_idx]) !== null && _col$operations$_idx !== void 0 ? _col$operations$_idx : (_col$operations4 = col.operations) === null || _col$operations4 === void 0 ? void 0 : _col$operations4[0]) !== null && _ref3 !== void 0 ? _ref3 : 'eq';
|
|
27783
|
+
var _onValue = (_col$onValues2 = col.onValues) === null || _col$onValues2 === void 0 ? void 0 : _col$onValues2[_idx];
|
|
27784
|
+
if (matchesColorCondition(record, value, _operation, undefined, _onValue)) {
|
|
27759
27785
|
return col.color;
|
|
27760
27786
|
}
|
|
27761
27787
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-backoffice",
|
|
3
|
-
"version": "26.5.0-beta.
|
|
3
|
+
"version": "26.5.0-beta.12",
|
|
4
4
|
"license": "COMMERCIAL",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@testing-library/jest-dom": "^6.5.0",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@ant-design/icons": "6.1.0",
|
|
17
17
|
"@babel/runtime": "7.24.7",
|
|
18
|
-
"@crystaldesign/content-box": "26.5.0-beta.
|
|
19
|
-
"@crystaldesign/content-item": "26.5.0-beta.
|
|
20
|
-
"@crystaldesign/diva-core": "26.5.0-beta.
|
|
21
|
-
"@crystaldesign/diva-utils": "26.5.0-beta.
|
|
22
|
-
"@crystaldesign/media-upload": "26.5.0-beta.
|
|
23
|
-
"@crystaldesign/rtf-editor": "26.5.0-beta.
|
|
24
|
-
"@crystaldesign/spreadsheet": "26.5.0-beta.
|
|
18
|
+
"@crystaldesign/content-box": "26.5.0-beta.12",
|
|
19
|
+
"@crystaldesign/content-item": "26.5.0-beta.12",
|
|
20
|
+
"@crystaldesign/diva-core": "26.5.0-beta.12",
|
|
21
|
+
"@crystaldesign/diva-utils": "26.5.0-beta.12",
|
|
22
|
+
"@crystaldesign/media-upload": "26.5.0-beta.12",
|
|
23
|
+
"@crystaldesign/rtf-editor": "26.5.0-beta.12",
|
|
24
|
+
"@crystaldesign/spreadsheet": "26.5.0-beta.12",
|
|
25
25
|
"@google/model-viewer": "3.5.0",
|
|
26
26
|
"ag-charts-community": "^10.1.0",
|
|
27
27
|
"ag-charts-react": "^10.1.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
},
|
|
53
53
|
"module": "build/esm/index.js",
|
|
54
54
|
"types": "./build/types/backoffice/src/index.d.ts",
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "fdca8b6238ce9d8d6b21b66eb5b71e7ab18c4472"
|
|
56
56
|
}
|