@smartbit4all/ng-client 3.0.1 → 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.
@@ -70,6 +70,7 @@ import { MatToolbarModule } from '@angular/material/toolbar';
70
70
  import { MatBadgeModule } from '@angular/material/badge';
71
71
  import * as i3$4 from '@angular/material/tabs';
72
72
  import { MatTabsModule } from '@angular/material/tabs';
73
+ import { __decorate, __param } from 'tslib';
73
74
 
74
75
  class SmartSubject extends Subject {
75
76
  constructor(unsubscribe$) {
@@ -11797,82 +11798,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
11797
11798
  }]
11798
11799
  }] });
11799
11800
 
11800
- class SmartNgClientModule {
11801
- }
11802
- SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11803
- SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
11804
- MatCommonModule,
11805
- ComponentFactoryServiceModule,
11806
- SmartSessionModule,
11807
- SmartViewContextModule,
11808
- SmartformModule,
11809
- SmartExpandableSectionModule,
11810
- SmartIconModule,
11811
- SmartComponentLayoutModule], exports: [SmartSessionModule,
11812
- SmartViewContextModule,
11813
- SmartFileUploaderComponent,
11814
- SmarttreeModule] });
11815
- SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
11816
- BrowserModule,
11817
- MatCommonModule,
11818
- ComponentFactoryServiceModule,
11819
- SmartSessionModule,
11820
- SmartViewContextModule,
11821
- SmartformModule,
11822
- SmartExpandableSectionModule,
11823
- SmartIconModule,
11824
- SmartComponentLayoutModule,
11825
- ], SmartSessionModule,
11826
- SmartViewContextModule,
11827
- SmarttreeModule] });
11828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
11829
- type: NgModule,
11830
- args: [{
11831
- declarations: [SmartFileUploaderComponent],
11832
- imports: [
11833
- BrowserModule,
11834
- MatCommonModule,
11835
- ComponentFactoryServiceModule,
11836
- SmartSessionModule,
11837
- SmartViewContextModule,
11838
- SmartformModule,
11839
- SmartExpandableSectionModule,
11840
- SmartIconModule,
11841
- SmartComponentLayoutModule,
11842
- ],
11843
- exports: [
11844
- SmartSessionModule,
11845
- SmartViewContextModule,
11846
- SmartFileUploaderComponent,
11847
- SmarttreeModule,
11848
- ],
11849
- providers: [SmartNgClientService],
11850
- }]
11851
- }] });
11852
-
11853
- class SmartComponentLayoutUtility {
11854
- static setParent(layout, parent) {
11855
- layout.parentComponent = parent;
11856
- layout.components?.forEach((l) => this.setParent(l, parent));
11857
- }
11858
- }
11859
-
11860
- /*
11861
- * Public API Surface of smart-component-layout
11862
- */
11863
-
11864
- class SmartNavbarService {
11865
- constructor() { }
11866
- }
11867
- SmartNavbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11868
- SmartNavbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, providedIn: 'root' });
11869
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, decorators: [{
11870
- type: Injectable,
11871
- args: [{
11872
- providedIn: 'root'
11873
- }]
11874
- }], ctorParameters: function () { return []; } });
11875
-
11876
11801
  var SmartUserSettinsIconPosition;
11877
11802
  (function (SmartUserSettinsIconPosition) {
11878
11803
  SmartUserSettinsIconPosition[SmartUserSettinsIconPosition["FRONT"] = 0] = "FRONT";
@@ -11980,22 +11905,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
11980
11905
  }]
11981
11906
  }] });
11982
11907
 
11983
- /*
11984
- * Public API Surface of smart-navbar
11985
- */
11986
-
11987
- class SmartTabGroupService {
11988
- constructor() { }
11989
- }
11990
- SmartTabGroupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11991
- SmartTabGroupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, providedIn: 'root' });
11992
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, decorators: [{
11993
- type: Injectable,
11994
- args: [{
11995
- providedIn: 'root'
11996
- }]
11997
- }], ctorParameters: function () { return []; } });
11998
-
11999
11908
  class TabGroupComponent {
12000
11909
  constructor(navigationService, route) {
12001
11910
  this.navigationService = navigationService;
@@ -12135,12 +12044,615 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12135
12044
  }]
