@smartbit4all/ng-client 3.3.56 → 3.3.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +74 -38
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +2 -2
- package/esm2020/lib/smart-form/widgets/smartformwidget/smartformwidget.component.mjs +2 -2
- package/esm2020/lib/smart-ng-client.module.mjs +2 -2
- package/fesm2015/smartbit4all-ng-client.mjs +78 -42
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +76 -40
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +11 -14
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.3.58.tgz +0 -0
- package/smartbit4all-ng-client-3.3.56.tgz +0 -0
|
@@ -4822,7 +4822,7 @@ class SmartformwidgetComponent {
|
|
|
4822
4822
|
let formControls = Object.keys(this.form.controls).filter((key) => key === this.widgetInstance.key || key.startsWith(`${this.widgetInstance.key}.`));
|
|
4823
4823
|
formControls.map((key) => {
|
|
4824
4824
|
this.form.controls[key].valueChanges
|
|
4825
|
-
.pipe(distinctUntilChanged())
|
|
4825
|
+
.pipe(takeUntil(this._destroy$), distinctUntilChanged())
|
|
4826
4826
|
.subscribe((value) => {
|
|
4827
4827
|
const valueChange = {
|
|
4828
4828
|
key,
|
|
@@ -13430,7 +13430,7 @@ class SmartFilterEditorContentComponent {
|
|
|
13430
13430
|
this.saveFilter();
|
|
13431
13431
|
});
|
|
13432
13432
|
this.simpleFilterRef.instance.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13433
|
-
if (change.kind === 'selection') {
|
|
13433
|
+
if (change.kind === 'selection' && !change.key.includes('selectedValues')) {
|
|
13434
13434
|
this.saveFilter();
|
|
13435
13435
|
}
|
|
13436
13436
|
});
|
|
@@ -14486,9 +14486,11 @@ class SmartComponentApiClient {
|
|
|
14486
14486
|
this.uiActionModels = [];
|
|
14487
14487
|
this.dataChanged = new SmartSubject(this._destroy$);
|
|
14488
14488
|
// Contained Widgets
|
|
14489
|
-
this.widgets = new
|
|
14490
|
-
this.formWidgets = new
|
|
14489
|
+
this.widgets = new Map();
|
|
14490
|
+
this.formWidgets = new Map();
|
|
14491
14491
|
this.useQueryLists = false;
|
|
14492
|
+
this.dataChangeKeys = [];
|
|
14493
|
+
this.dataChangeActionHandlers = new Map();
|
|
14492
14494
|
// check and calculate pageName
|
|
14493
14495
|
if (!this.pageName && !this._componentName) {
|
|
14494
14496
|
throw new Error('pageName or componentName must be specified!');
|
|
@@ -14524,7 +14526,7 @@ class SmartComponentApiClient {
|
|
|
14524
14526
|
}
|
|
14525
14527
|
this._uuid = uuid;
|
|
14526
14528
|
if (uuid) {
|
|
14527
|
-
this.getWidgets().
|
|
14529
|
+
this.getWidgets().forEach((ref, key) => {
|
|
14528
14530
|
if (ref instanceof SmartGridComponent) {
|
|
14529
14531
|
ref.uuid = uuid;
|
|
14530
14532
|
}
|
|
@@ -14572,7 +14574,7 @@ class SmartComponentApiClient {
|
|
|
14572
14574
|
}
|
|
14573
14575
|
_ngOnDestroy() {
|
|
14574
14576
|
this.viewContext.unfollow(this.uuid);
|
|
14575
|
-
this.widgets.
|
|
14577
|
+
this.widgets.clear();
|
|
14576
14578
|
this._destroy$.next();
|
|
14577
14579
|
this._destroy$.complete();
|
|
14578
14580
|
}
|
|
@@ -14588,10 +14590,20 @@ class SmartComponentApiClient {
|
|
|
14588
14590
|
SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
|
|
14589
14591
|
this.initActions();
|
|
14590
14592
|
}
|
|
14593
|
+
// for handling embedded forms
|
|
14594
|
+
this.handleDataChangeSubscriptions();
|
|
14591
14595
|
if (this.uuid && this.uuid !== comp.uuid)
|
|
14592
14596
|
comp.uuid = this.uuid;
|
|
14593
14597
|
});
|
|
14594
14598
|
}
|
|
14599
|
+
if (!this.getSmartFormsQL()) {
|
|
14600
|
+
console.warn('getSmartFormsQL not available!');
|
|
14601
|
+
}
|
|
14602
|
+
else {
|
|
14603
|
+
this.handleQueryList(this.getSmartFormsQL(), (form) => {
|
|
14604
|
+
this.handleDataChangeSubscriptions();
|
|
14605
|
+
});
|
|
14606
|
+
}
|
|
14595
14607
|
if (!this.getSmartGridsQL()) {
|
|
14596
14608
|
console.warn('SmartGridsQL not available!');
|
|
14597
14609
|
}
|
|
@@ -14623,6 +14635,10 @@ class SmartComponentApiClient {
|
|
|
14623
14635
|
});
|
|
14624
14636
|
}
|
|
14625
14637
|
}
|
|
14638
|
+
handleQueryListSimple(ql, handler) {
|
|
14639
|
+
handler();
|
|
14640
|
+
ql.changes.pipe(takeUntil(this._destroy$)).subscribe(() => handler());
|
|
14641
|
+
}
|
|
14626
14642
|
handleQueryList(ql, handler) {
|
|
14627
14643
|
ql.forEach((el) => handler(el));
|
|
14628
14644
|
ql.changes
|
|
@@ -14631,16 +14647,16 @@ class SmartComponentApiClient {
|
|
|
14631
14647
|
}
|
|
14632
14648
|
getWidgets() {
|
|
14633
14649
|
if (this.useQueryLists) {
|
|
14634
|
-
let widgets = new
|
|
14650
|
+
let widgets = new Map();
|
|
14635
14651
|
this.getAllSmartGridComponents()
|
|
14636
14652
|
.filter((grid) => (grid?.smartGrid?.gridIdentifier ? true : false))
|
|
14637
|
-
.forEach((grid) => widgets.
|
|
14653
|
+
.forEach((grid) => widgets.set(grid.smartGrid.gridIdentifier, grid));
|
|
14638
14654
|
this.getAllSmartTreeComponents()
|
|
14639
14655
|
.filter((tree) => (tree?.smartTreeModel?.identifier ? true : false))
|
|
14640
|
-
.forEach((tree) => widgets.
|
|
14656
|
+
.forEach((tree) => widgets.set(tree.smartTreeModel.identifier, tree));
|
|
14641
14657
|
this.getAllSmartFilterEditorServices()
|
|
14642
14658
|
.filter((filter) => (filter.config.identifier ? true : false))
|
|
14643
|
-
.forEach((filter) => widgets.
|
|
14659
|
+
.forEach((filter) => widgets.set(filter.config.identifier, filter));
|
|
14644
14660
|
return widgets;
|
|
14645
14661
|
}
|
|
14646
14662
|
return this.widgets;
|
|
@@ -14777,6 +14793,49 @@ class SmartComponentApiClient {
|
|
|
14777
14793
|
};
|
|
14778
14794
|
this.uiActionService.execute(uiAction, options);
|
|
14779
14795
|
}
|
|
14796
|
+
addDataChangeActionHandler(key) {
|
|
14797
|
+
if (!this.dataChangeKeys.includes(key)) {
|
|
14798
|
+
this.dataChangeKeys.push(key);
|
|
14799
|
+
}
|
|
14800
|
+
}
|
|
14801
|
+
dataChangeActionHandler(event) {
|
|
14802
|
+
console.log('event received', event);
|
|
14803
|
+
if (this.dataChangeKeys.includes(event.key)) {
|
|
14804
|
+
try {
|
|
14805
|
+
this.executeUiAction({
|
|
14806
|
+
code: event.key,
|
|
14807
|
+
model: true,
|
|
14808
|
+
params: {
|
|
14809
|
+
item: event.value,
|
|
14810
|
+
},
|
|
14811
|
+
});
|
|
14812
|
+
}
|
|
14813
|
+
catch (error) {
|
|
14814
|
+
console.log('error', error);
|
|
14815
|
+
}
|
|
14816
|
+
}
|
|
14817
|
+
}
|
|
14818
|
+
handleDataChangeSubscriptions() {
|
|
14819
|
+
if (this.useQueryLists) {
|
|
14820
|
+
let forms = this.getAllSmartFormComponents();
|
|
14821
|
+
// subscribe to new forms
|
|
14822
|
+
forms.forEach((component) => {
|
|
14823
|
+
if (!this.dataChangeActionHandlers.has(component)) {
|
|
14824
|
+
let subs = component.sophisticatedValueChange
|
|
14825
|
+
.pipe(takeUntil(this._destroy$))
|
|
14826
|
+
.subscribe((event) => this.dataChangeActionHandler(event));
|
|
14827
|
+
this.dataChangeActionHandlers.set(component, subs);
|
|
14828
|
+
}
|
|
14829
|
+
});
|
|
14830
|
+
// unsubscribe from removed forms
|
|
14831
|
+
this.dataChangeActionHandlers.forEach((subs, form) => {
|
|
14832
|
+
if (!forms.find((c) => c === form)) {
|
|
14833
|
+
subs.unsubscribe();
|
|
14834
|
+
this.dataChangeActionHandlers.delete(form);
|
|
14835
|
+
}
|
|
14836
|
+
});
|
|
14837
|
+
}
|
|
14838
|
+
}
|
|
14780
14839
|
getInvalidFields() {
|
|
14781
14840
|
let aggregatedInvalidFields = {
|
|
14782
14841
|
invalidFieldKeys: [],
|
|
@@ -14786,7 +14845,7 @@ class SmartComponentApiClient {
|
|
|
14786
14845
|
this.getAllSmartFormComponents()?.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
|
|
14787
14846
|
}
|
|
14788
14847
|
else {
|
|
14789
|
-
this.formWidgets?.
|
|
14848
|
+
this.formWidgets?.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
|
|
14790
14849
|
}
|
|
14791
14850
|
return aggregatedInvalidFields;
|
|
14792
14851
|
}
|
|
@@ -14861,7 +14920,7 @@ class SmartComponentApiClient {
|
|
|
14861
14920
|
});
|
|
14862
14921
|
}
|
|
14863
14922
|
else {
|
|
14864
|
-
this.formWidgets?.
|
|
14923
|
+
this.formWidgets?.forEach((form) => {
|
|
14865
14924
|
form?.submitForm(validate);
|
|
14866
14925
|
});
|
|
14867
14926
|
}
|
|
@@ -14873,7 +14932,7 @@ class SmartComponentApiClient {
|
|
|
14873
14932
|
smartGrid.serviceToUse = this;
|
|
14874
14933
|
smartGrid.viewContextService = this.viewContext;
|
|
14875
14934
|
if (!this.useQueryLists) {
|
|
14876
|
-
this.widgets.
|
|
14935
|
+
this.widgets.set(smartGrid.gridIdentifier, componentReference);
|
|
14877
14936
|
}
|
|
14878
14937
|
else {
|
|
14879
14938
|
console.warn(`Added smartGrid when useQueryLists === true (${smartGrid.gridIdentifier})`);
|
|
@@ -14886,7 +14945,7 @@ class SmartComponentApiClient {
|
|
|
14886
14945
|
}
|
|
14887
14946
|
addForm(smartFormId, smartForm, componentReference) {
|
|
14888
14947
|
if (!this.useQueryLists) {
|
|
14889
|
-
this.formWidgets.
|
|
14948
|
+
this.formWidgets.set(smartFormId, componentReference);
|
|
14890
14949
|
}
|
|
14891
14950
|
else {
|
|
14892
14951
|
console.warn(`Added smartForm when useQueryLists === true (${smartFormId})`);
|
|
@@ -14907,7 +14966,7 @@ class SmartComponentApiClient {
|
|
|
14907
14966
|
createTreeService(treeId) {
|
|
14908
14967
|
const treeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
|
|
14909
14968
|
if (!this.useQueryLists) {
|
|
14910
|
-
this.widgets.
|
|
14969
|
+
this.widgets.set(treeId, treeService);
|
|
14911
14970
|
}
|
|
14912
14971
|
else {
|
|
14913
14972
|
console.warn(`Added smartTree when useQueryLists === true (${treeId})`);
|
|
@@ -15035,7 +15094,7 @@ class SmartComponentApiClient {
|
|
|
15035
15094
|
this.getAllSmartFormComponents()?.forEach((form) => form.refresh());
|
|
15036
15095
|
}
|
|
15037
15096
|
else {
|
|
15038
|
-
this.formWidgets.
|
|
15097
|
+
this.formWidgets.forEach((formComponent, key) => {
|
|
15039
15098
|
if (formComponent === undefined) {
|
|
15040
15099
|
console.error(`Provided form reference for ${key} is undefined.`);
|
|
15041
15100
|
}
|
|
@@ -15065,29 +15124,6 @@ class SmartComponentApiClient {
|
|
|
15065
15124
|
handleConstraintChange(changes, changeKey) {
|
|
15066
15125
|
this.model.constraints = changes[changeKey];
|
|
15067
15126
|
}
|
|
15068
|
-
}
|
|
15069
|
-
class WidgetMap {
|
|
15070
|
-
constructor() {
|
|
15071
|
-
this._widgets = new Map();
|
|
15072
|
-
}
|
|
15073
|
-
get widgets() {
|
|
15074
|
-
return this._widgets;
|
|
15075
|
-
}
|
|
15076
|
-
set widgets(widgets) {
|
|
15077
|
-
this._widgets = widgets;
|
|
15078
|
-
}
|
|
15079
|
-
addWidget(key, reference, isForm) {
|
|
15080
|
-
this._widgets.set(key, reference);
|
|
15081
|
-
}
|
|
15082
|
-
removeWidget(key) {
|
|
15083
|
-
this._widgets.delete(key);
|
|
15084
|
-
}
|
|
15085
|
-
clearWidgets() {
|
|
15086
|
-
this._widgets.clear();
|
|
15087
|
-
}
|
|
15088
|
-
get(key) {
|
|
15089
|
-
return this.widgets.get(key);
|
|
15090
|
-
}
|
|
15091
15127
|
}
|
|
15092
15128
|
|
|
15093
15129
|
class SmartComponent extends SmartComponentApiClient {
|
|
@@ -15263,5 +15299,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
15263
15299
|
* Generated bundle index. Do not edit.
|
|
15264
15300
|
*/
|
|
15265
15301
|
|
|
15266
|
-
export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$5 as BASE_PATH, COLLECTION_FORMATS$5 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$5 as Configuration, DIALOG_DISABLE_CLOSE, DataChangeKind, DefaultUiActionCode_CLOSE, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator$1 as FilterExpressionBoolOperator, FilterExpressionBuilderGroupBuilderGroupKindEnum, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderByOrderEnum, GridColumnContentType, GridDataAccessConfigKindEnum, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptorKindEnum, IS_ASYNC_PARAM_NAME, IconPosition, ImageResourceKindEnum, LayoutDirection, LinkTargetEnum, MessageOptionType, MessageTextType, MessageType, SelectionDefinitionTypeEnum, SessionAPIS, SessionErrorBehaviour, SessionService, SharedModule, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterEditorContentComponent, SmartFilterEditorModule, SmartFilterEditorService, SmartFilterExpressionItemComponent, SmartFilterExpressionItemsComponent, SmartFilterModule, SmartFilterParamComponent, SmartFilterParamsComponent, 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, SmartTooltipDirective, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetHintPositionEnum, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, UiActionTooltipTooltipPositionEnum, ViewEventHandlerViewEventTypeEnum, ViewService, ViewState, ViewType
|
|
15302
|
+
export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$5 as BASE_PATH, COLLECTION_FORMATS$5 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$5 as Configuration, DIALOG_DISABLE_CLOSE, DataChangeKind, DefaultUiActionCode_CLOSE, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator$1 as FilterExpressionBoolOperator, FilterExpressionBuilderGroupBuilderGroupKindEnum, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderByOrderEnum, GridColumnContentType, GridDataAccessConfigKindEnum, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptorKindEnum, IS_ASYNC_PARAM_NAME, IconPosition, ImageResourceKindEnum, LayoutDirection, LinkTargetEnum, MessageOptionType, MessageTextType, MessageType, SelectionDefinitionTypeEnum, SessionAPIS, SessionErrorBehaviour, SessionService, SharedModule, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterEditorContentComponent, SmartFilterEditorModule, SmartFilterEditorService, SmartFilterExpressionItemComponent, SmartFilterExpressionItemsComponent, SmartFilterModule, SmartFilterParamComponent, SmartFilterParamsComponent, 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, SmartTooltipDirective, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetHintPositionEnum, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, UiActionTooltipTooltipPositionEnum, ViewEventHandlerViewEventTypeEnum, ViewService, ViewState, ViewType };
|
|
15267
15303
|
//# sourceMappingURL=smartbit4all-ng-client.mjs.map
|