@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.
@@ -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
- let headers = header.split('.');
7040
- if (headers.length > 1) {
7041
- let value = element;
7042
- for (let index = 0; index < headers.length; index++) {
7043
- const element = headers[index];
7044
- value = value[element];
7045
- if (!value && index !== headers.length - 1) {
7046
- return undefined;
7047
- }
7048
- }
7049
- return value;
7050
- }
7051
- return element[header];
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) {