@smartbit4all/ng-client 3.3.180 → 3.3.182
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 +35 -24
- package/esm2020/lib/smart-filter-editor/smart-filter-editor.model.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/smart-filter-editor.service.mjs +11 -7
- package/esm2020/lib/smart-grid/smart-grid.component.mjs +4 -2
- package/fesm2015/smartbit4all-ng-client.mjs +47 -30
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +47 -30
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +1 -1
- package/lib/smart-filter-editor/smart-filter-editor.model.d.ts +1 -1
- package/lib/smart-grid/smart-grid.component.d.ts +1 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.3.182.tgz +0 -0
- package/smartbit4all-ng-client-3.3.180.tgz +0 -0
|
@@ -10229,7 +10229,9 @@ class SmartGridComponent {
|
|
|
10229
10229
|
async refresh() {
|
|
10230
10230
|
this.setupToolbar();
|
|
10231
10231
|
// will cause this.service.gridModelChanged to fire
|
|
10232
|
-
|
|
10232
|
+
if (this.uuid) {
|
|
10233
|
+
await this.service.load(this.uuid, this.smartGrid.gridIdentifier);
|
|
10234
|
+
}
|
|
10233
10235
|
}
|
|
10234
10236
|
setupToolbar() {
|
|
10235
10237
|
// check if toolbar is available _and_ need set up
|
|
@@ -15167,14 +15169,18 @@ class SmartFilterEditorService {
|
|
|
15167
15169
|
this.reSubscribeToChange = new Subject();
|
|
15168
15170
|
}
|
|
15169
15171
|
async load() {
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
+
if (this.config.uuid) {
|
|
15173
|
+
this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
15174
|
+
this.modelChanged.next();
|
|
15175
|
+
}
|
|
15172
15176
|
}
|
|
15173
15177
|
async peformWidgetAction(request) {
|
|
15174
|
-
this.
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
+
if (this.config.uuid) {
|
|
15179
|
+
this.model = await this.service
|
|
15180
|
+
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
15181
|
+
.toPromise();
|
|
15182
|
+
this.modelChanged.next();
|
|
15183
|
+
}
|
|
15178
15184
|
}
|
|
15179
15185
|
getModel() {
|
|
15180
15186
|
return this.model;
|
|
@@ -15208,7 +15214,7 @@ class SmartComponentApiClient {
|
|
|
15208
15214
|
this.renderer = renderer;
|
|
15209
15215
|
this._destroy$ = new Subject();
|
|
15210
15216
|
this.detectChange = new SmartSubject(this._destroy$);
|
|
15211
|
-
this.
|
|
15217
|
+
this.componentModelLoaded = false;
|
|
15212
15218
|
this.uiActionModels = [];
|
|
15213
15219
|
this.dataChanged = new SmartSubject(this._destroy$);
|
|
15214
15220
|
// Contained Widgets
|
|
@@ -15252,29 +15258,29 @@ class SmartComponentApiClient {
|
|
|
15252
15258
|
firstUuid = false;
|
|
15253
15259
|
}
|
|
15254
15260
|
this._uuid = uuid;
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
-
|
|
15259
|
-
|
|
15260
|
-
|
|
15261
|
-
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
|
|
15261
|
+
this.getWidgets().forEach((ref, key) => {
|
|
15262
|
+
if (ref instanceof SmartGridComponent) {
|
|
15263
|
+
ref.uuid = this.componentModelLoaded ? uuid : undefined;
|
|
15264
|
+
}
|
|
15265
|
+
else if (ref instanceof SmartFilterEditorService) {
|
|
15266
|
+
ref.config.uuid = this.componentModelLoaded ? uuid : undefined;
|
|
15267
|
+
}
|
|
15268
|
+
else if (!ref && !firstUuid) {
|
|
15269
|
+
console.error(`Provided reference for ${key} is undefined on uuid change.`);
|
|
15270
|
+
}
|
|
15271
|
+
});
|
|
15272
|
+
if (!this.uuidOfPageHasBeenChangedSubscription) {
|
|
15273
|
+
this.uuidOfPageHasBeenChangedSubscription = this.viewContext.uuidOfPageHasBeenChanged
|
|
15274
|
+
.pipe(takeUntil(this._destroy$))
|
|
15275
|
+
.subscribe((pageName) => {
|
|
15276
|
+
if (pageName === this.pageName) {
|
|
15277
|
+
this.run();
|
|
15265
15278
|
}
|
|
15266
15279
|
});
|
|
15267
|
-
if (!this.uuidOfPageHasBeenChangedSubscription) {
|
|
15268
|
-
this.uuidOfPageHasBeenChangedSubscription = this.viewContext.uuidOfPageHasBeenChanged
|
|
15269
|
-
.pipe(takeUntil(this._destroy$))
|
|
15270
|
-
.subscribe((pageName) => {
|
|
15271
|
-
if (pageName === this.pageName) {
|
|
15272
|
-
this.run();
|
|
15273
|
-
}
|
|
15274
|
-
});
|
|
15275
|
-
}
|
|
15276
15280
|
}
|
|
15277
|
-
|
|
15281
|
+
if (uuid) {
|
|
15282
|
+
this.viewContext.follow(this._uuid, this.detectChange);
|
|
15283
|
+
}
|
|
15278
15284
|
}
|
|
15279
15285
|
get model() {
|
|
15280
15286
|
return this._model;
|
|
@@ -15505,9 +15511,16 @@ class SmartComponentApiClient {
|
|
|
15505
15511
|
}
|
|
15506
15512
|
}
|
|
15507
15513
|
async load() {
|
|
15508
|
-
this.
|
|
15514
|
+
this.componentModelLoaded = false;
|
|
15515
|
+
const uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
15509
15516
|
// this.model = await this.viewContext.load(this.uuid);
|
|
15510
|
-
await this.viewContext.load2(
|
|
15517
|
+
const change = await this.viewContext.load2(uuid);
|
|
15518
|
+
this.componentModelLoaded = true;
|
|
15519
|
+
this.uuid = uuid;
|
|
15520
|
+
this.model = change.result;
|
|
15521
|
+
if (this.model.widgets) {
|
|
15522
|
+
this.handleChangeWidgets(this.model.widgets);
|
|
15523
|
+
}
|
|
15511
15524
|
}
|
|
15512
15525
|
async executeUiAction(uiAction, options) {
|
|
15513
15526
|
this.uiActionService.uiActionModel = {
|
|
@@ -15750,6 +15763,10 @@ class SmartComponentApiClient {
|
|
|
15750
15763
|
}
|
|
15751
15764
|
handleChanges(change) {
|
|
15752
15765
|
try {
|
|
15766
|
+
if (!this.componentModelLoaded) {
|
|
15767
|
+
// initial load
|
|
15768
|
+
return;
|
|
15769
|
+
}
|
|
15753
15770
|
if (change.changedWidgets) {
|
|
15754
15771
|
this.handleChangeWidgets(change.changedWidgets);
|
|
15755
15772
|
}
|