@smartbit4all/ng-client 2.2.1 → 3.0.0
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/component-factory-service/component-factory-service.module.mjs +17 -0
- package/esm2020/lib/component-factory-service/component-factory-service.service.mjs +35 -0
- package/esm2020/lib/component-factory-service/projects.mjs +6 -0
- package/esm2020/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.component.mjs +1 -1
- package/esm2020/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.service.mjs +5 -5
- package/esm2020/lib/session/dev-tool/smart-dev-tool-floating-button/smart-dev-tool-floating-button.component.mjs +1 -1
- package/esm2020/lib/session/dev-tool/smart-dev-tool.service.mjs +2 -2
- package/esm2020/lib/session/smart-session.module.mjs +18 -18
- package/esm2020/lib/session/smart-session.service.mjs +2 -2
- package/esm2020/lib/session/smart-timer/smart-session-timer.service.mjs +2 -2
- package/esm2020/lib/smart-client/smart-authentication.service.mjs +2 -2
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +4 -5
- package/esm2020/lib/smart-client/smart-file-uploader/smart-file-uploader.component.mjs +2 -2
- package/esm2020/lib/smart-component-layout/api/api/api.mjs +4 -0
- package/esm2020/lib/smart-component-layout/api/api/default.service.mjs +133 -0
- package/esm2020/lib/smart-component-layout/api/api.module.mjs +40 -0
- package/esm2020/lib/smart-component-layout/api/configuration.mjs +91 -0
- package/esm2020/lib/smart-component-layout/api/encoder.mjs +19 -0
- package/esm2020/lib/smart-component-layout/api/index.mjs +7 -0
- package/esm2020/lib/smart-component-layout/api/model/componentType.mjs +17 -0
- package/esm2020/lib/smart-component-layout/api/model/componentWidgetType.mjs +17 -0
- package/esm2020/lib/smart-component-layout/api/model/layoutDirection.mjs +16 -0
- package/esm2020/lib/smart-component-layout/api/model/models.mjs +6 -0
- package/esm2020/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.mjs +2 -0
- package/esm2020/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +2 -0
- package/esm2020/lib/smart-component-layout/api/param.mjs +2 -0
- package/esm2020/lib/smart-component-layout/api/variables.mjs +9 -0
- package/esm2020/lib/smart-component-layout/projects.mjs +8 -0
- package/esm2020/lib/smart-component-layout/smart-component-layout-utility.mjs +7 -0
- package/esm2020/lib/smart-component-layout/smart-component-layout.component.mjs +123 -0
- package/esm2020/lib/smart-component-layout/smart-component-layout.module.mjs +43 -0
- package/esm2020/lib/smart-dialog/projects.mjs +8 -0
- package/esm2020/lib/smart-dialog/smartdialog.component.mjs +54 -0
- package/esm2020/lib/smart-dialog/smartdialog.model.mjs +16 -0
- package/esm2020/lib/smart-dialog/smartdialog.module.mjs +49 -0
- package/esm2020/lib/smart-dialog/smartdialog.service.mjs +60 -0
- package/esm2020/lib/smart-expandable-section/expandable-section.component.mjs +82 -0
- package/esm2020/lib/smart-expandable-section/expandable-section.model.mjs +12 -0
- package/esm2020/lib/smart-expandable-section/projects.mjs +8 -0
- package/esm2020/lib/smart-expandable-section/smart-expandable-section.module.mjs +51 -0
- package/esm2020/lib/smart-expandable-section/smart-expandable-section.service.mjs +14 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.mjs +16 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderField.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.mjs +9 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionData.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionDataType.mjs +19 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionField.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldList.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.mjs +25 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionList.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperandData.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperation.mjs +31 -0
- package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOrderBy.mjs +19 -0
- package/esm2020/lib/smart-filter/api/filter/model/model.mjs +16 -0
- package/esm2020/lib/smart-filter/api/filter/model/searchIndexObjectDefinitionData.mjs +2 -0
- package/esm2020/lib/smart-filter/api/filter/model/searchIndexPropertyDefinitionData.mjs +13 -0
- package/esm2020/lib/smart-filter/api/value/model/value.mjs +13 -0
- package/esm2020/lib/smart-filter/projects.mjs +9 -0
- package/esm2020/lib/smart-filter/smart-filter/components/smart-filter-expression-field/smart-filter-expression-field.component.mjs +14 -0
- package/esm2020/lib/smart-filter/smart-filter/components/smart-filter-simple/components/smart-filter-simple-field/smart-filter-simple-field.component.mjs +159 -0
- package/esm2020/lib/smart-filter/smart-filter/components/smart-filter-simple/smart-filter-simple.component.mjs +45 -0
- package/esm2020/lib/smart-filter/smart-filter/smart-filter.component.mjs +36 -0
- package/esm2020/lib/smart-filter/smart-filter/smart-filter.service.mjs +31 -0
- package/esm2020/lib/smart-filter/smart-filter.model.mjs +13 -0
- package/esm2020/lib/smart-filter/smart-filter.module.mjs +33 -0
- package/esm2020/lib/smart-form/api/api/api.mjs +4 -0
- package/esm2020/lib/smart-form/api/api/default.service.mjs +133 -0
- package/esm2020/lib/smart-form/api/api.module.mjs +40 -0
- package/esm2020/lib/smart-form/api/configuration.mjs +91 -0
- package/esm2020/lib/smart-form/api/encoder.mjs +19 -0
- package/esm2020/lib/smart-form/api/index.mjs +7 -0
- package/esm2020/lib/smart-form/api/model/models.mjs +8 -0
- package/esm2020/lib/smart-form/api/model/propertyMapping.mjs +13 -0
- package/esm2020/lib/smart-form/api/model/selectionDefinition.mjs +8 -0
- package/esm2020/lib/smart-form/api/model/smartFormWidgetDirection.mjs +16 -0
- package/esm2020/lib/smart-form/api/model/smartFormWidgetType.mjs +44 -0
- package/esm2020/lib/smart-form/api/model/smartLayoutDefinition.mjs +2 -0
- package/esm2020/lib/smart-form/api/model/smartMatrixModel.mjs +2 -0
- package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +2 -0
- package/esm2020/lib/smart-form/api/param.mjs +2 -0
- package/esm2020/lib/smart-form/api/variables.mjs +9 -0
- package/esm2020/lib/smart-form/projects.mjs +13 -0
- package/esm2020/lib/smart-form/services/smartform.layout-definition.service.mjs +397 -0
- package/esm2020/lib/smart-form/services/smartform.service.mjs +483 -0
- package/esm2020/lib/smart-form/smartfileuploader/large-file-snack-bar/large-file-snack-bar.component.mjs +14 -0
- package/esm2020/lib/smart-form/smartfileuploader/smartfileuploader.component.mjs +78 -0
- package/esm2020/lib/smart-form/smartfileuploader/smartfileuploader.model.mjs +2 -0
- package/esm2020/lib/smart-form/smartform.component.mjs +117 -0
- package/esm2020/lib/smart-form/smartform.form-model.mjs +2 -0
- package/esm2020/lib/smart-form/smartform.model.mjs +38 -0
- package/esm2020/lib/smart-form/smartform.module.mjs +146 -0
- package/esm2020/lib/smart-form/widgets/components/smart-month-picker/smart-month-picker.component.mjs +76 -0
- package/esm2020/lib/smart-form/widgets/smartformwidget/smartformwidget.component.mjs +589 -0
- package/esm2020/lib/smart-form/widgets/smartformwidget/sortable-widget/sortable-widget.component.mjs +59 -0
- package/esm2020/lib/smart-form/widgets/smartformwidget/trackCaps.directive.mjs +31 -0
- package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +4 -0
- package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +372 -0
- package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +40 -0
- package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +72 -0
- package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +19 -0
- package/esm2020/lib/smart-grid/api/grid-api/index.mjs +6 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +13 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +21 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +17 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +16 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +2 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +8 -0
- package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +12 -0
- package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +9 -0
- package/esm2020/lib/smart-grid/components/expandable-grid/expandable-grid.component.mjs +20 -0
- package/esm2020/lib/smart-grid/components/smart-grid-card/smart-grid-card.component.mjs +56 -0
- package/esm2020/lib/smart-grid/components/table-layout-definer/table-layout-definer.component.mjs +166 -0
- package/esm2020/lib/smart-grid/models/model.mjs +28 -0
- package/esm2020/lib/smart-grid/projects.mjs +9 -0
- package/esm2020/lib/smart-grid/smart-grid.component.mjs +452 -0
- package/esm2020/lib/smart-grid/smart-grid.module.mjs +69 -0
- package/esm2020/lib/smart-grid/smart-grid.service.mjs +71 -0
- package/esm2020/lib/smart-icon/projects.mjs +7 -0
- package/esm2020/lib/smart-icon/smart-icon/smart-icon.component.mjs +48 -0
- package/esm2020/lib/smart-icon/smart-icon.module.mjs +22 -0
- package/esm2020/lib/smart-icon/smart-icon.service.mjs +45 -0
- package/esm2020/lib/smart-navbar/projects.mjs +8 -0
- package/esm2020/lib/smart-navbar/smart-navbar.component.mjs +61 -0
- package/esm2020/lib/smart-navbar/smart-navbar.model.mjs +6 -0
- package/esm2020/lib/smart-navbar/smart-navbar.module.mjs +65 -0
- package/esm2020/lib/smart-navbar/smart-navbar.service.mjs +14 -0
- package/esm2020/lib/smart-navigation/projects.mjs +6 -0
- package/esm2020/lib/smart-navigation/smart-navigation.interface.mjs +2 -0
- package/esm2020/lib/smart-navigation/smart-navigation.module.mjs +18 -0
- package/esm2020/lib/smart-navigation/smart-navigation.service.mjs +56 -0
- package/esm2020/lib/smart-ng-client.module.mjs +16 -4
- package/esm2020/lib/smart-subject/projects.mjs +5 -0
- package/esm2020/lib/smart-subject/smart-subject.mjs +21 -0
- package/esm2020/lib/smart-tab-group/projects.mjs +8 -0
- package/esm2020/lib/smart-tab-group/smart-tab-group.component.mjs +43 -0
- package/esm2020/lib/smart-tab-group/smart-tab-group.module.mjs +25 -0
- package/esm2020/lib/smart-tab-group/smart-tab-group.service.mjs +14 -0
- package/esm2020/lib/smart-tab-group/tab-content/tab-content.component.mjs +31 -0
- package/esm2020/lib/smart-tab-group/tab-group-simplified/tab-group.component.mjs +66 -0
- package/esm2020/lib/smart-tab-group/tabTile.model.mjs +2 -0
- package/esm2020/lib/smart-table/components/loading/loading.component.mjs +15 -0
- package/esm2020/lib/smart-table/projects.mjs +9 -0
- package/esm2020/lib/smart-table/smarttable.component.mjs +98 -0
- package/esm2020/lib/smart-table/smarttable.date-pipe.mjs +43 -0
- package/esm2020/lib/smart-table/smarttable.model.mjs +167 -0
- package/esm2020/lib/smart-table/smarttable.module.mjs +89 -0
- package/esm2020/lib/smart-table/smarttable.service.mjs +14 -0
- package/esm2020/lib/smart-table/tables/material-table/material-table.component.mjs +36 -0
- package/esm2020/lib/smart-table/tables/mobile-table/mobile-table.component.mjs +22 -0
- package/esm2020/lib/smart-table/tables/table.mjs +411 -0
- package/esm2020/lib/smart-tree/smarttree.component.mjs +2 -2
- package/esm2020/lib/smart-tree/smarttree.model.mjs +1 -1
- package/esm2020/lib/smart-tree/smarttree.module.mjs +2 -2
- package/esm2020/lib/smart-tree/smarttree.service.interface.mjs +1 -1
- package/esm2020/lib/smart-tree/smarttree.service.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/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/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-confirm-dialog/ui-action-confirm-dialog.component.mjs +1 -1
- package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-confirm-dialog/ui-action-confirm-dialog.service.mjs +3 -3
- package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-file-upload-dialog/ui-action-file-upload-dialog.component.mjs +3 -3
- package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-file-upload-dialog/ui-action-file-upload-dialog.service.mjs +3 -3
- package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.component.mjs +8 -7
- package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.service.mjs +3 -3
- package/esm2020/lib/view-context/smart-ui-action/ui-action-toolbar.component.mjs +4 -3
- package/esm2020/lib/view-context/smart-ui-action/ui-action.descriptor.service.mjs +2 -2
- package/esm2020/lib/view-context/smart-ui-action/ui-action.model.mjs +1 -1
- package/esm2020/lib/view-context/smart-ui-action/ui-action.service.mjs +2 -2
- package/esm2020/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.mjs +2 -2
- package/esm2020/lib/view-context/smart-view-context.module.mjs +3 -3
- package/esm2020/lib/view-context/smart-view-context.service.mjs +4 -4
- package/esm2020/lib/view-context/smart-view-redirect/smart-view-redirect.mjs +9 -9
- package/esm2020/lib/view-context/value-api/model/valueSetData.mjs +1 -1
- package/esm2020/projects.mjs +15 -3
- package/fesm2015/smartbit4all-ng-client.mjs +9465 -3578
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +9275 -3460
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/component-factory-service/component-factory-service.module.d.ts +6 -0
- package/lib/component-factory-service/component-factory-service.service.d.ts +13 -0
- package/lib/component-factory-service/projects.d.ts +2 -0
- package/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.service.d.ts +1 -1
- package/lib/session/smart-session.module.d.ts +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +3 -4
- package/lib/smart-client/smart-file-uploader/smart-file-uploader.component.d.ts +3 -3
- package/lib/smart-component-layout/api/api/api.d.ts +3 -0
- package/lib/smart-component-layout/api/api/default.service.d.ts +33 -0
- package/lib/smart-component-layout/api/api.module.d.ts +11 -0
- package/lib/smart-component-layout/api/configuration.d.ts +104 -0
- package/lib/smart-component-layout/api/encoder.d.ts +11 -0
- package/lib/smart-component-layout/api/index.d.ts +6 -0
- package/lib/smart-component-layout/api/model/componentType.d.ts +17 -0
- package/lib/smart-component-layout/api/model/componentWidgetType.d.ts +17 -0
- package/lib/smart-component-layout/api/model/layoutDirection.d.ts +16 -0
- package/lib/smart-component-layout/api/model/models.d.ts +5 -0
- package/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.d.ts +29 -0
- package/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.d.ts +21 -0
- package/lib/smart-component-layout/api/param.d.ts +37 -0
- package/lib/smart-component-layout/api/variables.d.ts +8 -0
- package/lib/smart-component-layout/projects.d.ts +4 -0
- package/lib/smart-component-layout/smart-component-layout-utility.d.ts +4 -0
- package/lib/smart-component-layout/smart-component-layout.component.d.ts +35 -0
- package/lib/smart-component-layout/smart-component-layout.module.d.ts +13 -0
- package/lib/smart-dialog/projects.d.ts +4 -0
- package/lib/smart-dialog/smartdialog.component.d.ts +19 -0
- package/lib/smart-dialog/smartdialog.model.d.ts +67 -0
- package/lib/smart-dialog/smartdialog.module.d.ts +14 -0
- package/lib/smart-dialog/smartdialog.service.d.ts +20 -0
- package/lib/smart-expandable-section/expandable-section.component.d.ts +25 -0
- package/lib/smart-expandable-section/expandable-section.model.d.ts +40 -0
- package/lib/smart-expandable-section/projects.d.ts +4 -0
- package/lib/smart-expandable-section/smart-expandable-section.module.d.ts +15 -0
- package/lib/smart-expandable-section/smart-expandable-section.service.d.ts +6 -0
- package/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.d.ts +16 -0
- package/lib/smart-filter/api/filter/model/filterExpressionBuilderField.d.ts +27 -0
- package/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.d.ts +39 -0
- package/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.d.ts +21 -0
- package/lib/smart-filter/api/filter/model/filterExpressionData.d.ts +27 -0
- package/lib/smart-filter/api/filter/model/filterExpressionDataType.d.ts +19 -0
- package/lib/smart-filter/api/filter/model/filterExpressionField.d.ts +37 -0
- package/lib/smart-filter/api/filter/model/filterExpressionFieldList.d.ts +21 -0
- package/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.d.ts +25 -0
- package/lib/smart-filter/api/filter/model/filterExpressionList.d.ts +18 -0
- package/lib/smart-filter/api/filter/model/filterExpressionOperandData.d.ts +24 -0
- package/lib/smart-filter/api/filter/model/filterExpressionOperation.d.ts +31 -0
- package/lib/smart-filter/api/filter/model/filterExpressionOrderBy.d.ts +28 -0
- package/lib/smart-filter/api/filter/model/model.d.ts +15 -0
- package/lib/smart-filter/api/filter/model/searchIndexObjectDefinitionData.d.ts +19 -0
- package/lib/smart-filter/api/filter/model/searchIndexPropertyDefinitionData.d.ts +18 -0
- package/lib/smart-filter/api/value/model/value.d.ts +29 -0
- package/lib/smart-filter/projects.d.ts +5 -0
- package/lib/smart-filter/smart-filter/components/smart-filter-expression-field/smart-filter-expression-field.component.d.ts +8 -0
- package/lib/smart-filter/smart-filter/components/smart-filter-simple/components/smart-filter-simple-field/smart-filter-simple-field.component.d.ts +31 -0
- package/lib/smart-filter/smart-filter/components/smart-filter-simple/smart-filter-simple.component.d.ts +18 -0
- package/lib/smart-filter/smart-filter/smart-filter.component.d.ts +15 -0
- package/lib/smart-filter/smart-filter/smart-filter.service.d.ts +16 -0
- package/lib/smart-filter/smart-filter.model.d.ts +25 -0
- package/lib/smart-filter/smart-filter.module.d.ts +15 -0
- package/lib/smart-form/api/api/api.d.ts +3 -0
- package/lib/smart-form/api/api/default.service.d.ts +33 -0
- package/lib/smart-form/api/api.module.d.ts +11 -0
- package/lib/smart-form/api/configuration.d.ts +104 -0
- package/lib/smart-form/api/encoder.d.ts +11 -0
- package/lib/smart-form/api/index.d.ts +6 -0
- package/lib/smart-form/api/model/models.d.ts +7 -0
- package/lib/smart-form/api/model/propertyMapping.d.ts +24 -0
- package/lib/smart-form/api/model/selectionDefinition.d.ts +40 -0
- package/lib/smart-form/api/model/smartFormWidgetDirection.d.ts +16 -0
- package/lib/smart-form/api/model/smartFormWidgetType.d.ts +42 -0
- package/lib/smart-form/api/model/smartLayoutDefinition.d.ts +15 -0
- package/lib/smart-form/api/model/smartMatrixModel.d.ts +28 -0
- package/lib/smart-form/api/model/smartWidgetDefinition.d.ts +77 -0
- package/lib/smart-form/api/param.d.ts +37 -0
- package/lib/smart-form/api/variables.d.ts +8 -0
- package/lib/smart-form/projects.d.ts +9 -0
- package/lib/smart-form/services/smartform.layout-definition.service.d.ts +40 -0
- package/lib/smart-form/services/smartform.service.d.ts +29 -0
- package/lib/smart-form/smartfileuploader/large-file-snack-bar/large-file-snack-bar.component.d.ts +8 -0
- package/lib/smart-form/smartfileuploader/smartfileuploader.component.d.ts +22 -0
- package/lib/smart-form/smartfileuploader/smartfileuploader.model.d.ts +7 -0
- package/lib/smart-form/smartform.component.d.ts +33 -0
- package/lib/smart-form/smartform.form-model.d.ts +521 -0
- package/lib/smart-form/smartform.model.d.ts +120 -0
- package/lib/smart-form/smartform.module.d.ts +34 -0
- package/lib/smart-form/widgets/components/smart-month-picker/smart-month-picker.component.d.ts +29 -0
- package/lib/smart-form/widgets/smartformwidget/smartformwidget.component.d.ts +84 -0
- package/lib/smart-form/widgets/smartformwidget/sortable-widget/sortable-widget.component.d.ts +20 -0
- package/lib/smart-form/widgets/smartformwidget/trackCaps.directive.d.ts +9 -0
- package/lib/smart-grid/api/grid-api/api/api.d.ts +3 -0
- package/lib/smart-grid/api/grid-api/api/grid.service.d.ts +140 -0
- package/lib/smart-grid/api/grid-api/api.module.d.ts +11 -0
- package/lib/smart-grid/api/grid-api/configuration.d.ts +80 -0
- package/lib/smart-grid/api/grid-api/encoder.d.ts +11 -0
- package/lib/smart-grid/api/grid-api/index.d.ts +5 -0
- package/lib/smart-grid/api/grid-api/model/gridColumnMeta.d.ts +18 -0
- package/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.d.ts +35 -0
- package/lib/smart-grid/api/grid-api/model/gridModel.d.ts +30 -0
- package/lib/smart-grid/api/grid-api/model/gridPage.d.ts +26 -0
- package/lib/smart-grid/api/grid-api/model/gridRow.d.ts +22 -0
- package/lib/smart-grid/api/grid-api/model/gridSelectionMode.d.ts +17 -0
- package/lib/smart-grid/api/grid-api/model/gridSelectionType.d.ts +16 -0
- package/lib/smart-grid/api/grid-api/model/gridServerModel.d.ts +20 -0
- package/lib/smart-grid/api/grid-api/model/gridUpdateData.d.ts +19 -0
- package/lib/smart-grid/api/grid-api/model/gridView.d.ts +21 -0
- package/lib/smart-grid/api/grid-api/model/gridViewDescriptor.d.ts +33 -0
- package/lib/smart-grid/api/grid-api/model/models.d.ts +11 -0
- package/lib/smart-grid/api/grid-api/variables.d.ts +8 -0
- package/lib/smart-grid/components/expandable-grid/expandable-grid.component.d.ts +10 -0
- package/lib/smart-grid/components/smart-grid-card/smart-grid-card.component.d.ts +21 -0
- package/lib/smart-grid/components/table-layout-definer/table-layout-definer.component.d.ts +40 -0
- package/lib/smart-grid/models/model.d.ts +70 -0
- package/lib/smart-grid/projects.d.ts +5 -0
- package/lib/smart-grid/smart-grid.component.d.ts +67 -0
- package/lib/smart-grid/smart-grid.module.d.ts +20 -0
- package/lib/smart-grid/smart-grid.service.d.ts +26 -0
- package/lib/smart-icon/projects.d.ts +3 -0
- package/lib/smart-icon/smart-icon/smart-icon.component.d.ts +17 -0
- package/lib/smart-icon/smart-icon.module.d.ts +10 -0
- package/lib/smart-icon/smart-icon.service.d.ts +21 -0
- package/lib/smart-navbar/projects.d.ts +4 -0
- package/lib/smart-navbar/smart-navbar.component.d.ts +20 -0
- package/lib/smart-navbar/smart-navbar.model.d.ts +48 -0
- package/lib/smart-navbar/smart-navbar.module.d.ts +18 -0
- package/lib/smart-navbar/smart-navbar.service.d.ts +6 -0
- package/lib/smart-navigation/projects.d.ts +2 -0
- package/lib/smart-navigation/smart-navigation.interface.d.ts +11 -0
- package/lib/smart-navigation/smart-navigation.module.d.ts +6 -0
- package/lib/smart-navigation/smart-navigation.service.d.ts +18 -0
- package/lib/smart-ng-client.module.d.ts +9 -6
- package/lib/smart-subject/projects.d.ts +1 -0
- package/lib/smart-subject/smart-subject.d.ts +6 -0
- package/lib/smart-tab-group/projects.d.ts +4 -0
- package/lib/smart-tab-group/smart-tab-group.component.d.ts +21 -0
- package/lib/smart-tab-group/smart-tab-group.module.d.ts +13 -0
- package/lib/smart-tab-group/smart-tab-group.service.d.ts +6 -0
- package/lib/smart-tab-group/tab-content/tab-content.component.d.ts +14 -0
- package/lib/smart-tab-group/tab-group-simplified/tab-group.component.d.ts +29 -0
- package/lib/smart-tab-group/tabTile.model.d.ts +8 -0
- package/lib/smart-table/components/loading/loading.component.d.ts +8 -0
- package/lib/smart-table/projects.d.ts +5 -0
- package/lib/smart-table/smarttable.component.d.ts +34 -0
- package/lib/smart-table/smarttable.date-pipe.d.ts +18 -0
- package/lib/smart-table/smarttable.model.d.ts +183 -0
- package/lib/smart-table/smarttable.module.d.ts +23 -0
- package/lib/smart-table/smarttable.service.d.ts +6 -0
- package/lib/smart-table/tables/material-table/material-table.component.d.ts +8 -0
- package/lib/smart-table/tables/mobile-table/mobile-table.component.d.ts +8 -0
- package/lib/smart-table/tables/table.d.ts +59 -0
- package/lib/smart-tree/smarttree.component.d.ts +1 -1
- package/lib/smart-tree/smarttree.model.d.ts +1 -1
- package/lib/smart-tree/smarttree.module.d.ts +1 -1
- package/lib/smart-tree/smarttree.service.d.ts +1 -1
- package/lib/smart-tree/smarttree.service.interface.d.ts +1 -1
- package/lib/view-context/api/model/componentModel.d.ts +3 -2
- package/lib/view-context/api/model/view.d.ts +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-confirm-dialog/ui-action-confirm-dialog.service.d.ts +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-file-upload-dialog/ui-action-file-upload-dialog.component.d.ts +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-file-upload-dialog/ui-action-file-upload-dialog.service.d.ts +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.component.d.ts +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.service.d.ts +1 -1
- package/lib/view-context/smart-ui-action/ui-action-toolbar.component.d.ts +1 -1
- package/lib/view-context/smart-ui-action/ui-action.model.d.ts +3 -1
- package/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.d.ts +1 -1
- package/lib/view-context/smart-view-context.module.d.ts +2 -2
- package/lib/view-context/smart-view-context.service.d.ts +3 -3
- package/lib/view-context/smart-view-redirect/smart-view-redirect.d.ts +3 -3
- package/lib/view-context/value-api/model/valueSetData.d.ts +1 -1
- package/package.json +1 -4
- package/projects.d.ts +14 -2
- package/smartbit4all-ng-client-3.0.0.tgz +0 -0
- package/src/lib/component-factory-service/README.md +99 -0
- package/src/lib/smart-component-layout/README.md +31 -0
- package/src/lib/smart-component-layout/api/README.md +226 -0
- package/src/lib/smart-dialog/README.md +197 -0
- package/src/lib/smart-expandable-section/README.md +249 -0
- package/src/lib/smart-filter/README.md +101 -0
- package/src/lib/smart-form/README.md +1178 -0
- package/src/lib/smart-form/api/README.md +226 -0
- package/src/lib/smart-grid/README.md +24 -0
- package/src/lib/smart-grid/api/grid-api/README.md +203 -0
- package/src/lib/smart-icon/README.md +116 -0
- package/src/lib/smart-navbar/README.md +119 -0
- package/src/lib/smart-navigation/README.md +141 -0
- package/src/lib/smart-tab-group/README.md +155 -0
- package/src/lib/smart-table/README.md +667 -0
- package/src/lib/view-context/api/README.md +226 -226
- package/esm2020/lib/smart-client/projects.mjs +0 -5
- package/esm2020/lib/smart-client/smart.component.mjs +0 -30
- package/esm2020/lib/smart-client/smart.service.mjs +0 -30
- package/lib/smart-client/projects.d.ts +0 -4
- package/lib/smart-client/smart.component.d.ts +0 -11
- package/lib/smart-client/smart.service.d.ts +0 -11
- package/smartbit4all-ng-client-2.2.1.tgz +0 -0
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
# Smart Form
|
|
2
|
+
|
|
3
|
+
Stable version: 1.6.8
|
|
4
|
+
|
|
5
|
+
## References
|
|
6
|
+
|
|
7
|
+
These packages must be updated in case of a new version:
|
|
8
|
+
|
|
9
|
+
- [_@smartbit4all/dialog_](https://www.npmjs.com/package/@smartbit4all/dialog)
|
|
10
|
+
- [_@smartbit4all/view-context_](https://www.npmjs.com/package/@smartbit4all/view-context)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## How to use
|
|
15
|
+
|
|
16
|
+
### Installation
|
|
17
|
+
|
|
18
|
+
Go to your project, open the terminal and use the following command:
|
|
19
|
+
|
|
20
|
+
npm i moment
|
|
21
|
+
|
|
22
|
+
npm i @angular/material-moment-adapter@13.3.9
|
|
23
|
+
|
|
24
|
+
npm i @angular-material-components/datetime-picker@7.0.1
|
|
25
|
+
|
|
26
|
+
npm i ngx-mask@13.1.15
|
|
27
|
+
|
|
28
|
+
npm i @smartbit4all/form
|
|
29
|
+
|
|
30
|
+
Then import it in the AppModule:
|
|
31
|
+
|
|
32
|
+
`app.module.ts:`
|
|
33
|
+
|
|
34
|
+
import { SmartformModule } from '@smartbit4all/form';
|
|
35
|
+
...
|
|
36
|
+
@NgModule({
|
|
37
|
+
declarations: [...]
|
|
38
|
+
imports: [
|
|
39
|
+
...
|
|
40
|
+
SmartformModule,
|
|
41
|
+
]
|
|
42
|
+
...
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
### Usage
|
|
46
|
+
|
|
47
|
+
`example.component.html`
|
|
48
|
+
|
|
49
|
+
<div *ngIf="form">
|
|
50
|
+
<smartform #smartFilter [smartForm]="form"></smartform>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
`example.component.ts`
|
|
54
|
+
|
|
55
|
+
// smartFilter
|
|
56
|
+
@ViewChild("smartFilter") smartFilterChild!: SmartformComponent;
|
|
57
|
+
form!: SmartForm;
|
|
58
|
+
|
|
59
|
+
model?: RegistrationForm;
|
|
60
|
+
|
|
61
|
+
myValidator(group: any): ValidatorFn {
|
|
62
|
+
return fieldMatchingValidator(
|
|
63
|
+
group,
|
|
64
|
+
"registrationData.password",
|
|
65
|
+
"registrationData.confirmPassword"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
constructor() {
|
|
70
|
+
this.constructForm();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async constructForm(): Promise<void> {
|
|
74
|
+
this.model = await this.apiCall();
|
|
75
|
+
|
|
76
|
+
let nationalities: any = {
|
|
77
|
+
europe: {
|
|
78
|
+
displayValue: "Europe",
|
|
79
|
+
countries: [
|
|
80
|
+
{
|
|
81
|
+
displayValue: "Hungarian",
|
|
82
|
+
objectUri: "hungarian",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayValue: "German",
|
|
86
|
+
objectUri: "german",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
northAmerica: {
|
|
91
|
+
displayValue: "North America",
|
|
92
|
+
countries: [
|
|
93
|
+
{
|
|
94
|
+
displayValue: "American",
|
|
95
|
+
objectUri: "usa",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayValue: "Canadian",
|
|
99
|
+
objectUri: "canada",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
this.form = {
|
|
106
|
+
direction: SmartFormWidgetDirection.COL,
|
|
107
|
+
model: this.model,
|
|
108
|
+
useOnValueChangeEvent: true,
|
|
109
|
+
useOnBlurEvent: true,
|
|
110
|
+
validators: [
|
|
111
|
+
{
|
|
112
|
+
validator: this.myValidator.bind(this),
|
|
113
|
+
errorMessage: "The passwords are not the same",
|
|
114
|
+
name: SmartValidatorName.fieldMatchingValidator,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
widgets: [
|
|
118
|
+
{
|
|
119
|
+
key: "registrationData.email",
|
|
120
|
+
label: "Email",
|
|
121
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
122
|
+
showLabel: true,
|
|
123
|
+
validators: [
|
|
124
|
+
{
|
|
125
|
+
validator: Validators.required,
|
|
126
|
+
errorMessage: "This field is mandatory",
|
|
127
|
+
isCustom: false,
|
|
128
|
+
name: "required",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
validator: Validators.email,
|
|
132
|
+
errorMessage: "This is not a valid email",
|
|
133
|
+
isCustom: false,
|
|
134
|
+
name: "email",
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
key: "registrationData.password",
|
|
140
|
+
label: "Password",
|
|
141
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
142
|
+
showLabel: true,
|
|
143
|
+
isPassword: true,
|
|
144
|
+
validators: [
|
|
145
|
+
{
|
|
146
|
+
validator: Validators.required,
|
|
147
|
+
errorMessage: "This field is mandatory",
|
|
148
|
+
name: SmartValidatorName.required,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
validator: Validators.minLength(8),
|
|
152
|
+
errorMessage: "The password must be at least 8 characters",
|
|
153
|
+
name: SmartValidatorName.minLength,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "registrationData.confirmPassword",
|
|
159
|
+
label: "Confirm password",
|
|
160
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
161
|
+
showLabel: true,
|
|
162
|
+
isPassword: true,
|
|
163
|
+
validators: [
|
|
164
|
+
{
|
|
165
|
+
validator: Validators.required,
|
|
166
|
+
errorMessage: "This field is mandatory",
|
|
167
|
+
name: SmartValidatorName.required,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
validator: Validators.minLength(8),
|
|
171
|
+
errorMessage: "The password must be at least 8 characters",
|
|
172
|
+
name: SmartValidatorName.minLength,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
key: "registrationData.phone",
|
|
178
|
+
label: "Phone",
|
|
179
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
180
|
+
showLabel: true,
|
|
181
|
+
mask: "+00-00-000-0000",
|
|
182
|
+
validators: [
|
|
183
|
+
{
|
|
184
|
+
validator: Validators.required,
|
|
185
|
+
errorMessage: "This field is mandatory",
|
|
186
|
+
name: SmartValidatorName.required,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
validator: this.phoneNumberValidator("36"),
|
|
190
|
+
errorMessage: "This is not a valid phone number",
|
|
191
|
+
isCustom: true,
|
|
192
|
+
name: "validPhoneNumber",
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
key: "registrationData.dateOfBirth",
|
|
198
|
+
label: "Date of birth",
|
|
199
|
+
type: SmartFormWidgetType.DATE_PICKER,
|
|
200
|
+
showLabel: true,
|
|
201
|
+
validators: [
|
|
202
|
+
{
|
|
203
|
+
validator: Validators.required,
|
|
204
|
+
errorMessage: "This field is mandatory",
|
|
205
|
+
name: SmartValidatorName.required,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
key: "registrationData.nationality",
|
|
211
|
+
label: "Nationality",
|
|
212
|
+
type: SmartFormWidgetType.SELECT,
|
|
213
|
+
showLabel: true,
|
|
214
|
+
validators: [
|
|
215
|
+
{
|
|
216
|
+
validator: Validators.required,
|
|
217
|
+
errorMessage: "This field is mandatory",
|
|
218
|
+
name: SmartValidatorName.required,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
valueList: Object.keys(nationalities).map((key: string) => {
|
|
222
|
+
return {
|
|
223
|
+
key: key,
|
|
224
|
+
label: nationalities[key].displayValue,
|
|
225
|
+
type: SmartFormWidgetType.ITEM_GROUP,
|
|
226
|
+
valueList: nationalities[key].countries.map((value: Value) => {
|
|
227
|
+
return {
|
|
228
|
+
key: value.objectUri,
|
|
229
|
+
label: value.displayValue,
|
|
230
|
+
type: SmartFormWidgetType.ITEM,
|
|
231
|
+
value: value.objectUri,
|
|
232
|
+
};
|
|
233
|
+
}),
|
|
234
|
+
};
|
|
235
|
+
}),
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
key: "registrationData.interests",
|
|
239
|
+
label: "Interests",
|
|
240
|
+
type: SmartFormWidgetType.TEXT_FIELD_CHIPS,
|
|
241
|
+
showLabel: true,
|
|
242
|
+
validators: [
|
|
243
|
+
{
|
|
244
|
+
validator: Validators.required,
|
|
245
|
+
errorMessage: "This field is mandatory",
|
|
246
|
+
name: SmartValidatorName.required,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
key: "tos",
|
|
252
|
+
label: "Terms of Services",
|
|
253
|
+
type: SmartFormWidgetType.CHECK_BOX,
|
|
254
|
+
showLabel: true,
|
|
255
|
+
validators: [
|
|
256
|
+
{
|
|
257
|
+
validator: Validators.required,
|
|
258
|
+
errorMessage: "This field is mandatory",
|
|
259
|
+
name: SmartValidatorName.required,
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
valueList: [
|
|
263
|
+
{
|
|
264
|
+
key: "tos",
|
|
265
|
+
label: "Terms of Services",
|
|
266
|
+
type: SmartFormWidgetType.ITEM,
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
key: "subscribeToNewsletter",
|
|
272
|
+
label: "Newsletter",
|
|
273
|
+
type: SmartFormWidgetType.TOGGLE,
|
|
274
|
+
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
submit(): void {
|
|
281
|
+
this.form = this.smartFilterChild?.submitForm();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
### Using multiple languages - i18n
|
|
285
|
+
|
|
286
|
+
The labels of the form can be translated to any languages that your application supports, all you have to do is providing a service to the form (ideally the TranslateService exported from [@ngx-translate/core](https://www.npmjs.com/package/@ngx-translate/core)).
|
|
287
|
+
|
|
288
|
+
The SmartForm requires a SmartTranslateService which contains some very basic functions:
|
|
289
|
+
|
|
290
|
+
export interface SmartTranslateService {
|
|
291
|
+
get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any>;
|
|
292
|
+
get onLangChange(): EventEmitter<any>;
|
|
293
|
+
get currentLang(): string;
|
|
294
|
+
set currentLang(currentLang: string);
|
|
295
|
+
instant(key: string | Array<string>, interpolateParams?: Object): string | any;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
Example:
|
|
299
|
+
|
|
300
|
+
`en.json:`
|
|
301
|
+
|
|
302
|
+
{
|
|
303
|
+
"username": "Username",
|
|
304
|
+
"password": "Password",
|
|
305
|
+
...
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
`hu.json:`
|
|
309
|
+
|
|
310
|
+
{
|
|
311
|
+
"username": "Felhasználónév",
|
|
312
|
+
"password": "Jelszó",
|
|
313
|
+
...
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
`any.component.ts:`
|
|
318
|
+
|
|
319
|
+
import { TranslateService } from "@ngx-translate/core";
|
|
320
|
+
|
|
321
|
+
...
|
|
322
|
+
|
|
323
|
+
export class AnyComponent {
|
|
324
|
+
form: SmartForm;
|
|
325
|
+
|
|
326
|
+
constructor(private translate: TranslateService) {
|
|
327
|
+
this.translate.addLangs(["en", "hu"]);
|
|
328
|
+
this.translate.setDefaultLang("hu");
|
|
329
|
+
|
|
330
|
+
this.constructForm();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
constructForm(): void {
|
|
334
|
+
let model: any = {
|
|
335
|
+
username: "",
|
|
336
|
+
password: "",
|
|
337
|
+
language: "",
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
let possibleValues: any[] = [
|
|
341
|
+
{
|
|
342
|
+
displayValue: "hungarian",
|
|
343
|
+
objectUri: "Hungarian",
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
displayValue: "english",
|
|
347
|
+
objectUri: "English",
|
|
348
|
+
},
|
|
349
|
+
];
|
|
350
|
+
|
|
351
|
+
this.form = {
|
|
352
|
+
direction: SmartFormWidgetDirection.COL,
|
|
353
|
+
model,
|
|
354
|
+
translateService: this.translate, // The TranslateService is provided here
|
|
355
|
+
widgets: [
|
|
356
|
+
{
|
|
357
|
+
key: "username",
|
|
358
|
+
label: "username",
|
|
359
|
+
placeholder: "username",
|
|
360
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "password",
|
|
364
|
+
label: "password",
|
|
365
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
key: "language",
|
|
369
|
+
label: "language",
|
|
370
|
+
type: SmartFormWidgetType.SELECT,
|
|
371
|
+
valueList: possibleValues.map((value: any) => {
|
|
372
|
+
return {
|
|
373
|
+
key: value.objectUri,
|
|
374
|
+
label: value.displayValue,
|
|
375
|
+
type: SmartFormWidgetType.ITEM,
|
|
376
|
+
value: value.objectUri,
|
|
377
|
+
};
|
|
378
|
+
}),
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
toggleLanguage(): void {
|
|
385
|
+
this.translate.use(
|
|
386
|
+
this.translate
|
|
387
|
+
.getLangs()
|
|
388
|
+
.filter((lang: string) => lang !== this.translate.currentLang)[0]
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Version logs
|
|
396
|
+
|
|
397
|
+
## @smartbit4all/form v1.6.3
|
|
398
|
+
|
|
399
|
+
**Type: Bugfix**
|
|
400
|
+
|
|
401
|
+
A bug has been fixed which caused that the **invalidFields** property did not become `undefined` automatically if the form was valid.
|
|
402
|
+
|
|
403
|
+
## @smartbit4all/form v1.6.2
|
|
404
|
+
|
|
405
|
+
**Type: Update**
|
|
406
|
+
|
|
407
|
+
The **SmartLabel** got a new property which allows to mark that as required.
|
|
408
|
+
|
|
409
|
+
export interface SmartLabel {
|
|
410
|
+
...
|
|
411
|
+
markAsRequired?: boolean;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
## @smartbit4all/form v1.6.0
|
|
415
|
+
|
|
416
|
+
**Type: Update**
|
|
417
|
+
|
|
418
|
+
This version contains major updates and fixes.
|
|
419
|
+
|
|
420
|
+
### SmartFormWidget - type specific intellisense and type check
|
|
421
|
+
|
|
422
|
+
The **SmartFormWidget** became a type declaration:
|
|
423
|
+
|
|
424
|
+
export declare type SmartFormWidget<T> =
|
|
425
|
+
| SmartTextField<T>
|
|
426
|
+
| SmartTextFieldNumber<T>
|
|
427
|
+
| SmartTextFieldChips<T>
|
|
428
|
+
| SmartTextBox<T>
|
|
429
|
+
| SmartSelect<T>
|
|
430
|
+
| SmartSelectMultiple<T>
|
|
431
|
+
| SmartCheckBox<T>
|
|
432
|
+
| SmartRadioButton<T>
|
|
433
|
+
| SmartDatePicker<T>
|
|
434
|
+
| SmartDateTimePicker<T>
|
|
435
|
+
| SmartContainer<T>
|
|
436
|
+
| SmartLabel
|
|
437
|
+
| SmartTime<T>
|
|
438
|
+
| SmartToggle<T>
|
|
439
|
+
| SmartIndicatorItem;
|
|
440
|
+
|
|
441
|
+
All the types above have one property in common which is _type: SmartFormWidgetType_. By declaring the type of the widget the intellisense only shows those properties which are available.
|
|
442
|
+
|
|
443
|
+
### SmartIndicatorItem
|
|
444
|
+
|
|
445
|
+
The SmartForm got a new widget that can be used for password strength indicator.
|
|
446
|
+
|
|
447
|
+
export interface SmartIndicatorItem {
|
|
448
|
+
type: SmartFormWidgetType.INDICATOR;
|
|
449
|
+
key: string;
|
|
450
|
+
label: string;
|
|
451
|
+
originalLabel?: string;
|
|
452
|
+
showLabel?: boolean;
|
|
453
|
+
indicator: SmartIndicator;
|
|
454
|
+
isVisible?: boolean;
|
|
455
|
+
cssClass?: string;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface SmartIndicator {
|
|
459
|
+
indicateProperty: string;
|
|
460
|
+
indicatorLength: number;
|
|
461
|
+
indicatorStatusLabels: string[];
|
|
462
|
+
originalIndicatorStatusLabels?: string[];
|
|
463
|
+
indicatorValue: number;
|
|
464
|
+
changeIndicatorStatus: (valueToCheck: string) => number;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
### SmartValidator - icons
|
|
468
|
+
|
|
469
|
+
The SmartValidator got two new properties for setting custom icon and it's color to an error.
|
|
470
|
+
|
|
471
|
+
export interface SmartValidator {
|
|
472
|
+
...
|
|
473
|
+
icon?: string;
|
|
474
|
+
iconColor?: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
## @smartbit4all/form v1.5.0
|
|
478
|
+
|
|
479
|
+
**Type: Update**
|
|
480
|
+
|
|
481
|
+
From now on the SmartForm can be used in multi language applications by default.
|
|
482
|
+
|
|
483
|
+
## @smartbit4all/form v1.4.12
|
|
484
|
+
|
|
485
|
+
**Type: Update**
|
|
486
|
+
|
|
487
|
+
The max size of each files can be set for SmartFileUploader.
|
|
488
|
+
|
|
489
|
+
## @smartbit4all/form v1.4.10
|
|
490
|
+
|
|
491
|
+
**Type: Update**
|
|
492
|
+
|
|
493
|
+
In order to attract the user's attention to the invalid fields of the form, the submitForm() function can return a `SmartFormInvalidFields` object, which contains the name and keys of all the invalid fields.
|
|
494
|
+
|
|
495
|
+
export interface SmartFormInvalidFields {
|
|
496
|
+
invalidFieldNames: string[];
|
|
497
|
+
invalidFieldKeys: string[];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
**Type: Bugfix**
|
|
501
|
+
|
|
502
|
+
The TEXT_FIELD_CHIPS had a bug validation bug.
|
|
503
|
+
|
|
504
|
+
## @smartbit4all/form v1.4.9
|
|
505
|
+
|
|
506
|
+
**Type: Update**
|
|
507
|
+
|
|
508
|
+
Autofocus is disabled due to an issue.
|
|
509
|
+
|
|
510
|
+
This is the validator update, in which the validation of the form was rethinked.
|
|
511
|
+
|
|
512
|
+
The `SmartFormWidget` and the `SmartForm` both got a new property:
|
|
513
|
+
|
|
514
|
+
validators?: SmartValidator[];
|
|
515
|
+
|
|
516
|
+
A **SmartValidator** looks like this:
|
|
517
|
+
|
|
518
|
+
export interface SmartValidator {
|
|
519
|
+
validator: ValidatorFn;
|
|
520
|
+
errorMessage?: string;
|
|
521
|
+
name: SmartValidatorName | string;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
The _name_ refers to the _property name_ of the object **returned by the validator**. To make this easier, the `SmartValidatorName` enum contains all the validators supported by the `SmartForm` by default.
|
|
525
|
+
|
|
526
|
+
export enum SmartValidatorName {
|
|
527
|
+
// Angular validators
|
|
528
|
+
required = "required",
|
|
529
|
+
requiredTrue = "required",
|
|
530
|
+
email = "email",
|
|
531
|
+
max = "max",
|
|
532
|
+
maxLength = "maxlength",
|
|
533
|
+
min = "min",
|
|
534
|
+
minLength = "minlength",
|
|
535
|
+
pattern = "pattern",
|
|
536
|
+
passwordValidator = "passwordValidator",
|
|
537
|
+
|
|
538
|
+
// Custom validators
|
|
539
|
+
fieldMatchingValidator = "fieldsMatch",
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
## @smartbit4all/form v1.4.7
|
|
543
|
+
|
|
544
|
+
**Type: Update**
|
|
545
|
+
|
|
546
|
+
Autofocus property added to `SmartFormWidget`.
|
|
547
|
+
|
|
548
|
+
## @smartbit4all/form v1.4.6
|
|
549
|
+
|
|
550
|
+
**Type: Update**
|
|
551
|
+
|
|
552
|
+
onValueChange event added to TEXT_FIELD_NUMBER widget.
|
|
553
|
+
|
|
554
|
+
## @smartbit4all/form v1.4.5
|
|
555
|
+
|
|
556
|
+
**Type: Bugfix**
|
|
557
|
+
|
|
558
|
+
Text field chips bugfix.
|
|
559
|
+
|
|
560
|
+
## @smartbit4all/form v1.4.3
|
|
561
|
+
|
|
562
|
+
**Type: Update**
|
|
563
|
+
|
|
564
|
+
Date time picker widget has been introduced.
|
|
565
|
+
|
|
566
|
+
## @smartbit4all/form v1.4.2
|
|
567
|
+
|
|
568
|
+
**Type: Bugfix**
|
|
569
|
+
|
|
570
|
+
A bug with the Toggle widget has been fixed.
|
|
571
|
+
|
|
572
|
+
## @smartbit4all/form v1.4.1
|
|
573
|
+
|
|
574
|
+
**Type: Update**
|
|
575
|
+
|
|
576
|
+
Version 1.4.0 contains major updates which improves the **usability** of the `SmartForm`.
|
|
577
|
+
|
|
578
|
+
Updates:
|
|
579
|
+
|
|
580
|
+
- complex data structure support
|
|
581
|
+
- constraints
|
|
582
|
+
- text field masking
|
|
583
|
+
- label style update
|
|
584
|
+
|
|
585
|
+
**Complex data structure support:**
|
|
586
|
+
|
|
587
|
+
From now property path as the key of the widget works with complex models:
|
|
588
|
+
|
|
589
|
+
let model = {
|
|
590
|
+
id: "random_id",
|
|
591
|
+
data: {
|
|
592
|
+
username: "user's name",
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
let form: SmartForm = {
|
|
597
|
+
direction: SmartFormWidgetDirection.COL,
|
|
598
|
+
model,
|
|
599
|
+
widgets: [
|
|
600
|
+
{
|
|
601
|
+
key: "id",
|
|
602
|
+
label: "Id",
|
|
603
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
604
|
+
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
key: "data.username",
|
|
608
|
+
label: "Username",
|
|
609
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
610
|
+
|
|
611
|
+
},
|
|
612
|
+
]
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
**Constraints:**
|
|
616
|
+
|
|
617
|
+
The `SmartFormComponentConstraint` type has been introduced. Generic settings such as visibility, mandatoriness and enablement can be injected into the SmartForm and applied by key.
|
|
618
|
+
|
|
619
|
+
export interface SmartFormComponentConstraint {
|
|
620
|
+
/**
|
|
621
|
+
* The data name to identify the related component or componenets. If it is a path the format is the following - dataSheet.field.
|
|
622
|
+
*/
|
|
623
|
+
dataName?: string;
|
|
624
|
+
visible?: boolean;
|
|
625
|
+
mandatory?: boolean;
|
|
626
|
+
enabled?: boolean;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
**Text field masking:**
|
|
630
|
+
|
|
631
|
+
Text fields can be masked with a simple string.
|
|
632
|
+
|
|
633
|
+
SmartFormWidget for phone numbers (Hungarian):
|
|
634
|
+
|
|
635
|
+
{
|
|
636
|
+
key: "phoneNumber",
|
|
637
|
+
label: "Phone number",
|
|
638
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
639
|
+
|
|
640
|
+
mask: "+00-00-000-0000",
|
|
641
|
+
},
|
|
642
|
+
|
|
643
|
+
## @smartbit4all/form v1.3.7
|
|
644
|
+
|
|
645
|
+
**Type: Features**
|
|
646
|
+
|
|
647
|
+
This version add onValueChange event to TEXT field SmartformWidget.
|
|
648
|
+
|
|
649
|
+
## @smartbit4all/form v1.3.5
|
|
650
|
+
|
|
651
|
+
**Type: Features**
|
|
652
|
+
|
|
653
|
+
This version introduces the `isVisible?: boolean` property, and also supports to show icons in **Selects**.
|
|
654
|
+
|
|
655
|
+
## @smartbit4all/form v1.3.2
|
|
656
|
+
|
|
657
|
+
**Type: Update**
|
|
658
|
+
|
|
659
|
+
The labels of the widgets were updated. The SmartForm model got a `labelTheme` property which is applied to the labels. The `labelTheme` should be a theme defined by MaterialTheme.
|
|
660
|
+
|
|
661
|
+
## @smartbit4all/form v1.3.1
|
|
662
|
+
|
|
663
|
+
**Type: Features**
|
|
664
|
+
|
|
665
|
+
From now on the `<smartformwidget></smartformwidget>` always has a CSS class which is the key of the widget.
|
|
666
|
+
|
|
667
|
+
## @smartbit4all/form v1.3.0
|
|
668
|
+
|
|
669
|
+
**Type: Features**
|
|
670
|
+
|
|
671
|
+
This version contains two important updates:
|
|
672
|
+
|
|
673
|
+
- Detecting CapsLock in password fields
|
|
674
|
+
- Submitting the form using enter
|
|
675
|
+
|
|
676
|
+
The changes in the models are the followings:
|
|
677
|
+
|
|
678
|
+
export interface SmartForm {
|
|
679
|
+
...
|
|
680
|
+
submitOnEnter?: () => void;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export interface SmartFormWidget<T> {
|
|
684
|
+
...
|
|
685
|
+
capsLockWarning?: string;
|
|
686
|
+
capsLockWarningIcon?: string;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
## @smartbit4all/form v1.2.9
|
|
690
|
+
|
|
691
|
+
**Type: Bugfix**
|
|
692
|
+
|
|
693
|
+
The min value of `SmartFormWidgetType.TEXT_FIELD_NUMBER` used to be a static 10.
|
|
694
|
+
|
|
695
|
+
## @smartbit4all/form v1.2.8
|
|
696
|
+
|
|
697
|
+
**Type: Bugfix**
|
|
698
|
+
|
|
699
|
+
Previously the `SmartFormWidgetType.SELECT` used to emit onBlur events, however it was not supposed to. From now on it only emits onValueChange events.
|
|
700
|
+
|
|
701
|
+
## @smartbit4all/form v1.2.7
|
|
702
|
+
|
|
703
|
+
**Type: Update**
|
|
704
|
+
|
|
705
|
+
`@smartbit4all/icon` support.
|
|
706
|
+
|
|
707
|
+
## @smartbit4all/form v1.2.6
|
|
708
|
+
|
|
709
|
+
**Type: Update**
|
|
710
|
+
|
|
711
|
+
This update contains date issue fixes for the **DATEPICKER** widget. **The hint** for the datePicker can be injected when creating the widget with the `dateFormatHint` property.
|
|
712
|
+
|
|
713
|
+
export interface SmartFormWidget<T> {
|
|
714
|
+
...
|
|
715
|
+
dateFormatHint?: string;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
Using custom locales became more easy, just paste the following line with the correct locale into the **providers** in `app.module.ts`:
|
|
719
|
+
|
|
720
|
+
`app.module.ts:`
|
|
721
|
+
|
|
722
|
+
@NgModule({
|
|
723
|
+
...
|
|
724
|
+
providers: [
|
|
725
|
+
...
|
|
726
|
+
{ provide: MAT_DATE_LOCALE, useValue: "hu-HU" },
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
## @smartbit4all/form v1.2.4
|
|
731
|
+
|
|
732
|
+
**Type: Update**
|
|
733
|
+
|
|
734
|
+
The label position of the Toggle button can be set.
|
|
735
|
+
|
|
736
|
+
export enum ToggleLabelPosition {
|
|
737
|
+
BEFORE = "before",
|
|
738
|
+
AFTER = "after",
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export interface SmartFormWidget<T> {
|
|
742
|
+
...
|
|
743
|
+
toggleLabelPosition?: ToggleLabelPosition;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
## @smartbit4all/form v1.2.3
|
|
747
|
+
|
|
748
|
+
**Type: Feature**
|
|
749
|
+
|
|
750
|
+
The following widget types can be set to readonly:
|
|
751
|
+
|
|
752
|
+
- TEXT_FIELD
|
|
753
|
+
- TEXT_FIELD_NUMBER
|
|
754
|
+
- TEXT_FIELD_CHIPS
|
|
755
|
+
- TEXT_BOX
|
|
756
|
+
|
|
757
|
+
The change:
|
|
758
|
+
|
|
759
|
+
export interface SmartFormWidget<T> {
|
|
760
|
+
...
|
|
761
|
+
isReadonly?: boolean;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
## @smartbit4all/form v1.2.2
|
|
765
|
+
|
|
766
|
+
**Type: Bug fix**
|
|
767
|
+
|
|
768
|
+
Fix row layout inside Container widgets.
|
|
769
|
+
From now every row item align to center.
|
|
770
|
+
|
|
771
|
+
## @smartbit4all/form v1.2.1
|
|
772
|
+
|
|
773
|
+
**Type: Update**
|
|
774
|
+
|
|
775
|
+
From now on custom buttons can be added to two types of inputs:
|
|
776
|
+
|
|
777
|
+
TEXT_FIELD
|
|
778
|
+
TEXT_FIELD_NUMBER
|
|
779
|
+
|
|
780
|
+
The properties of the custom button:
|
|
781
|
+
|
|
782
|
+
export enum SmartFormTextFieldButtonIconPosition {
|
|
783
|
+
PRE,
|
|
784
|
+
POST,
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export interface SmartFormTextFieldButton {
|
|
788
|
+
icon?: string;
|
|
789
|
+
iconPosition?: SmartFormTextFieldButtonIconPosition;
|
|
790
|
+
label?: string;
|
|
791
|
+
callback: (widget: SmartFormWidget<any>) => any;
|
|
792
|
+
color?: ThemePalette;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export interface SmartFormWidget<T> {
|
|
796
|
+
...
|
|
797
|
+
textFieldButton?: SmartFormTextFieldButton;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
## @smartbit4all/form v1.2.0
|
|
801
|
+
|
|
802
|
+
**Type: Update**
|
|
803
|
+
|
|
804
|
+
Slide Toggle has been added as a new SmarFormWidget type.
|
|
805
|
+
|
|
806
|
+
Changes:
|
|
807
|
+
|
|
808
|
+
1. Toggle SmartFormWidgetType
|
|
809
|
+
|
|
810
|
+
export enum SmartFormWidgetType {
|
|
811
|
+
TEXT_FIELD,
|
|
812
|
+
TEXT_FIELD_NUMBER,
|
|
813
|
+
TEXT_FIELD_CHIPS,
|
|
814
|
+
TEXT_BOX,
|
|
815
|
+
SELECT,
|
|
816
|
+
SELECT_MULTIPLE,
|
|
817
|
+
CHECK_BOX,
|
|
818
|
+
CHECK_BOX_TABLE,
|
|
819
|
+
RADIO_BUTTON,
|
|
820
|
+
DATE_PICKER,
|
|
821
|
+
FILE_UPLOAD,
|
|
822
|
+
ITEM,
|
|
823
|
+
CONTAINER,
|
|
824
|
+
LABEL,
|
|
825
|
+
TIME,
|
|
826
|
+
>>> TOGGLE
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
2. SmartFormWidgetComponent html
|
|
830
|
+
|
|
831
|
+
<div *ngSwitchCase="smartFormWidgetType.TOGGLE">
|
|
832
|
+
<div *ngIf="widgetInstance.showLabel">
|
|
833
|
+
<h4>{{ widgetInstance.label }}</h4>
|
|
834
|
+
</div>
|
|
835
|
+
<mat-slide-toggle
|
|
836
|
+
formControlName="{{ widgetInstance.key }}"
|
|
837
|
+
value="{{ widgetInstance.value }}"
|
|
838
|
+
(change)="onValueChange?.next($event)"
|
|
839
|
+
>{{ widgetInstance.label }}</mat-slide-toggle
|
|
840
|
+
>
|
|
841
|
+
</div>
|
|
842
|
+
|
|
843
|
+
## @smartbit4all/form v1.1.11
|
|
844
|
+
|
|
845
|
+
**Type: Update**
|
|
846
|
+
|
|
847
|
+
The **name** property of the `SmartForm` became **nullable**.
|
|
848
|
+
|
|
849
|
+
export interface SmartForm {
|
|
850
|
+
name?: string;
|
|
851
|
+
...
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
## @smartbit4all/form v1.1.10
|
|
855
|
+
|
|
856
|
+
**Type: Bugfix**
|
|
857
|
+
|
|
858
|
+
Calling submitForm had not validated the form.
|
|
859
|
+
|
|
860
|
+
## @smartbit4all/form v1.1.7
|
|
861
|
+
|
|
862
|
+
**Type: Bugfix**
|
|
863
|
+
|
|
864
|
+
Fix CSS class issue.
|
|
865
|
+
|
|
866
|
+
## @smartbit4all/form v1.1.5
|
|
867
|
+
|
|
868
|
+
**Type: Update**
|
|
869
|
+
|
|
870
|
+
Fix CSS class in label and for layout classes.
|
|
871
|
+
Select and Multiple-select widget visible value can be set by SmartFormWidget's label property.
|
|
872
|
+
|
|
873
|
+
## @smartbit4all/form v1.1.4
|
|
874
|
+
|
|
875
|
+
**Type: Feature**
|
|
876
|
+
|
|
877
|
+
Show label can be set globally on form, however it can be overrided on widgets.
|
|
878
|
+
|
|
879
|
+
## @smartbit4all/form v1.1.1
|
|
880
|
+
|
|
881
|
+
**Type: Feature**
|
|
882
|
+
|
|
883
|
+
From now on TextFields can be used as password fields.
|
|
884
|
+
|
|
885
|
+
## @smartbit4all/form v1.1.0
|
|
886
|
+
|
|
887
|
+
**Type: Feature**
|
|
888
|
+
|
|
889
|
+
### Feature: custom CSS class for widgets
|
|
890
|
+
|
|
891
|
+
The `SmartFormWidget` got a new property (_cssClass?: string;_), which allows to inject any custom CSS class for each widgets.
|
|
892
|
+
|
|
893
|
+
### Feature: onBlur and onValueChange
|
|
894
|
+
|
|
895
|
+
From now on `SmartformComponent` has two subscribable Subjects:
|
|
896
|
+
|
|
897
|
+
- The **onBlur** subject signals when the user leaves the SmartFormWidget's input field.
|
|
898
|
+
- The second subject is the **onValueChange** which emits an event when the value of the SmartFormWidget was changed.
|
|
899
|
+
|
|
900
|
+
**The onBlur event can be used on the following types of widgets:**
|
|
901
|
+
|
|
902
|
+
- TEXT_FIELD
|
|
903
|
+
- TEXT_FIELD_NUMBER
|
|
904
|
+
- TEXT_FIELD_CHIPS
|
|
905
|
+
- TEXT_BOX
|
|
906
|
+
- DATE_PICKER
|
|
907
|
+
- SELECT
|
|
908
|
+
- SELECT_MULTIPLE
|
|
909
|
+
- TIME
|
|
910
|
+
|
|
911
|
+
**The onValuechange event can be used on the following types of widgets:**
|
|
912
|
+
|
|
913
|
+
- RADIO_BUTTON
|
|
914
|
+
- CHECK_BOX
|
|
915
|
+
- SELECT
|
|
916
|
+
- SELECT_MULTIPLE
|
|
917
|
+
|
|
918
|
+
**How to use it:**
|
|
919
|
+
|
|
920
|
+
Firstly, set the **useOnBlurEvent** and **useOnValueChangeEvent** properties to **true**.
|
|
921
|
+
|
|
922
|
+
this.smartForm = {
|
|
923
|
+
name: '',
|
|
924
|
+
direction: SmartFormWidgetDirection.COL,
|
|
925
|
+
widgets: [ ... ],
|
|
926
|
+
useOnBlurEvent: true,
|
|
927
|
+
useOnValueChangeEvent: true
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
Secondly, subscribe to the events.
|
|
931
|
+
|
|
932
|
+
@ViewChild('exampleForm') child?: SmartformComponent;
|
|
933
|
+
smartForm: SmartForm;
|
|
934
|
+
|
|
935
|
+
ngAfterViewInit(){
|
|
936
|
+
this.child?.onBlurSubject.subscribe( ... );
|
|
937
|
+
this.child?.onValueChangeSubject.subscribe( ... );
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
## @smartbit4all/form v1.0.1
|
|
941
|
+
|
|
942
|
+
**Type: Update**
|
|
943
|
+
|
|
944
|
+
The package has been published.
|
|
945
|
+
|
|
946
|
+
## @smartbit4all/form v0.2.0
|
|
947
|
+
|
|
948
|
+
**Type: Feature**
|
|
949
|
+
|
|
950
|
+
From now on SmartForm supports object handling by default. This means that an object with default values can be added to the **SmartForm**, and if the keys of the **SmartFormWidget**s are matches with the properties of the given object, the value changes will be handled by the **SmartFormService** automatically.
|
|
951
|
+
|
|
952
|
+
### Let's see an examplatory scenario:
|
|
953
|
+
|
|
954
|
+
**You have an object like this:**
|
|
955
|
+
|
|
956
|
+
const loginRequestDetails = {
|
|
957
|
+
email: "example@domain.com",
|
|
958
|
+
password: "examplePwd123#"
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
**You want to use this in your form:**
|
|
962
|
+
|
|
963
|
+
this.smartForm = {
|
|
964
|
+
name: '',
|
|
965
|
+
direction: SmartFormWidgetDirection.COL,
|
|
966
|
+
model: loginRequestDetails,
|
|
967
|
+
widgets: [
|
|
968
|
+
{
|
|
969
|
+
key: 'email',
|
|
970
|
+
label: 'Email',
|
|
971
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
972
|
+
value: '',
|
|
973
|
+
validators: [Validators.required, Validators.email],
|
|
974
|
+
errorMessage: 'It is not a valid email.'
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
key: 'password',
|
|
978
|
+
label: 'Password',
|
|
979
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
980
|
+
value: '',
|
|
981
|
+
validators: [Validators.required],
|
|
982
|
+
}
|
|
983
|
+
]
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
**The output will be this:**
|
|
987
|
+
|
|
988
|
+
<label>Email</label>
|
|
989
|
+
<input type="text" value="example@domain.com">
|
|
990
|
+
|
|
991
|
+
<label>Password</label>
|
|
992
|
+
<input type="text" value="examplePwd123#">
|
|
993
|
+
|
|
994
|
+
**After submit:**
|
|
995
|
+
|
|
996
|
+
After you have submitted the SmartForm, the new values are available in `this.smartForm.model`.
|
|
997
|
+
|
|
998
|
+
## @smartbit4all/form v0.1.7
|
|
999
|
+
|
|
1000
|
+
**Type: Bugfix**
|
|
1001
|
+
|
|
1002
|
+
A major bug has been fixed which made _getting the value of a container_ impossible.
|
|
1003
|
+
|
|
1004
|
+
In the previous version the **SmartFormService** only had the **toSmartForm()** function, which was not able to recreate the smartForm in depth.
|
|
1005
|
+
|
|
1006
|
+
**The bugfix:**
|
|
1007
|
+
|
|
1008
|
+
toSmartForm(group: FormGroup, smartForm: SmartForm): SmartForm {
|
|
1009
|
+
smartForm = this.toSmartFormDeeply(smartForm.widgets, group, smartForm);
|
|
1010
|
+
|
|
1011
|
+
return smartForm;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
toSmartFormDeeply(
|
|
1015
|
+
widgets: SmartFormWidget<any>[],
|
|
1016
|
+
group: FormGroup,
|
|
1017
|
+
smartForm: SmartForm
|
|
1018
|
+
): SmartForm {
|
|
1019
|
+
widgets.forEach((widget) => {
|
|
1020
|
+
if (widget.type === SmartFormWidgetType.CONTAINER && widget.valueList?.length) {
|
|
1021
|
+
smartForm = this.toSmartFormDeeply(widget.valueList, group, smartForm);
|
|
1022
|
+
} else {
|
|
1023
|
+
widget.value = group.controls[widget.key].value;
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
return smartForm;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
## @smartbit4all/form v0.1.6
|
|
1030
|
+
|
|
1031
|
+
**Type: Feature**
|
|
1032
|
+
|
|
1033
|
+
This version contains one major change: **TIME** picker component have been added.
|
|
1034
|
+
Small layout change: 1em margin have been added to **CONTAINER** typed widgets.
|
|
1035
|
+
|
|
1036
|
+
**Usage have not changed**.
|
|
1037
|
+
|
|
1038
|
+
## @smartbit4all/form v0.1.5
|
|
1039
|
+
|
|
1040
|
+
**Type: Feature**
|
|
1041
|
+
|
|
1042
|
+
This version contains two changes: **LABEL** type to the SmartFormWidgetType enum
|
|
1043
|
+
and
|
|
1044
|
+
**widgetDescription** to the SmartFormWidget have been added.
|
|
1045
|
+
|
|
1046
|
+
**Changes:**
|
|
1047
|
+
|
|
1048
|
+
The LABEL type widget can be used as separated label for the input field.
|
|
1049
|
+
Description can be added to the label if you'd like to.
|
|
1050
|
+
|
|
1051
|
+
## @smartbit4all/form v0.1.4
|
|
1052
|
+
|
|
1053
|
+
**Type: Feature**
|
|
1054
|
+
|
|
1055
|
+
This version contains two major changes: a **submit function** and **custom validators** have been added to the `SmartForm`.
|
|
1056
|
+
|
|
1057
|
+
---
|
|
1058
|
+
|
|
1059
|
+
**Changes:**
|
|
1060
|
+
|
|
1061
|
+
The **submitForm()** function is implemented in the `SmartformComponent`. The new values are translated back to the given `SmartForm` object if the status of the form is valid. If it is not, the function throws an error with the current state.
|
|
1062
|
+
|
|
1063
|
+
submitForm(): SmartForm {
|
|
1064
|
+
if (this.form.status === "VALID") {
|
|
1065
|
+
return this.service.toSmartForm(this.form, this.smartForm);
|
|
1066
|
+
} else {
|
|
1067
|
+
throw new Error(`The form status is ${this.form.status}.`);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
In order to use **multiple custom validators**, the `SmartFormWidget` got a validators property. A custom error message can be set with the **errorMessage** property.
|
|
1072
|
+
|
|
1073
|
+
export interface SmartFormWidget<T> {
|
|
1074
|
+
...
|
|
1075
|
+
validators?: ValidatorFn[];
|
|
1076
|
+
errorMessage?: string;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
## @smartbit4all/form v0.1.2
|
|
1080
|
+
|
|
1081
|
+
**Type: Feature**
|
|
1082
|
+
|
|
1083
|
+
_Prefix_ and _Suffix_ have been added to `SmartFormWidget`. These two can be used with **TextFields**.
|
|
1084
|
+
|
|
1085
|
+
**TEXT_FIELD_NUMBER** as a new `SmartFormWidgetType` can be used for numbers.
|
|
1086
|
+
|
|
1087
|
+
**Example for prefix, suffix and TEXT_FIELD_NUMBER:**
|
|
1088
|
+
|
|
1089
|
+
{
|
|
1090
|
+
key: 'money',
|
|
1091
|
+
label: 'Money',
|
|
1092
|
+
type: SmartFormWidgetType.TEXT_FIELD_NUMBER,
|
|
1093
|
+
value: 10,
|
|
1094
|
+
prefix: '€',
|
|
1095
|
+
suffix: '.00',
|
|
1096
|
+
...
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
**Output:** _€ 10.00_
|
|
1100
|
+
|
|
1101
|
+
## @smartbit4all/form v0.1.1
|
|
1102
|
+
|
|
1103
|
+
**Type: Feature**
|
|
1104
|
+
|
|
1105
|
+
`CONTAINER` has been added to `SmartFormWidgetType`.
|
|
1106
|
+
|
|
1107
|
+
This **CONTAINER** type can be used for creating inline forms with _n_ widgets in it.
|
|
1108
|
+
|
|
1109
|
+
**CONTAINER usage example**
|
|
1110
|
+
|
|
1111
|
+
{
|
|
1112
|
+
key: 'container-key',
|
|
1113
|
+
label: '',
|
|
1114
|
+
value: '',
|
|
1115
|
+
type: SmartFormWidgetType.CONTAINER,
|
|
1116
|
+
direction: SmartFormWidgetDirection.ROW,
|
|
1117
|
+
valueList: [
|
|
1118
|
+
{
|
|
1119
|
+
key: 'container-key-1',
|
|
1120
|
+
label: '1st label',
|
|
1121
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
1122
|
+
value: this.containerValue,
|
|
1123
|
+
...
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
key: 'container-key-2',
|
|
1127
|
+
label: '2nd label',
|
|
1128
|
+
type: SmartFormWidgetType.TEXT_FIELD,
|
|
1129
|
+
value: this.containerValue,
|
|
1130
|
+
...
|
|
1131
|
+
},
|
|
1132
|
+
...
|
|
1133
|
+
],
|
|
1134
|
+
...
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
**Type: Feature**
|
|
1138
|
+
|
|
1139
|
+
A new property has been added to `SmartFormWidget` which disables the SmartFormWidget.
|
|
1140
|
+
|
|
1141
|
+
**The new property**
|
|
1142
|
+
|
|
1143
|
+
export interface SmartFormWidget<T> {
|
|
1144
|
+
...
|
|
1145
|
+
isDisabled?: boolean;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
**The change in the SmartFormService**
|
|
1149
|
+
|
|
1150
|
+
createFormControls(widgets: SmartFormWidget<any>[]) {
|
|
1151
|
+
...
|
|
1152
|
+
if (widget.isDisabled) {
|
|
1153
|
+
formControl.disable();
|
|
1154
|
+
}
|
|
1155
|
+
...
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
**Type: Bugfix**
|
|
1159
|
+
|
|
1160
|
+
The **CHECKBOX** widget had a bug, which caused that the label was shown after the options.
|
|
1161
|
+
|
|
1162
|
+
**The code snippet which caused the bug**
|
|
1163
|
+
|
|
1164
|
+
.checkbox {
|
|
1165
|
+
flex-direction: column-reverse;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
**The code snippet which solved the bug**
|
|
1169
|
+
|
|
1170
|
+
.checkbox {
|
|
1171
|
+
flex-direction: column;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
## @smartbit4all/form v0.0.2
|
|
1175
|
+
|
|
1176
|
+
**Type: Feature**
|
|
1177
|
+
|
|
1178
|
+
The basic smart form with its features.
|