@smartbit4all/ng-client 3.0.9 → 3.0.11
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 +6 -3
- package/esm2020/lib/smart-form/services/smartform.service.mjs +50 -37
- package/esm2020/lib/smart-form/smartform.form-model.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/index.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/param.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
- package/esm2020/lib/view-context/api/api/api.mjs +1 -1
- package/esm2020/lib/view-context/api/api/view.service.mjs +1 -1
- package/esm2020/lib/view-context/api/api.module.mjs +1 -1
- package/esm2020/lib/view-context/api/configuration.mjs +1 -1
- package/esm2020/lib/view-context/api/encoder.mjs +1 -1
- package/esm2020/lib/view-context/api/index.mjs +1 -1
- package/esm2020/lib/view-context/api/model/closeResult.mjs +1 -1
- package/esm2020/lib/view-context/api/model/componentConstraint.mjs +1 -1
- package/esm2020/lib/view-context/api/model/componentModel.mjs +1 -1
- package/esm2020/lib/view-context/api/model/componentModelChange.mjs +1 -1
- package/esm2020/lib/view-context/api/model/dataChange.mjs +1 -1
- package/esm2020/lib/view-context/api/model/dataChangeEvent.mjs +1 -1
- package/esm2020/lib/view-context/api/model/dataChangeKind.mjs +1 -1
- package/esm2020/lib/view-context/api/model/link.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageData.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageOption.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageOptionType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageResult.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/models.mjs +1 -1
- package/esm2020/lib/view-context/api/model/openPendingData.mjs +1 -1
- package/esm2020/lib/view-context/api/model/smartLinkData.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiAction.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionButtonDescriptor.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionButtonIconPos.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionButtonType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionConstraint.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionDescriptor.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionDialogDescriptor.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionFeedbackType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionInputType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionRequest.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionUploadDescriptor.mjs +1 -1
- package/esm2020/lib/view-context/api/model/valueSet.mjs +1 -1
- package/esm2020/lib/view-context/api/model/view.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewApiError.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewConstraint.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContext.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContextChange.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContextData.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContextUpdate.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewData.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewState.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewStateUpdate.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewType.mjs +1 -1
- package/esm2020/lib/view-context/api/param.mjs +1 -1
- package/esm2020/lib/view-context/api/variables.mjs +1 -1
- package/fesm2015/smartbit4all-ng-client.mjs +56 -40
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +54 -38
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-form/services/smartform.service.d.ts +1 -0
- package/lib/smart-form/smartform.form-model.d.ts +4 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.0.11.tgz +0 -0
- package/src/lib/smart-grid/api/grid-api/README.md +226 -226
- package/src/lib/view-context/api/README.md +226 -226
- package/smartbit4all-ng-client-3.0.9.tgz +0 -0
|
@@ -2992,7 +2992,11 @@ class SmartFormService {
|
|
|
2992
2992
|
deepModel.push(tempModel[splittedKeys[index]]);
|
|
2993
2993
|
}
|
|
2994
2994
|
if (index === splittedKeys.length - 1) {
|
|
2995
|
-
tempModel[splittedKeys[index]]
|
|
2995
|
+
let oldValue = tempModel[splittedKeys[index]];
|
|
2996
|
+
// if (value === '' && (oldValue === null || oldValue === undefined) then don't change value.
|
|
2997
|
+
if (value !== '' || (oldValue !== null && oldValue !== undefined)) {
|
|
2998
|
+
tempModel[splittedKeys[index]] = value;
|
|
2999
|
+
}
|
|
2996
3000
|
break;
|
|
2997
3001
|
}
|
|
2998
3002
|
}
|
|
@@ -3044,35 +3048,7 @@ class SmartFormService {
|
|
|
3044
3048
|
widget.showLabel = true;
|
|
3045
3049
|
}
|
|
3046
3050
|
}
|
|
3047
|
-
|
|
3048
|
-
widget.type === SmartFormWidgetType.TEXT_FIELD) {
|
|
3049
|
-
if (widget.selection && smartForm.componentModel.valueSets) {
|
|
3050
|
-
if (widget.selection.type === SelectionDefinition.TypeEnum.Property &&
|
|
3051
|
-
!widget.selection.mapping.length) {
|
|
3052
|
-
let valueSetData = smartForm.componentModel.valueSets[widget.selection.valueSetName].valueSetData;
|
|
3053
|
-
widget.valueList = valueSetData.values.map((value) => {
|
|
3054
|
-
return {
|
|
3055
|
-
key: value[valueSetData.keyProperty],
|
|
3056
|
-
label: value[widget.selection?.displayProperty ?? 'displayValue'],
|
|
3057
|
-
type: SmartFormWidgetType.ITEM,
|
|
3058
|
-
value: value[valueSetData.keyProperty],
|
|
3059
|
-
};
|
|
3060
|
-
});
|
|
3061
|
-
}
|
|
3062
|
-
else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
|
|
3063
|
-
!widget.selection.mapping.length) {
|
|
3064
|
-
let valueSetData = smartForm.componentModel.valueSets[widget.selection.valueSetName].valueSetData;
|
|
3065
|
-
widget.valueList = valueSetData.values.map((value, index) => {
|
|
3066
|
-
return {
|
|
3067
|
-
key: `${index}`,
|
|
3068
|
-
label: value[widget.selection?.displayProperty ?? 'displayValue'],
|
|
3069
|
-
type: SmartFormWidgetType.ITEM,
|
|
3070
|
-
value: value,
|
|
3071
|
-
};
|
|
3072
|
-
});
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3051
|
+
this.copyFromValueSetToValuesList(widget, smartForm.componentModel.valueSets);
|
|
3076
3052
|
if (widget &&
|
|
3077
3053
|
widget.type === SmartFormWidgetType.CHECK_BOX &&
|
|
3078
3054
|
widget.valueList.length === 1) {
|
|
@@ -3088,17 +3064,54 @@ class SmartFormService {
|
|
|
3088
3064
|
let splittedKeys = key.split('.');
|
|
3089
3065
|
splittedKeys.splice(splittedKeys.length - 1, 1);
|
|
3090
3066
|
widget = this.findSmartFormWidgetByKey(smartForm.widgets, splittedKeys.join('.'));
|
|
3091
|
-
if (widget && widget.type === SmartFormWidgetType.CHECK_BOX_2
|
|
3092
|
-
widget
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3067
|
+
if (widget && widget.type === SmartFormWidgetType.CHECK_BOX_2) {
|
|
3068
|
+
this.copyFromValueSetToValuesList(widget, smartForm.componentModel.valueSets);
|
|
3069
|
+
if (widget.valueList) {
|
|
3070
|
+
widget.valueList = widget.valueList.map((item) => {
|
|
3071
|
+
let value = this.getValueDeeply(data, `${widget?.key}.${item.key}`);
|
|
3072
|
+
item.value = value;
|
|
3073
|
+
return item;
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3097
3076
|
}
|
|
3098
3077
|
}
|
|
3099
3078
|
}
|
|
3100
3079
|
}
|
|
3101
3080
|
}
|
|
3081
|
+
copyFromValueSetToValuesList(widget, valueSets) {
|
|
3082
|
+
if (widget.type === SmartFormWidgetType.SELECT ||
|
|
3083
|
+
widget.type === SmartFormWidgetType.SELECT_MULTIPLE ||
|
|
3084
|
+
widget.type === SmartFormWidgetType.RADIO_BUTTON ||
|
|
3085
|
+
widget.type === SmartFormWidgetType.CHECK_BOX ||
|
|
3086
|
+
widget.type === SmartFormWidgetType.TEXT_FIELD) {
|
|
3087
|
+
if (widget.selection && valueSets) {
|
|
3088
|
+
if (widget.selection.type === SelectionDefinition.TypeEnum.Property &&
|
|
3089
|
+
!widget.selection.mapping.length) {
|
|
3090
|
+
let valueSetData = valueSets[widget.selection.valueSetName].valueSetData;
|
|
3091
|
+
widget.valueList = valueSetData.values.map((value) => {
|
|
3092
|
+
return {
|
|
3093
|
+
key: value[valueSetData.keyProperty],
|
|
3094
|
+
label: value[widget.selection?.displayProperty ?? 'displayValue'],
|
|
3095
|
+
type: SmartFormWidgetType.ITEM,
|
|
3096
|
+
value: value[valueSetData.keyProperty],
|
|
3097
|
+
};
|
|
3098
|
+
});
|
|
3099
|
+
}
|
|
3100
|
+
else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
|
|
3101
|
+
!widget.selection.mapping.length) {
|
|
3102
|
+
let valueSetData = valueSets[widget.selection.valueSetName].valueSetData;
|
|
3103
|
+
widget.valueList = valueSetData.values.map((value, index) => {
|
|
3104
|
+
return {
|
|
3105
|
+
key: `${index}`,
|
|
3106
|
+
label: value[widget.selection?.displayProperty ?? 'displayValue'],
|
|
3107
|
+
type: SmartFormWidgetType.ITEM,
|
|
3108
|
+
value: value,
|
|
3109
|
+
};
|
|
3110
|
+
});
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3102
3115
|
toFormGroup() {
|
|
3103
3116
|
this.createFormControls(this.smartForm.widgets);
|
|
3104
3117
|
let formGroup = new FormGroup(this.group);
|
|
@@ -12616,11 +12629,14 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
12616
12629
|
deepModel.push(tempModel[splittedKeys[index]]);
|
|
12617
12630
|
}
|
|
12618
12631
|
if (index === splittedKeys.length - 1) {
|
|
12619
|
-
tempModel[splittedKeys[index]]
|
|
12632
|
+
let oldValue = tempModel[splittedKeys[index]];
|
|
12633
|
+
// if (value === '' && (oldValue === null || oldValue === undefined) then don't change value.
|
|
12634
|
+
if (value !== '' || (oldValue !== null && oldValue !== undefined)) {
|
|
12635
|
+
tempModel[splittedKeys[index]] = value;
|
|
12636
|
+
}
|
|
12620
12637
|
break;
|
|
12621
12638
|
}
|
|
12622
12639
|
}
|
|
12623
|
-
return model;
|
|
12624
12640
|
}
|
|
12625
12641
|
handleDataChange(changes, changeKey) {
|
|
12626
12642
|
this.setValueDeeply(this.model, changeKey, changes[changeKey]);
|