@smartbit4all/ng-client 3.0.0 → 3.0.2

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Input, ViewChild, forwardRef, EventEmitter, Output, Directive, HostListener, ViewContainerRef, ViewEncapsulation, ViewChildren, Pipe, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
- import { __awaiter } from 'tslib';
3
+ import { __awaiter, __decorate, __param } from 'tslib';
4
4
  import { Subject, takeUntil, startWith, map, distinctUntilChanged, catchError, throwError, from, lastValueFrom } from 'rxjs';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpHeaders, HttpContext, HttpParams, HttpEventType, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
@@ -11903,83 +11903,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
11903
11903
  }]
11904
11904
  }] });
11905
11905
 
11906
- class SmartNgClientModule {
11907
- }
11908
- SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11909
- SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
11910
- MatCommonModule,
11911
- ComponentFactoryServiceModule,
11912
- SmartSessionModule,
11913
- SmartViewContextModule,
11914
- SmartformModule,
11915
- SmartExpandableSectionModule,
11916
- SmartIconModule,
11917
- SmartComponentLayoutModule], exports: [SmartSessionModule,
11918
- SmartViewContextModule,
11919
- SmartFileUploaderComponent,
11920
- SmarttreeModule] });
11921
- SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
11922
- BrowserModule,
11923
- MatCommonModule,
11924
- ComponentFactoryServiceModule,
11925
- SmartSessionModule,
11926
- SmartViewContextModule,
11927
- SmartformModule,
11928
- SmartExpandableSectionModule,
11929
- SmartIconModule,
11930
- SmartComponentLayoutModule,
11931
- ], SmartSessionModule,
11932
- SmartViewContextModule,
11933
- SmarttreeModule] });
11934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
11935
- type: NgModule,
11936
- args: [{
11937
- declarations: [SmartFileUploaderComponent],
11938
- imports: [
11939
- BrowserModule,
11940
- MatCommonModule,
11941
- ComponentFactoryServiceModule,
11942
- SmartSessionModule,
11943
- SmartViewContextModule,
11944
- SmartformModule,
11945
- SmartExpandableSectionModule,
11946
- SmartIconModule,
11947
- SmartComponentLayoutModule,
11948
- ],
11949
- exports: [
11950
- SmartSessionModule,
11951
- SmartViewContextModule,
11952
- SmartFileUploaderComponent,
11953
- SmarttreeModule,
11954
- ],
11955
- providers: [SmartNgClientService],
11956
- }]
11957
- }] });
11958
-
11959
- class SmartComponentLayoutUtility {
11960
- static setParent(layout, parent) {
11961
- var _a;
11962
- layout.parentComponent = parent;
11963
- (_a = layout.components) === null || _a === void 0 ? void 0 : _a.forEach((l) => this.setParent(l, parent));
11964
- }
11965
- }
11966
-
11967
- /*
11968
- * Public API Surface of smart-component-layout
11969
- */
11970
-
11971
- class SmartNavbarService {
11972
- constructor() { }
11973
- }
11974
- SmartNavbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11975
- SmartNavbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, providedIn: 'root' });
11976
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, decorators: [{
11977
- type: Injectable,
11978
- args: [{
11979
- providedIn: 'root'
11980
- }]
11981
- }], ctorParameters: function () { return []; } });
11982
-
11983
11906
  var SmartUserSettinsIconPosition;
11984
11907
  (function (SmartUserSettinsIconPosition) {
11985
11908
  SmartUserSettinsIconPosition[SmartUserSettinsIconPosition["FRONT"] = 0] = "FRONT";
@@ -12090,22 +12013,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12090
12013
  }]
12091
12014
  }] });
12092
12015
 
12093
- /*
12094
- * Public API Surface of smart-navbar
12095
- */
12096
-
12097
- class SmartTabGroupService {
12098
- constructor() { }
12099
- }
12100
- SmartTabGroupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12101
- SmartTabGroupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, providedIn: 'root' });
12102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, decorators: [{
12103
- type: Injectable,
12104
- args: [{
12105
- providedIn: 'root'
12106
- }]
12107
- }], ctorParameters: function () { return []; } });
12108
-
12109
12016
  class TabGroupComponent {
12110
12017
  constructor(navigationService, route) {
12111
12018
  this.navigationService = navigationService;
@@ -12249,12 +12156,628 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12249
12156
  }]
12250
12157
  }] });
12251
12158
 