12136
12045
  }] });
12137
12046
 
12047
+ class SmartNgClientModule {
12048
+ }
12049
+ SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12050
+ SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
12051
+ MatCommonModule,
12052
+ ComponentFactoryServiceModule,
12053
+ SmartViewContextModule,
12054
+ SmartdialogModule,
12055
+ SmartFilterModule,
12056
+ SmartformModule,
12057
+ SmartGridModule,
12058
+ SmartIconModule,
12059
+ SmartNavbarModule,
12060
+ SmartSessionModule,
12061
+ SmartTabGroupModule,
12062
+ SmarttableModule,
12063
+ SmartExpandableSectionModule,
12064
+ SmartComponentLayoutModule], exports: [ComponentFactoryServiceModule,
12065
+ SmartComponentLayoutModule,
12066
+ SmartdialogModule,
12067
+ SmartExpandableSectionModule,
12068
+ SmartFilterModule,
12069
+ SmartformModule,
12070
+ SmartGridModule,
12071
+ SmartIconModule,
12072
+ SmartNavbarModule,
12073
+ SmartSessionModule,
12074
+ SmartTabGroupModule,
12075
+ SmarttableModule,
12076
+ SmartViewContextModule,
12077
+ SmartFileUploaderComponent,
12078
+ SmarttreeModule] });
12079
+ SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
12080
+ BrowserModule,
12081
+ MatCommonModule,
12082
+ ComponentFactoryServiceModule,
12083
+ SmartViewContextModule,
12084
+ SmartdialogModule,
12085
+ SmartFilterModule,
12086
+ SmartformModule,
12087
+ SmartGridModule,
12088
+ SmartIconModule,
12089
+ SmartNavbarModule,
12090
+ SmartSessionModule,
12091
+ SmartTabGroupModule,
12092
+ SmarttableModule,
12093
+ SmartExpandableSectionModule,
12094
+ SmartComponentLayoutModule,
12095
+ ], ComponentFactoryServiceModule,
12096
+ SmartComponentLayoutModule,
12097
+ SmartdialogModule,
12098
+ SmartExpandableSectionModule,
12099
+ SmartFilterModule,
12100
+ SmartformModule,
12101
+ SmartGridModule,
12102
+ SmartIconModule,
12103
+ SmartNavbarModule,
12104
+ SmartSessionModule,
12105
+ SmartTabGroupModule,
12106
+ SmarttableModule,
12107
+ SmartViewContextModule,
12108
+ SmarttreeModule] });
12109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
12110
+ type: NgModule,
12111
+ args: [{
12112
+ declarations: [SmartFileUploaderComponent],
12113
+ imports: [
12114
+ BrowserModule,
12115
+ MatCommonModule,
12116
+ ComponentFactoryServiceModule,
12117
+ SmartViewContextModule,
12118
+ SmartdialogModule,
12119
+ SmartFilterModule,
12120
+ SmartformModule,
12121
+ SmartGridModule,
12122
+ SmartIconModule,
12123
+ SmartNavbarModule,
12124
+ SmartSessionModule,
12125
+ SmartTabGroupModule,
12126
+ SmarttableModule,
12127
+ SmartExpandableSectionModule,
12128
+ SmartComponentLayoutModule,
12129
+ ],
12130
+ exports: [
12131
+ ComponentFactoryServiceModule,
12132
+ SmartComponentLayoutModule,
12133
+ SmartdialogModule,
12134
+ SmartExpandableSectionModule,
12135
+ SmartFilterModule,
12136
+ SmartformModule,
12137
+ SmartGridModule,
12138
+ SmartIconModule,
12139
+ SmartNavbarModule,
12140
+ SmartSessionModule,
12141
+ SmartTabGroupModule,
12142
+ SmarttableModule,
12143
+ SmartViewContextModule,
12144
+ SmartFileUploaderComponent,
12145
+ SmarttreeModule,
12146
+ ],
12147
+ providers: [SmartNgClientService],
12148
+ }]
12149
+ }] });
12150
+
12151
+ class SmartAuthService {
12152
+ constructor() {
12153
+ this.bffApisHaveBeenSetUp = false;
12154
+ this._destroy$ = new Subject();
12155
+ this.headersUpdated = new SmartSubject(this._destroy$);
12156
+ }
12157
+ ngOnDestroy() {
12158
+ this._destroy$.next();
12159
+ this._destroy$.complete();
12160
+ }
12161
+ }
12162
+ SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12163
+ SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
12164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
12165
+ type: Injectable
12166
+ }] });
12167
+
12138
12168
  /*
12139
- * Public API Surface of smart-tab-group
12169
+ * Public API Surface of smarttree
12170
+ */
12171
+
12172
+ let SmartComponentApiClient = class SmartComponentApiClient {
12173
+ constructor(inject, auth, pageName) {
12174
+ this.inject = inject;
12175
+ this.auth = auth;
12176
+ this.pageName = pageName;
12177
+ this._destroy$ = new Subject();
12178
+ // protected sendDataChanges: boolean = false;
12179
+ // private _useAutoSubmit: boolean = false;
12180
+ // private _useAutoSubmitTurnedOff: Subject<void> = new SmartSubject(this._destroy$);
12181
+ // protected get useAutoSubmit(): boolean {
12182
+ // return this._useAutoSubmit;
12183
+ // }
12184
+ // protected set useAutoSubmit(useAutoSubmit: boolean) {
12185
+ // this._useAutoSubmit = useAutoSubmit;
12186
+ // if (this._useAutoSubmit) {
12187
+ // this.subscribeToAutoSubmit();
12188
+ // this.reSubscribeToChange.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
12189
+ // this.subscribeToAutoSubmit();
12190
+ // });
12191
+ // } else {
12192
+ // this._useAutoSubmitTurnedOff.next();
12193
+ // }
12194
+ // }
12195
+ // private subscribeToAutoSubmit(): void {
12196
+ // this.submit.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
12197
+ // this.submitForms();
12198
+ // this.submit.complete();
12199
+ // });
12200
+ // }
12201
+ this.detectChange = new SmartSubject(this._destroy$);
12202
+ this.uiActionModels = [];
12203
+ this.dataChanged = new SmartSubject(this._destroy$);
12204
+ // Contained Widgets
12205
+ this.widgets = new WidgetMap();
12206
+ this.formWidgets = new WidgetMap();
12207
+ this.detectChange.subscribe((change) => {
12208
+ this.handleChanges(change);
12209
+ });
12210
+ this.viewContext = inject.get(SmartViewContextService);
12211
+ this.uiActionService = inject.get(UiActionService);
12212
+ this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
12213
+ }
12214
+ get uuid() {
12215
+ return this._uuid;
12216
+ }
12217
+ set uuid(uuid) {
12218
+ let firstUuid = true;
12219
+ if (this.uuid) {
12220
+ this.viewContext.unfollow(this.uuid);
12221
+ firstUuid = false;
12222
+ }
12223
+ this._uuid = uuid;
12224
+ if (uuid) {
12225
+ this.widgets.widgets.forEach((ref, key) => {
12226
+ if (ref instanceof SmartGridComponent) {
12227
+ ref.uuid = uuid;
12228
+ }
12229
+ else if (!ref && !firstUuid) {
12230
+ console.error(`Provided reference for ${key} is undefined on uuid change.`);
12231
+ }
12232
+ });
12233
+ if (!this.uuidOfPageHasBeenChangedSubscription) {
12234
+ this.uuidOfPageHasBeenChangedSubscription = this.viewContext.uuidOfPageHasBeenChanged
12235
+ .pipe(takeUntil(this._destroy$))
12236
+ .subscribe((pageName) => {
12237
+ if (pageName === this.pageName) {
12238
+ this.run();
12239
+ }
12240
+ });
12241
+ }
12242
+ }
12243
+ this.viewContext.follow(this._uuid, this.detectChange);
12244
+ }
12245
+ get model() {
12246
+ return this._model;
12247
+ }
12248
+ set model(model) {
12249
+ this._model = model;
12250
+ this.initComponentByModel();
12251
+ }
12252
+ get data() {
12253
+ return this._data;
12254
+ }
12255
+ set data(model) {
12256
+ this._data = model;
12257
+ this.dataChanged.next();
12258
+ }
12259
+ get smartTreeService() {
12260
+ return this._smartTreeService;
12261
+ }
12262
+ set smartTreeService(smartTreeService) {
12263
+ if (this._smartTreeService !== undefined) {
12264
+ throw Error('The default tree has already set up!');
12265
+ }
12266
+ this._smartTreeService = smartTreeService;
12267
+ }
12268
+ _ngOnInit() {
12269
+ this.run();
12270
+ }
12271
+ _ngOnDestroy() {
12272
+ this.viewContext.unfollow(this.uuid);
12273
+ this.widgets.clearWidgets();
12274
+ this._destroy$.next();
12275
+ this._destroy$.complete();
12276
+ }
12277
+ initComponentByModel() {
12278
+ this.initData();
12279
+ this.initActions();
12280
+ // TODO: layout, valueSet, widgets
12281
+ }
12282
+ initData() {
12283
+ if (this.model?.data) {
12284
+ this.data = this.model?.data;
12285
+ }
12286
+ }
12287
+ initActions() {
12288
+ if (this.model?.actions) {
12289
+ this.uiActionModels = this.model?.actions.map((uiAction) => {
12290
+ return {
12291
+ serviceToUse: this,
12292
+ uiAction,
12293
+ };
12294
+ });
12295
+ }
12296
+ }
12297
+ run() {
12298
+ if (this.auth.bffApisHaveBeenSetUp) {
12299
+ this.load();
12300
+ }
12301
+ else {
12302
+ this.auth.headersUpdated.subscribe(() => {
12303
+ this.load();
12304
+ });
12305
+ }
12306
+ }
12307
+ async load() {
12308
+ this.uuid = this.viewContext.getUuidOfPage(this.pageName);
12309
+ this.model = await this.viewContext.load(this.uuid);
12310
+ // await this.viewContext.load2(this.uuid);
12311
+ }
12312
+ //#region UseUiAction
12313
+ getAdditionalParams(uiAction) {
12314
+ return {
12315
+ forTextArea: '',
12316
+ forTextField: '',
12317
+ };
12318
+ }
12319
+ getModel() {
12320
+ return this.data;
12321
+ }
12322
+ submitForm(validate) {
12323
+ this.submitForms(validate);
12324
+ }
12325
+ async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
12326
+ if (uiActionRequest.params['_files']) {
12327
+ const param = uiActionRequest.params['param'];
12328
+ const files = uiActionRequest.params['_files'];
12329
+ const isMultiple = uiActionRequest.params['isMultiple'];
12330
+ delete uiActionRequest.params['param'];
12331
+ delete uiActionRequest.params['_files'];
12332
+ delete uiActionRequest.params['isMultiple'];
12333
+ if (!isMultiple) {
12334
+ await this.viewContext.performUploadAction(this.uuid, uiActionRequest, param, files[0]);
12335
+ }
12336
+ else {
12337
+ await this.viewContext.performUploadMultipleAction(this.uuid, uiActionRequest, param, files);
12338
+ }
12339
+ }
12340
+ else if (widgetId && nodeId) {
12341
+ await this.viewContext.performWidgetAction(this.uuid, widgetId, nodeId, uiActionRequest);
12342
+ }
12343
+ else if (widgetId) {
12344
+ await this.viewContext.performWidgetMainAction(this.uuid, widgetId, uiActionRequest);
12345
+ }
12346
+ else {
12347
+ await this.viewContext.performAction(this.uuid, uiActionRequest);
12348
+ }
12349
+ }
12350
+ handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
12351
+ throw new Error('handleSpecificDemandsAsynchronously method not implemented.');
12352
+ }
12353
+ //#endregion
12354
+ /**
12355
+ * Submits all the registered forms in the SmartComponent
12356
+ */
12357
+ submitForms(validate) {
12358
+ this.formWidgets?.widgets?.forEach((form) => {
12359
+ form?.submitForm(validate);
12360
+ });
12361
+ }
12362
+ addGrid(smartGrid, options, useAsDefaultGrid, componentReference) {
12363
+ smartGrid.options = options;
12364
+ smartGrid.uiActionService = this.uiActionService;
12365
+ smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
12366
+ smartGrid.serviceToUse = this;
12367
+ smartGrid.viewContextService = this.viewContext;
12368
+ this.widgets.addWidget(smartGrid.gridIdentifier, componentReference);
12369
+ if (useAsDefaultGrid) {
12370
+ this.smartGrid = smartGrid;
12371
+ return this.smartGrid;
12372
+ }
12373
+ return smartGrid;
12374
+ }
12375
+ addForm(smartFormId, smartForm, componentReference) {
12376
+ this.formWidgets.addWidget(smartFormId, componentReference);
12377
+ // if (this.sendDataChanges && componentReference) {
12378
+ // smartForm.useOnValueChangeEvent = true;
12379
+ // componentReference.sophisticatedValueChange
12380
+ // .pipe(takeUntil(this._destroy$))
12381
+ // .subscribe((valueChange: SophisticatedValueChange) => {
12382
+ // this.handleValueChanges(valueChange);
12383
+ // });
12384
+ // }
12385
+ return smartForm;
12386
+ }
12387
+ setUpDefaultTree(treeId) {
12388
+ this.smartTreeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
12389
+ this.widgets.addWidget(treeId, this.smartTreeService);
12390
+ }
12391
+ createTreeService(treeId) {
12392
+ const treeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
12393
+ this.widgets.addWidget(treeId, treeService);
12394
+ return treeService;
12395
+ }
12396
+ addFileUploader(uiActionCode, fileFormats, maxSizeMb, isMultiple) {
12397
+ return {
12398
+ uiActionCode,
12399
+ smartComponent: this,
12400
+ fileFormats,
12401
+ isMultiple,
12402
+ maxSizeMb,
12403
+ };
12404
+ }
12405
+ // #region handle changes
12406
+ handleValueChanges(valueChange) {
12407
+ let dataChange;
12408
+ if (valueChange.key.includes('.')) {
12409
+ const source = valueChange.key.split('.')[0];
12410
+ const valueKey = valueChange.key.split('.')[1];
12411
+ dataChange = {
12412
+ kind: valueChange.kind === 'basic' ? DataChangeKind.Widget : DataChangeKind.Selection,
12413
+ source,
12414
+ values: [[valueKey, valueChange.value]],
12415
+ };
12416
+ }
12417
+ else {
12418
+ dataChange = {
12419
+ kind: valueChange.kind === 'basic' ? DataChangeKind.Widget : DataChangeKind.Selection,
12420
+ source: valueChange.key,
12421
+ values: [[valueChange.key, valueChange.value]],
12422
+ };
12423
+ }
12424
+ this.viewContext.dataChanged(this.uuid, dataChange);
12425
+ }
12426
+ handleChanges(change) {
12427
+ try {
12428
+ if (change.changedWidgets) {
12429
+ this.handleChangeWidgets(change.changedWidgets);
12430
+ }
12431
+ let dataChangeHasBeenNexted = false;
12432
+ if (change.changes) {
12433
+ const changes = change.changes;
12434
+ Object.keys(changes).map((changeKey) => {
12435
+ if (changeKey.startsWith('data.')) {
12436
+ this.handleDataChange(changes, changeKey);
12437
+ }
12438
+ else if (changeKey.startsWith('layouts.') && this.model?.layouts) {
12439
+ this.handleLayoutChange(changes, changeKey);
12440
+ }
12441
+ else if (changeKey.startsWith('componentLayouts.') && this.model?.layouts) {
12442
+ this.handleComponentLayoutChange(changes, changeKey);
12443
+ }
12444
+ else if (changeKey.startsWith('valueSets.') && this.model?.valueSets) {
12445
+ this.handleValueSetChange(changes, changeKey);
12446
+ }
12447
+ else if (changeKey === 'actions') {
12448
+ this.handleActionChange(changes, changeKey);
12449
+ }
12450
+ else if (changeKey === 'constraints') {
12451
+ this.handleConstraintChange(changes, changeKey);
12452
+ }
12453
+ else if (changeKey === '') {
12454
+ this.model = changes[''];
12455
+ dataChangeHasBeenNexted = true;
12456
+ }
12457
+ });
12458
+ if (!dataChangeHasBeenNexted) {
12459
+ this.dataChanged.next();
12460
+ }
12461
+ }
12462
+ }
12463
+ catch (error) {
12464
+ console.error(error);
12465
+ this.model = change.value;
12466
+ }
12467
+ if (!change.changedWidgets && !change.changes && change.value) {
12468
+ this.model = change.value;
12469
+ }
12470
+ }
12471
+ handleChangeWidgets(changedWidgets) {
12472
+ changedWidgets.forEach((key) => {
12473
+ const reference = this.widgets.get(key);
12474
+ if (reference instanceof SmartGridComponent) {
12475
+ reference.refresh();
12476
+ }
12477
+ else if (reference instanceof SmarttreeGenericService) {
12478
+ reference.initialize();
12479
+ }
12480
+ else if (reference === undefined) {
12481
+ console.error(`Provided reference for ${key} is undefined.`);
12482
+ }
12483
+ });
12484
+ }
12485
+ setValueDeeply(model, key, value) {
12486
+ let splittedKeys = key.split('.');
12487
+ let deepModel = [model];
12488
+ let tempModel;
12489
+ for (let index = 0; index < splittedKeys.length; index++) {
12490
+ tempModel = deepModel[index];
12491
+ if (typeof tempModel[splittedKeys[index]] !== 'string' &&
12492
+ typeof tempModel[splittedKeys[index]] !== 'boolean' &&
12493
+ typeof tempModel[splittedKeys[index]] !== 'number' &&
12494
+ tempModel[splittedKeys[index]] !== undefined) {
12495
+ deepModel.push(tempModel[splittedKeys[index]]);
12496
+ }
12497
+ if (index === splittedKeys.length - 1) {
12498
+ tempModel[splittedKeys[index]] = value;
12499
+ break;
12500
+ }
12501
+ }
12502
+ return model;
12503
+ }
12504
+ handleDataChange(changes, changeKey) {
12505
+ this.setValueDeeply(this.model, changeKey, changes[changeKey]);
12506
+ this.formWidgets.widgets.forEach((formComponent, key) => {
12507
+ if (formComponent === undefined) {
12508
+ console.error(`Provided form reference for ${key} is undefined.`);
12509
+ }
12510
+ else {
12511
+ formComponent.refresh();
12512
+ }
12513
+ });
12514
+ }
12515
+ handleLayoutChange(changes, changeKey) {
12516
+ let layoutKey = changeKey.split('.')[1];
12517
+ this.model.layouts[layoutKey] = changes[changeKey];
12518
+ }
12519
+ handleComponentLayoutChange(changes, changeKey) {
12520
+ let layoutKey = changeKey.split('.')[1];
12521
+ let componentLayouts = this.model.componentLayouts;
12522
+ componentLayouts[layoutKey] = changes[changeKey];
12523
+ }
12524
+ handleValueSetChange(changes, changeKey) {
12525
+ let valueSetKey = changeKey.split('.')[1];
12526
+ this.model.valueSets[valueSetKey] = changes[changeKey];
12527
+ }
12528
+ handleActionChange(changes, changeKey) {
12529
+ this.model.actions = changes[changeKey];
12530
+ this.initActions();
12531
+ }
12532
+ handleConstraintChange(changes, changeKey) {
12533
+ this.model.constraints = changes[changeKey];
12534
+ }
12535
+ };
12536
+ SmartComponentApiClient = __decorate([
12537
+ __param(2, Inject('pageName'))
12538
+ ], SmartComponentApiClient);
12539
+ class WidgetMap {
12540
+ constructor() {
12541
+ this._widgets = new Map();
12542
+ }
12543
+ get widgets() {
12544
+ return this._widgets;
12545
+ }
12546
+ set widgets(widgets) {
12547
+ this._widgets = widgets;
12548
+ }
12549
+ addWidget(key, reference, isForm) {
12550
+ this._widgets.set(key, reference);
12551
+ }
12552
+ removeWidget(key) {
12553
+ this._widgets.delete(key);
12554
+ }
12555
+ clearWidgets() {
12556
+ this._widgets.clear();
12557
+ }
12558
+ get(key) {
12559
+ return this.widgets.get(key);
12560
+ }
12561
+ }
12562
+
12563
+ class SmartComponent extends SmartComponentApiClient {
12564
+ constructor(inject, auth, pageName) {
12565
+ super(inject, auth, pageName);
12566
+ }
12567
+ ngOnInit() {
12568
+ this._ngOnInit();
12569
+ }
12570
+ ngOnDestroy() {
12571
+ this._ngOnDestroy();
12572
+ }
12573
+ }
12574
+ 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 });
12575
+ SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
12576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, decorators: [{
12577
+ type: Component,
12578
+ args: [{
12579
+ template: '',
12580
+ }]
12581
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
12582
+ type: Inject,
12583
+ args: [SmartAuthService]
12584
+ }] }, { type: undefined, decorators: [{
12585
+ type: Inject,
12586
+ args: ['pageName']
12587
+ }] }]; } });
12588
+
12589
+ class SmartService extends SmartComponentApiClient {
12590
+ constructor(inject, auth, pageName) {
12591
+ super(inject, auth, pageName);
12592
+ }
12593
+ ngOnInit() {
12594
+ this._ngOnInit();
12595
+ }
12596
+ ngOnDestroy() {
12597
+ this._ngOnDestroy();
12598
+ }
12599
+ }
12600
+ 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 });
12601
+ SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, providedIn: 'root' });
12602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, decorators: [{
12603
+ type: Injectable,
12604
+ args: [{
12605
+ providedIn: 'root',
12606
+ }]
12607
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
12608
+ type: Inject,
12609
+ args: [SmartAuthService]
12610
+ }] }, { type: undefined, decorators: [{
12611
+ type: Inject,
12612
+ args: ['pageName']
12613
+ }] }]; } });
12614
+
12615
+ class SmartComponentLayoutUtility {
12616
+ static setParent(layout, parent) {
12617
+ layout.parentComponent = parent;
12618
+ layout.components?.forEach((l) => this.setParent(l, parent));
12619
+ }
12620
+ }
12621
+
12622
+ /*
12623
+ * Public API Surface of smart-component-layout
12140
12624
  */
