@beinformed/ui 1.20.6 → 1.20.9
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/CHANGELOG.md +18 -0
- package/esm/builder/mergeLayoutHintConfigurations.js +34 -59
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js +37 -37
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js +1 -1
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +20 -22
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +12 -26
- package/esm/constants/Settings.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js +5 -27
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js +33 -65
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js +5 -27
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js +5 -27
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js +5 -27
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js +5 -27
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js +5 -27
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js +9 -31
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js +5 -27
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +12 -35
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js +5 -27
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js +5 -27
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js +5 -26
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js +11 -33
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js +5 -27
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js +25 -46
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js +20 -26
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js +13 -24
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js +3 -3
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js +27 -45
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js +9 -19
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js +11 -11
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +24 -30
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js +3 -3
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js +17 -16
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +9 -7
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +39 -59
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +4 -6
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js +16 -21
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js +3 -5
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js +9 -30
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js +12 -26
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js +96 -135
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +94 -148
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js +13 -24
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/languages.js +1 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/withMessage.js +10 -16
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +55 -100
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +165 -204
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +104 -153
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +246 -331
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +181 -244
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +202 -250
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +832 -941
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +46 -77
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +259 -325
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +24 -55
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +337 -424
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +271 -361
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +297 -351
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +180 -257
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +326 -401
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +368 -419
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js +38 -70
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js +23 -54
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js +31 -63
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js +30 -62
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +178 -225
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +197 -246
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +234 -282
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js +181 -238
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js +32 -64
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +21 -36
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js +63 -81
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +29 -66
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +44 -59
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +170 -192
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +52 -67
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +52 -67
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +66 -83
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +78 -94
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js +35 -51
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js +39 -57
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +62 -81
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +149 -171
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +104 -124
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +91 -113
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +35 -52
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +65 -83
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js +115 -134
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js +47 -61
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js +157 -176
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js +48 -66
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +49 -64
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +167 -209
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +40 -68
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +30 -59
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js +169 -203
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +97 -112
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js +27 -55
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js +167 -217
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +132 -180
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +98 -147
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +239 -316
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +114 -150
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +118 -158
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +56 -103
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +60 -75
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +89 -126
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +11 -42
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +47 -70
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +108 -150
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +157 -199
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +184 -228
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +132 -196
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +58 -93
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js +161 -247
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js +122 -188
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js +44 -58
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +123 -162
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +24 -38
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +30 -41
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +73 -95
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js +174 -225
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js +79 -132
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js +36 -48
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +175 -204
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +142 -186
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +170 -220
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +8 -36
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +106 -165
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js +1 -26
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +29 -58
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +957 -1133
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +412 -506
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +115 -163
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js +391 -450
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js +116 -155
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +91 -136
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js +127 -185
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js +189 -228
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +30 -57
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +226 -289
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js +74 -97
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +49 -85
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +73 -110
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +342 -421
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +15 -51
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +42 -71
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +35 -67
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js +31 -42
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js +77 -94
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +116 -160
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +82 -97
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js +63 -100
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js +3 -5
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +23 -56
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +76 -90
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +86 -134
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +118 -163
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js +7 -37
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +51 -83
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/user/UserModel.js +29 -61
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +19 -50
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +79 -123
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +143 -156
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js +9 -32
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +476 -630
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js +104 -119
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/react/ErrorBoundary.js +32 -65
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +8 -6
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/utils.js +12 -15
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js +9 -7
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +21 -22
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js +4 -4
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/rehydrate.js +14 -21
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/createSSRComplete.js +10 -14
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js +5 -8
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +50 -55
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js +13 -13
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js +8 -10
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +22 -21
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js +24 -24
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +45 -61
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +10 -7
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +15 -35
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/useTheme.js +1 -1
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js +9 -9
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js +12 -12
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +27 -27
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +10 -9
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +23 -22
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js +28 -29
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/actions.js +15 -21
- package/esm/redux/_i18n/actions.js.map +1 -1
- package/esm/redux/_i18n/reducer.js +20 -29
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_modularui/actions.js +40 -67
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js +46 -50
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/middleware.js +23 -36
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js +16 -23
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js +42 -53
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js +89 -99
- package/esm/redux/_modularui/selectors.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +15 -19
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/actions.js +29 -39
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js +12 -14
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/middleware.js +27 -29
- package/esm/redux/_router/middleware.js.map +1 -1
- package/esm/redux/_router/reducer.js +4 -4
- package/esm/redux/_router/reducer.js.map +1 -1
- package/esm/redux/actions/Application.js +9 -32
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +31 -33
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +33 -43
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +13 -15
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +6 -6
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +6 -6
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +12 -18
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +2 -2
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +12 -20
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js +8 -12
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js +32 -42
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +32 -38
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js +15 -23
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js +39 -53
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js +9 -17
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/connectors/Application.js +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js +4 -6
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +4 -2
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +5 -3
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +4 -2
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +5 -3
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +6 -4
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +11 -9
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js +13 -21
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +4 -2
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js +4 -6
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +4 -2
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js +8 -10
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +7 -6
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js +6 -8
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js +2 -2
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js +6 -8
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +6 -4
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +4 -4
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js +3 -3
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js +4 -2
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +14 -25
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js +4 -4
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js +19 -37
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js +8 -19
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js +10 -17
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js +14 -25
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js +11 -13
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/selectors/i18n.js +2 -4
- package/esm/redux/selectors/i18n.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js +5 -26
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js +10 -19
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/browser/Cache.js +122 -156
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js +4 -4
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +363 -418
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js +5 -5
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +13 -14
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js +281 -358
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +7 -7
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/esm/utils/helpers/createHash.js +5 -5
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/esm/utils/helpers/createUUID.js +4 -4
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/objects.js +9 -14
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js +13 -13
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js +1 -1
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js +297 -327
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js +10 -16
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +13 -13
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +34 -64
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js +37 -37
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +20 -22
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +12 -26
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js +3 -3
- package/lib/exceptions/ConfigurationException.js +5 -34
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js +32 -75
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +5 -34
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +5 -34
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +5 -34
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +5 -34
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +5 -34
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +9 -38
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +5 -34
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +12 -41
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +5 -34
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +5 -34
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +5 -32
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +11 -40
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +5 -34
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js +15 -15
- package/lib/hooks/index.js +16 -16
- package/lib/hooks/useAllFormsOnModel.js +25 -51
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js +18 -24
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js +14 -27
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +5 -7
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js +27 -45
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js +10 -20
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js +11 -11
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +24 -30
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +3 -3
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +17 -16
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +9 -7
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +39 -59
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +4 -6
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js +16 -21
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +3 -5
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js +9 -37
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js +11 -25
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js +97 -144
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +97 -160
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +13 -31
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js +9 -11
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/languages.js +1 -1
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/withMessage.js +11 -17
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/models/actions/ActionCollection.js +58 -104
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +169 -210
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +107 -159
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +245 -341
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +182 -255
- package/lib/models/attributes/AttributeContent.js.flow +46 -44
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +203 -257
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +838 -950
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +49 -83
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +267 -339
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +27 -59
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +343 -437
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +268 -369
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +299 -357
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +181 -270
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +331 -411
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +371 -425
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js +41 -74
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js +26 -58
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js +34 -67
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js +34 -67
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +181 -231
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +201 -253
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +239 -289
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js +183 -243
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js +38 -71
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +20 -43
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +64 -84
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +36 -74
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +46 -59
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +171 -193
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +53 -68
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +53 -68
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +67 -84
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +79 -95
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +41 -58
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +39 -60
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +63 -82
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +150 -172
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +105 -125
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +92 -114
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +36 -55
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +64 -82
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +116 -135
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +48 -62
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +158 -177
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +49 -69
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +54 -70
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +172 -218
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +43 -74
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +32 -64
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +170 -206
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +98 -113
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +28 -60
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +171 -231
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +137 -188
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +97 -153
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +243 -329
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +118 -156
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +122 -163
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +57 -105
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +62 -75
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +87 -127
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +13 -44
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +47 -74
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +112 -156
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +162 -205
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +188 -235
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +133 -209
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +56 -92
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +160 -254
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js +125 -196
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js +46 -58
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +127 -171
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +28 -45
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +31 -42
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +74 -98
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js +176 -232
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js +82 -139
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js +36 -48
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +177 -205
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +144 -195
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +171 -228
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +9 -39
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +109 -177
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js +2 -29
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +30 -60
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +961 -1150
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +411 -517
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js +117 -165
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js +392 -452
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js +119 -159
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js +97 -99
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js +94 -140
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js +136 -196
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js +191 -235
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +30 -66
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +229 -302
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js +73 -97
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +49 -91
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +76 -114
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +347 -435
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +16 -61
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +48 -79
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +39 -72
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js +29 -38
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js +77 -92
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +117 -164
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +83 -99
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +67 -105
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js +3 -5
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +26 -60
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +77 -91
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +88 -140
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +122 -170
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js +8 -39
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +54 -88
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/user/UserModel.js +32 -65
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +21 -56
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +78 -128
- package/lib/models/user/UserServicesModel.js.flow +1 -7
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +144 -157
- package/lib/modularui/Authenticate.js.flow +13 -7
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js +9 -39
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +477 -647
- package/lib/modularui/ModularUIRequest.js.flow +1 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +102 -120
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js +3 -3
- package/lib/react/ErrorBoundary.js +33 -71
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +8 -6
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js +2 -2
- package/lib/react/utils.js +12 -16
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js +9 -7
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +22 -23
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js +4 -4
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js +3 -3
- package/lib/react-client/rehydrate.js +14 -22
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +10 -14
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +5 -8
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js +8 -8
- package/lib/react-server/renderSSRComplete.js +50 -55
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +13 -13
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js +8 -10
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +22 -21
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +24 -24
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +49 -74
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +10 -7
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +15 -44
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js +9 -9
- package/lib/react-theme/useTheme.js +1 -1
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js +9 -9
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js +12 -12
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +27 -28
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +10 -9
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +23 -22
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js +28 -30
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js +15 -21
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js +2 -2
- package/lib/redux/_i18n/reducer.js +20 -34
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_modularui/actions.js +40 -72
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js +46 -55
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js +7 -7
- package/lib/redux/_modularui/middleware.js +23 -36
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js +16 -24
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js +42 -61
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js +89 -106
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +11 -15
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js +29 -39
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js +7 -9
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js +4 -4
- package/lib/redux/_router/middleware.js +27 -29
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js +4 -4
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/actions/Application.js +11 -37
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +31 -33
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +33 -43
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +14 -16
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +6 -6
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +6 -6
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +12 -18
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +2 -2
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +12 -20
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js +8 -12
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js +32 -42
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +32 -43
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js +15 -23
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js +43 -57
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +9 -17
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/index.js +15 -15
- package/lib/redux/connectors/Application.js +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +4 -6
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +4 -2
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +5 -3
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +4 -2
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +5 -3
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +6 -4
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +10 -8
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +13 -21
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +4 -2
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +4 -6
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +4 -2
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +8 -10
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +7 -6
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js +6 -8
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js +2 -2
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +6 -8
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +5 -3
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +4 -4
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +3 -3
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +4 -2
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js +21 -21
- package/lib/redux/index.js +8 -8
- package/lib/redux/reducers/AuthReducer.js +14 -33
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +4 -4
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +19 -45
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +8 -27
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +10 -25
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +14 -33
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js +11 -13
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js +7 -7
- package/lib/redux/selectors/i18n.js +2 -4
- package/lib/redux/selectors/i18n.js.map +1 -1
- package/lib/redux/selectors/index.js +1 -1
- package/lib/redux/store/beforeRenderHooks.js +5 -29
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js +10 -24
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +126 -161
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js +4 -4
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +364 -418
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js +5 -5
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +13 -13
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +281 -365
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js +7 -7
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js +5 -5
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +4 -4
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js +9 -15
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js +13 -13
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js +15 -15
- package/lib/utils/number/DecimalFormat.js +298 -328
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +10 -17
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +13 -13
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +18 -18
- package/src/models/attributes/AttributeContent.js +46 -44
- package/src/models/user/UserServicesModel.js +1 -7
- package/src/modularui/Authenticate.js +13 -7
- package/src/modularui/ModularUIRequest.js +1 -1
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
-
|
|
5
|
-
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
-
|
|
7
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
8
|
-
|
|
9
|
-
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
10
|
-
|
|
11
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
12
|
-
|
|
13
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
14
|
-
|
|
15
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
16
4
|
|
|
17
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -19,12 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
19
7
|
});
|
|
20
8
|
exports.default = void 0;
|
|
21
9
|
|
|
22
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
23
|
-
|
|
24
10
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
25
11
|
|
|
26
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
27
|
-
|
|
28
12
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
29
13
|
|
|
30
14
|
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
@@ -39,20 +23,6 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
|
|
|
39
23
|
|
|
40
24
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
41
25
|
|
|
42
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
43
|
-
|
|
44
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
45
|
-
|
|
46
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
47
|
-
|
|
48
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
49
|
-
|
|
50
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
51
|
-
|
|
52
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
53
|
-
|
|
54
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
55
|
-
|
|
56
26
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
57
27
|
|
|
58
28
|
var _flattenDeep = _interopRequireDefault(require("lodash/flattenDeep"));
|
|
@@ -63,7 +33,7 @@ var _objects = require("../../utils/helpers/objects");
|
|
|
63
33
|
|
|
64
34
|
var _exceptions = require("../../exceptions");
|
|
65
35
|
|
|
66
|
-
var
|
|
36
|
+
var _ResourceModel = _interopRequireDefault(require("../base/ResourceModel"));
|
|
67
37
|
|
|
68
38
|
var _ErrorCollection = _interopRequireDefault(require("../error/ErrorCollection"));
|
|
69
39
|
|
|
@@ -79,1282 +49,1123 @@ var _Settings = require("../../constants/Settings");
|
|
|
79
49
|
|
|
80
50
|
var _LayoutHints = require("../../constants/LayoutHints");
|
|
81
51
|
|
|
82
|
-
var _excluded = ["elements"];
|
|
83
|
-
|
|
84
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
85
|
-
|
|
86
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
87
|
-
|
|
88
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
89
|
-
|
|
90
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
91
|
-
|
|
92
52
|
/**
|
|
93
53
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
(0,
|
|
105
|
-
|
|
106
|
-
(0, _defineProperty2.default)((0,
|
|
107
|
-
(0, _defineProperty2.default)(
|
|
108
|
-
(0, _defineProperty2.default)(
|
|
109
|
-
(0, _defineProperty2.default)(
|
|
110
|
-
(0, _defineProperty2.default)(
|
|
111
|
-
(0, _defineProperty2.default)(
|
|
112
|
-
(0, _defineProperty2.default)(
|
|
113
|
-
(0, _defineProperty2.default)(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
_this.currentFormObject = _this.createFormObject();
|
|
123
|
-
_this.endResultFormObjects = _this.setEndResultFormObjects();
|
|
124
|
-
_this.parameters = _this.setParameters(modularuiResponse);
|
|
125
|
-
_this.isComplete = _this.getData("complete", false);
|
|
126
|
-
|
|
127
|
-
if (_this.data.errors) {
|
|
128
|
-
_this.handleRootErrors(_this.data.errors);
|
|
54
|
+
class FormModel extends _ResourceModel.default {
|
|
55
|
+
/**
|
|
56
|
+
*/
|
|
57
|
+
constructor(modularuiResponse) {
|
|
58
|
+
super(modularuiResponse);
|
|
59
|
+
(0, _defineProperty2.default)(this, "_lastUpdate", void 0);
|
|
60
|
+
(0, _defineProperty2.default)(this, "_completedFormObjects", []);
|
|
61
|
+
(0, _defineProperty2.default)(this, "_currentFormObject", null);
|
|
62
|
+
(0, _defineProperty2.default)(this, "_previouslyEnteredFormObjects", []);
|
|
63
|
+
(0, _defineProperty2.default)(this, "_mergePreviouslyEnteredObjects", true);
|
|
64
|
+
(0, _defineProperty2.default)(this, "_endResultFormObjects", []);
|
|
65
|
+
(0, _defineProperty2.default)(this, "_previousEndResultKeys", []);
|
|
66
|
+
(0, _defineProperty2.default)(this, "_useClientsideValidation", (0, _Settings.getSetting)("USE_CLIENTSIDE_VALIDATION"));
|
|
67
|
+
(0, _defineProperty2.default)(this, "_errorCollection", new _ErrorCollection.default("form"));
|
|
68
|
+
(0, _defineProperty2.default)(this, "_redirectLocation", void 0);
|
|
69
|
+
(0, _defineProperty2.default)(this, "_commit", void 0);
|
|
70
|
+
(0, _defineProperty2.default)(this, "_isFinished", void 0);
|
|
71
|
+
(0, _defineProperty2.default)(this, "_isComplete", void 0);
|
|
72
|
+
(0, _defineProperty2.default)(this, "_parameters", void 0);
|
|
73
|
+
(0, _defineProperty2.default)(this, "_tokens", void 0);
|
|
74
|
+
this.lastUpdate = 0;
|
|
75
|
+
this.currentFormObject = this.createFormObject();
|
|
76
|
+
this.endResultFormObjects = this.setEndResultFormObjects();
|
|
77
|
+
this.parameters = this.setParameters(modularuiResponse);
|
|
78
|
+
this.isComplete = this.getData("complete", false);
|
|
79
|
+
|
|
80
|
+
if (this.data.errors) {
|
|
81
|
+
this.handleRootErrors(this.data.errors);
|
|
129
82
|
}
|
|
130
|
-
|
|
131
|
-
return _this;
|
|
132
83
|
}
|
|
133
84
|
/**
|
|
134
85
|
*/
|
|
135
86
|
|
|
136
87
|
|
|
137
|
-
(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
}, {
|
|
146
|
-
key: "actiontype",
|
|
147
|
-
get: function get() {
|
|
148
|
-
if (this.layouthint.has(_LayoutHints.CREATE_ACTION)) {
|
|
149
|
-
return "create";
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (this.layouthint.has(_LayoutHints.UPDATE_ACTION)) {
|
|
153
|
-
return "update";
|
|
154
|
-
}
|
|
88
|
+
get type() {
|
|
89
|
+
return "Form";
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
*/
|
|
155
93
|
|
|
156
|
-
if (this.layouthint.has(_LayoutHints.DELETE_ACTION)) {
|
|
157
|
-
return "delete";
|
|
158
|
-
}
|
|
159
94
|
|
|
160
|
-
|
|
95
|
+
get actiontype() {
|
|
96
|
+
if (this.layouthint.has(_LayoutHints.CREATE_ACTION)) {
|
|
97
|
+
return "create";
|
|
161
98
|
}
|
|
162
|
-
/**
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
}, {
|
|
166
|
-
key: "getInitialChildModelLinks",
|
|
167
|
-
value:
|
|
168
|
-
/**
|
|
169
|
-
*/
|
|
170
|
-
function getInitialChildModelLinks() {
|
|
171
|
-
var _context, _context2;
|
|
172
|
-
|
|
173
|
-
var endResultChildLinks = (0, _flattenDeep.default)((0, _map.default)(_context = this.endResultFormObjects).call(_context, function (endResultFormObject) {
|
|
174
|
-
return endResultFormObject.getInitialChildModelLinks();
|
|
175
|
-
}));
|
|
176
|
-
|
|
177
|
-
if (this.currentFormObject === null) {
|
|
178
|
-
return endResultChildLinks;
|
|
179
|
-
}
|
|
180
99
|
|
|
181
|
-
|
|
100
|
+
if (this.layouthint.has(_LayoutHints.UPDATE_ACTION)) {
|
|
101
|
+
return "update";
|
|
182
102
|
}
|
|
183
|
-
/**
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
}, {
|
|
187
|
-
key: "setChildModels",
|
|
188
|
-
value: function setChildModels(models) {
|
|
189
|
-
if (this.currentFormObject) {
|
|
190
|
-
this.currentFormObject.setChildModels(models);
|
|
191
|
-
}
|
|
192
103
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
104
|
+
if (this.layouthint.has(_LayoutHints.DELETE_ACTION)) {
|
|
105
|
+
return "delete";
|
|
196
106
|
}
|
|
197
|
-
/**
|
|
198
|
-
*/
|
|
199
107
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Get form level button labels
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
}, {
|
|
210
|
-
key: "buttonLabels",
|
|
211
|
-
get: function get() {
|
|
212
|
-
return this.getContribution("buttonLabels", {});
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* @returns button label from contributions;
|
|
216
|
-
*/
|
|
108
|
+
return this.getContribution("actiontype", "form");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
*/
|
|
112
|
+
|
|
217
113
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
114
|
+
static isApplicableModel(data) {
|
|
115
|
+
return data.contributions.resourcetype && data.contributions.resourcetype === "Form";
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
*/
|
|
222
119
|
|
|
223
|
-
// cancel button labels are defined on the form
|
|
224
|
-
if (buttonType === "cancel") {
|
|
225
|
-
var _this$buttonLabels$ca, _this$buttonLabels;
|
|
226
120
|
|
|
227
|
-
|
|
228
|
-
|
|
121
|
+
getInitialChildModelLinks() {
|
|
122
|
+
var _context;
|
|
229
123
|
|
|
124
|
+
const endResultChildLinks = (0, _flattenDeep.default)((0, _map.default)(_context = this.endResultFormObjects).call(_context, endResultFormObject => endResultFormObject.getInitialChildModelLinks()));
|
|
230
125
|
|
|
231
|
-
|
|
126
|
+
if (this.currentFormObject === null) {
|
|
127
|
+
return endResultChildLinks;
|
|
232
128
|
}
|
|
233
|
-
/**
|
|
234
|
-
* Get all applicable objects
|
|
235
|
-
*/
|
|
236
129
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
130
|
+
return [...this.currentFormObject.getInitialChildModelLinks(), ...endResultChildLinks];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
*/
|
|
241
134
|
|
|
242
|
-
if (this.currentFormObject === null) {
|
|
243
|
-
return this.completedFormObjects;
|
|
244
|
-
}
|
|
245
135
|
|
|
246
|
-
|
|
136
|
+
setChildModels(models) {
|
|
137
|
+
if (this.currentFormObject) {
|
|
138
|
+
this.currentFormObject.setChildModels(models);
|
|
247
139
|
}
|
|
248
|
-
/**
|
|
249
|
-
*/
|
|
250
|
-
|
|
251
|
-
}, {
|
|
252
|
-
key: "objectKeys",
|
|
253
|
-
get: function get() {
|
|
254
|
-
if ((0, _objects.has)(this.contributions, "objects")) {
|
|
255
|
-
return (0, _keys.default)(this.contributions.objects);
|
|
256
|
-
}
|
|
257
140
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
141
|
+
this.endResultFormObjects.forEach(endResultFormObject => {
|
|
142
|
+
endResultFormObject.setChildModels(models);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
*/
|
|
262
147
|
|
|
263
|
-
}, {
|
|
264
|
-
key: "numberOfExpectedQuestions",
|
|
265
|
-
get: function get() {
|
|
266
|
-
return this.objectKeys.length;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Has questions configured on form
|
|
270
|
-
*/
|
|
271
|
-
|
|
272
|
-
}, {
|
|
273
|
-
key: "hasNoQuestionsConfigured",
|
|
274
|
-
get: function get() {
|
|
275
|
-
return this.isComplete && (this.objectKeys.length === 0 || !("missing" in this.data) && !("results" in this.data) && !("errors" in this.data));
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
*/
|
|
279
148
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
149
|
+
get label() {
|
|
150
|
+
return this.getContribution("label", "");
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get form level button labels
|
|
154
|
+
*/
|
|
284
155
|
|
|
285
|
-
if (!dynamicschema) {
|
|
286
|
-
return anchor;
|
|
287
|
-
}
|
|
288
156
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
296
|
-
elements: _objectSpread(_objectSpread({}, item.elements), {}, {
|
|
297
|
-
dynamicschema: dynamicschema
|
|
298
|
-
})
|
|
299
|
-
});
|
|
300
|
-
}) : null
|
|
301
|
-
});
|
|
302
|
-
})
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
*/
|
|
157
|
+
get buttonLabels() {
|
|
158
|
+
return this.getContribution("buttonLabels", {});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @returns button label from contributions;
|
|
162
|
+
*/
|
|
307
163
|
|
|
308
|
-
}, {
|
|
309
|
-
key: "getMissingAnchors",
|
|
310
|
-
value: function getMissingAnchors() {
|
|
311
|
-
var _this$data$missing$an,
|
|
312
|
-
_this$data$missing,
|
|
313
|
-
_this2 = this;
|
|
314
164
|
|
|
315
|
-
|
|
165
|
+
getButtonLabel(buttonType) {
|
|
166
|
+
var _this$currentFormObje, _this$currentFormObje2, _this$currentFormObje3;
|
|
316
167
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
168
|
+
// cancel button labels are defined on the form
|
|
169
|
+
if (buttonType === "cancel") {
|
|
170
|
+
var _this$buttonLabels$ca, _this$buttonLabels;
|
|
320
171
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
});
|
|
172
|
+
return (_this$buttonLabels$ca = (_this$buttonLabels = this.buttonLabels) === null || _this$buttonLabels === void 0 ? void 0 : _this$buttonLabels.cancel) !== null && _this$buttonLabels$ca !== void 0 ? _this$buttonLabels$ca : null;
|
|
173
|
+
} // all other form related button labels are defined on the object
|
|
324
174
|
|
|
325
|
-
if (resultObject) {
|
|
326
|
-
anchor.results = resultObject.elements;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
175
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
*/
|
|
176
|
+
return (_this$currentFormObje = (_this$currentFormObje2 = this.currentFormObject) === null || _this$currentFormObje2 === void 0 ? void 0 : (_this$currentFormObje3 = _this$currentFormObje2.buttonLabels) === null || _this$currentFormObje3 === void 0 ? void 0 : _this$currentFormObje3[buttonType]) !== null && _this$currentFormObje !== void 0 ? _this$currentFormObje : null;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get all applicable objects
|
|
180
|
+
*/
|
|
336
181
|
|
|
337
|
-
}, {
|
|
338
|
-
key: "createFormObject",
|
|
339
|
-
value: function createFormObject() {
|
|
340
|
-
if (this.data && this.contributions) {
|
|
341
|
-
var _missingAnchors$0$obj, _missingAnchors$, _this$contributions$o;
|
|
342
182
|
|
|
343
|
-
|
|
183
|
+
get allObjects() {
|
|
184
|
+
if (this.currentFormObject === null) {
|
|
185
|
+
return this.completedFormObjects;
|
|
186
|
+
}
|
|
344
187
|
|
|
345
|
-
|
|
346
|
-
|
|
188
|
+
return [...this.completedFormObjects, this.currentFormObject];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
*/
|
|
347
192
|
|
|
348
|
-
if (contributions) {
|
|
349
|
-
return new _FormObjectModel.default(missingAnchors[0], contributions);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
193
|
|
|
353
|
-
|
|
194
|
+
get objectKeys() {
|
|
195
|
+
if ((0, _objects.has)(this.contributions, "objects")) {
|
|
196
|
+
return (0, _keys.default)(this.contributions.objects);
|
|
354
197
|
}
|
|
355
|
-
/**
|
|
356
|
-
*/
|
|
357
198
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
*/
|
|
362
203
|
|
|
363
|
-
if (formObjectModel) {
|
|
364
|
-
var emptyFormObject = _FormObjectModel.default.createEmpty(formObjectModel);
|
|
365
204
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}, {
|
|
374
|
-
key: "getHighestRepeatIndex",
|
|
375
|
-
value: function getHighestRepeatIndex(formObjectModel) {
|
|
376
|
-
var _context7, _context8;
|
|
377
|
-
|
|
378
|
-
return Math.max.apply(Math, (0, _toConsumableArray2.default)((0, _map.default)(_context7 = (0, _filter.default)(_context8 = this.allObjects).call(_context8, function (formObject) {
|
|
379
|
-
return formObject.equals(formObjectModel, false);
|
|
380
|
-
})).call(_context7, function (formObject) {
|
|
381
|
-
return formObject.repeatIndex;
|
|
382
|
-
})));
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
*/
|
|
386
|
-
|
|
387
|
-
}, {
|
|
388
|
-
key: "addFormObject",
|
|
389
|
-
value: function addFormObject(formObjectModel) {
|
|
390
|
-
if (!formObjectModel) {
|
|
391
|
-
throw new _exceptions.IllegalArgumentException("Missing form object to add");
|
|
392
|
-
}
|
|
205
|
+
get numberOfExpectedQuestions() {
|
|
206
|
+
return this.objectKeys.length;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Has questions configured on form
|
|
210
|
+
*/
|
|
393
211
|
|
|
394
|
-
this.completedFormObjects = (0, _toConsumableArray2.default)(this.allObjects);
|
|
395
|
-
this.currentFormObject = formObjectModel;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Retrieve a form object by the key
|
|
399
|
-
*/
|
|
400
212
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
213
|
+
get hasNoQuestionsConfigured() {
|
|
214
|
+
return this.isComplete && (this.objectKeys.length === 0 || !("missing" in this.data) && !("results" in this.data) && !("errors" in this.data));
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
*/
|
|
405
218
|
|
|
406
|
-
return (0, _find.default)(_context9 = this.allObjects).call(_context9, function (formObject) {
|
|
407
|
-
return formObject.key === key;
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Retrieve a form object by a layouthint
|
|
412
|
-
*/
|
|
413
219
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
value: function getFormObjectByLayoutHint(hint) {
|
|
417
|
-
var _context10;
|
|
220
|
+
addGlobalDynamicSchema(anchor, dynamicschema) {
|
|
221
|
+
var _context2;
|
|
418
222
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
});
|
|
223
|
+
if (!dynamicschema) {
|
|
224
|
+
return anchor;
|
|
422
225
|
}
|
|
423
|
-
/**
|
|
424
|
-
*/
|
|
425
226
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
var _context11;
|
|
227
|
+
return { ...anchor,
|
|
228
|
+
elements: (0, _map.default)(_context2 = anchor.elements).call(_context2, element => {
|
|
229
|
+
var _context3;
|
|
430
230
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
231
|
+
return { ...element,
|
|
232
|
+
dynamicschema: element.dynamicschema ? (0, _map.default)(_context3 = element.dynamicschema).call(_context3, item => ({ ...item,
|
|
233
|
+
elements: { ...item.elements,
|
|
234
|
+
dynamicschema
|
|
235
|
+
}
|
|
236
|
+
})) : null
|
|
237
|
+
};
|
|
238
|
+
})
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
*/
|
|
434
243
|
|
|
435
|
-
if (formObjectModel.equals(this.currentFormObject)) {
|
|
436
|
-
throw new _exceptions.IllegalArgumentException("Can not remove the current form object");
|
|
437
|
-
}
|
|
438
244
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
*/
|
|
245
|
+
getMissingAnchors() {
|
|
246
|
+
var _this$data$missing$an, _this$data$missing;
|
|
445
247
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
*/
|
|
453
|
-
,
|
|
454
|
-
set: function set(formObject) {
|
|
455
|
-
this._currentFormObject = formObject;
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Completed objects are previously entered questions
|
|
459
|
-
*/
|
|
460
|
-
|
|
461
|
-
}, {
|
|
462
|
-
key: "completedFormObjects",
|
|
463
|
-
get: function get() {
|
|
464
|
-
return this._completedFormObjects;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
*/
|
|
468
|
-
,
|
|
469
|
-
set: function set(formObjects) {
|
|
470
|
-
this._completedFormObjects = formObjects;
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Previously entered objects are questions that have been entered before,
|
|
474
|
-
* but are currently not applicable for the form.
|
|
475
|
-
* For example because of previous navigation
|
|
476
|
-
*/
|
|
477
|
-
|
|
478
|
-
}, {
|
|
479
|
-
key: "previouslyEnteredFormObjects",
|
|
480
|
-
get: function get() {
|
|
481
|
-
return this._previouslyEnteredFormObjects;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
*/
|
|
485
|
-
,
|
|
486
|
-
set: function set(formObjects) {
|
|
487
|
-
this._previouslyEnteredFormObjects = formObjects;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Handle end results
|
|
491
|
-
*/
|
|
492
|
-
|
|
493
|
-
}, {
|
|
494
|
-
key: "setEndResultFormObjects",
|
|
495
|
-
value: function setEndResultFormObjects() {
|
|
496
|
-
var _this3 = this;
|
|
497
|
-
|
|
498
|
-
if (this.data && this.data.results) {
|
|
499
|
-
var _this$data$missing$an2, _this$data$missing2, _context12, _context13;
|
|
500
|
-
|
|
501
|
-
var missingObjects = (_this$data$missing$an2 = (_this$data$missing2 = this.data.missing) === null || _this$data$missing2 === void 0 ? void 0 : _this$data$missing2.anchors) !== null && _this$data$missing$an2 !== void 0 ? _this$data$missing$an2 : [];
|
|
502
|
-
var missingObjectIds = (0, _map.default)(missingObjects).call(missingObjects, function (anchor) {
|
|
503
|
-
return anchor.objectid;
|
|
504
|
-
}); // Filter out intermediate results and rename elements property to result property
|
|
505
|
-
|
|
506
|
-
var endResultAnchors = (0, _map.default)(_context12 = (0, _filter.default)(_context13 = this.data.results).call(_context13, function (result) {
|
|
507
|
-
return !(0, _includes.default)(missingObjectIds).call(missingObjectIds, result.objectid);
|
|
508
|
-
})).call(_context12, function (result) {
|
|
509
|
-
var elements = result.elements,
|
|
510
|
-
otherProps = (0, _objectWithoutProperties2.default)(result, _excluded);
|
|
511
|
-
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
512
|
-
results: elements
|
|
513
|
-
});
|
|
514
|
-
});
|
|
248
|
+
const missingAnchors = (_this$data$missing$an = (_this$data$missing = this.data.missing) === null || _this$data$missing === void 0 ? void 0 : _this$data$missing.anchors) !== null && _this$data$missing$an !== void 0 ? _this$data$missing$an : []; // Add intermediate result data to anchor
|
|
249
|
+
|
|
250
|
+
return (0, _map.default)(missingAnchors).call(missingAnchors, anchor => {
|
|
251
|
+
if (this.data.results) {
|
|
252
|
+
var _context4;
|
|
515
253
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
254
|
+
const resultObject = (0, _find.default)(_context4 = this.data.results).call(_context4, result => result.objectid === anchor.objectid && "elements" in result);
|
|
255
|
+
|
|
256
|
+
if (resultObject) {
|
|
257
|
+
anchor.results = resultObject.elements;
|
|
520
258
|
}
|
|
521
259
|
}
|
|
522
260
|
|
|
523
|
-
return
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
261
|
+
return this.addGlobalDynamicSchema(anchor, this.data.dynamicschema);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Create form object based on the data and contributions available in this form
|
|
266
|
+
*/
|
|
527
267
|
|
|
528
|
-
}, {
|
|
529
|
-
key: "expectsEndResultFormObjects",
|
|
530
|
-
get: function get() {
|
|
531
|
-
var _context14,
|
|
532
|
-
_this4 = this;
|
|
533
268
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
return this.objectKeys.some(function (objectKey) {
|
|
538
|
-
var _this4$contributions$, _this4$contributions$2, _this4$contributions$3;
|
|
269
|
+
createFormObject() {
|
|
270
|
+
if (this.data && this.contributions) {
|
|
271
|
+
var _missingAnchors$0$obj, _missingAnchors$, _this$contributions$o;
|
|
539
272
|
|
|
540
|
-
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
*/
|
|
273
|
+
const missingAnchors = this.getMissingAnchors(); // Get object id from first anchor
|
|
545
274
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
*/
|
|
553
|
-
,
|
|
554
|
-
set:
|
|
555
|
-
/**
|
|
556
|
-
*/
|
|
557
|
-
function set(endResultFormObjects) {
|
|
558
|
-
var _context15;
|
|
559
|
-
|
|
560
|
-
this.previousEndResultKeys = (0, _map.default)(_context15 = this.endResultFormObjects).call(_context15, function (endResult) {
|
|
561
|
-
return endResult.key;
|
|
562
|
-
});
|
|
563
|
-
this._endResultFormObjects = endResultFormObjects;
|
|
275
|
+
const objectId = (_missingAnchors$0$obj = missingAnchors === null || missingAnchors === void 0 ? void 0 : (_missingAnchors$ = missingAnchors[0]) === null || _missingAnchors$ === void 0 ? void 0 : _missingAnchors$.objectid) !== null && _missingAnchors$0$obj !== void 0 ? _missingAnchors$0$obj : "";
|
|
276
|
+
const contributions = (_this$contributions$o = this.contributions.objects) === null || _this$contributions$o === void 0 ? void 0 : _this$contributions$o[objectId];
|
|
277
|
+
|
|
278
|
+
if (contributions) {
|
|
279
|
+
return new _FormObjectModel.default(missingAnchors[0], contributions);
|
|
280
|
+
}
|
|
564
281
|
}
|
|
565
|
-
/**
|
|
566
|
-
*/
|
|
567
282
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
_this5 = this;
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
*/
|
|
573
287
|
|
|
574
|
-
return (0, _filter.default)(_context16 = this.endResultFormObjects).call(_context16, function (endResult) {
|
|
575
|
-
var _context17;
|
|
576
288
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
}, {
|
|
581
|
-
key: "previousEndResultKeys",
|
|
582
|
-
get: function get() {
|
|
583
|
-
return this._previousEndResultKeys;
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
*/
|
|
587
|
-
,
|
|
588
|
-
set: function set(endResultFormObjectKeys) {
|
|
589
|
-
this._previousEndResultKeys = endResultFormObjectKeys;
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Error handling
|
|
593
|
-
*/
|
|
594
|
-
|
|
595
|
-
}, {
|
|
596
|
-
key: "isValid",
|
|
597
|
-
get: function get() {
|
|
598
|
-
var _this6 = this;
|
|
599
|
-
|
|
600
|
-
if (this.currentFormObject) {
|
|
601
|
-
var _this$currentFormObje4, _this$currentFormObje5;
|
|
602
|
-
|
|
603
|
-
if (this.currentFormObject.isRepeatable) {
|
|
604
|
-
var _context18, _context19;
|
|
605
|
-
|
|
606
|
-
// repeating objects need at least one valid form object
|
|
607
|
-
var hasOneValidQuestion = (0, _find.default)(_context18 = (0, _filter.default)(_context19 = this.allObjects).call(_context19, function (object) {
|
|
608
|
-
return object.equals(_this6.currentFormObject, false);
|
|
609
|
-
})).call(_context18, function (object) {
|
|
610
|
-
return object.isValid;
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
if (hasOneValidQuestion) {
|
|
614
|
-
return true;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
289
|
+
addEmptyFormObject() {
|
|
290
|
+
let formObjectModel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.currentFormObject;
|
|
617
291
|
|
|
618
|
-
|
|
619
|
-
|
|
292
|
+
if (formObjectModel) {
|
|
293
|
+
const emptyFormObject = _FormObjectModel.default.createEmpty(formObjectModel);
|
|
620
294
|
|
|
621
|
-
|
|
295
|
+
emptyFormObject.repeatIndex = this.getHighestRepeatIndex(formObjectModel) + 1;
|
|
296
|
+
this.addFormObject(emptyFormObject);
|
|
622
297
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}, {
|
|
627
|
-
key: "hasServerErrors",
|
|
628
|
-
value: function hasServerErrors() {
|
|
629
|
-
if (this.errorCollection.hasItems) {
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
*/
|
|
632
301
|
|
|
633
|
-
if (this.currentFormObject) {
|
|
634
|
-
return this.currentFormObject.hasServerErrors();
|
|
635
|
-
}
|
|
636
302
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
}, {
|
|
643
|
-
key: "hasErrors",
|
|
644
|
-
value: function hasErrors() {
|
|
645
|
-
if (this.errorCollection.hasItems) {
|
|
646
|
-
return true;
|
|
647
|
-
}
|
|
303
|
+
getHighestRepeatIndex(formObjectModel) {
|
|
304
|
+
var _context5, _context6;
|
|
648
305
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
306
|
+
return Math.max(...(0, _map.default)(_context5 = (0, _filter.default)(_context6 = this.allObjects).call(_context6, formObject => formObject.equals(formObjectModel, false))).call(_context5, formObject => formObject.repeatIndex));
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
*/
|
|
652
310
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
*/
|
|
658
|
-
|
|
659
|
-
}, {
|
|
660
|
-
key: "addServerError",
|
|
661
|
-
value: function addServerError(error) {
|
|
662
|
-
if (error.parameters) {
|
|
663
|
-
this.errorCollection.addServerError(error.id, error.message, error.parameters);
|
|
664
|
-
} else {
|
|
665
|
-
this.errorCollection.addServerError(error.id, error.message);
|
|
666
|
-
}
|
|
311
|
+
|
|
312
|
+
addFormObject(formObjectModel) {
|
|
313
|
+
if (!formObjectModel) {
|
|
314
|
+
throw new _exceptions.IllegalArgumentException("Missing form object to add");
|
|
667
315
|
}
|
|
668
|
-
/**
|
|
669
|
-
* Reset error messages
|
|
670
|
-
*/
|
|
671
316
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
317
|
+
this.completedFormObjects = [...this.allObjects];
|
|
318
|
+
this.currentFormObject = formObjectModel;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Retrieve a form object by the key
|
|
322
|
+
*/
|
|
676
323
|
|
|
677
|
-
if (this.currentFormObject) {
|
|
678
|
-
this.currentFormObject.resetErrors();
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
*/
|
|
683
324
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
get: function get() {
|
|
687
|
-
return this._errorCollection;
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
*/
|
|
691
|
-
,
|
|
692
|
-
set: function set(errorCollection) {
|
|
693
|
-
this._errorCollection = errorCollection;
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* Indicates if the form needs to be committed
|
|
697
|
-
*/
|
|
698
|
-
|
|
699
|
-
}, {
|
|
700
|
-
key: "commit",
|
|
701
|
-
get: function get() {
|
|
702
|
-
return this._commit || false;
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
*/
|
|
706
|
-
,
|
|
707
|
-
set: function set(commit) {
|
|
708
|
-
this._commit = commit;
|
|
709
|
-
}
|
|
710
|
-
/**
|
|
711
|
-
* Inidicates if form is finished: Form is completely entered and committed
|
|
712
|
-
*/
|
|
713
|
-
|
|
714
|
-
}, {
|
|
715
|
-
key: "isFinished",
|
|
716
|
-
get: function get() {
|
|
717
|
-
return this._isFinished || "success" in this.data;
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
*/
|
|
721
|
-
,
|
|
722
|
-
set: function set(isFinished) {
|
|
723
|
-
this._isFinished = isFinished;
|
|
724
|
-
}
|
|
725
|
-
/**
|
|
726
|
-
* Indicates if form is completely entered
|
|
727
|
-
*/
|
|
728
|
-
|
|
729
|
-
}, {
|
|
730
|
-
key: "isComplete",
|
|
731
|
-
get: function get() {
|
|
732
|
-
return this._isComplete;
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
*/
|
|
736
|
-
,
|
|
737
|
-
set: function set(isComplete) {
|
|
738
|
-
this._isComplete = isComplete;
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Handle success redirects
|
|
742
|
-
*/
|
|
743
|
-
|
|
744
|
-
}, {
|
|
745
|
-
key: "successRedirect",
|
|
746
|
-
get: function get() {
|
|
747
|
-
return this.isFinished && this.data.success ? new _Href.default(this.data.success.redirect) : null;
|
|
748
|
-
}
|
|
749
|
-
/**
|
|
750
|
-
*/
|
|
325
|
+
getFormObjectByKey(key) {
|
|
326
|
+
var _context7;
|
|
751
327
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
*/
|
|
328
|
+
return (0, _find.default)(_context7 = this.allObjects).call(_context7, formObject => formObject.key === key);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Retrieve a form object by a layouthint
|
|
332
|
+
*/
|
|
759
333
|
|
|
760
|
-
}, {
|
|
761
|
-
key: "getSuccessData",
|
|
762
|
-
value: function getSuccessData() {
|
|
763
|
-
var _this$data$success;
|
|
764
334
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* Href handling
|
|
769
|
-
*/
|
|
770
|
-
|
|
771
|
-
}, {
|
|
772
|
-
key: "setParameters",
|
|
773
|
-
value: function setParameters(modularuiResponse) {
|
|
774
|
-
var _modularuiResponse$pa;
|
|
775
|
-
|
|
776
|
-
var parameters = (_modularuiResponse$pa = modularuiResponse === null || modularuiResponse === void 0 ? void 0 : modularuiResponse.parameters) !== null && _modularuiResponse$pa !== void 0 ? _modularuiResponse$pa : [];
|
|
777
|
-
return (0, _map.default)(parameters).call(parameters, function (par) {
|
|
778
|
-
return new _Parameter.default(par._prefix, par._name, par._value);
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
*/
|
|
335
|
+
getFormObjectByLayoutHint(hint) {
|
|
336
|
+
var _context8;
|
|
783
337
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
338
|
+
return (0, _find.default)(_context8 = this.allObjects).call(_context8, formObject => formObject.layouthint.has(hint));
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
*/
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
removeFormObject(formObjectModel) {
|
|
345
|
+
var _context9;
|
|
346
|
+
|
|
347
|
+
if (!formObjectModel) {
|
|
348
|
+
throw new _exceptions.IllegalArgumentException("Missing form object to remove");
|
|
794
349
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}, {
|
|
799
|
-
key: "selfhrefNoCommitParam",
|
|
800
|
-
value: function selfhrefNoCommitParam() {
|
|
801
|
-
var _context20;
|
|
802
|
-
|
|
803
|
-
var selfhref = this.selflink.href;
|
|
804
|
-
selfhref.method = _Constants.HTTP_METHODS.POST;
|
|
805
|
-
selfhref.parameters = (0, _filter.default)(_context20 = this.parameters).call(_context20, function (parameter) {
|
|
806
|
-
return parameter.name !== "commit";
|
|
807
|
-
});
|
|
808
|
-
return selfhref;
|
|
350
|
+
|
|
351
|
+
if (formObjectModel.equals(this.currentFormObject)) {
|
|
352
|
+
throw new _exceptions.IllegalArgumentException("Can not remove the current form object");
|
|
809
353
|
}
|
|
810
|
-
/**
|
|
811
|
-
*/
|
|
812
354
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
355
|
+
this.completedFormObjects = (0, _filter.default)(_context9 = this.completedFormObjects).call(_context9, formObject => !formObject.equals(formObjectModel));
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
*/
|
|
817
359
|
|
|
818
|
-
if (this.expectsEndResultFormObjects && !this.isComplete && !this.commit) {
|
|
819
|
-
selfhref.addParameter("commit", "false");
|
|
820
|
-
}
|
|
821
360
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
}, {
|
|
829
|
-
key: "selfhref",
|
|
830
|
-
get: function get() {
|
|
831
|
-
if (!this.selflink) {
|
|
832
|
-
throw new Error("No self link found for form");
|
|
833
|
-
}
|
|
361
|
+
get currentFormObject() {
|
|
362
|
+
return this._currentFormObject;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
*/
|
|
834
366
|
|
|
835
|
-
if ((0, _Settings.getSetting)("ALWAYS_COMMIT_FORM")) {
|
|
836
|
-
return this.selfhrefNoCommitParam();
|
|
837
|
-
}
|
|
838
367
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
368
|
+
set currentFormObject(formObject) {
|
|
369
|
+
this._currentFormObject = formObject;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Completed objects are previously entered questions
|
|
373
|
+
*/
|
|
844
374
|
|
|
845
|
-
}, {
|
|
846
|
-
key: "tokens",
|
|
847
|
-
get: function get() {
|
|
848
|
-
if (!this._tokens) {
|
|
849
|
-
var _this$data$tokens;
|
|
850
375
|
|
|
851
|
-
|
|
852
|
-
|
|
376
|
+
get completedFormObjects() {
|
|
377
|
+
return this._completedFormObjects;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
*/
|
|
853
381
|
|
|
854
|
-
return this._tokens;
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Replaces all tokens with the given collection of tokens
|
|
858
|
-
*/
|
|
859
|
-
,
|
|
860
|
-
set: function set(tokens) {
|
|
861
|
-
this._tokens = tokens;
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* Removes all tokens from the form
|
|
865
|
-
*/
|
|
866
|
-
|
|
867
|
-
}, {
|
|
868
|
-
key: "removeTokens",
|
|
869
|
-
value: function removeTokens() {
|
|
870
|
-
this._tokens = [];
|
|
871
|
-
}
|
|
872
|
-
/**
|
|
873
|
-
* Keep track of changed form
|
|
874
|
-
*/
|
|
875
|
-
|
|
876
|
-
}, {
|
|
877
|
-
key: "isChanged",
|
|
878
|
-
value: function isChanged() {
|
|
879
|
-
return this.currentFormObject !== null && this.currentFormObject.isChangedSince(this.lastUpdate);
|
|
880
|
-
}
|
|
881
|
-
/**
|
|
882
|
-
*/
|
|
883
382
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
set: function set(lastUpdate) {
|
|
893
|
-
this._lastUpdate = lastUpdate;
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
|
-
}, {
|
|
899
|
-
key: "getFormDataObjects",
|
|
900
|
-
value: function getFormDataObjects() {
|
|
901
|
-
var _context21,
|
|
902
|
-
_this7 = this;
|
|
903
|
-
|
|
904
|
-
var validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
905
|
-
var validationData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
906
|
-
var formdata = [];
|
|
907
|
-
var formObjects = (0, _filter.default)(_context21 = this.allObjects).call(_context21, function (formObject, index) {
|
|
908
|
-
// repeatabe object without fixed nr of repeats, remove last form object from formdata,
|
|
909
|
-
// because this is the formobject that is used as a placeholder for the create object
|
|
910
|
-
// of the collection of repeats
|
|
911
|
-
if (formObject.isRepeatable && !formObject.hasFixedNrOfRepeats) {
|
|
912
|
-
var isLastRepeat = index === _this7.allObjects.length - 1 || _this7.allObjects[index + 1].key !== formObject.key;
|
|
913
|
-
|
|
914
|
-
if (isLastRepeat) {
|
|
915
|
-
return false;
|
|
916
|
-
}
|
|
917
|
-
}
|
|
383
|
+
set completedFormObjects(formObjects) {
|
|
384
|
+
this._completedFormObjects = formObjects;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Previously entered objects are questions that have been entered before,
|
|
388
|
+
* but are currently not applicable for the form.
|
|
389
|
+
* For example because of previous navigation
|
|
390
|
+
*/
|
|
918
391
|
|
|
919
|
-
return formObject.isValid || !validOnly;
|
|
920
|
-
});
|
|
921
|
-
formObjects.forEach(function (formObject) {
|
|
922
|
-
var objectFormData = formObject.getFormData(validationData);
|
|
923
|
-
var existingObjectIndex = (0, _findIndex.default)(formdata).call(formdata, function (obj) {
|
|
924
|
-
return obj.key === formObject.key && obj.repeatIndex === formObject.repeatIndex;
|
|
925
|
-
});
|
|
926
|
-
/*
|
|
927
|
-
* when the object already exists in the formdata with the same key and index,
|
|
928
|
-
* merge the attributes of both objects together
|
|
929
|
-
*/
|
|
930
392
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
repeatIndex: formObject.repeatIndex,
|
|
937
|
-
formdata: objectFormData
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
return (0, _map.default)(formdata).call(formdata, function (obj) {
|
|
942
|
-
return (0, _defineProperty2.default)({}, obj.key, obj.formdata);
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
*/
|
|
947
|
-
|
|
948
|
-
}, {
|
|
949
|
-
key: "getFormData",
|
|
950
|
-
value: function getFormData() {
|
|
951
|
-
var validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
952
|
-
var withConcurrencyToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
953
|
-
var validationData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
954
|
-
|
|
955
|
-
if (withConcurrencyToken && this.tokens.length > 0) {
|
|
956
|
-
return (0, _stringify.default)({
|
|
957
|
-
objects: this.getFormDataObjects(validOnly, validationData),
|
|
958
|
-
tokens: this.tokens
|
|
959
|
-
});
|
|
960
|
-
}
|
|
393
|
+
get previouslyEnteredFormObjects() {
|
|
394
|
+
return this._previouslyEnteredFormObjects;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
*/
|
|
961
398
|
|
|
962
|
-
return (0, _stringify.default)({
|
|
963
|
-
objects: this.getFormDataObjects(validOnly, validationData)
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
|
|
968
|
-
*/
|
|
969
|
-
|
|
970
|
-
}, {
|
|
971
|
-
key: "setUseClientsideValidation",
|
|
972
|
-
value: function setUseClientsideValidation(enabled) {
|
|
973
|
-
this._useClientsideValidation = enabled;
|
|
974
|
-
this.allObjects.forEach(function (formObject) {
|
|
975
|
-
formObject.attributeCollection.all.forEach(function (item) {
|
|
976
|
-
return item.setUseClientsideValidation(enabled);
|
|
977
|
-
});
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Indicates if client side validation is enabled
|
|
982
|
-
* @returns {boolean}
|
|
983
|
-
*/
|
|
984
399
|
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
400
|
+
set previouslyEnteredFormObjects(formObjects) {
|
|
401
|
+
this._previouslyEnteredFormObjects = formObjects;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Handle end results
|
|
405
|
+
*/
|
|
989
406
|
|
|
990
|
-
return (_this$_useClientsideV = this._useClientsideValidation) !== null && _this$_useClientsideV !== void 0 ? _this$_useClientsideV : true;
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* Get form data for submitting
|
|
994
|
-
*/
|
|
995
|
-
|
|
996
|
-
}, {
|
|
997
|
-
key: "formdata",
|
|
998
|
-
get: function get() {
|
|
999
|
-
return this.getFormData(this.useClientsideValidation());
|
|
1000
|
-
}
|
|
1001
|
-
/**
|
|
1002
|
-
*/
|
|
1003
407
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
return this.getFormData(false, false, true);
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Form navigation: Go one object back (previous button)
|
|
1011
|
-
*/
|
|
1012
|
-
|
|
1013
|
-
}, {
|
|
1014
|
-
key: "hasPreviousStep",
|
|
1015
|
-
get: function get() {
|
|
1016
|
-
var _context22;
|
|
1017
|
-
|
|
1018
|
-
var currentFormObjectKey = this.currentFormObject != null ? this.currentFormObject.key : "";
|
|
1019
|
-
return (0, _filter.default)(_context22 = this.completedFormObjects).call(_context22, function (formObject) {
|
|
1020
|
-
return !formObject.isRepeatWithUnknownTotal || formObject.key !== currentFormObjectKey;
|
|
1021
|
-
}).length > 0;
|
|
1022
|
-
}
|
|
1023
|
-
/**
|
|
1024
|
-
* Go one form-object back,
|
|
1025
|
-
* for repeating object this means go back
|
|
1026
|
-
* until we get at a form object that had
|
|
1027
|
-
* a different key than the current form object
|
|
1028
|
-
*/
|
|
1029
|
-
|
|
1030
|
-
}, {
|
|
1031
|
-
key: "setPreviousObject",
|
|
1032
|
-
value: function setPreviousObject() {
|
|
1033
|
-
var _context24,
|
|
1034
|
-
_context25,
|
|
1035
|
-
_context26,
|
|
1036
|
-
_this8 = this,
|
|
1037
|
-
_context27,
|
|
1038
|
-
_context28;
|
|
1039
|
-
|
|
1040
|
-
this.isComplete = false;
|
|
1041
|
-
var oldCurrentFormObject = this.currentFormObject;
|
|
1042
|
-
|
|
1043
|
-
if (this.currentFormObject !== null) {
|
|
1044
|
-
var _context23;
|
|
1045
|
-
|
|
1046
|
-
this.previouslyEnteredFormObjects = (0, _concat.default)(_context23 = [this.currentFormObject]).call(_context23, (0, _toConsumableArray2.default)(this.previouslyEnteredFormObjects));
|
|
1047
|
-
}
|
|
408
|
+
setEndResultFormObjects() {
|
|
409
|
+
if (this.data && this.data.results) {
|
|
410
|
+
var _this$data$missing$an2, _this$data$missing2, _context10, _context11;
|
|
1048
411
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
var completedFormObjectKeys = (0, _filter.default)(_context25 = (0, _map.default)(_context26 = this.completedFormObjects).call(_context26, function (formObject) {
|
|
1052
|
-
return formObject.key;
|
|
1053
|
-
})).call(_context25, function (formObjectKey) {
|
|
1054
|
-
var _this8$currentFormObj;
|
|
412
|
+
const missingObjects = (_this$data$missing$an2 = (_this$data$missing2 = this.data.missing) === null || _this$data$missing2 === void 0 ? void 0 : _this$data$missing2.anchors) !== null && _this$data$missing$an2 !== void 0 ? _this$data$missing$an2 : [];
|
|
413
|
+
const missingObjectIds = (0, _map.default)(missingObjects).call(missingObjects, anchor => anchor.objectid); // Filter out intermediate results and rename elements property to result property
|
|
1055
414
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
415
|
+
const endResultAnchors = (0, _map.default)(_context10 = (0, _filter.default)(_context11 = this.data.results).call(_context11, result => !(0, _includes.default)(missingObjectIds).call(missingObjectIds, result.objectid))).call(_context10, result => {
|
|
416
|
+
const {
|
|
417
|
+
elements,
|
|
418
|
+
...otherProps
|
|
419
|
+
} = result;
|
|
420
|
+
return { ...otherProps,
|
|
421
|
+
results: elements
|
|
422
|
+
};
|
|
1060
423
|
});
|
|
1061
|
-
this.previousEndResultKeys = (0, _map.default)(_context28 = this.endResultFormObjects).call(_context28, function (endResult) {
|
|
1062
|
-
return endResult.key;
|
|
1063
|
-
}); // while we are at the same repeating form object, go a step back
|
|
1064
424
|
|
|
1065
|
-
if (
|
|
1066
|
-
|
|
425
|
+
if (endResultAnchors.length > 0) {
|
|
426
|
+
return (0, _map.default)(endResultAnchors).call(endResultAnchors, endResult => new _FormObjectModel.default(endResult, this.contributions.objects[endResult.objectid]));
|
|
1067
427
|
}
|
|
1068
428
|
}
|
|
1069
|
-
/**
|
|
1070
|
-
* Form navigation: has next step or is last
|
|
1071
|
-
*/
|
|
1072
429
|
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
_this9 = this;
|
|
430
|
+
return [];
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
*/
|
|
1078
434
|
|
|
1079
|
-
if (this.isComplete || this.isFinished || this.hasNoQuestionsConfigured || !this.contributions.objects) {
|
|
1080
|
-
return false;
|
|
1081
|
-
} // current object is a dynamic object
|
|
1082
435
|
|
|
436
|
+
get expectsEndResultFormObjects() {
|
|
437
|
+
var _context12;
|
|
1083
438
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
439
|
+
const endResultKeys = (0, _map.default)(_context12 = this.endResultFormObjects).call(_context12, endResult => endResult.key);
|
|
440
|
+
return this.objectKeys.some(objectKey => {
|
|
441
|
+
var _this$contributions$o2, _this$contributions$o3, _this$contributions$o4;
|
|
1087
442
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
443
|
+
return ((_this$contributions$o2 = this.contributions.objects) === null || _this$contributions$o2 === void 0 ? void 0 : (_this$contributions$o3 = _this$contributions$o2[objectKey]) === null || _this$contributions$o3 === void 0 ? void 0 : (_this$contributions$o4 = _this$contributions$o3.content) === null || _this$contributions$o4 === void 0 ? void 0 : _this$contributions$o4.results) && !(0, _includes.default)(endResultKeys).call(endResultKeys, objectKey);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
*/
|
|
1091
448
|
|
|
1092
|
-
var currentObjectIndex = (0, _findIndex.default)(_context29 = this.objectKeys).call(_context29, function (objectKey) {
|
|
1093
|
-
var _this9$currentFormObj;
|
|
1094
449
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
450
|
+
get endResultFormObjects() {
|
|
451
|
+
return this._endResultFormObjects;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
*/
|
|
1098
455
|
|
|
1099
|
-
if (isLastObject && this.currentFormObject && this.currentFormObject.isRepeatable && !this.currentFormObject.isLastRepeat) {
|
|
1100
|
-
return true;
|
|
1101
|
-
} // current object is not repeatable and the last object
|
|
1102
456
|
|
|
457
|
+
getEndResultFormObjects() {
|
|
458
|
+
var _context13;
|
|
1103
459
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
} // can't determine if this is te last, render a next button
|
|
460
|
+
return (0, _filter.default)(_context13 = this.endResultFormObjects).call(_context13, endResult => {
|
|
461
|
+
var _context14;
|
|
1107
462
|
|
|
463
|
+
return !(0, _includes.default)(_context14 = this.previousEndResultKeys).call(_context14, endResult.key);
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
*/
|
|
1108
468
|
|
|
1109
|
-
return true;
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* Merge existing form with new form
|
|
1113
|
-
*/
|
|
1114
|
-
|
|
1115
|
-
}, {
|
|
1116
|
-
key: "update",
|
|
1117
|
-
value: function update(receivedForm) {
|
|
1118
|
-
if (receivedForm instanceof FormModel) {
|
|
1119
|
-
var _receivedForm$data;
|
|
1120
|
-
|
|
1121
|
-
this.resetErrors();
|
|
1122
|
-
this.lastUpdate = Date.now();
|
|
1123
|
-
this.lastServerUpdate = receivedForm.lastServerUpdate;
|
|
1124
|
-
this.tokens = receivedForm.tokens;
|
|
1125
|
-
this.isComplete = receivedForm.isComplete;
|
|
1126
|
-
this.isFinished = receivedForm.isFinished;
|
|
1127
|
-
var receivedFormData = (_receivedForm$data = receivedForm.data) !== null && _receivedForm$data !== void 0 ? _receivedForm$data : {};
|
|
1128
|
-
var hasMissing = (0, _objects.has)(receivedFormData, "missing");
|
|
1129
|
-
var hasErrors = (0, _objects.has)(receivedFormData, "errors");
|
|
1130
|
-
|
|
1131
|
-
if (!hasMissing && !hasErrors) {
|
|
1132
|
-
this.handleFinished(receivedForm);
|
|
1133
|
-
}
|
|
1134
469
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
}
|
|
470
|
+
set endResultFormObjects(endResultFormObjects) {
|
|
471
|
+
var _context15;
|
|
1138
472
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
473
|
+
this.previousEndResultKeys = (0, _map.default)(_context15 = this.endResultFormObjects).call(_context15, endResult => endResult.key);
|
|
474
|
+
this._endResultFormObjects = endResultFormObjects;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
*/
|
|
1143
478
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
479
|
+
|
|
480
|
+
get previousEndResultKeys() {
|
|
481
|
+
return this._previousEndResultKeys;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
set previousEndResultKeys(endResultFormObjectKeys) {
|
|
488
|
+
this._previousEndResultKeys = endResultFormObjectKeys;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Error handling
|
|
492
|
+
*/
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
get isValid() {
|
|
496
|
+
if (this.currentFormObject) {
|
|
497
|
+
var _this$currentFormObje4, _this$currentFormObje5;
|
|
498
|
+
|
|
499
|
+
if (this.currentFormObject.isRepeatable) {
|
|
500
|
+
var _context16, _context17;
|
|
501
|
+
|
|
502
|
+
// repeating objects need at least one valid form object
|
|
503
|
+
const hasOneValidQuestion = (0, _find.default)(_context16 = (0, _filter.default)(_context17 = this.allObjects).call(_context17, object => object.equals(this.currentFormObject, false))).call(_context16, object => object.isValid);
|
|
504
|
+
|
|
505
|
+
if (hasOneValidQuestion) {
|
|
506
|
+
return true;
|
|
507
|
+
}
|
|
1154
508
|
}
|
|
1155
509
|
|
|
1156
|
-
return this;
|
|
510
|
+
return (_this$currentFormObje4 = (_this$currentFormObje5 = this.currentFormObject) === null || _this$currentFormObje5 === void 0 ? void 0 : _this$currentFormObje5.isValid) !== null && _this$currentFormObje4 !== void 0 ? _this$currentFormObje4 : true;
|
|
1157
511
|
}
|
|
1158
|
-
/**
|
|
1159
|
-
* Process finished form
|
|
1160
|
-
*/
|
|
1161
|
-
|
|
1162
|
-
}, {
|
|
1163
|
-
key: "handleFinished",
|
|
1164
|
-
value: function handleFinished(receivedForm) {
|
|
1165
|
-
if (this.currentFormObject) {
|
|
1166
|
-
var _context30;
|
|
1167
512
|
|
|
1168
|
-
|
|
1169
|
-
|
|
513
|
+
return true;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
*/
|
|
1170
517
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
518
|
+
|
|
519
|
+
hasServerErrors() {
|
|
520
|
+
if (this.errorCollection.hasItems) {
|
|
521
|
+
return true;
|
|
1174
522
|
}
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
}, {
|
|
1179
|
-
key: "handleRootErrors",
|
|
1180
|
-
value: function handleRootErrors(errors) {
|
|
1181
|
-
var _this10 = this;
|
|
1182
|
-
|
|
1183
|
-
(0, _filter.default)(errors).call(errors, function (error) {
|
|
1184
|
-
return !error.anchor;
|
|
1185
|
-
}).forEach(function (error) {
|
|
1186
|
-
_this10.errorCollection.addServerError(error.id, error.message, error.properties);
|
|
1187
|
-
});
|
|
523
|
+
|
|
524
|
+
if (this.currentFormObject) {
|
|
525
|
+
return this.currentFormObject.hasServerErrors();
|
|
1188
526
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
if (errorAnchors) {
|
|
1201
|
-
errorAnchors.forEach(function (error) {
|
|
1202
|
-
if (error.anchor && _this11.currentFormObject && _this11.currentFormObject.key === error.anchor.objectid) {
|
|
1203
|
-
_this11.currentFormObject.addServerError(error);
|
|
1204
|
-
} else {
|
|
1205
|
-
_this11.errorCollection.addServerError(error.id, error.message, error.properties);
|
|
1206
|
-
}
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
527
|
+
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
*/
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
hasErrors() {
|
|
535
|
+
if (this.errorCollection.hasItems) {
|
|
536
|
+
return true;
|
|
1209
537
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}, {
|
|
1215
|
-
key: "handleMissing",
|
|
1216
|
-
value: function handleMissing(receivedForm) {
|
|
1217
|
-
if (this.currentFormObject && this.currentFormObject.equals(receivedForm.currentFormObject)) {
|
|
1218
|
-
this.handleMissingErrors(receivedForm);
|
|
1219
|
-
} else {
|
|
1220
|
-
this.handleNewFormObject(receivedForm);
|
|
1221
|
-
}
|
|
538
|
+
|
|
539
|
+
if (this.currentFormObject) {
|
|
540
|
+
return this.currentFormObject.hasErrors();
|
|
1222
541
|
}
|
|
1223
|
-
/**
|
|
1224
|
-
* Received missing anchors in the response with an object id that is the current form object
|
|
1225
|
-
*/
|
|
1226
542
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Add an error to the error collection of this form
|
|
547
|
+
*/
|
|
1231
548
|
|
|
1232
|
-
if (this.currentFormObject === null) {
|
|
1233
|
-
return null;
|
|
1234
|
-
}
|
|
1235
549
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
550
|
+
addServerError(error) {
|
|
551
|
+
if (error.parameters) {
|
|
552
|
+
this.errorCollection.addServerError(error.id, error.message, error.parameters);
|
|
553
|
+
} else {
|
|
554
|
+
this.errorCollection.addServerError(error.id, error.message);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Reset error messages
|
|
559
|
+
*/
|
|
1242
560
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
561
|
+
|
|
562
|
+
resetErrors() {
|
|
563
|
+
this._errorCollection = new _ErrorCollection.default("form");
|
|
564
|
+
|
|
565
|
+
if (this.currentFormObject) {
|
|
566
|
+
this.currentFormObject.resetErrors();
|
|
1246
567
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
get errorCollection() {
|
|
574
|
+
return this._errorCollection;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
*/
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
set errorCollection(errorCollection) {
|
|
581
|
+
this._errorCollection = errorCollection;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Indicates if the form needs to be committed
|
|
585
|
+
*/
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
get commit() {
|
|
589
|
+
return this._commit || false;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
*/
|
|
1249
593
|
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
594
|
+
|
|
595
|
+
set commit(commit) {
|
|
596
|
+
this._commit = commit;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Inidicates if form is finished: Form is completely entered and committed
|
|
600
|
+
*/
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
get isFinished() {
|
|
604
|
+
return this._isFinished || "success" in this.data;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
*/
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
set isFinished(isFinished) {
|
|
611
|
+
this._isFinished = isFinished;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Indicates if form is completely entered
|
|
615
|
+
*/
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
get isComplete() {
|
|
619
|
+
return this._isComplete;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
*/
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
set isComplete(isComplete) {
|
|
626
|
+
this._isComplete = isComplete;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Handle success redirects
|
|
630
|
+
*/
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
get successRedirect() {
|
|
634
|
+
return this.isFinished && this.data.success ? new _Href.default(this.data.success.redirect) : null;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
*/
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
get redirectLocation() {
|
|
641
|
+
return this._redirectLocation || this.successRedirect;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
getSuccessData() {
|
|
648
|
+
var _this$data$success;
|
|
649
|
+
|
|
650
|
+
return (_this$data$success = this.data.success) === null || _this$data$success === void 0 ? void 0 : _this$data$success.data;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Href handling
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
setParameters(modularuiResponse) {
|
|
658
|
+
var _modularuiResponse$pa;
|
|
659
|
+
|
|
660
|
+
const parameters = (_modularuiResponse$pa = modularuiResponse === null || modularuiResponse === void 0 ? void 0 : modularuiResponse.parameters) !== null && _modularuiResponse$pa !== void 0 ? _modularuiResponse$pa : [];
|
|
661
|
+
return (0, _map.default)(parameters).call(parameters, par => new _Parameter.default(par._prefix, par._name, par._value));
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
*/
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
get parameters() {
|
|
668
|
+
return this._parameters;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
set parameters(parameters) {
|
|
675
|
+
this._parameters = parameters;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
*/
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
selfhrefNoCommitParam() {
|
|
682
|
+
var _context18;
|
|
683
|
+
|
|
684
|
+
const selfhref = this.selflink.href;
|
|
685
|
+
selfhref.method = _Constants.HTTP_METHODS.POST;
|
|
686
|
+
selfhref.parameters = (0, _filter.default)(_context18 = this.parameters).call(_context18, parameter => parameter.name !== "commit");
|
|
687
|
+
return selfhref;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
*/
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
selfhrefWithCommitParam() {
|
|
694
|
+
const selfhref = this.selfhrefNoCommitParam();
|
|
695
|
+
|
|
696
|
+
if (this.expectsEndResultFormObjects && !this.isComplete && !this.commit) {
|
|
697
|
+
selfhref.addParameter("commit", "false");
|
|
1254
698
|
}
|
|
1255
|
-
/**
|
|
1256
|
-
*/
|
|
1257
|
-
|
|
1258
|
-
}, {
|
|
1259
|
-
key: "handleNewFormObject",
|
|
1260
|
-
value: function handleNewFormObject(receivedForm) {
|
|
1261
|
-
this.endResultFormObjects = receivedForm.endResultFormObjects;
|
|
1262
|
-
var receivedCurrentFormObject = receivedForm.currentFormObject;
|
|
1263
|
-
|
|
1264
|
-
if (receivedCurrentFormObject === null) {
|
|
1265
|
-
this.completedFormObjects = (0, _toConsumableArray2.default)(this.allObjects);
|
|
1266
|
-
this.currentFormObject = null;
|
|
1267
|
-
} else {
|
|
1268
|
-
var _context32;
|
|
1269
699
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
700
|
+
return selfhref;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Create a selfhref including the parameters that are used to start this form
|
|
704
|
+
*/
|
|
1274
705
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
this.currentFormObject = receivedCurrentFormObject;
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
706
|
+
|
|
707
|
+
get selfhref() {
|
|
708
|
+
if (!this.selflink) {
|
|
709
|
+
throw new Error("No self link found for form");
|
|
1282
710
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
*/
|
|
1287
|
-
|
|
1288
|
-
}, {
|
|
1289
|
-
key: "mergePreviouslyEnteredObjects",
|
|
1290
|
-
get: function get() {
|
|
1291
|
-
return this._mergePreviouslyEnteredObjects;
|
|
711
|
+
|
|
712
|
+
if ((0, _Settings.getSetting)("ALWAYS_COMMIT_FORM")) {
|
|
713
|
+
return this.selfhrefNoCommitParam();
|
|
1292
714
|
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
715
|
+
|
|
716
|
+
return this.selfhrefWithCommitParam();
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Handle form tokens to indicate concurrent form use
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
get tokens() {
|
|
724
|
+
if (!this._tokens) {
|
|
725
|
+
var _this$data$tokens;
|
|
726
|
+
|
|
727
|
+
this._tokens = (_this$data$tokens = this.data.tokens) !== null && _this$data$tokens !== void 0 ? _this$data$tokens : [];
|
|
1298
728
|
}
|
|
1299
|
-
/**
|
|
1300
|
-
*/
|
|
1301
729
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
730
|
+
return this._tokens;
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Replaces all tokens with the given collection of tokens
|
|
734
|
+
*/
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
set tokens(tokens) {
|
|
738
|
+
this._tokens = tokens;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Removes all tokens from the form
|
|
742
|
+
*/
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
removeTokens() {
|
|
746
|
+
this._tokens = [];
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Keep track of changed form
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
isChanged() {
|
|
754
|
+
return this.currentFormObject !== null && this.currentFormObject.isChangedSince(this.lastUpdate);
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
*/
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
get lastUpdate() {
|
|
761
|
+
return this._lastUpdate;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
*/
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
set lastUpdate(lastUpdate) {
|
|
768
|
+
this._lastUpdate = lastUpdate;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
*/
|
|
772
|
+
|
|
1307
773
|
|
|
1308
|
-
|
|
1309
|
-
|
|
774
|
+
getFormDataObjects() {
|
|
775
|
+
var _context19;
|
|
1310
776
|
|
|
1311
|
-
|
|
1312
|
-
|
|
777
|
+
let validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
778
|
+
let validationData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
779
|
+
const formdata = [];
|
|
780
|
+
const formObjects = (0, _filter.default)(_context19 = this.allObjects).call(_context19, (formObject, index) => {
|
|
781
|
+
// repeatabe object without fixed nr of repeats, remove last form object from formdata,
|
|
782
|
+
// because this is the formobject that is used as a placeholder for the create object
|
|
783
|
+
// of the collection of repeats
|
|
784
|
+
if (formObject.isRepeatable && !formObject.hasFixedNrOfRepeats) {
|
|
785
|
+
const isLastRepeat = index === this.allObjects.length - 1 || this.allObjects[index + 1].key !== formObject.key;
|
|
1313
786
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
787
|
+
if (isLastRepeat) {
|
|
788
|
+
return false;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return formObject.isValid || !validOnly;
|
|
793
|
+
});
|
|
794
|
+
formObjects.forEach(formObject => {
|
|
795
|
+
const objectFormData = formObject.getFormData(validationData);
|
|
796
|
+
const existingObjectIndex = (0, _findIndex.default)(formdata).call(formdata, obj => obj.key === formObject.key && obj.repeatIndex === formObject.repeatIndex);
|
|
797
|
+
/*
|
|
798
|
+
* when the object already exists in the formdata with the same key and index,
|
|
799
|
+
* merge the attributes of both objects together
|
|
800
|
+
*/
|
|
801
|
+
|
|
802
|
+
if (existingObjectIndex > -1) {
|
|
803
|
+
formdata[existingObjectIndex].formdata = (0, _deepmerge.default)(formdata[existingObjectIndex].formdata, objectFormData);
|
|
804
|
+
} else {
|
|
805
|
+
formdata.push({
|
|
806
|
+
key: formObject.key,
|
|
807
|
+
repeatIndex: formObject.repeatIndex,
|
|
808
|
+
formdata: objectFormData
|
|
1317
809
|
});
|
|
1318
|
-
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
return (0, _map.default)(formdata).call(formdata, obj => ({
|
|
813
|
+
[obj.key]: obj.formdata
|
|
814
|
+
}));
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
*/
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
getFormData() {
|
|
821
|
+
let validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
822
|
+
let withConcurrencyToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
823
|
+
let validationData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
824
|
+
|
|
825
|
+
if (withConcurrencyToken && this.tokens.length > 0) {
|
|
826
|
+
return (0, _stringify.default)({
|
|
827
|
+
objects: this.getFormDataObjects(validOnly, validationData),
|
|
828
|
+
tokens: this.tokens
|
|
1319
829
|
});
|
|
1320
830
|
}
|
|
1321
|
-
/**
|
|
1322
|
-
*/
|
|
1323
831
|
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
832
|
+
return (0, _stringify.default)({
|
|
833
|
+
objects: this.getFormDataObjects(validOnly, validationData)
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
|
|
838
|
+
*/
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
setUseClientsideValidation(enabled) {
|
|
842
|
+
this._useClientsideValidation = enabled;
|
|
843
|
+
this.allObjects.forEach(formObject => {
|
|
844
|
+
formObject.attributeCollection.all.forEach(item => item.setUseClientsideValidation(enabled));
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Indicates if client side validation is enabled
|
|
849
|
+
* @returns {boolean}
|
|
850
|
+
*/
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
useClientsideValidation() {
|
|
854
|
+
var _this$_useClientsideV;
|
|
855
|
+
|
|
856
|
+
return (_this$_useClientsideV = this._useClientsideValidation) !== null && _this$_useClientsideV !== void 0 ? _this$_useClientsideV : true;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Get form data for submitting
|
|
860
|
+
*/
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
get formdata() {
|
|
864
|
+
return this.getFormData(this.useClientsideValidation());
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
*/
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
get validationData() {
|
|
871
|
+
return this.getFormData(false, false, true);
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Form navigation: Go one object back (previous button)
|
|
875
|
+
*/
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
get hasPreviousStep() {
|
|
879
|
+
var _context20;
|
|
880
|
+
|
|
881
|
+
const currentFormObjectKey = this.currentFormObject != null ? this.currentFormObject.key : "";
|
|
882
|
+
return (0, _filter.default)(_context20 = this.completedFormObjects).call(_context20, formObject => !formObject.isRepeatWithUnknownTotal || formObject.key !== currentFormObjectKey).length > 0;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Go one form-object back,
|
|
886
|
+
* for repeating object this means go back
|
|
887
|
+
* until we get at a form object that had
|
|
888
|
+
* a different key than the current form object
|
|
889
|
+
*/
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
setPreviousObject() {
|
|
893
|
+
var _context21, _context22, _context23, _context24, _context25;
|
|
894
|
+
|
|
895
|
+
this.isComplete = false;
|
|
896
|
+
const oldCurrentFormObject = this.currentFormObject;
|
|
897
|
+
|
|
898
|
+
if (this.currentFormObject !== null) {
|
|
899
|
+
this.previouslyEnteredFormObjects = [this.currentFormObject, ...this.previouslyEnteredFormObjects];
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
this.currentFormObject = this.completedFormObjects[this.completedFormObjects.length - 1];
|
|
903
|
+
this.completedFormObjects = (0, _slice.default)(_context21 = this.completedFormObjects).call(_context21, 0, -1);
|
|
904
|
+
const completedFormObjectKeys = (0, _filter.default)(_context22 = (0, _map.default)(_context23 = this.completedFormObjects).call(_context23, formObject => formObject.key)).call(_context22, formObjectKey => {
|
|
905
|
+
var _this$currentFormObje6;
|
|
906
|
+
|
|
907
|
+
return formObjectKey !== ((_this$currentFormObje6 = this.currentFormObject) === null || _this$currentFormObje6 === void 0 ? void 0 : _this$currentFormObje6.key);
|
|
908
|
+
});
|
|
909
|
+
this.endResultFormObjects = (0, _filter.default)(_context24 = this._endResultFormObjects).call(_context24, endResult => (0, _includes.default)(completedFormObjectKeys).call(completedFormObjectKeys, endResult.key));
|
|
910
|
+
this.previousEndResultKeys = (0, _map.default)(_context25 = this.endResultFormObjects).call(_context25, endResult => endResult.key); // while we are at the same repeating form object, go a step back
|
|
911
|
+
|
|
912
|
+
if (this.currentFormObject && this.currentFormObject.equals(oldCurrentFormObject, this.currentFormObject.hasFixedNrOfRepeats)) {
|
|
913
|
+
this.setPreviousObject();
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Form navigation: has next step or is last
|
|
918
|
+
*/
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
get hasNextStep() {
|
|
922
|
+
var _context26;
|
|
923
|
+
|
|
924
|
+
if (this.isComplete || this.isFinished || this.hasNoQuestionsConfigured || !this.contributions.objects) {
|
|
925
|
+
return false;
|
|
926
|
+
} // current object is a dynamic object
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
if (this.currentFormObject && this.currentFormObject.isDynamic) {
|
|
930
|
+
return true;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
if (this.expectsEndResultFormObjects) {
|
|
934
|
+
return true;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
const currentObjectIndex = (0, _findIndex.default)(_context26 = this.objectKeys).call(_context26, objectKey => {
|
|
938
|
+
var _this$currentFormObje7;
|
|
939
|
+
|
|
940
|
+
return objectKey === ((_this$currentFormObje7 = this.currentFormObject) === null || _this$currentFormObje7 === void 0 ? void 0 : _this$currentFormObje7.key);
|
|
941
|
+
});
|
|
942
|
+
const isLastObject = this.objectKeys.length - 1 === currentObjectIndex; // current object is a repeating question but it is not the last one
|
|
943
|
+
|
|
944
|
+
if (isLastObject && this.currentFormObject && this.currentFormObject.isRepeatable && !this.currentFormObject.isLastRepeat) {
|
|
945
|
+
return true;
|
|
946
|
+
} // current object is not repeatable and the last object
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
if (isLastObject) {
|
|
950
|
+
return false;
|
|
951
|
+
} // can't determine if this is te last, render a next button
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
return true;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Merge existing form with new form
|
|
958
|
+
*/
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
update(receivedForm) {
|
|
962
|
+
if (receivedForm instanceof FormModel) {
|
|
963
|
+
var _receivedForm$data;
|
|
964
|
+
|
|
965
|
+
this.resetErrors();
|
|
966
|
+
this.lastUpdate = Date.now();
|
|
967
|
+
this.lastServerUpdate = receivedForm.lastServerUpdate;
|
|
968
|
+
this.tokens = receivedForm.tokens;
|
|
969
|
+
this.isComplete = receivedForm.isComplete;
|
|
970
|
+
this.isFinished = receivedForm.isFinished;
|
|
971
|
+
const receivedFormData = (_receivedForm$data = receivedForm.data) !== null && _receivedForm$data !== void 0 ? _receivedForm$data : {};
|
|
972
|
+
const hasMissing = (0, _objects.has)(receivedFormData, "missing");
|
|
973
|
+
const hasErrors = (0, _objects.has)(receivedFormData, "errors");
|
|
974
|
+
|
|
975
|
+
if (!hasMissing && !hasErrors) {
|
|
976
|
+
this.handleFinished(receivedForm);
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
if (hasErrors) {
|
|
980
|
+
this.handleErrors(receivedForm);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
if (hasMissing) {
|
|
984
|
+
this.handleMissing(receivedForm);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return this;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
*/
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
updateValidations(data) {
|
|
995
|
+
if (this.currentFormObject) {
|
|
996
|
+
this.currentFormObject.updateValidations(data);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return this;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Process finished form
|
|
1003
|
+
*/
|
|
1328
1004
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1005
|
+
|
|
1006
|
+
handleFinished(receivedForm) {
|
|
1007
|
+
if (this.currentFormObject) {
|
|
1008
|
+
this.completedFormObjects = [...this.completedFormObjects, this.currentFormObject];
|
|
1331
1009
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1010
|
+
|
|
1011
|
+
this.currentFormObject = receivedForm.currentFormObject;
|
|
1012
|
+
this.endResultFormObjects = receivedForm.endResultFormObjects;
|
|
1013
|
+
this._data = receivedForm._data;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
*/
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
handleRootErrors(errors) {
|
|
1020
|
+
(0, _filter.default)(errors).call(errors, error => !error.anchor).forEach(error => {
|
|
1021
|
+
this.errorCollection.addServerError(error.id, error.message, error.properties);
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Process errors from received form
|
|
1026
|
+
*/
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
handleErrors(receivedForm) {
|
|
1030
|
+
const errorAnchors = receivedForm.data.errors;
|
|
1031
|
+
|
|
1032
|
+
if (errorAnchors) {
|
|
1033
|
+
errorAnchors.forEach(error => {
|
|
1034
|
+
if (error.anchor && this.currentFormObject && this.currentFormObject.key === error.anchor.objectid) {
|
|
1035
|
+
this.currentFormObject.addServerError(error);
|
|
1036
|
+
} else {
|
|
1037
|
+
this.errorCollection.addServerError(error.id, error.message, error.properties);
|
|
1346
1038
|
}
|
|
1347
1039
|
});
|
|
1348
|
-
return foundAttribute;
|
|
1349
1040
|
}
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Process missing from received form
|
|
1044
|
+
*/
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
handleMissing(receivedForm) {
|
|
1048
|
+
if (this.currentFormObject && this.currentFormObject.equals(receivedForm.currentFormObject)) {
|
|
1049
|
+
this.handleMissingErrors(receivedForm);
|
|
1050
|
+
} else {
|
|
1051
|
+
this.handleNewFormObject(receivedForm);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Received missing anchors in the response with an object id that is the current form object
|
|
1056
|
+
*/
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
processMissingErrors(receivedForm) {
|
|
1060
|
+
var _context27;
|
|
1061
|
+
|
|
1062
|
+
if (this.currentFormObject === null) {
|
|
1063
|
+
return null;
|
|
1354
1064
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1065
|
+
|
|
1066
|
+
(0, _map.default)(_context27 = this.currentFormObject.attributeCollection).call(_context27, attribute => {
|
|
1067
|
+
if (receivedForm.currentFormObject && receivedForm.currentFormObject.hasAttributeByKey(attribute.key)) {
|
|
1068
|
+
attribute.addMissingError();
|
|
1069
|
+
} else {
|
|
1070
|
+
attribute.removeMissingError();
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
return attribute;
|
|
1074
|
+
});
|
|
1075
|
+
return this.currentFormObject;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
*/
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
handleMissingErrors(receivedForm) {
|
|
1082
|
+
this.currentFormObject = this.processMissingErrors(receivedForm);
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
*/
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
handleNewFormObject(receivedForm) {
|
|
1089
|
+
this.endResultFormObjects = receivedForm.endResultFormObjects;
|
|
1090
|
+
const receivedCurrentFormObject = receivedForm.currentFormObject;
|
|
1091
|
+
|
|
1092
|
+
if (receivedCurrentFormObject === null) {
|
|
1093
|
+
this.completedFormObjects = [...this.allObjects];
|
|
1094
|
+
this.currentFormObject = null;
|
|
1095
|
+
} else {
|
|
1096
|
+
var _context28;
|
|
1097
|
+
|
|
1098
|
+
// check if received form exists in the previously entered form objects
|
|
1099
|
+
const previouslyEnteredFormObjects = (0, _filter.default)(_context28 = this.previouslyEnteredFormObjects).call(_context28, formObject => formObject.equals(receivedCurrentFormObject, formObject.hasFixedNrOfRepeats));
|
|
1100
|
+
|
|
1101
|
+
if (previouslyEnteredFormObjects.length > 0) {
|
|
1102
|
+
this.handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects);
|
|
1103
|
+
} else {
|
|
1104
|
+
this.completedFormObjects = [...this.allObjects];
|
|
1105
|
+
this.currentFormObject = receivedCurrentFormObject;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Indicate if a new form object model should be merged with a previousled entered form object model
|
|
1111
|
+
* Set this property to false on the form that receives the new form to skip the merge behavior
|
|
1112
|
+
*/
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
get mergePreviouslyEnteredObjects() {
|
|
1116
|
+
return this._mergePreviouslyEnteredObjects;
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
*/
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
set mergePreviouslyEnteredObjects(mergePreviouslyEnteredObjects) {
|
|
1123
|
+
this._mergePreviouslyEnteredObjects = mergePreviouslyEnteredObjects;
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
*/
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects) {
|
|
1130
|
+
var _context29;
|
|
1131
|
+
|
|
1132
|
+
previouslyEnteredFormObjects.forEach(previouslyEnteredFormObject => {
|
|
1133
|
+
const mergedObject = this.mergePreviouslyEnteredObjects ? this.mergeObjects(receivedCurrentFormObject, previouslyEnteredFormObject) : receivedCurrentFormObject;
|
|
1134
|
+
this.addFormObject(mergedObject);
|
|
1135
|
+
}); // remove the previously entered form object
|
|
1136
|
+
|
|
1137
|
+
this.previouslyEnteredFormObjects = (0, _filter.default)(_context29 = this.previouslyEnteredFormObjects).call(_context29, formObject => {
|
|
1138
|
+
const hasPreviouslyEnteredObject = (0, _find.default)(previouslyEnteredFormObjects).call(previouslyEnteredFormObjects, previouslyEnteredFormObject => formObject.equals(previouslyEnteredFormObject));
|
|
1139
|
+
return !hasPreviouslyEnteredObject;
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
*/
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
mergeObjects(newObject, oldObject) {
|
|
1147
|
+
const mergedFormObject = _FormObjectModel.default.createEmpty(newObject);
|
|
1148
|
+
|
|
1149
|
+
mergedFormObject.mergeObject(oldObject);
|
|
1150
|
+
return mergedFormObject;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
*/
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
findAttribute(findMethod) {
|
|
1157
|
+
let foundAttribute = null;
|
|
1158
|
+
this.allObjects.forEach(formObject => {
|
|
1159
|
+
if (foundAttribute === null) {
|
|
1160
|
+
var _context30;
|
|
1161
|
+
|
|
1162
|
+
foundAttribute = (0, _find.default)(_context30 = formObject.attributeCollection.all).call(_context30, item => findMethod(item)) || null;
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1165
|
+
return foundAttribute;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
}
|
|
1358
1169
|
|
|
1359
1170
|
var _default = FormModel;
|
|
1360
1171
|
exports.default = _default;
|