@smartbit4all/ng-client 3.3.145 → 3.3.147
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/session/api/api/session.service.mjs +1 -1
- package/esm2020/lib/session/api/encoder.mjs +1 -1
- package/esm2020/lib/session/api/model/accountInfo.mjs +1 -1
- package/esm2020/lib/session/api/model/apiError.mjs +1 -1
- package/esm2020/lib/session/api/model/authenticationProviderData.mjs +1 -1
- package/esm2020/lib/session/api/model/getAuthenticationProvidersResponse.mjs +1 -1
- package/esm2020/lib/session/api/model/models.mjs +1 -1
- package/esm2020/lib/session/api/model/refreshSessionRequest.mjs +1 -1
- package/esm2020/lib/session/api/model/session.mjs +1 -1
- package/esm2020/lib/session/api/model/sessionInfoData.mjs +1 -1
- package/esm2020/lib/session/api/model/userActivityLog.mjs +1 -1
- package/esm2020/lib/session/api/param.mjs +1 -1
- package/esm2020/lib/session/api/variables.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api/api.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api/default.service.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api.module.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/configuration.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/encoder.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/index.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/componentType.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/componentWidgetType.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/layoutDirection.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/models.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/param.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/variables.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderField.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionData.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionDataType.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionField.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldList.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionList.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperandData.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperation.mjs +1 -1
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOrderBy.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/api/filter.service.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/configuration.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/encoder.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBoolOperator.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderApiConfig.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderGroup.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderModel.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderUiModel.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionData.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionDataType.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldEditor.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldWidgetType.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperandData.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperation.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/smartFilterType.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/param.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/variables.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/smartFormWidgetType.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/valueChangeMode.mjs +1 -1
- package/esm2020/lib/smart-form/services/smartform.service.mjs +58 -37
- package/esm2020/lib/smart-form/smartform.component.mjs +3 -3
- 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/gridColumnContentType.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/gridSelectionChange.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/smart-tree/tree-api/api/tree.service.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/param.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-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/downloadedFile.mjs +1 -1
- package/esm2020/lib/view-context/api/model/iconPosition.mjs +1 -1
- package/esm2020/lib/view-context/api/model/imageResource.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/messageTextType.mjs +1 -1
- package/esm2020/lib/view-context/api/model/messageType.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/style.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionButtonDescriptor.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/uiActionTooltip.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionUploadDescriptor.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/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 +61 -40
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +59 -38
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-form/services/smartform.service.d.ts +2 -2
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.3.147.tgz +0 -0
- package/src/lib/session/api/README.md +226 -226
- package/src/lib/smart-component-layout/api/README.md +226 -226
- package/src/lib/smart-filter-editor/api/README.md +226 -226
- package/src/lib/smart-grid/api/grid-api/README.md +226 -226
- package/src/lib/smart-tree/tree-api/README.md +226 -226
- package/src/lib/view-context/api/README.md +226 -226
- package/smartbit4all-ng-client-3.3.145.tgz +0 -0
|
@@ -3931,17 +3931,20 @@ class SmartFormService {
|
|
|
3931
3931
|
});
|
|
3932
3932
|
return properties;
|
|
3933
3933
|
}
|
|
3934
|
-
setValuesFromModel() {
|
|
3934
|
+
setValuesFromModel(widgets) {
|
|
3935
3935
|
const smartForm = this.smartForm;
|
|
3936
|
-
const data =
|
|
3936
|
+
const data = smartForm.componentModel?.data;
|
|
3937
3937
|
if (!data) {
|
|
3938
3938
|
return;
|
|
3939
3939
|
}
|
|
3940
|
-
|
|
3940
|
+
if (!widgets) {
|
|
3941
|
+
widgets = smartForm.widgets;
|
|
3942
|
+
}
|
|
3943
|
+
const keys = this.collectKeysFromSmartForm(widgets, []);
|
|
3941
3944
|
let widget;
|
|
3942
3945
|
for (const key of this.getPropertyNamesDeeply(data)) {
|
|
3943
3946
|
if (keys.includes(key)) {
|
|
3944
|
-
widget = this.findSmartFormWidgetByKey(
|
|
3947
|
+
widget = this.findSmartFormWidgetByKey(widgets, key);
|
|
3945
3948
|
if (widget) {
|
|
3946
3949
|
let value = this.getValueDeeply(data, key);
|
|
3947
3950
|
if (typeof value === 'boolean' && widget.type !== SmartFormWidgetType.TOGGLE) {
|
|
@@ -3975,7 +3978,7 @@ class SmartFormService {
|
|
|
3975
3978
|
// In case of CheckBox2
|
|
3976
3979
|
let splittedKeys = key.split('.');
|
|
3977
3980
|
splittedKeys.splice(splittedKeys.length - 1, 1);
|
|
3978
|
-
widget = this.findSmartFormWidgetByKey(
|
|
3981
|
+
widget = this.findSmartFormWidgetByKey(widgets, splittedKeys.join('.'));
|
|
3979
3982
|
if (widget && widget.type === SmartFormWidgetType.CHECK_BOX_2) {
|
|
3980
3983
|
this.copyFromValueSetToValuesList(widget, smartForm.componentModel.valueSets);
|
|
3981
3984
|
if (widget.valueList) {
|
|
@@ -4233,29 +4236,6 @@ class SmartFormService {
|
|
|
4233
4236
|
else {
|
|
4234
4237
|
widget.isVisible = constraint.visible;
|
|
4235
4238
|
}
|
|
4236
|
-
if (constraint.mandatory !== undefined && constraint.mandatory) {
|
|
4237
|
-
if (widget.type !== SmartFormWidgetType.INDICATOR &&
|
|
4238
|
-
widget.type !== SmartFormWidgetType.LABEL &&
|
|
4239
|
-
widget.type !== SmartFormWidgetType.CONTAINER &&
|
|
4240
|
-
widget.type !== SmartFormWidgetType.IMAGE &&
|
|
4241
|
-
widget.type !== SmartFormWidgetType.SVG &&
|
|
4242
|
-
widget.type !== SmartFormWidgetType.FILE_UPLOADER &&
|
|
4243
|
-
widget.type !== SmartFormWidgetType.DIVIDER &&
|
|
4244
|
-
widget.type !== SmartFormWidgetType.BUTTON &&
|
|
4245
|
-
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
4246
|
-
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
4247
|
-
widget.validators = [
|
|
4248
|
-
...(widget.validators ?? []),
|
|
4249
|
-
{
|
|
4250
|
-
validator: Validators.required,
|
|
4251
|
-
isCustom: false,
|
|
4252
|
-
errorMessage: '',
|
|
4253
|
-
name: 'required',
|
|
4254
|
-
},
|
|
4255
|
-
];
|
|
4256
|
-
this.removeEmptyItemFromValueList(widget);
|
|
4257
|
-
}
|
|
4258
|
-
}
|
|
4259
4239
|
if (widget.type !== SmartFormWidgetType.INDICATOR &&
|
|
4260
4240
|
widget.type !== SmartFormWidgetType.LABEL &&
|
|
4261
4241
|
widget.type !== SmartFormWidgetType.CONTAINER &&
|
|
@@ -4266,6 +4246,41 @@ class SmartFormService {
|
|
|
4266
4246
|
widget.type !== SmartFormWidgetType.BUTTON &&
|
|
4267
4247
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
4268
4248
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
4249
|
+
let validators = widget.validators ?? [];
|
|
4250
|
+
let requiredIndex = validators.findIndex((v) => v.validator === Validators.required);
|
|
4251
|
+
let wasMandatory = requiredIndex >= 0;
|
|
4252
|
+
let tobeMandatory = false;
|
|
4253
|
+
if (constraint.mandatory === undefined) {
|
|
4254
|
+
// not specified on server, use client state
|
|
4255
|
+
tobeMandatory = wasMandatory;
|
|
4256
|
+
}
|
|
4257
|
+
else {
|
|
4258
|
+
tobeMandatory = constraint.mandatory;
|
|
4259
|
+
}
|
|
4260
|
+
if (!wasMandatory && tobeMandatory) {
|
|
4261
|
+
// add required validator
|
|
4262
|
+
widget.validators = [
|
|
4263
|
+
...validators,
|
|
4264
|
+
{
|
|
4265
|
+
validator: Validators.required,
|
|
4266
|
+
isCustom: false,
|
|
4267
|
+
errorMessage: '',
|
|
4268
|
+
name: 'required',
|
|
4269
|
+
},
|
|
4270
|
+
];
|
|
4271
|
+
// remove empty item
|
|
4272
|
+
this.removeEmptyItemFromValueList(widget);
|
|
4273
|
+
}
|
|
4274
|
+
if (wasMandatory && !tobeMandatory) {
|
|
4275
|
+
// remove required validator
|
|
4276
|
+
widget.validators?.splice(requiredIndex, 1);
|
|
4277
|
+
// add empty item
|
|
4278
|
+
let emptyLabel = '';
|
|
4279
|
+
if ('selection' in widget) {
|
|
4280
|
+
emptyLabel = widget.selection?.emptyLabel ?? '';
|
|
4281
|
+
}
|
|
4282
|
+
this.addEmptyItemToValueList(widget, emptyLabel);
|
|
4283
|
+
}
|
|
4269
4284
|
if (constraint.enabled === undefined) {
|
|
4270
4285
|
if (widget.isDisabled === undefined) {
|
|
4271
4286
|
widget.isDisabled = false;
|
|
@@ -4311,20 +4326,26 @@ class SmartFormService {
|
|
|
4311
4326
|
// test the path against the generated regex
|
|
4312
4327
|
return regex.test(path);
|
|
4313
4328
|
}
|
|
4314
|
-
applyConstraints() {
|
|
4329
|
+
applyConstraints(widgets) {
|
|
4315
4330
|
if (this.smartForm.componentModel?.constraints &&
|
|
4316
4331
|
this.smartForm.componentModel?.constraints.length) {
|
|
4317
|
-
|
|
4332
|
+
if (!widgets) {
|
|
4333
|
+
widgets = this.smartForm.widgets;
|
|
4334
|
+
}
|
|
4335
|
+
this.applyComponentConstraints(widgets, this.smartForm.componentModel?.constraints);
|
|
4318
4336
|
}
|
|
4319
4337
|
}
|
|
4320
4338
|
addEmptyItemToValueList(widget, emptyLabel) {
|
|
4321
4339
|
if (widget.type == SmartFormWidgetType.SELECT) {
|
|
4322
|
-
widget.valueList
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4340
|
+
const containsEmptyKey = widget.valueList.some((v) => v.key === this.emptyKey);
|
|
4341
|
+
if (!containsEmptyKey) {
|
|
4342
|
+
widget.valueList?.unshift({
|
|
4343
|
+
key: this.emptyKey,
|
|
4344
|
+
label: emptyLabel ?? '',
|
|
4345
|
+
type: SmartFormWidgetType.ITEM,
|
|
4346
|
+
value: '', // this should be undefined, but FormControl cannot be null, from v14 it will
|
|
4347
|
+
});
|
|
4348
|
+
}
|
|
4328
4349
|
}
|
|
4329
4350
|
}
|
|
4330
4351
|
removeEmptyItemFromValueList(widget) {
|
|
@@ -6112,11 +6133,11 @@ class SmartformComponent {
|
|
|
6112
6133
|
this.onValueChangeSubject = new SmartSubject(this._destroy$);
|
|
6113
6134
|
}
|
|
6114
6135
|
this.service.smartForm = this.smartForm;
|
|
6115
|
-
this.service.setValuesFromModel();
|
|
6116
|
-
this.service.applyConstraints();
|
|
6117
6136
|
if (!this.originalWidgets || this.originalWidgets.length === 0) {
|
|
6118
6137
|
this.originalWidgets = this.smartForm.widgets;
|
|
6119
6138
|
}
|
|
6139
|
+
this.service.setValuesFromModel(this.originalWidgets);
|
|
6140
|
+
this.service.applyConstraints(this.originalWidgets);
|
|
6120
6141
|
this.smartForm.widgets = this.service.filterWidgetsByVisibility(this.originalWidgets);
|
|
6121
6142
|
this.form = this.service.toFormGroup();
|
|
6122
6143
|
if (this.smartForm.translateService) {
|