12141
12625
 
12626
+ class SmartNavbarService {
12627
+ constructor() { }
12628
+ }
12629
+ SmartNavbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12630
+ SmartNavbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, providedIn: 'root' });
12631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNavbarService, decorators: [{
12632
+ type: Injectable,
12633
+ args: [{
12634
+ providedIn: 'root'
12635
+ }]
12636
+ }], ctorParameters: function () { return []; } });
12637
+
12142
12638
  /*
12143
- * Public API Surface of smarttree
12639
+ * Public API Surface of smart-navbar
12640
+ */
12641
+
12642
+ class SmartTabGroupService {
12643
+ constructor() { }
12644
+ }
12645
+ SmartTabGroupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12646
+ SmartTabGroupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, providedIn: 'root' });
12647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTabGroupService, decorators: [{
12648
+ type: Injectable,
12649
+ args: [{
12650
+ providedIn: 'root'
12651
+ }]
12652
+ }], ctorParameters: function () { return []; } });
12653
+
12654
+ /*
12655
+ * Public API Surface of smart-tab-group
12144
12656
  */
12145
12657
 
12146
12658
  /*
@@ -12151,5 +12663,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12151
12663
  * Generated bundle index. Do not edit.
12152
12664
  */
12153
12665
 
12154
- 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 };
12666
+ 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 };
12155
12667
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map