@smartbit4all/ng-client 3.3.192 → 3.3.194
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-client/smart-component-api-client.mjs +7 -2
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionField.mjs +1 -1
- package/esm2020/lib/smart-table/tables/table.mjs +3 -14
- package/esm2020/lib/view-context/utility/smart-object-utility.mjs +30 -0
- package/fesm2015/smartbit4all-ng-client.mjs +37 -14
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +37 -14
- 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.194.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,7 @@ class Table {
|
|
|
7036
7066
|
return false;
|
|
7037
7067
|
}
|
|
7038
7068
|
getValue(element, header) {
|
|
7039
|
-
|
|
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);
|
|
7052
7070
|
}
|
|
7053
7071
|
showButton(button, element) {
|
|
7054
7072
|
if (button.showButtonIf) {
|
|
@@ -15492,7 +15510,9 @@ class SmartComponentApiClient {
|
|
|
15492
15510
|
uiAction,
|
|
15493
15511
|
};
|
|
15494
15512
|
});
|
|
15495
|
-
|
|
15513
|
+
const allToolbars = this.getAllSmartUiActionToolbars();
|
|
15514
|
+
let toolbars = allToolbars.filter((toolbar) => toolbar.id);
|
|
15515
|
+
let toolbarsWithoutId = this.getAllSmartUiActionToolbars().filter((toolbar) => toolbar.id === undefined || toolbar.id === null);
|
|
15496
15516
|
let toolbarModels = new Map();
|
|
15497
15517
|
toolbars.forEach((toolbar) => {
|
|
15498
15518
|
toolbarModels.set(toolbar.id, []);
|
|
@@ -15514,6 +15534,9 @@ class SmartComponentApiClient {
|
|
|
15514
15534
|
toolbar.uiActionModels = toolbarModels.get(toolbar.id);
|
|
15515
15535
|
await toolbar.setUp();
|
|
15516
15536
|
});
|
|
15537
|
+
toolbarsWithoutId.forEach(async (toolbar) => {
|
|
15538
|
+
await toolbar.setUp();
|
|
15539
|
+
});
|
|
15517
15540
|
this.changeDetector?.detectChanges();
|
|
15518
15541
|
}
|
|
15519
15542
|
}
|