12159
+ class SmartNgClientModule {
12160
+ }
12161
+ SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12162
+ SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
12163
+ MatCommonModule,
12164
+ ComponentFactoryServiceModule,
12165
+ SmartViewContextModule,
12166
+ SmartdialogModule,
12167
+ SmartFilterModule,
12168
+ SmartformModule,
12169
+ SmartGridModule,
12170
+ SmartIconModule,
12171
+ SmartNavbarModule,
12172
+ SmartSessionModule,
12173
+ SmartTabGroupModule,
12174
+ SmarttableModule,
12175
+ SmartExpandableSectionModule,
12176
+ SmartComponentLayoutModule], exports: [ComponentFactoryServiceModule,
12177
+ SmartComponentLayoutModule,
12178
+ SmartdialogModule,
12179
+ SmartExpandableSectionModule,
12180
+ SmartFilterModule,
12181
+ SmartformModule,
12182
+ SmartGridModule,
12183
+ SmartIconModule,
12184
+ SmartNavbarModule,
12185
+ SmartSessionModule,
12186
+ SmartTabGroupModule,
12187
+ SmarttableModule,
12188
+ SmartViewContextModule,
12189
+ SmartFileUploaderComponent,
12190
+ SmarttreeModule] });
12191
+ SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
12192
+ BrowserModule,
12193
+ MatCommonModule,
12194
+ ComponentFactoryServiceModule,
12195
+ SmartViewContextModule,
12196
+ SmartdialogModule,
12197
+ SmartFilterModule,
12198
+ SmartformModule,
12199
+ SmartGridModule,
12200
+ SmartIconModule,
12201
+ SmartNavbarModule,
12202
+ SmartSessionModule,
12203
+ SmartTabGroupModule,
12204
+ SmarttableModule,
12205
+ SmartExpandableSectionModule,
12206
+ SmartComponentLayoutModule,
12207
+ ], ComponentFactoryServiceModule,
12208
+ SmartComponentLayoutModule,
12209
+ SmartdialogModule,
12210
+ SmartExpandableSectionModule,
12211
+ SmartFilterModule,
12212
+ SmartformModule,
12213
+ SmartGridModule,
12214
+ SmartIconModule,
12215
+ SmartNavbarModule,
12216
+ SmartSessionModule,
12217
+ SmartTabGroupModule,
12218
+ SmarttableModule,
12219
+ SmartViewContextModule,
12220
+ SmarttreeModule] });
12221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
12222
+ type: NgModule,
12223
+ args: [{
12224
+ declarations: [SmartFileUploaderComponent],
12225
+ imports: [
12226
+ BrowserModule,
12227
+ MatCommonModule,
12228
+ ComponentFactoryServiceModule,
12229
+ SmartViewContextModule,
12230
+ SmartdialogModule,
12231
+ SmartFilterModule,
12232
+ SmartformModule,
12233
+ SmartGridModule,
12234
+ SmartIconModule,
12235
+ SmartNavbarModule,
12236
+ SmartSessionModule,
12237
+ SmartTabGroupModule,
12238
+ SmarttableModule,
12239
+ SmartExpandableSectionModule,
12240
+ SmartComponentLayoutModule,
12241
+ ],
12242
+ exports: [
12243
+ ComponentFactoryServiceModule,
12244
+ SmartComponentLayoutModule,
12245
+ SmartdialogModule,
12246
+ SmartExpandableSectionModule,
12247
+ SmartFilterModule,
12248
+ SmartformModule,
12249
+ SmartGridModule,
12250
+ SmartIconModule,
12251
+ SmartNavbarModule,
12252
+ SmartSessionModule,
12253
+ SmartTabGroupModule,
12254
+ SmarttableModule,
12255
+ SmartViewContextModule,
12256
+ SmartFileUploaderComponent,
12257
+ SmarttreeModule,
12258
+ ],
12259
+ providers: [SmartNgClientService],
12260
+ }]
12261
+ }] });
12262
+
12263
+ class SmartAuthService {
12264
+ constructor() {
12265
+ this.bffApisHaveBeenSetUp = false;
12266
+ this._destroy$ = new Subject();
12267
+ this.headersUpdated = new SmartSubject(this._destroy$);
12268
+ }
12269
+ ngOnDestroy() {
12270
+ this._destroy$.next();
12271
+ this._destroy$.complete();
12272
+ }
12273
+ }
12274
+ SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12275
+ SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
12276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
12277
+ type: Injectable
12278
+ }] });
12279
+
12252
12280
  /*
12253
- * Public API Surface of smart-tab-group
12281
+ * Public API Surface of smarttree
12282
+ */
12283
+
12284
+ let SmartComponentApiClient = class SmartComponentApiClient {
12285
+ constructor(inject, auth, pageName) {
12286
+ this.inject = inject;
12287
+ this.auth = auth;
12288
+ this.pageName = pageName;
12289
+ this._destroy$ = new Subject();
12290
+ // protected sendDataChanges: boolean = false;
12291
+ // private _useAutoSubmit: boolean = false;
12292
+ // private _useAutoSubmitTurnedOff: Subject<void> = new SmartSubject(this._destroy$);
12293
+ // protected get useAutoSubmit(): boolean {
12294
+ // return this._useAutoSubmit;
12295
+ // }
12296
+ // protected set useAutoSubmit(useAutoSubmit: boolean) {
12297
+ // this._useAutoSubmit = useAutoSubmit;
12298
+ // if (this._useAutoSubmit) {
12299
+ // this.subscribeToAutoSubmit();
12300
+ // this.reSubscribeToChange.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
12301
+ // this.subscribeToAutoSubmit();
12302
+ // });
12303
+ // } else {
12304
+ // this._useAutoSubmitTurnedOff.next();
12305
+ // }
12306
+ // }
12307
+ // private subscribeToAutoSubmit(): void {
12308
+ // this.submit.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
12309
+ // this.submitForms();
12310
+ // this.submit.complete();
12311
+ // });
12312
+ // }
12313
+ this.detectChange = new SmartSubject(this._destroy$);
12314
+ this.uiActionModels = [];
12315
+ this.dataChanged = new SmartSubject(this._destroy$);
12316
+ // Contained Widgets
12317
+ this.widgets = new WidgetMap();
12318
+ this.formWidgets = new WidgetMap();
12319
+ this.detectChange.subscribe((change) => {
12320
+ this.handleChanges(change);
12321
+ });
12322
+ this.viewContext = inject.get(SmartViewContextService);
12323
+ this.uiActionService = inject.get(UiActionService);
12324
+ this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
12325
+ }
12326
+ get uuid() {
12327
+ return this._uuid;
12328
+ }
12329
+ set uuid(uuid) {
12330
+ let firstUuid = true;
12331
+ if (this.uuid) {
12332
+ this.viewContext.unfollow(this.uuid);
12333
+ firstUuid = false;
12334
+ }
12335
+ this._uuid = uuid;
12336
+ if (uuid) {
12337
+ this.widgets.widgets.forEach((ref, key) => {
12338
+ if (ref instanceof SmartGridComponent) {
12339
+ ref.uuid = uuid;
12340
+ }
12341
+ else if (!ref && !firstUuid) {
12342
+ console.error(`Provided reference for ${key} is undefined on uuid change.`);
12343
+ }
12344
+ });
12345
+ if (!this.uuidOfPageHasBeenChangedSubscription) {
12346
+ this.uuidOfPageHasBeenChangedSubscription = this.viewContext.uuidOfPageHasBeenChanged
12347
+ .pipe(takeUntil(this._destroy$))
12348
+ .subscribe((pageName) => {
12349
+ if (pageName === this.pageName) {
12350
+ this.run();
12351
+ }
12352
+ });
12353
+ }
12354
+ }
12355
+ this.viewContext.follow(this._uuid, this.detectChange);
12356
+ }
12357
+ get model() {
12358
+ return this._model;
12359
+ }
12360
+ set model(model) {
12361
+ this._model = model;
12362
+ this.initComponentByModel();
12363
+ }
12364
+ get data() {
12365
+ return this._data;
12366
+ }
12367
+ set data(model) {
12368
+ this._data = model;
12369
+ this.dataChanged.next();
12370
+ }
12371
+ get smartTreeService() {
12372
+ return this._smartTreeService;
12373
+ }
12374
+ set smartTreeService(smartTreeService) {
12375
+ if (this._smartTreeService !== undefined) {
12376
+ throw Error('The default tree has already set up!');
12377
+ }
12378
+ this._smartTreeService = smartTreeService;
12379
+ }
12380
+ _ngOnInit() {
12381
+ this.run();
12382
+ }
12383
+ _ngOnDestroy() {
12384
+ this.viewContext.unfollow(this.uuid);
12385
+ this.widgets.clearWidgets();
12386
+ this._destroy$.next();
12387
+ this._destroy$.complete();
12388
+ }
12389
+ initComponentByModel() {
12390
+ this.initData();
12391
+ this.initActions();
12392
+ // TODO: layout, valueSet, widgets
12393
+ }
12394
+ initData() {
12395
+ var _a, _b;
12396
+ if ((_a = this.model) === null || _a === void 0 ? void 0 : _a.data) {
12397
+ this.data = (_b = this.model) === null || _b === void 0 ? void 0 : _b.data;
12398
+ }
12399
+ }
12400
+ initActions() {
12401
+ var _a, _b;
12402
+ if ((_a = this.model) === null || _a === void 0 ? void 0 : _a.actions) {
12403
+ this.uiActionModels = (_b = this.model) === null || _b === void 0 ? void 0 : _b.actions.map((uiAction) => {
12404
+ return {
12405
+ serviceToUse: this,
12406
+ uiAction,
12407
+ };
12408
+ });
12409
+ }
12410
+ }
12411
+ run() {
12412
+ if (this.auth.bffApisHaveBeenSetUp) {
12413
+ this.load();
12414
+ }
12415
+ else {
12416
+ this.auth.headersUpdated.subscribe(() => {
12417
+ this.load();
12418
+ });
12419
+ }
12420
+ }
12421
+ load() {
12422
+ return __awaiter(this, void 0, void 0, function* () {
12423
+ this.uuid = this.viewContext.getUuidOfPage(this.pageName);
12424
+ this.model = yield this.viewContext.load(this.uuid);
12425
+ // await this.viewContext.load2(this.uuid);
12426
+ });
12427
+ }
12428
+ //#region UseUiAction
12429
+ getAdditionalParams(uiAction) {
12430
+ return {
12431
+ forTextArea: '',
12432
+ forTextField: '',
12433
+ };
12434
+ }
12435
+ getModel() {
12436
+ return this.data;
12437
+ }
12438
+ submitForm(validate) {
12439
+ this.submitForms(validate);
12440
+ }
12441
+ performUiActionRequest(uiActionRequest, widgetId, nodeId) {
12442
+ return __awaiter(this, void 0, void 0, function* () {
12443
+ if (uiActionRequest.params['_files']) {
12444
+ const param = uiActionRequest.params['param'];
12445
+ const files = uiActionRequest.params['_files'];
12446
+ const isMultiple = uiActionRequest.params['isMultiple'];
12447
+ delete uiActionRequest.params['param'];
12448
+ delete uiActionRequest.params['_files'];
12449
+ delete uiActionRequest.params['isMultiple'];
12450
+ if (!isMultiple) {
12451
+ yield this.viewContext.performUploadAction(this.uuid, uiActionRequest, param, files[0]);
12452
+ }
12453
+ else {
12454
+ yield this.viewContext.performUploadMultipleAction(this.uuid, uiActionRequest, param, files);
12455
+ }
12456
+ }
12457
+ else if (widgetId && nodeId) {
12458
+ yield this.viewContext.performWidgetAction(this.uuid, widgetId, nodeId, uiActionRequest);
12459
+ }
12460
+ else if (widgetId) {
12461
+ yield this.viewContext.performWidgetMainAction(this.uuid, widgetId, uiActionRequest);
12462
+ }
12463
+ else {
12464
+ yield this.viewContext.performAction(this.uuid, uiActionRequest);
12465
+ }
12466
+ });
12467
+ }
12468
+ handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
12469
+ throw new Error('handleSpecificDemandsAsynchronously method not implemented.');
12470
+ }
12471
+ //#endregion
12472
+ /**
12473
+ * Submits all the registered forms in the SmartComponent
12474
+ */
12475
+ submitForms(validate) {
12476
+ var _a, _b;
12477
+ (_b = (_a = this.formWidgets) === null || _a === void 0 ? void 0 : _a.widgets) === null || _b === void 0 ? void 0 : _b.forEach((form) => {
12478
+ form === null || form === void 0 ? void 0 : form.submitForm(validate);
12479
+ });
12480
+ }
12481
+ addGrid(smartGrid, options, useAsDefaultGrid, componentReference) {
12482
+ smartGrid.options = options;
12483
+ smartGrid.uiActionService = this.uiActionService;
12484
+ smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
12485
+ smartGrid.serviceToUse = this;
12486
+ smartGrid.viewContextService = this.viewContext;
12487
+ this.widgets.addWidget(smartGrid.gridIdentifier, componentReference);
12488
+ if (useAsDefaultGrid) {
12489
+ this.smartGrid = smartGrid;
12490
+ return this.smartGrid;
12491
+ }
12492
+ return smartGrid;
12493
+ }
12494
+ addForm(smartFormId, smartForm, componentReference) {
12495
+ this.formWidgets.addWidget(smartFormId, componentReference);
12496
+ // if (this.sendDataChanges && componentReference) {
12497
+ // smartForm.useOnValueChangeEvent = true;
12498
+ // componentReference.sophisticatedValueChange
12499
+ // .pipe(takeUntil(this._destroy$))
12500
+ // .subscribe((valueChange: SophisticatedValueChange) => {
12501
+ // this.handleValueChanges(valueChange);
12502
+ // });
12503
+ // }
12504
+ return smartForm;
12505
+ }
12506
+ setUpDefaultTree(treeId) {
12507
+ this.smartTreeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
12508
+ this.widgets.addWidget(treeId, this.smartTreeService);
12509
+ }
12510
+ createTreeService(treeId) {
12511
+ const treeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
12512
+ this.widgets.addWidget(treeId, treeService);
12513
+ return treeService;
12514
+ }
12515
+ addFileUploader(uiActionCode, fileFormats, maxSizeMb, isMultiple) {
12516
+ return {
12517
+ uiActionCode,
12518
+ smartComponent: this,
12519
+ fileFormats,
12520
+ isMultiple,
12521
+ maxSizeMb,
12522
+ };
12523
+ }
12524
+ // #region handle changes
12525
+ handleValueChanges(valueChange) {
12526
+ let dataChange;
12527
+ if (valueChange.key.includes('.')) {
12528
+ const source = valueChange.key.split('.')[0];
12529
+ const valueKey = valueChange.key.split('.')[1];
12530
+ dataChange = {
12531
+ kind: valueChange.kind === 'basic' ? DataChangeKind.Widget : DataChangeKind.Selection,
12532
+ source,
12533
+ values: [[valueKey, valueChange.value]],
12534
+ };
12535
+ }
12536
+ else {
12537
+ dataChange = {
12538
+ kind: valueChange.kind === 'basic' ? DataChangeKind.Widget : DataChangeKind.Selection,
12539
+ source: valueChange.key,
12540
+ values: [[valueChange.key, valueChange.value]],
12541
+ };
12542
+ }
12543
+ this.viewContext.dataChanged(this.uuid, dataChange);
12544
+ }
12545
+ handleChanges(change) {
12546
+ try {
12547
+ if (change.changedWidgets) {
12548
+ this.handleChangeWidgets(change.changedWidgets);
12549
+ }
12550
+ let dataChangeHasBeenNexted = false;
12551
+ if (change.changes) {
12552
+ const changes = change.changes;
12553
+ Object.keys(changes).map((changeKey) => {
12554
+ var _a, _b, _c;
12555
+ if (changeKey.startsWith('data.')) {
12556
+ this.handleDataChange(changes, changeKey);
12557
+ }
12558
+ else if (changeKey.startsWith('layouts.') && ((_a = this.model) === null || _a === void 0 ? void 0 : _a.layouts)) {
12559
+ this.handleLayoutChange(changes, changeKey);
12560
+ }
12561
+ else if (changeKey.startsWith('componentLayouts.') && ((_b = this.model) === null || _b === void 0 ? void 0 : _b.layouts)) {
12562
+ this.handleComponentLayoutChange(changes, changeKey);
12563
+ }
12564
+ else if (changeKey.startsWith('valueSets.') && ((_c = this.model) === null || _c === void 0 ? void 0 : _c.valueSets)) {
12565
+ this.handleValueSetChange(changes, changeKey);
12566
+ }
12567
+ else if (changeKey === 'actions') {
12568
+ this.handleActionChange(changes, changeKey);
12569
+ }
12570
+ else if (changeKey === 'constraints') {
12571
+ this.handleConstraintChange(changes, changeKey);
12572
+ }
12573
+ else if (changeKey === '') {
12574
+ this.model = changes[''];
12575
+ dataChangeHasBeenNexted = true;
12576
+ }
12577
+ });
12578
+ if (!dataChangeHasBeenNexted) {
12579
+ this.dataChanged.next();
12580
+ }
12581
+ }
12582
+ }
12583
+ catch (error) {
12584
+ console.error(error);
12585
+ this.model = change.value;
12586
+ }
12587
+ if (!change.changedWidgets && !change.changes && change.value) {
12588
+ this.model = change.value;
12589
+ }
12590
+ }
12591
+ handleChangeWidgets(changedWidgets) {
12592
+ changedWidgets.forEach((key) => {
12593
+ const reference = this.widgets.get(key);
12594
+ if (reference instanceof SmartGridComponent) {
12595
+ reference.refresh();
12596
+ }
12597
+ else if (reference instanceof SmarttreeGenericService) {
12598
+ reference.initialize();
12599
+ }
12600
+ else if (reference === undefined) {
12601
+ console.error(`Provided reference for ${key} is undefined.`);
12602
+ }
12603
+ });
12604
+ }
12605
+ setValueDeeply(model, key, value) {
12606
+ let splittedKeys = key.split('.');
12607
+ let deepModel = [model];
12608
+ let tempModel;
12609
+ for (let index = 0; index < splittedKeys.length; index++) {
12610
+ tempModel = deepModel[index];
12611
+ if (typeof tempModel[splittedKeys[index]] !== 'string' &&
12612
+ typeof tempModel[splittedKeys[index]] !== 'boolean' &&
12613
+ typeof tempModel[splittedKeys[index]] !== 'number' &&
12614
+ tempModel[splittedKeys[index]] !== undefined) {
12615
+ deepModel.push(tempModel[splittedKeys[index]]);
12616
+ }
12617
+ if (index === splittedKeys.length - 1) {
12618
+ tempModel[splittedKeys[index]] = value;
12619
+ break;
12620
+ }
12621
+ }
12622
+ return model;
12623
+ }
12624
+ handleDataChange(changes, changeKey) {
12625
+ this.setValueDeeply(this.model, changeKey, changes[changeKey]);
12626
+ this.formWidgets.widgets.forEach((formComponent, key) => {
12627
+ if (formComponent === undefined) {
12628
+ console.error(`Provided form reference for ${key} is undefined.`);
12629
+ }
12630
+ else {
12631
+ formComponent.refresh();
12632
+ }
12633
+ });
12634
+ }
12635
+ handleLayoutChange(changes, changeKey) {
12636
+ let layoutKey = changeKey.split('.')[1];
12637
+ this.model.layouts[layoutKey] = changes[changeKey];
12638
+ }
12639
+ handleComponentLayoutChange(changes, changeKey) {
12640
+ let layoutKey = changeKey.split('.')[1];
12641
+ let componentLayouts = this.model.componentLayouts;
12642
+ componentLayouts[layoutKey] = changes[changeKey];
12643
+ }
12644
+ handleValueSetChange(changes, changeKey) {
12645
+ let valueSetKey = changeKey.split('.')[1];
12646
+ this.model.valueSets[valueSetKey] = changes[changeKey];
12647
+ }
12648
+ handleActionChange(changes, changeKey) {
12649
+ this.model.actions = changes[changeKey];
12650
+ this.initActions();
12651
+ }
12652
+ handleConstraintChange(changes, changeKey) {
12653
+ this.model.constraints = changes[changeKey];
12654
+ }
12655
+ };
12656
+ SmartComponentApiClient = __decorate([
12657
+ __param(2, Inject('pageName'))
12658
+ ], SmartComponentApiClient);
12659
+ class WidgetMap {
12660
+ constructor() {
12661
+ this._widgets = new Map();
12662
+ }
12663
+ get widgets() {
12664
+ return this._widgets;
12665
+ }
12666
+ set widgets(widgets) {
12667
+ this._widgets = widgets;
12668
+ }
12669
+ addWidget(key, reference, isForm) {
12670
+ this._widgets.set(key, reference);
12671
+ }
12672
+ removeWidget(key) {
12673
+ this._widgets.delete(key);
12674
+ }
12675
+ clearWidgets() {
12676
+ this._widgets.clear();
12677
+ }
12678
+ get(key) {
12679
+ return this.widgets.get(key);
12680
+ }
12681
+ }
12682
+
12683
+ class SmartComponent extends SmartComponentApiClient {
12684
+ constructor(inject, auth, pageName) {
12685
+ super(inject, auth, pageName);
12686
+ }
12687
+ ngOnInit() {
12688
+ this._ngOnInit();
12689
+ }
12690
+ ngOnDestroy() {
12691
+ this._ngOnDestroy();
12692
+ }
12693
+ }
12694
+ SmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Component });
12695
+ SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
12696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, decorators: [{
12697
+ type: Component,
12698
+ args: [{
12699
+ template: '',
12700
+ }]
12701
+ }], ctorParameters: function () {
12702
+ return [{ type: i0.Injector }, { type: undefined, decorators: [{
12703
+ type: Inject,
12704
+ args: [SmartAuthService]
12705
+ }] }, { type: undefined, decorators: [{
12706
+ type: Inject,
12707
+ args: ['pageName']
12708
+ }] }];
12709
+ } });
12710
+
12711
+ class SmartService extends SmartComponentApiClient {
12712
+ constructor(inject, auth, pageName) {
12713
+ super(inject, auth, pageName);
12714
+ }
12715
+ ngOnInit() {
12716
+ this._ngOnInit();
12717
+ }
12718
+ ngOnDestroy() {
12719
+ this._ngOnDestroy();
12720
+ }
12721
+ }
12722
+ SmartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Injectable });
12723
+ SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, providedIn: 'root' });
12724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, decorators: [{
12725
+ type: Injectable,
12726
+ args: [{
12727
+ providedIn: 'root',
12728
+ }]
12729
+ }], ctorParameters: function () {
12730
+ return [{ type: i0.Injector }, { type: undefined, decorators: [{
12731
+ type: Inject,
12732
+ args: [SmartAuthService]
12733
+ }] }, { type: undefined, decorators: [{
12734
+ type: Inject,
12735
+ args: ['pageName']
12736
+ }] }];
12737
+ } });
12738
+
12739
+ class SmartComponentLayoutUtility {
12740
+ static setParent(layout, parent) {
12741
+ var _a;
12742
+ layout.parentComponent = parent;
12743
+ (_a = layout.components) === null || _a === void 0 ? void 0 : _a.forEach((l) => this.setParent(l, parent));
12744
+ }
12745
+ }
12746
+
12747
+ /*
12748
+ * Public API Surface of smart-component-layout
12254
12749
  */
