@smartbit4all/ng-client 3.3.145 → 3.3.146
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 +57 -36
- 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 +60 -39
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +58 -37
- 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.146.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
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zbWFydC1uZy1jbGllbnQvc3JjL2xpYi92aWV3LWNvbnRleHQvYXBpL3BhcmFtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFN0YW5kYXJkIHBhcmFtZXRlciBzdHlsZXMgZGVmaW5lZCBieSBPcGVuQVBJIHNwZWNcbiAqL1xuZXhwb3J0IHR5cGUgU3RhbmRhcmRQYXJhbVN0eWxlID1cbiAgfCAnbWF0cml4J1xuICB8ICdsYWJlbCdcbiAgfCAnZm9ybSdcbiAgfCAnc2ltcGxlJ1xuICB8ICdzcGFjZURlbGltaXRlZCdcbiAgfCAncGlwZURlbGltaXRlZCdcbiAgfCAnZGVlcE9iamVjdCdcbiAgO1xuXG4vKipcbiAqIFRoZSBPcGVuQVBJIHN0YW5kYXJkIHtAbGluayBTdGFuZGFyZFBhcmFtU3R5bGV9cyBtYXkgYmUgZXh0ZW5kZWQgYnkgY3VzdG9tIHN0eWxlcyBieSB0aGUgdXNlci5cbiAqL1xuZXhwb3J0IHR5cGUgUGFyYW1TdHlsZSA9IFN0YW5kYXJkUGFyYW1TdHlsZSB8IHN0cmluZztcblxuLyoqXG4gKiBTdGFuZGFyZCBwYXJhbWV0ZXIgbG9jYXRpb25zIGRlZmluZWQgYnkgT3BlbkFQSSBzcGVjXG4gKi9cbmV4cG9ydCB0eXBlIFBhcmFtTG9jYXRpb24gPSAncXVlcnknIHwgJ2hlYWRlcicgfCAncGF0aCcgfCAnY29va2llJztcblxuLyoqXG4gKiBTdGFuZGFyZCB0eXBlcyBhcyBkZWZpbmVkIGluIDxhIGhyZWY9XCJodHRwczovL3N3YWdnZXIuaW8vc3BlY2lmaWNhdGlvbi8jZGF0YS10eXBlc1wiPk9wZW5BUEkgU3BlY2lmaWNhdGlvbjogRGF0YSBUeXBlczwvYT5cbiAqL1xuZXhwb3J0IHR5cGUgU3RhbmRhcmREYXRhVHlwZSA9XG4gIHwgXCJpbnRlZ2VyXCJcbiAgfCBcIm51bWJlclwiXG4gIHwgXCJib29sZWFuXCJcbiAgfCBcInN0cmluZ1wiXG4gIHwgXCJvYmplY3RcIlxuICB8IFwiYXJyYXlcIlxuICA7XG5cbi8qKlxuICogU3RhbmRhcmQge0BsaW5rIERhdGFUeXBlfXMgcGx1cyB5b3VyIG93biB0eXBlcy9jbGFzc2VzLlxuICovXG5leHBvcnQgdHlwZSBEYXRhVHlwZSA9IFN0YW5kYXJkRGF0YVR5cGUgfCBzdHJpbmc7XG5cbi8qKlxuICogU3RhbmRhcmQgZm9ybWF0cyBhcyBkZWZpbmVkIGluIDxhIGhyZWY9XCJodHRwczovL3N3YWdnZXIuaW8vc3BlY2lmaWNhdGlvbi8jZGF0YS10eXBlc1wiPk9wZW5BUEkgU3BlY2lmaWNhdGlvbjogRGF0YSBUeXBlczwvYT5cbiAqL1xuZXhwb3J0IHR5cGUgU3RhbmRhcmREYXRhRm9ybWF0ID1cbiAgfCBcImludDMyXCJcbiAgfCBcImludDY0XCJcbiAgfCBcImZsb2F0XCJcbiAgfCBcImRvdWJsZVwiXG4gIHwgXCJieXRlXCJcbiAgfCBcImJpbmFyeVwiXG4gIHwgXCJkYXRlXCJcbiAgfCBcImRhdGUtdGltZVwiXG4gIHwgXCJwYXNzd29yZFwiXG4gIDtcblxuZXhwb3J0IHR5cGUgRGF0YUZvcm1hdCA9IFN0YW5kYXJkRGF0YUZvcm1hdCB8IHN0cmluZztcblxuLyoqXG4gKiBUaGUgcGFyYW1ldGVyIHRvIGVuY29kZS5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBQYXJhbSB7XG4gIG5hbWU6IHN0cmluZztcbiAgdmFsdWU6IHVua25vd247XG4gIGluOiBQYXJhbUxvY2F0aW9uO1xuICBzdHlsZTogUGFyYW1TdHlsZSxcbiAgZXhwbG9kZTogYm9vbGVhbjtcbiAgZGF0YVR5cGU6IERhdGFUeXBlO1xuICBkYXRhRm9ybWF0OiBEYXRhRm9ybWF0IHwgdW5kZWZpbmVkO1xufVxuIl19
|
|
@@ -6,4 +6,4 @@ export const COLLECTION_FORMATS = {
|
|
|
6
6
|
'ssv': ' ',
|
|
7
7
|
'pipes': '|'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaWFibGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc21hcnQtbmctY2xpZW50L3NyYy9saWIvdmlldy1jb250ZXh0L2FwaS92YXJpYWJsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUvQyxNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsSUFBSSxjQUFjLENBQVMsVUFBVSxDQUFDLENBQUM7QUFDaEUsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUc7SUFDOUIsS0FBSyxFQUFFLEdBQUc7SUFDVixLQUFLLEVBQUUsS0FBSztJQUNaLEtBQUssRUFBRSxHQUFHO0lBQ1YsT0FBTyxFQUFFLEdBQUc7Q0FDZixDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuZXhwb3J0IGNvbnN0IEJBU0VfUEFUSCA9IG5ldyBJbmplY3Rpb25Ub2tlbjxzdHJpbmc+KCdiYXNlUGF0aCcpO1xuZXhwb3J0IGNvbnN0IENPTExFQ1RJT05fRk9STUFUUyA9IHtcbiAgICAnY3N2JzogJywnLFxuICAgICd0c3YnOiAnICAgJyxcbiAgICAnc3N2JzogJyAnLFxuICAgICdwaXBlcyc6ICd8J1xufVxuIl19
|
|
@@ -3855,18 +3855,21 @@ class SmartFormService {
|
|
|
3855
3855
|
});
|
|
3856
3856
|
return properties;
|
|
3857
3857
|
}
|
|
3858
|
-
setValuesFromModel() {
|
|
3859
|
-
var _a
|
|
3858
|
+
setValuesFromModel(widgets) {
|
|
3859
|
+
var _a;
|
|
3860
3860
|
const smartForm = this.smartForm;
|
|
3861
|
-
const data = (
|
|
3861
|
+
const data = (_a = smartForm.componentModel) === null || _a === void 0 ? void 0 : _a.data;
|
|
3862
3862
|
if (!data) {
|
|
3863
3863
|
return;
|
|
3864
3864
|
}
|
|
3865
|
-
|
|
3865
|
+
if (!widgets) {
|
|
3866
|
+
widgets = smartForm.widgets;
|
|
3867
|
+
}
|
|
3868
|
+
const keys = this.collectKeysFromSmartForm(widgets, []);
|
|
3866
3869
|
let widget;
|
|
3867
3870
|
for (const key of this.getPropertyNamesDeeply(data)) {
|
|
3868
3871
|
if (keys.includes(key)) {
|
|
3869
|
-
widget = this.findSmartFormWidgetByKey(
|
|
3872
|
+
widget = this.findSmartFormWidgetByKey(widgets, key);
|
|
3870
3873
|
if (widget) {
|
|
3871
3874
|
let value = this.getValueDeeply(data, key);
|
|
3872
3875
|
if (typeof value === 'boolean' && widget.type !== SmartFormWidgetType.TOGGLE) {
|
|
@@ -3900,7 +3903,7 @@ class SmartFormService {
|
|
|
3900
3903
|
// In case of CheckBox2
|
|
3901
3904
|
let splittedKeys = key.split('.');
|
|
3902
3905
|
splittedKeys.splice(splittedKeys.length - 1, 1);
|
|
3903
|
-
widget = this.findSmartFormWidgetByKey(
|
|
3906
|
+
widget = this.findSmartFormWidgetByKey(widgets, splittedKeys.join('.'));
|
|
3904
3907
|
if (widget && widget.type === SmartFormWidgetType.CHECK_BOX_2) {
|
|
3905
3908
|
this.copyFromValueSetToValuesList(widget, smartForm.componentModel.valueSets);
|
|
3906
3909
|
if (widget.valueList) {
|
|
@@ -4155,7 +4158,7 @@ class SmartFormService {
|
|
|
4155
4158
|
(constraint) => this.antPathMatcher(constraint.dataName, widget.key));
|
|
4156
4159
|
if (widgetConstraints && widgetConstraints.length) {
|
|
4157
4160
|
widgetConstraints.forEach((constraint) => {
|
|
4158
|
-
var _a;
|
|
4161
|
+
var _a, _b, _c, _d;
|
|
4159
4162
|
if (constraint.visible === undefined) {
|
|
4160
4163
|
if (widget.isVisible === undefined) {
|
|
4161
4164
|
widget.isVisible = true;
|
|
@@ -4164,29 +4167,6 @@ class SmartFormService {
|
|
|
4164
4167
|
else {
|
|
4165
4168
|
widget.isVisible = constraint.visible;
|
|
4166
4169
|
}
|
|
4167
|
-
if (constraint.mandatory !== undefined && constraint.mandatory) {
|
|
4168
|
-
if (widget.type !== SmartFormWidgetType.INDICATOR &&
|
|
4169
|
-
widget.type !== SmartFormWidgetType.LABEL &&
|
|
4170
|
-
widget.type !== SmartFormWidgetType.CONTAINER &&
|
|
4171
|
-
widget.type !== SmartFormWidgetType.IMAGE &&
|
|
4172
|
-
widget.type !== SmartFormWidgetType.SVG &&
|
|
4173
|
-
widget.type !== SmartFormWidgetType.FILE_UPLOADER &&
|
|
4174
|
-
widget.type !== SmartFormWidgetType.DIVIDER &&
|
|
4175
|
-
widget.type !== SmartFormWidgetType.BUTTON &&
|
|
4176
|
-
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
4177
|
-
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
4178
|
-
widget.validators = [
|
|
4179
|
-
...((_a = widget.validators) !== null && _a !== void 0 ? _a : []),
|
|
4180
|
-
{
|
|
4181
|
-
validator: Validators.required,
|
|
4182
|
-
isCustom: false,
|
|
4183
|
-
errorMessage: '',
|
|
4184
|
-
name: 'required',
|
|
4185
|
-
},
|
|
4186
|
-
];
|
|
4187
|
-
this.removeEmptyItemFromValueList(widget);
|
|
4188
|
-
}
|
|
4189
|
-
}
|
|
4190
4170
|
if (widget.type !== SmartFormWidgetType.INDICATOR &&
|
|
4191
4171
|
widget.type !== SmartFormWidgetType.LABEL &&
|
|
4192
4172
|
widget.type !== SmartFormWidgetType.CONTAINER &&
|
|
@@ -4197,6 +4177,41 @@ class SmartFormService {
|
|
|
4197
4177
|
widget.type !== SmartFormWidgetType.BUTTON &&
|
|
4198
4178
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
4199
4179
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
4180
|
+
let validators = (_a = widget.validators) !== null && _a !== void 0 ? _a : [];
|
|
4181
|
+
let requiredIndex = validators.findIndex((v) => v.validator === Validators.required);
|
|
4182
|
+
let wasMandatory = requiredIndex >= 0;
|
|
4183
|
+
let tobeMandatory = false;
|
|
4184
|
+
if (constraint.mandatory === undefined) {
|
|
4185
|
+
// not specified on server, use client state
|
|
4186
|
+
tobeMandatory = wasMandatory;
|
|
4187
|
+
}
|
|
4188
|
+
else {
|
|
4189
|
+
tobeMandatory = constraint.mandatory;
|
|
4190
|
+
}
|
|
4191
|
+
if (!wasMandatory && tobeMandatory) {
|
|
4192
|
+
// add required validator
|
|
4193
|
+
widget.validators = [
|
|
4194
|
+
...validators,
|
|
4195
|
+
{
|
|
4196
|
+
validator: Validators.required,
|
|
4197
|
+
isCustom: false,
|
|
4198
|
+
errorMessage: '',
|
|
4199
|
+
name: 'required',
|
|
4200
|
+
},
|
|
4201
|
+
];
|
|
4202
|
+
// remove empty item
|
|
4203
|
+
this.removeEmptyItemFromValueList(widget);
|
|
4204
|
+
}
|
|
4205
|
+
if (wasMandatory && !tobeMandatory) {
|
|
4206
|
+
// remove required validator
|
|
4207
|
+
(_b = widget.validators) === null || _b === void 0 ? void 0 : _b.splice(requiredIndex, 1);
|
|
4208
|
+
// add empty item
|
|
4209
|
+
let emptyLabel = '';
|
|
4210
|
+
if ('selection' in widget) {
|
|
4211
|
+
emptyLabel = (_d = (_c = widget.selection) === null || _c === void 0 ? void 0 : _c.emptyLabel) !== null && _d !== void 0 ? _d : '';
|
|
4212
|
+
}
|
|
4213
|
+
this.addEmptyItemToValueList(widget, emptyLabel);
|
|
4214
|
+
}
|
|
4200
4215
|
if (constraint.enabled === undefined) {
|
|
4201
4216
|
if (widget.isDisabled === undefined) {
|
|
4202
4217
|
widget.isDisabled = false;
|
|
@@ -4242,22 +4257,28 @@ class SmartFormService {
|
|
|
4242
4257
|
// test the path against the generated regex
|
|
4243
4258
|
return regex.test(path);
|
|
4244
4259
|
}
|
|
4245
|
-
applyConstraints() {
|
|
4260
|
+
applyConstraints(widgets) {
|
|
4246
4261
|
var _a, _b, _c;
|
|
4247
4262
|
if (((_a = this.smartForm.componentModel) === null || _a === void 0 ? void 0 : _a.constraints) &&
|
|
4248
4263
|
((_b = this.smartForm.componentModel) === null || _b === void 0 ? void 0 : _b.constraints.length)) {
|
|
4264
|
+
if (!widgets) {
|
|
4265
|
+
widgets = this.smartForm.widgets;
|
|
4266
|
+
}
|
|
4249
4267
|
this.applyComponentConstraints(this.smartForm.widgets, (_c = this.smartForm.componentModel) === null || _c === void 0 ? void 0 : _c.constraints);
|
|
4250
4268
|
}
|
|
4251
4269
|
}
|
|
4252
4270
|
addEmptyItemToValueList(widget, emptyLabel) {
|
|
4253
4271
|
var _a;
|
|
4254
4272
|
if (widget.type == SmartFormWidgetType.SELECT) {
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4273
|
+
const containsEmptyKey = widget.valueList.some((v) => v.key === this.emptyKey);
|
|
4274
|
+
if (!containsEmptyKey) {
|
|
4275
|
+
(_a = widget.valueList) === null || _a === void 0 ? void 0 : _a.unshift({
|
|
4276
|
+
key: this.emptyKey,
|
|
4277
|
+
label: emptyLabel !== null && emptyLabel !== void 0 ? emptyLabel : '',
|
|
4278
|
+
type: SmartFormWidgetType.ITEM,
|
|
4279
|
+
value: '', // this should be undefined, but FormControl cannot be null, from v14 it will
|
|
4280
|
+
});
|
|
4281
|
+
}
|
|
4261
4282
|
}
|
|
4262
4283
|
}
|
|
4263
4284
|
removeEmptyItemFromValueList(widget) {
|
|
@@ -6096,11 +6117,11 @@ class SmartformComponent {
|
|
|
6096
6117
|
this.onValueChangeSubject = new SmartSubject(this._destroy$);
|
|
6097
6118
|
}
|
|
6098
6119
|
this.service.smartForm = this.smartForm;
|
|
6099
|
-
this.service.setValuesFromModel();
|
|
6100
|
-
this.service.applyConstraints();
|
|
6101
6120
|
if (!this.originalWidgets || this.originalWidgets.length === 0) {
|
|
6102
6121
|
this.originalWidgets = this.smartForm.widgets;
|
|
6103
6122
|
}
|
|
6123
|
+
this.service.setValuesFromModel(this.originalWidgets);
|
|
6124
|
+
this.service.applyConstraints(this.originalWidgets);
|
|
6104
6125
|
this.smartForm.widgets = this.service.filterWidgetsByVisibility(this.originalWidgets);
|
|
6105
6126
|
this.form = this.service.toFormGroup();
|
|
6106
6127
|
if (this.smartForm.translateService) {
|