@crystaldesign/diva-backoffice 24.13.0-beta.2 → 24.13.0-beta.4
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
CHANGED
|
@@ -23431,38 +23431,6 @@ function StringCell (_ref) {
|
|
|
23431
23431
|
var form = useContext(EditableContext);
|
|
23432
23432
|
var _useTranslation = useTranslation(),
|
|
23433
23433
|
t = _useTranslation.t;
|
|
23434
|
-
var _useState3 = useState(undefined),
|
|
23435
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
23436
|
-
color = _useState4[0],
|
|
23437
|
-
setColor = _useState4[1];
|
|
23438
|
-
useEffect(function () {
|
|
23439
|
-
if (column.color && record) {
|
|
23440
|
-
var returnValue = '';
|
|
23441
|
-
var _iterator = _createForOfIteratorHelper$7(column.color),
|
|
23442
|
-
_step;
|
|
23443
|
-
try {
|
|
23444
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
23445
|
-
var col = _step.value;
|
|
23446
|
-
for (var idx = 0; idx < col.onValues.length; idx++) {
|
|
23447
|
-
var _col$fields, _col$operations, _col$onValues, _JSON$stringify;
|
|
23448
|
-
var field = (_col$fields = col.fields) === null || _col$fields === void 0 ? void 0 : _col$fields[idx];
|
|
23449
|
-
var operation = (_col$operations = col.operations) === null || _col$operations === void 0 ? void 0 : _col$operations[0];
|
|
23450
|
-
var onValue = (_col$onValues = col.onValues) === null || _col$onValues === void 0 ? void 0 : _col$onValues[idx];
|
|
23451
|
-
if (!field && operation === 'eq' && onValue === children[1]) {
|
|
23452
|
-
returnValue = col.color;
|
|
23453
|
-
} else if (field && operation === 'ct' && (_JSON$stringify = JSON.stringify(record[field])) !== null && _JSON$stringify !== void 0 && _JSON$stringify.includes(onValue)) {
|
|
23454
|
-
returnValue = col.color;
|
|
23455
|
-
}
|
|
23456
|
-
}
|
|
23457
|
-
}
|
|
23458
|
-
} catch (err) {
|
|
23459
|
-
_iterator.e(err);
|
|
23460
|
-
} finally {
|
|
23461
|
-
_iterator.f();
|
|
23462
|
-
}
|
|
23463
|
-
setColor(returnValue);
|
|
23464
|
-
}
|
|
23465
|
-
}, []);
|
|
23466
23434
|
useEffect(function () {
|
|
23467
23435
|
if (editing) {
|
|
23468
23436
|
inputRef.current.focus();
|
|
@@ -23542,7 +23510,7 @@ function StringCell (_ref) {
|
|
|
23542
23510
|
whiteSpace: 'nowrap',
|
|
23543
23511
|
overflow: 'hidden',
|
|
23544
23512
|
textOverflow: 'ellipsis',
|
|
23545
|
-
color:
|
|
23513
|
+
color: getColor(column, record, children[1]),
|
|
23546
23514
|
width: column.width,
|
|
23547
23515
|
paddingRight: 12
|
|
23548
23516
|
},
|
|
@@ -23551,6 +23519,33 @@ function StringCell (_ref) {
|
|
|
23551
23519
|
});
|
|
23552
23520
|
}
|
|
23553
23521
|
}
|
|
23522
|
+
function getColor(column, record, value) {
|
|
23523
|
+
if (column.color && record) {
|
|
23524
|
+
var _iterator = _createForOfIteratorHelper$7(column.color),
|
|
23525
|
+
_step;
|
|
23526
|
+
try {
|
|
23527
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
23528
|
+
var col = _step.value;
|
|
23529
|
+
for (var idx = 0; idx < col.onValues.length; idx++) {
|
|
23530
|
+
var _col$fields, _col$operations, _col$onValues, _JSON$stringify;
|
|
23531
|
+
var field = (_col$fields = col.fields) === null || _col$fields === void 0 ? void 0 : _col$fields[idx];
|
|
23532
|
+
var operation = (_col$operations = col.operations) === null || _col$operations === void 0 ? void 0 : _col$operations[0];
|
|
23533
|
+
var onValue = (_col$onValues = col.onValues) === null || _col$onValues === void 0 ? void 0 : _col$onValues[idx];
|
|
23534
|
+
if (!field && operation === 'eq' && onValue === value) {
|
|
23535
|
+
return col.color;
|
|
23536
|
+
} else if (field && operation === 'ct' && (_JSON$stringify = JSON.stringify(record[field])) !== null && _JSON$stringify !== void 0 && _JSON$stringify.includes(onValue)) {
|
|
23537
|
+
return col.color;
|
|
23538
|
+
}
|
|
23539
|
+
}
|
|
23540
|
+
}
|
|
23541
|
+
} catch (err) {
|
|
23542
|
+
_iterator.e(err);
|
|
23543
|
+
} finally {
|
|
23544
|
+
_iterator.f();
|
|
23545
|
+
}
|
|
23546
|
+
}
|
|
23547
|
+
return undefined;
|
|
23548
|
+
}
|
|
23554
23549
|
|
|
23555
23550
|
function TextCell (_ref) {
|
|
23556
23551
|
var children = _ref.children,
|
package/build/types/backoffice/src/ui/Table/BaseTable/cellRenderer/StringCell/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/Table/BaseTable/cellRenderer/StringCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAmB,MAAM,IAAI,CAAC;AAGzD,MAAM,CAAC,OAAO,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/ui/Table/BaseTable/cellRenderer/StringCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAmB,MAAM,IAAI,CAAC;AAGzD,MAAM,CAAC,OAAO,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,kBAAkB,qBAgGzF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-backoffice",
|
|
3
|
-
"version": "24.13.0-beta.
|
|
3
|
+
"version": "24.13.0-beta.4",
|
|
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": "5.4.0",
|
|
17
17
|
"@babel/runtime": "7.24.7",
|
|
18
|
-
"@crystaldesign/content-box": "24.13.0-beta.
|
|
19
|
-
"@crystaldesign/content-item": "24.13.0-beta.
|
|
20
|
-
"@crystaldesign/diva-core": "24.13.0-beta.
|
|
21
|
-
"@crystaldesign/diva-utils": "24.13.0-beta.
|
|
22
|
-
"@crystaldesign/media-upload": "24.13.0-beta.
|
|
23
|
-
"@crystaldesign/rtf-editor": "24.13.0-beta.
|
|
24
|
-
"@crystaldesign/spreadsheet": "24.13.0-beta.
|
|
18
|
+
"@crystaldesign/content-box": "24.13.0-beta.4",
|
|
19
|
+
"@crystaldesign/content-item": "24.13.0-beta.4",
|
|
20
|
+
"@crystaldesign/diva-core": "24.13.0-beta.4",
|
|
21
|
+
"@crystaldesign/diva-utils": "24.13.0-beta.4",
|
|
22
|
+
"@crystaldesign/media-upload": "24.13.0-beta.4",
|
|
23
|
+
"@crystaldesign/rtf-editor": "24.13.0-beta.4",
|
|
24
|
+
"@crystaldesign/spreadsheet": "24.13.0-beta.4",
|
|
25
25
|
"@google/model-viewer": "3.5.0",
|
|
26
26
|
"ag-charts-community": "^10.1.0",
|
|
27
27
|
"ag-charts-react": "^10.1.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
},
|
|
52
52
|
"module": "build/esm/index.js",
|
|
53
53
|
"types": "./build/types/backoffice/src/index.d.ts",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b2e7e97fc6e8853f3f77af832c9a9974a68189eb"
|
|
55
55
|
}
|