12255
12750
 
12751
+ class SmartNavbarService {
12752
+ constructor() { }
12753
+ }
12754
+ SmartNavbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12755
+ SmartNavbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, providedIn: 'root' });
12756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, decorators: [{
12757
+ type: Injectable,
12758
+ args: [{
12759
+ providedIn: 'root'
12760
+ }]
12761
+ }], ctorParameters: function () { return []; } });
12762
+
12256
12763
  /*
12257
- * Public API Surface of smarttree
12764
+ * Public API Surface of smart-navbar
12765
+ */
12766
+
12767
+ class SmartTabGroupService {
12768
+ constructor() { }
12769
+ }
12770
+ SmartTabGroupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12771
+ SmartTabGroupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, providedIn: 'root' });
12772
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, decorators: [{
12773
+ type: Injectable,
12774
+ args: [{
12775
+ providedIn: 'root'
12776
+ }]
12777
+ }], ctorParameters: function () { return []; } });
12778
+
12779
+ /*
12780
+ * Public API Surface of smart-tab-group
12258
12781
  */
12259
12782
 
12260
12783
  /*
@@ -12265,5 +12788,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12265
12788
  * Generated bundle index. Do not edit.
12266
12789
  */
12267
12790
 
12268
- export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$4 as BASE_PATH, COLLECTION_FORMATS$4 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$4 as Configuration, DataChangeKind, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator, FilterExpressionBuilderGroup, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderBy, GridDataAccessConfig, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptor, IS_ASYNC_PARAM_NAME, LayoutDirection, MessageOptionType, MessageType, SelectionDefinition, SessionAPIS, SessionErrorBehaviour, SessionService, SimplifiedTabGroupComponent, SmartActionType, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterModule, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType };
12791
+ export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$4 as BASE_PATH, COLLECTION_FORMATS$4 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$4 as Configuration, DataChangeKind, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator, FilterExpressionBuilderGroup, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderBy, GridDataAccessConfig, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptor, IS_ASYNC_PARAM_NAME, LayoutDirection, MessageOptionType, MessageType, SelectionDefinition, SessionAPIS, SessionErrorBehaviour, SessionService, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterModule, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
12269
12792
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map