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