@smartbit4all/ng-client 4.5.16 → 4.5.17
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/esm2022/lib/smart-client/smart-component-api-client.mjs +35 -37
- package/esm2022/lib/smart-component-layout/api/api/api.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/api/default.service.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/api.module.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/configuration.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/encoder.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/index.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/model/componentType.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/model/layoutDefinitionDescriptor.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/model/layoutDirection.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/param.mjs +1 -1
- package/esm2022/lib/smart-component-layout/api/variables.mjs +1 -1
- package/esm2022/lib/smart-component-layout/smart-component-layout-utility.mjs +17 -1
- package/esm2022/lib/smart-component-layout/smart-component-layout.component.mjs +16 -8
- package/esm2022/lib/smart-diagram/api/api/api.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/api/diagramService.service.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/api.module.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/configuration.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/encoder.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/index.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramColor.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramDataContainer.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramDataItem.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramDataSet.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramDescriptor.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramModel.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/diagramShape.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/drawTime.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/labelText.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/model/models.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/param.mjs +1 -1
- package/esm2022/lib/smart-diagram/api/variables.mjs +1 -1
- package/esm2022/lib/smart-form/api/api/api.mjs +1 -1
- package/esm2022/lib/smart-form/api/api/default.service.mjs +1 -1
- package/esm2022/lib/smart-form/api/api.module.mjs +1 -1
- package/esm2022/lib/smart-form/api/configuration.mjs +1 -1
- package/esm2022/lib/smart-form/api/encoder.mjs +1 -1
- package/esm2022/lib/smart-form/api/index.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/dateFieldProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/fileUploaderProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/imageProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/models.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/multiFileUploaderProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/propertyMapping.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/recordingUploaderProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/selectionDefinition.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartFormInputMode.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartFormWidgetDirection.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartFormWidgetType.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartLayoutDefinition.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartMatrixModel.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/smartWidgetHint.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/sortDefinition.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/textBoxProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/textFieldProperties.mjs +1 -1
- package/esm2022/lib/smart-form/api/model/valueChangeMode.mjs +1 -1
- package/esm2022/lib/smart-form/api/param.mjs +1 -1
- package/esm2022/lib/smart-form/api/variables.mjs +1 -1
- package/esm2022/lib/smart-map/api/api/api.mjs +1 -1
- package/esm2022/lib/smart-map/api/api/geoMap.service.mjs +1 -1
- package/esm2022/lib/smart-map/api/api.module.mjs +1 -1
- package/esm2022/lib/smart-map/api/configuration.mjs +1 -1
- package/esm2022/lib/smart-map/api/encoder.mjs +1 -1
- package/esm2022/lib/smart-map/api/index.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/gPSPosition.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/gPSRoute.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapChange.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapDataLoadingMode.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapDataSourceDescriptor.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapDataSourceType.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapEditingSession.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapInteraction.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapItem.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapItemKind.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapLayer.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapLayerChange.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapLayerDescriptor.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapModel.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapOperationMode.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapSelectionMode.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapServerModel.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapTextType.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapViewState.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/geoMapViewport.mjs +1 -1
- package/esm2022/lib/smart-map/api/model/models.mjs +1 -1
- package/esm2022/lib/smart-map/api/param.mjs +1 -1
- package/esm2022/lib/smart-map/api/variables.mjs +1 -1
- package/esm2022/lib/view-context/api/api/api.mjs +1 -1
- package/esm2022/lib/view-context/api/api.module.mjs +1 -1
- package/esm2022/lib/view-context/api/configuration.mjs +1 -1
- package/esm2022/lib/view-context/api/encoder.mjs +1 -1
- package/esm2022/lib/view-context/api/index.mjs +1 -1
- package/esm2022/lib/view-context/api/model/backgroundProcessInfo.mjs +1 -1
- package/esm2022/lib/view-context/api/model/badgeDescriptor.mjs +1 -1
- package/esm2022/lib/view-context/api/model/clipboardData.mjs +1 -1
- package/esm2022/lib/view-context/api/model/closeResult.mjs +1 -1
- package/esm2022/lib/view-context/api/model/componentConstraint.mjs +1 -1
- package/esm2022/lib/view-context/api/model/componentModel.mjs +1 -1
- package/esm2022/lib/view-context/api/model/componentModelChange.mjs +1 -1
- package/esm2022/lib/view-context/api/model/dataChange.mjs +1 -1
- package/esm2022/lib/view-context/api/model/dataChangeEvent.mjs +1 -1
- package/esm2022/lib/view-context/api/model/dataChangeKind.mjs +1 -1
- package/esm2022/lib/view-context/api/model/deviceInfo.mjs +1 -1
- package/esm2022/lib/view-context/api/model/downloadedFile.mjs +1 -1
- package/esm2022/lib/view-context/api/model/iconPosition.mjs +1 -1
- package/esm2022/lib/view-context/api/model/imageResource.mjs +1 -1
- package/esm2022/lib/view-context/api/model/link.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageData.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageOption.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageOptionType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageResult.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageTextType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/messageType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/multiComboBoxElement.mjs +1 -1
- package/esm2022/lib/view-context/api/model/multiComboBoxModel.mjs +1 -1
- package/esm2022/lib/view-context/api/model/namedValidator.mjs +1 -1
- package/esm2022/lib/view-context/api/model/openPendingData.mjs +1 -1
- package/esm2022/lib/view-context/api/model/serverRequestExecutionStat.mjs +1 -1
- package/esm2022/lib/view-context/api/model/serverRequestTrack.mjs +1 -1
- package/esm2022/lib/view-context/api/model/serverRequestType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/smartLinkMigrationStatus.mjs +1 -1
- package/esm2022/lib/view-context/api/model/statisticRecord.mjs +1 -1
- package/esm2022/lib/view-context/api/model/style.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionButtonDescriptor.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionButtonType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionConstraint.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionDescriptor.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionDialogDescriptor.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionFeedbackType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionRequest.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uiActionTooltip.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uploadWidgetType.mjs +1 -1
- package/esm2022/lib/view-context/api/model/uploadedFile.mjs +1 -1
- package/esm2022/lib/view-context/api/model/valueSet.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewApiError.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewConstraint.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewContext.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewContextChange.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewContextData.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewContextUpdate.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewPlaceholder.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewState.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewStateUpdate.mjs +1 -1
- package/esm2022/lib/view-context/api/model/viewType.mjs +1 -1
- package/esm2022/lib/view-context/api/param.mjs +1 -1
- package/esm2022/lib/view-context/api/variables.mjs +1 -1
- package/fesm2022/smartbit4all-ng-client.mjs +215 -194
- package/fesm2022/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +2 -1
- package/lib/smart-component-layout/smart-component-layout-utility.d.ts +1 -0
- package/lib/smart-component-layout/smart-component-layout.component.d.ts +4 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-4.5.17.tgz +0 -0
- package/smartbit4all-ng-client-4.5.16.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, RendererStyleFlags2, Directive, Input, HostBinding, HostListener, Component, EventEmitter, Output, ViewChildren, ViewChild, ElementRef, forwardRef, Pipe, ViewContainerRef, ViewEncapsulation, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, inject, input, computed, effect, signal, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, RendererStyleFlags2, Directive, Input, HostBinding, HostListener, Component, EventEmitter, Output, ViewChildren, ViewChild, ElementRef, forwardRef, Pipe, ViewContainerRef, ViewEncapsulation, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, inject, input, computed, effect, signal, ApplicationRef, viewChild, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import { HttpHeaders, HttpContext, HttpErrorResponse, HttpParams, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
5
5
|
import { Subject, lastValueFrom, take, takeUntil, interval, startWith, map, distinctUntilChanged, catchError, throwError, from } from 'rxjs';
|
|
@@ -20027,6 +20027,174 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
20027
20027
|
* Public API Surface of smart-grid
|
|
20028
20028
|
*/
|
|
20029
20029
|
|
|
20030
|
+
class SmartComponentLayoutUtility {
|
|
20031
|
+
static getForms(comp) {
|
|
20032
|
+
let result = [];
|
|
20033
|
+
if (comp.components) {
|
|
20034
|
+
const children = comp.components
|
|
20035
|
+
.map((c) => this.getForms(c))
|
|
20036
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20037
|
+
result.push(...children);
|
|
20038
|
+
}
|
|
20039
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20040
|
+
if (expandable) {
|
|
20041
|
+
result.push(...this.getForms(expandable));
|
|
20042
|
+
}
|
|
20043
|
+
if (comp.smartFormComponent) {
|
|
20044
|
+
result.push(comp.smartFormComponent);
|
|
20045
|
+
}
|
|
20046
|
+
return result;
|
|
20047
|
+
}
|
|
20048
|
+
static getGrids(comp) {
|
|
20049
|
+
let result = [];
|
|
20050
|
+
if (comp.components) {
|
|
20051
|
+
const children = comp.components
|
|
20052
|
+
.map((c) => this.getGrids(c))
|
|
20053
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20054
|
+
result.push(...children);
|
|
20055
|
+
}
|
|
20056
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20057
|
+
if (expandable) {
|
|
20058
|
+
result.push(...this.getGrids(expandable));
|
|
20059
|
+
}
|
|
20060
|
+
if (comp.smartGridComponent) {
|
|
20061
|
+
result.push(comp.smartGridComponent);
|
|
20062
|
+
}
|
|
20063
|
+
return result;
|
|
20064
|
+
}
|
|
20065
|
+
static getMaps(comp) {
|
|
20066
|
+
const result = [];
|
|
20067
|
+
if (comp.components) {
|
|
20068
|
+
const children = comp.components
|
|
20069
|
+
.map((c) => SmartComponentLayoutUtility.getMaps(c))
|
|
20070
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20071
|
+
result.push(...children);
|
|
20072
|
+
}
|
|
20073
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20074
|
+
if (expandable) {
|
|
20075
|
+
result.push(...this.getMaps(expandable));
|
|
20076
|
+
}
|
|
20077
|
+
if (comp.smartMapComponent) {
|
|
20078
|
+
result.push(comp.smartMapComponent);
|
|
20079
|
+
}
|
|
20080
|
+
return result;
|
|
20081
|
+
}
|
|
20082
|
+
static getDiagrams(comp) {
|
|
20083
|
+
const result = [];
|
|
20084
|
+
if (comp.components) {
|
|
20085
|
+
const children = comp.components
|
|
20086
|
+
.map((c) => SmartComponentLayoutUtility.getDiagrams(c))
|
|
20087
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20088
|
+
result.push(...children);
|
|
20089
|
+
}
|
|
20090
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20091
|
+
if (expandable) {
|
|
20092
|
+
result.push(...this.getDiagrams(expandable));
|
|
20093
|
+
}
|
|
20094
|
+
if (comp.smartDiagramComponent) {
|
|
20095
|
+
result.push(comp.smartDiagramComponent);
|
|
20096
|
+
}
|
|
20097
|
+
return result;
|
|
20098
|
+
}
|
|
20099
|
+
static getTrees(comp) {
|
|
20100
|
+
let result = [];
|
|
20101
|
+
if (comp.components) {
|
|
20102
|
+
const children = comp.components
|
|
20103
|
+
?.map((c) => this.getTrees(c))
|
|
20104
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20105
|
+
result.push(...children);
|
|
20106
|
+
}
|
|
20107
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20108
|
+
if (expandable) {
|
|
20109
|
+
result.push(...this.getTrees(expandable));
|
|
20110
|
+
}
|
|
20111
|
+
if (comp.treeService) {
|
|
20112
|
+
result.push(comp.treeService);
|
|
20113
|
+
}
|
|
20114
|
+
return result;
|
|
20115
|
+
}
|
|
20116
|
+
static getToolbars(comp) {
|
|
20117
|
+
let result = [];
|
|
20118
|
+
if (comp.components) {
|
|
20119
|
+
const children = comp.components
|
|
20120
|
+
.map((c) => this.getToolbars(c))
|
|
20121
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20122
|
+
result.push(...children);
|
|
20123
|
+
}
|
|
20124
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20125
|
+
if (expandable) {
|
|
20126
|
+
result.push(...this.getToolbars(expandable));
|
|
20127
|
+
}
|
|
20128
|
+
let expandeableHeaderToolbar = comp.expandableComponents?.first?.toolbar;
|
|
20129
|
+
if (expandeableHeaderToolbar) {
|
|
20130
|
+
result.push(expandeableHeaderToolbar);
|
|
20131
|
+
}
|
|
20132
|
+
if (comp.toolbar) {
|
|
20133
|
+
result.push(comp.toolbar);
|
|
20134
|
+
}
|
|
20135
|
+
return result;
|
|
20136
|
+
}
|
|
20137
|
+
static clearFormHandlers(comp) {
|
|
20138
|
+
const smartComponent = comp.parentSmartComponent;
|
|
20139
|
+
const forms = SmartComponentLayoutUtility.getForms(comp);
|
|
20140
|
+
forms.forEach((form) => {
|
|
20141
|
+
form.smartForm?.widgets
|
|
20142
|
+
.map((w) => w.key)
|
|
20143
|
+
.forEach((wKey) => {
|
|
20144
|
+
smartComponent.removeDataChangeActionHandler(wKey);
|
|
20145
|
+
});
|
|
20146
|
+
const subs = smartComponent.dataChangeActionHandlers.get(form);
|
|
20147
|
+
if (subs) {
|
|
20148
|
+
subs.forEach((sub) => sub.unsubscribe());
|
|
20149
|
+
smartComponent.dataChangeActionHandlers.delete(form);
|
|
20150
|
+
}
|
|
20151
|
+
});
|
|
20152
|
+
}
|
|
20153
|
+
static getEmbeddedSlots(comp) {
|
|
20154
|
+
const result = [];
|
|
20155
|
+
if (comp.components) {
|
|
20156
|
+
const children = comp.components
|
|
20157
|
+
.map((c) => this.getEmbeddedSlots(c))
|
|
20158
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
20159
|
+
result.push(...children);
|
|
20160
|
+
}
|
|
20161
|
+
const expandable = this.getExpandableComponent(comp);
|
|
20162
|
+
if (expandable) {
|
|
20163
|
+
result.push(...this.getEmbeddedSlots(expandable));
|
|
20164
|
+
}
|
|
20165
|
+
if (comp._embeddedSlotVcRef && comp.embeddedSlotContainerId) {
|
|
20166
|
+
result.push({ containerId: comp.embeddedSlotContainerId, vcRef: comp._embeddedSlotVcRef });
|
|
20167
|
+
}
|
|
20168
|
+
return result;
|
|
20169
|
+
}
|
|
20170
|
+
static getExpandableComponent(comp) {
|
|
20171
|
+
return comp.expandableComponents?.first?.componentRef?.instance;
|
|
20172
|
+
}
|
|
20173
|
+
static applyStyle(style, elementRef, renderer) {
|
|
20174
|
+
if (style && elementRef && renderer) {
|
|
20175
|
+
let element = elementRef.nativeElement;
|
|
20176
|
+
// css style properties
|
|
20177
|
+
if (style.style) {
|
|
20178
|
+
Object.entries(style.style).forEach(([key, value]) => {
|
|
20179
|
+
renderer.setStyle(element, key, value, RendererStyleFlags2.Important);
|
|
20180
|
+
});
|
|
20181
|
+
}
|
|
20182
|
+
// add classes
|
|
20183
|
+
if (style.classesToAdd) {
|
|
20184
|
+
style.classesToAdd.forEach((cl) => renderer.addClass(element, cl));
|
|
20185
|
+
}
|
|
20186
|
+
// remove classes
|
|
20187
|
+
if (style.classesToRemove) {
|
|
20188
|
+
style.classesToRemove.forEach((cl) => renderer.removeClass(element, cl));
|
|
20189
|
+
}
|
|
20190
|
+
}
|
|
20191
|
+
}
|
|
20192
|
+
static setUuid(comp, uuid) {
|
|
20193
|
+
comp.updateUuid(uuid);
|
|
20194
|
+
comp.components?.forEach((child) => this.setUuid(child, uuid));
|
|
20195
|
+
}
|
|
20196
|
+
}
|
|
20197
|
+
|
|
20030
20198
|
function deepMerge(target, source) {
|
|
20031
20199
|
for (const key of Object.keys(source)) {
|
|
20032
20200
|
if (source[key] instanceof Object && target[key]) {
|
|
@@ -21045,6 +21213,16 @@ class SmartComponentLayoutComponent {
|
|
|
21045
21213
|
this.element = element;
|
|
21046
21214
|
this.renderer = renderer;
|
|
21047
21215
|
this._destroy$ = new Subject();
|
|
21216
|
+
this.appRef = inject(ApplicationRef);
|
|
21217
|
+
this.formRef = viewChild(SmartformComponent);
|
|
21218
|
+
this.onFormChange = effect(() => {
|
|
21219
|
+
const form = this.formRef();
|
|
21220
|
+
if (this.smartForm && form && this.parentSmartComponent) {
|
|
21221
|
+
this.parentSmartComponent.handleDataChangeSubscriptions(form);
|
|
21222
|
+
this.parentSmartComponent.handleLayoutUploadCallback(form);
|
|
21223
|
+
form.markAllWidgetsForChangeDetection();
|
|
21224
|
+
}
|
|
21225
|
+
});
|
|
21048
21226
|
this.pendingOrphanCleanup = false;
|
|
21049
21227
|
this.embeddedSlotActive = false;
|
|
21050
21228
|
}
|
|
@@ -21122,6 +21300,7 @@ class SmartComponentLayoutComponent {
|
|
|
21122
21300
|
}
|
|
21123
21301
|
// layout changed, render, but save current
|
|
21124
21302
|
// this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
|
|
21303
|
+
SmartComponentLayoutUtility.clearFormHandlers(this);
|
|
21125
21304
|
this.currentLayout = this.smartComponentLayout;
|
|
21126
21305
|
this.uuid = this.parentSmartComponent.uuid;
|
|
21127
21306
|
this.treeService = this.parentSmartComponent.smartTreeService;
|
|
@@ -21235,10 +21414,6 @@ class SmartComponentLayoutComponent {
|
|
|
21235
21414
|
}
|
|
21236
21415
|
bindForm() {
|
|
21237
21416
|
if (this.parentSmartComponent?.useQueryLists) {
|
|
21238
|
-
if (this.smartForm && this.smartFormComponent && this.parentSmartComponent) {
|
|
21239
|
-
this.parentSmartComponent.handleDataChangeSubscriptions();
|
|
21240
|
-
this.parentSmartComponent.handleLayoutUploadCallback(this.smartFormComponent);
|
|
21241
|
-
}
|
|
21242
21417
|
return;
|
|
21243
21418
|
}
|
|
21244
21419
|
if (this.smartForm && this.smartFormComponent) {
|
|
@@ -21376,7 +21551,7 @@ class SmartComponentLayoutComponent {
|
|
|
21376
21551
|
}
|
|
21377
21552
|
}
|
|
21378
21553
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }, { token: SmartViewContextService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21379
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent", parentSmartComponent: "parentSmartComponent", gridRow: "gridRow" }, host: { properties: { "attr.data-testid": "this.testId", "class.horizontal": "this.isHorizontal", "class.vertical": "this.isVertical" } }, viewQueries: [{ propertyName: "embeddedSlotVcRefSetter", first: true, predicate: ["embeddedSlot"], descendants: true, read: ViewContainerRef }, { propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartMapList", predicate: ["map"], descendants: true }, { propertyName: "smartDiagramList", predicate: ["diagram"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }, { propertyName: "toolbarList", predicate: ["toolbar"], descendants: true }, { propertyName: "expandableComponents", predicate: ExpandableSectionComponent, descendants: true }, { propertyName: "components", predicate: SmartComponentLayoutComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n @if (smartComponentLayout?.type === type().CONTAINER) {\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n [gridRow]=\"gridRow\"\r\n ></smart-component-layout>\r\n }\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <smart-map\r\n *ngIf=\"!!uuid && !!mapId\"\r\n #map\r\n [uuid]=\"uuid\"\r\n [identifier]=\"mapId\"\r\n [parent]=\"parentSmartComponent\"\r\n ></smart-map>\r\n <smart-diagram\r\n *ngIf=\"!!uuid && !!smartDiagramId\"\r\n #diagram\r\n [uuid]=\"uuid\"\r\n [identifier]=\"smartDiagramId\"\r\n [parent]=\"parentSmartComponent\"\r\n ></smart-diagram>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar\r\n *ngIf=\"!!toolbarId\"\r\n #toolbar\r\n [id]=\"toolbarId\"\r\n [toolbarPropertes]=\"toolbarPropertes\"\r\n ></smart-ui-action-toolbar>\r\n <ng-container *ngIf=\"embeddedSlotActive\" #embeddedSlot></ng-container>\r\n</ng-template>\r\n", styles: [":host(.horizontal){display:flex;flex-direction:row}:host(.vertical){display:flex;flex-direction:column}:host(.horizontal) smart-component-layout{display:flex}:host(.horizontal) smartform{flex:1;display:flex}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id", "scrollOnWrap", "toolbarPropertes"] }, { kind: "component", type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { kind: "component", type: SmartMapComponent, selector: "smart-map", inputs: ["uuid", "identifier", "parent"] }, { kind: "component", type: SmartDiagramComponent, selector: "smart-diagram", inputs: ["uuid", "identifier", "parent", "diagramModel", "options", "plugins"], outputs: ["elementSelect", "canvasClick", "dataClick"] }, { kind: "component", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent", "parentSmartComponent", "gridRow"] }] }); }
|
|
21554
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent", parentSmartComponent: "parentSmartComponent", gridRow: "gridRow" }, host: { properties: { "attr.data-testid": "this.testId", "class.horizontal": "this.isHorizontal", "class.vertical": "this.isVertical" } }, viewQueries: [{ propertyName: "formRef", first: true, predicate: SmartformComponent, descendants: true, isSignal: true }, { propertyName: "embeddedSlotVcRefSetter", first: true, predicate: ["embeddedSlot"], descendants: true, read: ViewContainerRef }, { propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartMapList", predicate: ["map"], descendants: true }, { propertyName: "smartDiagramList", predicate: ["diagram"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }, { propertyName: "toolbarList", predicate: ["toolbar"], descendants: true }, { propertyName: "expandableComponents", predicate: ExpandableSectionComponent, descendants: true }, { propertyName: "components", predicate: SmartComponentLayoutComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n @if (smartComponentLayout?.type === type().CONTAINER) {\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n [gridRow]=\"gridRow\"\r\n ></smart-component-layout>\r\n }\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <smart-map\r\n *ngIf=\"!!uuid && !!mapId\"\r\n #map\r\n [uuid]=\"uuid\"\r\n [identifier]=\"mapId\"\r\n [parent]=\"parentSmartComponent\"\r\n ></smart-map>\r\n <smart-diagram\r\n *ngIf=\"!!uuid && !!smartDiagramId\"\r\n #diagram\r\n [uuid]=\"uuid\"\r\n [identifier]=\"smartDiagramId\"\r\n [parent]=\"parentSmartComponent\"\r\n ></smart-diagram>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar\r\n *ngIf=\"!!toolbarId\"\r\n #toolbar\r\n [id]=\"toolbarId\"\r\n [toolbarPropertes]=\"toolbarPropertes\"\r\n ></smart-ui-action-toolbar>\r\n <ng-container *ngIf=\"embeddedSlotActive\" #embeddedSlot></ng-container>\r\n</ng-template>\r\n", styles: [":host(.horizontal){display:flex;flex-direction:row}:host(.vertical){display:flex;flex-direction:column}:host(.horizontal) smart-component-layout{display:flex}:host(.horizontal) smartform{flex:1;display:flex}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id", "scrollOnWrap", "toolbarPropertes"] }, { kind: "component", type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { kind: "component", type: SmartMapComponent, selector: "smart-map", inputs: ["uuid", "identifier", "parent"] }, { kind: "component", type: SmartDiagramComponent, selector: "smart-diagram", inputs: ["uuid", "identifier", "parent", "diagramModel", "options", "plugins"], outputs: ["elementSelect", "canvasClick", "dataClick"] }, { kind: "component", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent", "parentSmartComponent", "gridRow"] }] }); }
|
|
21380
21555
|
}
|
|
21381
21556
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
|
|
21382
21557
|
type: Component,
|
|
@@ -22399,158 +22574,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
22399
22574
|
}]
|
|
22400
22575
|
}] });
|
|
22401
22576
|
|
|
22402
|
-
class SmartComponentLayoutUtility {
|
|
22403
|
-
static getForms(comp) {
|
|
22404
|
-
let result = [];
|
|
22405
|
-
if (comp.components) {
|
|
22406
|
-
const children = comp.components
|
|
22407
|
-
.map((c) => this.getForms(c))
|
|
22408
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22409
|
-
result.push(...children);
|
|
22410
|
-
}
|
|
22411
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22412
|
-
if (expandable) {
|
|
22413
|
-
result.push(...this.getForms(expandable));
|
|
22414
|
-
}
|
|
22415
|
-
if (comp.smartFormComponent) {
|
|
22416
|
-
result.push(comp.smartFormComponent);
|
|
22417
|
-
}
|
|
22418
|
-
return result;
|
|
22419
|
-
}
|
|
22420
|
-
static getGrids(comp) {
|
|
22421
|
-
let result = [];
|
|
22422
|
-
if (comp.components) {
|
|
22423
|
-
const children = comp.components
|
|
22424
|
-
.map((c) => this.getGrids(c))
|
|
22425
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22426
|
-
result.push(...children);
|
|
22427
|
-
}
|
|
22428
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22429
|
-
if (expandable) {
|
|
22430
|
-
result.push(...this.getGrids(expandable));
|
|
22431
|
-
}
|
|
22432
|
-
if (comp.smartGridComponent) {
|
|
22433
|
-
result.push(comp.smartGridComponent);
|
|
22434
|
-
}
|
|
22435
|
-
return result;
|
|
22436
|
-
}
|
|
22437
|
-
static getMaps(comp) {
|
|
22438
|
-
const result = [];
|
|
22439
|
-
if (comp.components) {
|
|
22440
|
-
const children = comp.components
|
|
22441
|
-
.map((c) => SmartComponentLayoutUtility.getMaps(c))
|
|
22442
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22443
|
-
result.push(...children);
|
|
22444
|
-
}
|
|
22445
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22446
|
-
if (expandable) {
|
|
22447
|
-
result.push(...this.getMaps(expandable));
|
|
22448
|
-
}
|
|
22449
|
-
if (comp.smartMapComponent) {
|
|
22450
|
-
result.push(comp.smartMapComponent);
|
|
22451
|
-
}
|
|
22452
|
-
return result;
|
|
22453
|
-
}
|
|
22454
|
-
static getDiagrams(comp) {
|
|
22455
|
-
const result = [];
|
|
22456
|
-
if (comp.components) {
|
|
22457
|
-
const children = comp.components
|
|
22458
|
-
.map((c) => SmartComponentLayoutUtility.getDiagrams(c))
|
|
22459
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22460
|
-
result.push(...children);
|
|
22461
|
-
}
|
|
22462
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22463
|
-
if (expandable) {
|
|
22464
|
-
result.push(...this.getDiagrams(expandable));
|
|
22465
|
-
}
|
|
22466
|
-
if (comp.smartDiagramComponent) {
|
|
22467
|
-
result.push(comp.smartDiagramComponent);
|
|
22468
|
-
}
|
|
22469
|
-
return result;
|
|
22470
|
-
}
|
|
22471
|
-
static getTrees(comp) {
|
|
22472
|
-
let result = [];
|
|
22473
|
-
if (comp.components) {
|
|
22474
|
-
const children = comp.components
|
|
22475
|
-
?.map((c) => this.getTrees(c))
|
|
22476
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22477
|
-
result.push(...children);
|
|
22478
|
-
}
|
|
22479
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22480
|
-
if (expandable) {
|
|
22481
|
-
result.push(...this.getTrees(expandable));
|
|
22482
|
-
}
|
|
22483
|
-
if (comp.treeService) {
|
|
22484
|
-
result.push(comp.treeService);
|
|
22485
|
-
}
|
|
22486
|
-
return result;
|
|
22487
|
-
}
|
|
22488
|
-
static getToolbars(comp) {
|
|
22489
|
-
let result = [];
|
|
22490
|
-
if (comp.components) {
|
|
22491
|
-
const children = comp.components
|
|
22492
|
-
.map((c) => this.getToolbars(c))
|
|
22493
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22494
|
-
result.push(...children);
|
|
22495
|
-
}
|
|
22496
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22497
|
-
if (expandable) {
|
|
22498
|
-
result.push(...this.getToolbars(expandable));
|
|
22499
|
-
}
|
|
22500
|
-
let expandeableHeaderToolbar = comp.expandableComponents?.first?.toolbar;
|
|
22501
|
-
if (expandeableHeaderToolbar) {
|
|
22502
|
-
result.push(expandeableHeaderToolbar);
|
|
22503
|
-
}
|
|
22504
|
-
if (comp.toolbar) {
|
|
22505
|
-
result.push(comp.toolbar);
|
|
22506
|
-
}
|
|
22507
|
-
return result;
|
|
22508
|
-
}
|
|
22509
|
-
static getEmbeddedSlots(comp) {
|
|
22510
|
-
const result = [];
|
|
22511
|
-
if (comp.components) {
|
|
22512
|
-
const children = comp.components
|
|
22513
|
-
.map((c) => this.getEmbeddedSlots(c))
|
|
22514
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
22515
|
-
result.push(...children);
|
|
22516
|
-
}
|
|
22517
|
-
const expandable = this.getExpandableComponent(comp);
|
|
22518
|
-
if (expandable) {
|
|
22519
|
-
result.push(...this.getEmbeddedSlots(expandable));
|
|
22520
|
-
}
|
|
22521
|
-
if (comp._embeddedSlotVcRef && comp.embeddedSlotContainerId) {
|
|
22522
|
-
result.push({ containerId: comp.embeddedSlotContainerId, vcRef: comp._embeddedSlotVcRef });
|
|
22523
|
-
}
|
|
22524
|
-
return result;
|
|
22525
|
-
}
|
|
22526
|
-
static getExpandableComponent(comp) {
|
|
22527
|
-
return comp.expandableComponents?.first?.componentRef?.instance;
|
|
22528
|
-
}
|
|
22529
|
-
static applyStyle(style, elementRef, renderer) {
|
|
22530
|
-
if (style && elementRef && renderer) {
|
|
22531
|
-
let element = elementRef.nativeElement;
|
|
22532
|
-
// css style properties
|
|
22533
|
-
if (style.style) {
|
|
22534
|
-
Object.entries(style.style).forEach(([key, value]) => {
|
|
22535
|
-
renderer.setStyle(element, key, value, RendererStyleFlags2.Important);
|
|
22536
|
-
});
|
|
22537
|
-
}
|
|
22538
|
-
// add classes
|
|
22539
|
-
if (style.classesToAdd) {
|
|
22540
|
-
style.classesToAdd.forEach((cl) => renderer.addClass(element, cl));
|
|
22541
|
-
}
|
|
22542
|
-
// remove classes
|
|
22543
|
-
if (style.classesToRemove) {
|
|
22544
|
-
style.classesToRemove.forEach((cl) => renderer.removeClass(element, cl));
|
|
22545
|
-
}
|
|
22546
|
-
}
|
|
22547
|
-
}
|
|
22548
|
-
static setUuid(comp, uuid) {
|
|
22549
|
-
comp.updateUuid(uuid);
|
|
22550
|
-
comp.components?.forEach((child) => this.setUuid(child, uuid));
|
|
22551
|
-
}
|
|
22552
|
-
}
|
|
22553
|
-
|
|
22554
22577
|
/*
|
|
22555
22578
|
* Public API Surface of smart-component-layout
|
|
22556
22579
|
*/
|
|
@@ -23429,45 +23452,43 @@ class SmartComponentApiClient {
|
|
|
23429
23452
|
}
|
|
23430
23453
|
});
|
|
23431
23454
|
}
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
if (widget.key) {
|
|
23439
|
-
if (widget.valueChangeMode === ValueChangeMode.IMMEDIATE_ACTION ||
|
|
23440
|
-
widget.valueChangeMode === ValueChangeMode.BLUR) {
|
|
23441
|
-
this.addDataChangeActionHandler(widget.key, widget.valueChangeMode);
|
|
23442
|
-
}
|
|
23443
|
-
else {
|
|
23444
|
-
this.removeDataChangeActionHandler(widget.key);
|
|
23445
|
-
}
|
|
23446
|
-
}
|
|
23447
|
-
});
|
|
23448
|
-
});
|
|
23449
|
-
// subscribe to new forms
|
|
23450
|
-
forms.forEach((component) => {
|
|
23451
|
-
if (!this.dataChangeActionHandlers.has(component)) {
|
|
23452
|
-
let inmediateValueChangeSub = component.sophisticatedValueChange
|
|
23453
|
-
.pipe(takeUntil(this._destroy$))
|
|
23454
|
-
.subscribe((event) => this.dataChangeActionHandler(event, ValueChangeMode.IMMEDIATE_ACTION));
|
|
23455
|
-
let blurValueChangeSub = component.blurSophisticatedValueChange
|
|
23456
|
-
.pipe(takeUntil(this._destroy$))
|
|
23457
|
-
.subscribe((event) => this.dataChangeActionHandler(event, ValueChangeMode.BLUR));
|
|
23458
|
-
this.dataChangeActionHandlers.set(component, [
|
|
23459
|
-
inmediateValueChangeSub,
|
|
23460
|
-
blurValueChangeSub,
|
|
23461
|
-
]);
|
|
23455
|
+
handleFormSubscriptions(form) {
|
|
23456
|
+
form.smartForm?.widgets.forEach((widget) => {
|
|
23457
|
+
if (widget.key) {
|
|
23458
|
+
if (widget.valueChangeMode === ValueChangeMode.IMMEDIATE_ACTION ||
|
|
23459
|
+
widget.valueChangeMode === ValueChangeMode.BLUR) {
|
|
23460
|
+
this.addDataChangeActionHandler(widget.key, widget.valueChangeMode);
|
|
23462
23461
|
}
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
this.dataChangeActionHandlers.forEach((subs, form) => {
|
|
23466
|
-
if (!forms.find((c) => c === form)) {
|
|
23467
|
-
subs.forEach((sub) => sub.unsubscribe());
|
|
23468
|
-
this.dataChangeActionHandlers.delete(form);
|
|
23462
|
+
else {
|
|
23463
|
+
this.removeDataChangeActionHandler(widget.key);
|
|
23469
23464
|
}
|
|
23465
|
+
}
|
|
23466
|
+
});
|
|
23467
|
+
if (!this.dataChangeActionHandlers.has(form)) {
|
|
23468
|
+
let inmediateValueChangeSub = form.sophisticatedValueChange
|
|
23469
|
+
.pipe(takeUntil(this._destroy$))
|
|
23470
|
+
.subscribe((event) => {
|
|
23471
|
+
this.dataChangeActionHandler(event, ValueChangeMode.IMMEDIATE_ACTION);
|
|
23470
23472
|
});
|
|
23473
|
+
let blurValueChangeSub = form.blurSophisticatedValueChange
|
|
23474
|
+
.pipe(takeUntil(this._destroy$))
|
|
23475
|
+
.subscribe((event) => this.dataChangeActionHandler(event, ValueChangeMode.BLUR));
|
|
23476
|
+
this.dataChangeActionHandlers.set(form, [inmediateValueChangeSub, blurValueChangeSub]);
|
|
23477
|
+
}
|
|
23478
|
+
}
|
|
23479
|
+
handleDataChangeSubscriptions(formComponent) {
|
|
23480
|
+
if (this.useQueryLists) {
|
|
23481
|
+
let forms = !!formComponent ? [formComponent] : this.getAllSmartFormComponents();
|
|
23482
|
+
forms.forEach((form) => this.handleFormSubscriptions(form));
|
|
23483
|
+
// unsubscribe from removed forms
|
|
23484
|
+
if (!formComponent) {
|
|
23485
|
+
this.dataChangeActionHandlers.forEach((subs, form) => {
|
|
23486
|
+
if (!forms.find((c) => c === form)) {
|
|
23487
|
+
subs.forEach((sub) => sub.unsubscribe());
|
|
23488
|
+
this.dataChangeActionHandlers.delete(form);
|
|
23489
|
+
}
|
|
23490
|
+
});
|
|
23491
|
+
}
|
|
23471
23492
|
}
|
|
23472
23493
|
}
|
|
23473
23494
|
getInvalidFields() {
|