@smartbit4all/ng-client 3.3.192 → 3.3.193
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/esm2020/lib/smart-table/tables/table.mjs +16 -14
- package/esm2020/lib/view-context/utility/smart-object-utility.mjs +30 -0
- package/fesm2015/smartbit4all-ng-client.mjs +44 -13
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +44 -13
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/utility/smart-object-utility.d.ts +4 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.3.193.tgz +0 -0
- package/smartbit4all-ng-client-3.3.192.tgz +0 -0
|
@@ -6630,6 +6630,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
6630
6630
|
args: [{ selector: 'lib-loading', template: "<div class=\"spinnerContainer\">\r\n <div class=\"spinner\">\r\n <mat-spinner color=\"accent\" #mainSpinner></mat-spinner>\r\n </div>\r\n</div>\r\n", styles: [".spinnerContainer{width:100%;display:flex;flex-direction:row;justify-content:center}\n"] }]
|
|
6631
6631
|
}], ctorParameters: function () { return []; } });
|
|
6632
6632
|
|
|
6633
|
+
class SmartObjectUtility {
|
|
6634
|
+
static getValueByPath(model, key) {
|
|
6635
|
+
// Attempt to directly access the key in case it's fully represented with dots
|
|
6636
|
+
if (key in model) {
|
|
6637
|
+
return model[key];
|
|
6638
|
+
}
|
|
6639
|
+
// Split the key into parts on the dot for deeper checks
|
|
6640
|
+
const keys = key.split('.');
|
|
6641
|
+
// Use a recursive helper function to traverse the object
|
|
6642
|
+
return this.traverse(model, keys, 0);
|
|
6643
|
+
}
|
|
6644
|
+
static traverse(currentModel, keys, index) {
|
|
6645
|
+
if (index >= keys.length) {
|
|
6646
|
+
return currentModel;
|
|
6647
|
+
}
|
|
6648
|
+
if (!currentModel) {
|
|
6649
|
+
return undefined;
|
|
6650
|
+
}
|
|
6651
|
+
// Reconstruct possible keys with dots
|
|
6652
|
+
for (let i = index; i < keys.length; i++) {
|
|
6653
|
+
const reconstructedKey = keys.slice(index, i + 1).join('.');
|
|
6654
|
+
if (reconstructedKey in currentModel) {
|
|
6655
|
+
// Recursively continue with the next index past the current reconstructed key
|
|
6656
|
+
return this.traverse(currentModel[reconstructedKey], keys, i + 1);
|
|
6657
|
+
}
|
|
6658
|
+
}
|
|
6659
|
+
return undefined;
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6662
|
+
|
|
6633
6663
|
class Table {
|
|
6634
6664
|
constructor(cfService) {
|
|
6635
6665
|
this.cfService = cfService;
|
|
@@ -7036,19 +7066,20 @@ class Table {
|
|
|
7036
7066
|
return false;
|
|
7037
7067
|
}
|
|
7038
7068
|
getValue(element, header) {
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7069
|
+
return SmartObjectUtility.getValueByPath(element, header);
|
|
7070
|
+
// let headers = header.split('.');
|
|
7071
|
+
// if (headers.length > 1) {
|
|
7072
|
+
// let value: any = element;
|
|
7073
|
+
// for (let index = 0; index < headers.length; index++) {
|
|
7074
|
+
// const element = headers[index];
|
|
7075
|
+
// value = value[element];
|
|
7076
|
+
// if (!value && index !== headers.length - 1) {
|
|
7077
|
+
// return undefined;
|
|
7078
|
+
// }
|
|
7079
|
+
// }
|
|
7080
|
+
// return value;
|
|
7081
|
+
// }
|
|
7082
|
+
// return element[header];
|
|
7052
7083
|
}
|
|
7053
7084
|
showButton(button, element) {
|
|
7054
7085
|
if (button.showButtonIf) {
|