@beinformed/ui 1.23.2 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -6
- package/esm/builder/index.js +1 -0
- package/esm/builder/index.js.map +1 -1
- package/esm/builder/mergeLayoutHintConfigurations.js +1 -11
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js +23 -28
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js +1 -0
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +11 -27
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +9 -15
- package/esm/constants/Settings.js.map +1 -1
- package/esm/constants/index.js +1 -0
- package/esm/constants/index.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js +2 -2
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js +9 -28
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js +1 -2
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js +1 -2
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js +1 -2
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js +1 -2
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js +1 -2
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js +1 -10
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js +1 -2
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +1 -11
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js +1 -2
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js +1 -2
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js +1 -6
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js +1 -10
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js +1 -2
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/exceptions/index.js +1 -0
- package/esm/exceptions/index.js.map +1 -1
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js +0 -16
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js +9 -23
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js +3 -10
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js +2 -6
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js +4 -13
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js +3 -7
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js +0 -3
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +10 -21
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js +1 -1
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js +7 -11
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +2 -12
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +11 -10
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +2 -1
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js +2 -2
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js +1 -1
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js +3 -2
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js +7 -10
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js +15 -40
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +13 -33
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js +3 -5
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/index.js +1 -0
- package/esm/i18n/index.js.map +1 -1
- package/esm/i18n/languages.js +1 -0
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js +1 -0
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js +1 -0
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/esm/i18n/withMessage.js +1 -4
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +13 -26
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +23 -60
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +14 -34
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +27 -81
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +23 -56
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +33 -83
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +102 -258
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +6 -17
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +29 -76
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +5 -8
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +38 -108
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +27 -80
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +34 -102
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +23 -64
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +40 -99
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +51 -145
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js +7 -17
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js +4 -8
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js +6 -10
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js +5 -10
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +22 -49
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +23 -65
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +29 -72
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js +21 -62
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js +5 -10
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +7 -21
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js +8 -19
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +3 -10
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +6 -22
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +16 -59
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +8 -22
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +8 -22
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +10 -28
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +7 -18
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +10 -24
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js +6 -13
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js +8 -15
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +8 -25
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +17 -53
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +15 -41
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +15 -39
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +8 -20
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +7 -12
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +7 -17
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +7 -17
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +8 -22
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js +22 -57
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js +7 -18
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js +14 -50
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js +8 -17
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +9 -17
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +30 -84
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +5 -11
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +4 -10
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js +27 -67
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +14 -39
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js +2 -5
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js +21 -53
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +16 -46
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +10 -39
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +32 -85
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +12 -36
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +16 -45
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +7 -20
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +8 -22
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +12 -25
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +2 -5
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +10 -21
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +13 -37
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +19 -56
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +22 -59
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +17 -45
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +8 -16
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js +20 -57
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js +16 -43
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js +6 -20
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +11 -48
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +3 -13
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +5 -15
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +13 -32
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js +21 -54
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js +11 -29
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js +8 -21
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +37 -93
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +19 -45
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +25 -58
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +1 -5
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +11 -44
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js +2 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +1 -6
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +136 -332
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +55 -141
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +20 -58
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js +47 -121
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js +11 -32
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/index.js +1 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +9 -32
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js +15 -44
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js +21 -57
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +5 -21
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +31 -79
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js +10 -28
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +4 -20
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +7 -23
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +38 -115
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +4 -6
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +5 -16
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +6 -14
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js +4 -12
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js +11 -26
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +14 -41
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +14 -41
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js +10 -24
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js +2 -7
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +3 -9
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +15 -41
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +9 -28
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +14 -41
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js +1 -2
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +7 -17
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/user/UserModel.js +5 -10
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +2 -10
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +11 -27
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +21 -56
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js +3 -8
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +89 -193
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js +13 -37
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/modularui/index.js +1 -0
- package/esm/modularui/index.js.map +1 -1
- package/esm/react/ErrorBoundary.js +2 -12
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +2 -2
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/index.js +1 -0
- package/esm/react/index.js.map +1 -1
- package/esm/react/utils.js +3 -7
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js +1 -2
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +15 -29
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js +3 -8
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/index.js +1 -0
- package/esm/react-client/index.js.map +1 -1
- package/esm/react-client/rehydrate.js +4 -19
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/contextPath.js +2 -2
- package/esm/react-server/contextPath.js.map +1 -1
- package/esm/react-server/createSSRComplete.js +2 -12
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js +25 -12
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/index.js +1 -0
- package/esm/react-server/index.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +4 -4
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js +1 -2
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js +7 -12
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +3 -7
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js +1 -2
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +13 -37
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +1 -2
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +7 -20
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/index.js +1 -0
- package/esm/react-theme/index.js.map +1 -1
- package/esm/react-theme/useTheme.js +1 -2
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js +2 -5
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js +3 -9
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +8 -27
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +4 -10
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +7 -22
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js +8 -22
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/actions.js +3 -3
- package/esm/redux/_i18n/actions.js.map +1 -1
- package/esm/redux/_i18n/index.js +1 -0
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_i18n/reducer.js +13 -16
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_modularui/actions.js +36 -48
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js +21 -18
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/index.js +1 -0
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/middleware.js +8 -22
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js +10 -25
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js +19 -39
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js +20 -62
- package/esm/redux/_modularui/selectors.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +3 -3
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/actions.js +7 -5
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js +11 -14
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/index.js +1 -0
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/_router/middleware.js +2 -1
- package/esm/redux/_router/middleware.js.map +1 -1
- package/esm/redux/_router/reducer.js +3 -3
- package/esm/redux/_router/reducer.js.map +1 -1
- package/esm/redux/actions/Application.js +2 -4
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +8 -14
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +5 -13
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +2 -3
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +1 -9
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +3 -3
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +4 -6
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +1 -4
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +3 -7
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js +3 -1
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js +5 -10
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +14 -26
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js +5 -4
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js +5 -8
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js +2 -2
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/actions/index.js +1 -0
- package/esm/redux/actions/index.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 +2 -3
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +2 -5
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +2 -5
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +2 -5
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +3 -10
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js +2 -3
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js +1 -5
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js +2 -3
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +1 -5
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js +2 -4
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js +2 -1
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js +2 -3
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +2 -1
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +3 -6
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js +4 -6
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/connectors/index.js +1 -0
- package/esm/redux/connectors/index.js.map +1 -1
- package/esm/redux/index.js +16 -7
- package/esm/redux/index.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +13 -14
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js +3 -4
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js +11 -15
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js +7 -8
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js +7 -7
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js +11 -15
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js +1 -1
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/reducers/index.js +1 -0
- package/esm/redux/reducers/index.js.map +1 -1
- package/esm/redux/selectors/i18n.js +5 -4
- package/esm/redux/selectors/i18n.js.map +1 -1
- package/esm/redux/selectors/index.js +1 -0
- package/esm/redux/selectors/index.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js +2 -1
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js +3 -7
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/browser/Cache.js +17 -44
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js +4 -9
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +53 -110
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js +2 -8
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +6 -17
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js +42 -101
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +6 -6
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/esm/utils/helpers/createHash.js +3 -5
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/esm/utils/helpers/createUUID.js +1 -1
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/objects.js +5 -8
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js +7 -9
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js +2 -3
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/index.js +8 -3
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js +43 -124
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js +5 -18
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +5 -17
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js +0 -3
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +1 -13
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js +25 -32
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +9 -29
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +9 -38
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js +0 -7
- package/lib/constants/index.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js +0 -2
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js +9 -27
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +0 -3
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +0 -3
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +0 -3
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +0 -3
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +0 -3
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +1 -10
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +0 -3
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +1 -10
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +0 -3
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +0 -3
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +1 -10
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +1 -9
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +0 -3
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js +0 -16
- package/lib/exceptions/index.js.map +1 -1
- package/lib/hooks/index.js +0 -33
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAllFormsOnModel.js +0 -23
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js +8 -35
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js +3 -16
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +1 -12
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js +3 -27
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js +3 -15
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js +0 -9
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +9 -45
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +0 -3
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +6 -19
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +2 -17
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +9 -39
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +1 -7
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js +1 -7
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +0 -4
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js +2 -4
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js +6 -20
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js +15 -44
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +13 -44
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +2 -8
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js +0 -9
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/lib/i18n/withMessage.js +1 -10
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +12 -33
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +23 -68
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +14 -41
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +27 -87
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +23 -65
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +32 -89
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +101 -254
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +5 -20
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +29 -83
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +3 -10
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +38 -115
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +26 -84
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +34 -108
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +23 -70
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +40 -109
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +51 -159
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js +5 -20
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js +3 -11
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js +4 -13
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js +4 -14
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +21 -61
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +23 -75
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +28 -79
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js +21 -66
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js +4 -16
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +7 -41
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +6 -19
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +3 -15
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +6 -19
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +16 -58
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +8 -22
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +8 -22
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +10 -27
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +7 -20
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +10 -26
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +5 -14
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +6 -15
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +8 -25
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +17 -51
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +15 -44
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +15 -40
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +8 -20
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +5 -12
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +7 -18
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +7 -18
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +8 -24
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +22 -57
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +7 -19
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +13 -50
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +6 -17
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +8 -18
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +30 -88
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +4 -19
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +3 -13
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +26 -73
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +14 -40
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +1 -6
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +21 -53
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +16 -54
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +10 -44
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +32 -90
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +12 -42
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +16 -49
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +6 -25
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +8 -23
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +11 -26
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +1 -11
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +9 -22
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +12 -44
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +19 -61
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +21 -67
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +17 -55
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +7 -18
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +19 -62
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js +15 -51
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js +5 -25
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +10 -45
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +2 -17
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +4 -16
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +12 -37
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js +21 -61
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js +10 -35
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js +6 -17
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +36 -96
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +19 -45
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +24 -60
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +0 -9
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +11 -55
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js +0 -3
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +1 -10
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +135 -328
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +55 -144
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js +20 -58
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js +47 -123
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js +11 -29
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js +0 -97
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js +8 -40
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js +15 -51
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js +20 -62
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +5 -21
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +31 -84
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js +10 -30
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +4 -24
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +7 -29
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +38 -123
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +2 -8
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +5 -19
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +4 -17
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js +4 -13
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js +10 -26
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +14 -47
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +13 -42
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +9 -29
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js +1 -33
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +3 -12
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +13 -39
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +8 -35
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +14 -48
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js +0 -4
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +6 -19
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/user/UserModel.js +4 -12
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +2 -14
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +11 -30
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +20 -66
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js +3 -7
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +89 -200
- package/lib/modularui/ModularUIRequest.js.flow +14 -0
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +13 -34
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js +0 -4
- package/lib/modularui/index.js.map +1 -1
- package/lib/react/ErrorBoundary.js +2 -14
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +1 -8
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js +0 -5
- package/lib/react/index.js.map +1 -1
- package/lib/react/utils.js +2 -13
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js +0 -8
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +16 -49
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js +2 -9
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js +0 -4
- package/lib/react-client/index.js.map +1 -1
- package/lib/react-client/rehydrate.js +3 -23
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/contextPath.js +1 -2
- package/lib/react-server/contextPath.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +2 -16
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +25 -16
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js +0 -12
- package/lib/react-server/index.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +3 -16
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +0 -10
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js +6 -21
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +2 -14
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +0 -8
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +13 -60
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +0 -6
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +7 -23
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js +0 -18
- package/lib/react-theme/index.js.map +1 -1
- package/lib/react-theme/useTheme.js +0 -3
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js +1 -5
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js +2 -12
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +7 -35
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +3 -14
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +6 -30
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js +7 -35
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js +2 -8
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js +0 -5
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_i18n/reducer.js +12 -21
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_modularui/actions.js +36 -69
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js +20 -28
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js +0 -14
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/middleware.js +8 -28
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js +10 -36
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js +19 -45
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js +20 -97
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +2 -11
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js +5 -16
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js +10 -15
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js +0 -9
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/_router/middleware.js +0 -2
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js +2 -4
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/actions/Application.js +1 -8
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +6 -25
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +4 -24
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +1 -12
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +0 -14
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +2 -8
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +3 -12
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +0 -6
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +2 -13
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js +1 -4
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js +4 -19
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +13 -44
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js +3 -11
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js +5 -28
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +1 -9
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/index.js +0 -31
- package/lib/redux/actions/index.js.map +1 -1
- package/lib/redux/connectors/Application.js +0 -2
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +1 -4
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +0 -2
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +1 -7
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +0 -2
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +1 -7
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +1 -8
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +2 -19
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +1 -5
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +0 -3
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +1 -7
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +0 -2
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +1 -4
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +0 -7
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js +1 -5
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js +1 -4
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +1 -3
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +1 -7
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +2 -8
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +3 -8
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +0 -2
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js +0 -21
- package/lib/redux/connectors/index.js.map +1 -1
- package/lib/redux/index.js +0 -17
- package/lib/redux/index.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +12 -14
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +2 -4
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +11 -18
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +6 -8
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +6 -7
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +10 -15
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js +0 -11
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js +0 -10
- package/lib/redux/reducers/index.js.map +1 -1
- package/lib/redux/selectors/i18n.js +3 -7
- package/lib/redux/selectors/i18n.js.map +1 -1
- package/lib/redux/selectors/index.js +0 -3
- package/lib/redux/selectors/index.js.map +1 -1
- package/lib/redux/store/beforeRenderHooks.js +0 -2
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js +2 -13
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +16 -49
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js +3 -14
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +52 -115
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js +2 -13
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +6 -25
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +42 -111
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js +5 -11
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js +1 -6
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +0 -2
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js +3 -15
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js +6 -13
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js +0 -4
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js +0 -25
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js +43 -121
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +3 -22
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +3 -19
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +29 -29
- package/src/modularui/ModularUIRequest.js +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverFetch.js","names":["BASE","FetchException","serverFetch","args","urlNoBase","url","replace","params","data","dataFetcher","fetch","jsonData","JSON","parse","error","reject","resolve"],"sources":["../../../src/utils/fetch/serverFetch.js"],"sourcesContent":["// @flow\nimport { BASE } from \"../../constants/Constants\";\nimport { FetchException } from \"../../exceptions\";\n\nimport type { RequestOptions } from \"./types\";\n\n/**\n * Fetch data from server (uses nashorn and datafetcher).\n */\nexport default function serverFetch(args: RequestOptions): Promise<any> {\n // remove contextPath of url, when the request is internal the context path is not needed\n const urlNoBase = args.url.includes(\"http\")\n ? args.url\n : args.url.replace(BASE, \"\");\n const params = args.params\n ? args.params.replace(\"includeContext=true\", \"\")\n : \"\";\n const url = params === \"\" ? urlNoBase : `${urlNoBase}?${params}`;\n\n const data = dataFetcher.fetch(url, args);\n\n try {\n const jsonData = JSON.parse(data);\n\n if (jsonData.error) {\n return Promise.reject(new FetchException(jsonData, null, args));\n }\n\n return Promise.resolve(jsonData);\n } catch (error) {\n return Promise.reject(error);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"serverFetch.js","names":["BASE","FetchException","serverFetch","args","urlNoBase","url","replace","params","data","dataFetcher","fetch","jsonData","JSON","parse","error","reject","resolve"],"sources":["../../../src/utils/fetch/serverFetch.js"],"sourcesContent":["// @flow\nimport { BASE } from \"../../constants/Constants\";\nimport { FetchException } from \"../../exceptions\";\n\nimport type { RequestOptions } from \"./types\";\n\n/**\n * Fetch data from server (uses nashorn and datafetcher).\n */\nexport default function serverFetch(args: RequestOptions): Promise<any> {\n // remove contextPath of url, when the request is internal the context path is not needed\n const urlNoBase = args.url.includes(\"http\")\n ? args.url\n : args.url.replace(BASE, \"\");\n const params = args.params\n ? args.params.replace(\"includeContext=true\", \"\")\n : \"\";\n const url = params === \"\" ? urlNoBase : `${urlNoBase}?${params}`;\n\n const data = dataFetcher.fetch(url, args);\n\n try {\n const jsonData = JSON.parse(data);\n\n if (jsonData.error) {\n return Promise.reject(new FetchException(jsonData, null, args));\n }\n\n return Promise.resolve(jsonData);\n } catch (error) {\n return Promise.reject(error);\n }\n}\n"],"mappings":";;AACA,SAASA,IAAI,QAAQ,2BAA2B;AAChD,SAASC,cAAc,QAAQ,kBAAkB;AAIjD;AACA;AACA;AACA,eAAe,SAASC,WAAW,CAACC,IAAoB,EAAgB;EAAA;EACtE;EACA,MAAMC,SAAS,GAAG,qCAAAD,IAAI,CAACE,GAAG,iBAAU,MAAM,CAAC,GACvCF,IAAI,CAACE,GAAG,GACRF,IAAI,CAACE,GAAG,CAACC,OAAO,CAACN,IAAI,EAAE,EAAE,CAAC;EAC9B,MAAMO,MAAM,GAAGJ,IAAI,CAACI,MAAM,GACtBJ,IAAI,CAACI,MAAM,CAACD,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,GAC9C,EAAE;EACN,MAAMD,GAAG,GAAGE,MAAM,KAAK,EAAE,GAAGH,SAAS,GAAI,GAAEA,SAAU,IAAGG,MAAO,EAAC;EAEhE,MAAMC,IAAI,GAAGC,WAAW,CAACC,KAAK,CAACL,GAAG,EAAEF,IAAI,CAAC;EAEzC,IAAI;IACF,MAAMQ,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACL,IAAI,CAAC;IAEjC,IAAIG,QAAQ,CAACG,KAAK,EAAE;MAClB,OAAO,SAAQC,MAAM,CAAC,IAAId,cAAc,CAACU,QAAQ,EAAE,IAAI,EAAER,IAAI,CAAC,CAAC;IACjE;IAEA,OAAO,SAAQa,OAAO,CAACL,QAAQ,CAAC;EAClC,CAAC,CAAC,OAAOG,KAAK,EAAE;IACd,OAAO,SAAQC,MAAM,CAACD,KAAK,CAAC;EAC9B;AACF"}
|
|
@@ -5,11 +5,11 @@ import serverFetch from "./serverFetch";
|
|
|
5
5
|
import xhr from "./xhr";
|
|
6
6
|
import Cache from "../browser/Cache";
|
|
7
7
|
const IS_FETCHING = "is-fetching";
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Checks each x ms if a cache item is set after fetching the item.
|
|
10
11
|
* @private
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
13
|
const waitForCachedItem = cacheKey => {
|
|
14
14
|
let TIMEOUT = 3000;
|
|
15
15
|
const CHECK_TIMEOUT = 100;
|
|
@@ -17,7 +17,6 @@ const waitForCachedItem = cacheKey => {
|
|
|
17
17
|
const check = () => {
|
|
18
18
|
if (Cache.getItem(cacheKey) !== IS_FETCHING) {
|
|
19
19
|
const cachedItem = Cache.getItem(cacheKey);
|
|
20
|
-
|
|
21
20
|
if (cachedItem != null) {
|
|
22
21
|
resolve(cachedItem);
|
|
23
22
|
} else {
|
|
@@ -30,22 +29,18 @@ const waitForCachedItem = cacheKey => {
|
|
|
30
29
|
setTimeout(check, CHECK_TIMEOUT);
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
|
-
|
|
34
32
|
setTimeout(check, CHECK_TIMEOUT);
|
|
35
33
|
});
|
|
36
34
|
};
|
|
35
|
+
|
|
37
36
|
/**
|
|
38
37
|
* @private
|
|
39
38
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
39
|
const browserFetch = args => {
|
|
43
40
|
if (USE_CACHE && args.cache) {
|
|
44
41
|
const cacheKey = Cache.createResourceKey(args);
|
|
45
|
-
|
|
46
42
|
if (Cache.hasItem(cacheKey)) {
|
|
47
43
|
const cacheItem = Cache.getItem(cacheKey);
|
|
48
|
-
|
|
49
44
|
if (cacheItem != null) {
|
|
50
45
|
if (cacheItem === IS_FETCHING) {
|
|
51
46
|
return waitForCachedItem(cacheKey);
|
|
@@ -54,24 +49,20 @@ const browserFetch = args => {
|
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
|
-
|
|
58
52
|
Cache.addItem(cacheKey, IS_FETCHING);
|
|
59
53
|
}
|
|
60
|
-
|
|
61
54
|
return xhr(args).then(response => {
|
|
62
55
|
if (USE_CACHE && args.cache) {
|
|
63
56
|
const cacheKey = Cache.createResourceKey(args);
|
|
64
57
|
Cache.addItem(cacheKey, response);
|
|
65
58
|
}
|
|
66
|
-
|
|
67
59
|
return response;
|
|
68
60
|
});
|
|
69
61
|
};
|
|
62
|
+
|
|
70
63
|
/**
|
|
71
64
|
* Request data from server, uses server datafetcher or xhr in browser.
|
|
72
65
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
66
|
export default function universalFetch(args) {
|
|
76
67
|
// Set locale as Accept-Language header
|
|
77
68
|
if (args.locale) {
|
|
@@ -79,16 +70,14 @@ export default function universalFetch(args) {
|
|
|
79
70
|
"Accept-Language": args.locale
|
|
80
71
|
};
|
|
81
72
|
}
|
|
82
|
-
|
|
83
73
|
if (args.includeContext) {
|
|
84
|
-
args.url =
|
|
85
|
-
}
|
|
86
|
-
|
|
74
|
+
args.url = `${args.url}?includeContext=true`;
|
|
75
|
+
}
|
|
87
76
|
|
|
77
|
+
// server side no access to the browser cache apis, no cache available
|
|
88
78
|
if (IS_SYNC) {
|
|
89
79
|
return serverFetch(args);
|
|
90
80
|
}
|
|
91
|
-
|
|
92
81
|
return browserFetch(args);
|
|
93
82
|
}
|
|
94
83
|
//# sourceMappingURL=universalFetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universalFetch.js","names":["isPlainObject","IS_SYNC","USE_CACHE","serverFetch","xhr","Cache","IS_FETCHING","waitForCachedItem","cacheKey","TIMEOUT","CHECK_TIMEOUT","resolve","reject","check","getItem","cachedItem","Error","setTimeout","browserFetch","args","cache","createResourceKey","hasItem","cacheItem","addItem","then","response","universalFetch","locale","headers","includeContext","url"],"sources":["../../../src/utils/fetch/universalFetch.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"../helpers/objects\";\n\nimport { IS_SYNC, USE_CACHE } from \"../../constants/Constants\";\nimport serverFetch from \"./serverFetch\";\nimport xhr from \"./xhr\";\nimport Cache from \"../browser/Cache\";\n\nimport type { RequestOptions } from \"./types\";\n\ntype CachedResponse = string | { ... };\n\nconst IS_FETCHING = \"is-fetching\";\n\n/**\n * Checks each x ms if a cache item is set after fetching the item.\n * @private\n */\nconst waitForCachedItem = (cacheKey) => {\n let TIMEOUT = 3000;\n const CHECK_TIMEOUT = 100;\n\n return new Promise<CachedResponse>((resolve, reject) => {\n const check = () => {\n if (Cache.getItem(cacheKey) !== IS_FETCHING) {\n const cachedItem = Cache.getItem(cacheKey);\n if (cachedItem != null) {\n resolve(cachedItem);\n } else {\n reject(new Error(\"Empty cached item\"));\n }\n } else if (TIMEOUT <= 0) {\n reject(new Error(\"Empty cached item\"));\n } else {\n TIMEOUT = TIMEOUT - CHECK_TIMEOUT;\n setTimeout(check, CHECK_TIMEOUT);\n }\n };\n\n setTimeout(check, CHECK_TIMEOUT);\n });\n};\n\n/**\n * @private\n */\nconst browserFetch = (args) => {\n if (USE_CACHE && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n if (Cache.hasItem(cacheKey)) {\n const cacheItem = Cache.getItem(cacheKey);\n\n if (cacheItem != null) {\n if (cacheItem === IS_FETCHING) {\n return waitForCachedItem(cacheKey);\n } else if (isPlainObject(cacheItem)) {\n return Promise.resolve(cacheItem);\n }\n }\n }\n\n Cache.addItem(cacheKey, IS_FETCHING);\n }\n\n return xhr(args).then((response) => {\n if (USE_CACHE && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n Cache.addItem(cacheKey, response);\n }\n\n return response;\n });\n};\n\n/**\n * Request data from server, uses server datafetcher or xhr in browser.\n */\nexport default function universalFetch(\n args: RequestOptions\n): Promise<CachedResponse> | Promise<?(string | { ... })> {\n // Set locale as Accept-Language header\n if (args.locale) {\n args.headers = {\n \"Accept-Language\": args.locale,\n };\n }\n\n if (args.includeContext) {\n args.url = `${args.url}?includeContext=true`;\n }\n\n // server side no access to the browser cache apis, no cache available\n if (IS_SYNC) {\n return serverFetch(args);\n }\n\n return browserFetch(args);\n}\n"],"mappings":";AACA,SAASA,
|
|
1
|
+
{"version":3,"file":"universalFetch.js","names":["isPlainObject","IS_SYNC","USE_CACHE","serverFetch","xhr","Cache","IS_FETCHING","waitForCachedItem","cacheKey","TIMEOUT","CHECK_TIMEOUT","resolve","reject","check","getItem","cachedItem","Error","setTimeout","browserFetch","args","cache","createResourceKey","hasItem","cacheItem","addItem","then","response","universalFetch","locale","headers","includeContext","url"],"sources":["../../../src/utils/fetch/universalFetch.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"../helpers/objects\";\n\nimport { IS_SYNC, USE_CACHE } from \"../../constants/Constants\";\nimport serverFetch from \"./serverFetch\";\nimport xhr from \"./xhr\";\nimport Cache from \"../browser/Cache\";\n\nimport type { RequestOptions } from \"./types\";\n\ntype CachedResponse = string | { ... };\n\nconst IS_FETCHING = \"is-fetching\";\n\n/**\n * Checks each x ms if a cache item is set after fetching the item.\n * @private\n */\nconst waitForCachedItem = (cacheKey) => {\n let TIMEOUT = 3000;\n const CHECK_TIMEOUT = 100;\n\n return new Promise<CachedResponse>((resolve, reject) => {\n const check = () => {\n if (Cache.getItem(cacheKey) !== IS_FETCHING) {\n const cachedItem = Cache.getItem(cacheKey);\n if (cachedItem != null) {\n resolve(cachedItem);\n } else {\n reject(new Error(\"Empty cached item\"));\n }\n } else if (TIMEOUT <= 0) {\n reject(new Error(\"Empty cached item\"));\n } else {\n TIMEOUT = TIMEOUT - CHECK_TIMEOUT;\n setTimeout(check, CHECK_TIMEOUT);\n }\n };\n\n setTimeout(check, CHECK_TIMEOUT);\n });\n};\n\n/**\n * @private\n */\nconst browserFetch = (args) => {\n if (USE_CACHE && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n if (Cache.hasItem(cacheKey)) {\n const cacheItem = Cache.getItem(cacheKey);\n\n if (cacheItem != null) {\n if (cacheItem === IS_FETCHING) {\n return waitForCachedItem(cacheKey);\n } else if (isPlainObject(cacheItem)) {\n return Promise.resolve(cacheItem);\n }\n }\n }\n\n Cache.addItem(cacheKey, IS_FETCHING);\n }\n\n return xhr(args).then((response) => {\n if (USE_CACHE && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n Cache.addItem(cacheKey, response);\n }\n\n return response;\n });\n};\n\n/**\n * Request data from server, uses server datafetcher or xhr in browser.\n */\nexport default function universalFetch(\n args: RequestOptions\n): Promise<CachedResponse> | Promise<?(string | { ... })> {\n // Set locale as Accept-Language header\n if (args.locale) {\n args.headers = {\n \"Accept-Language\": args.locale,\n };\n }\n\n if (args.includeContext) {\n args.url = `${args.url}?includeContext=true`;\n }\n\n // server side no access to the browser cache apis, no cache available\n if (IS_SYNC) {\n return serverFetch(args);\n }\n\n return browserFetch(args);\n}\n"],"mappings":";AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,SAASC,OAAO,EAAEC,SAAS,QAAQ,2BAA2B;AAC9D,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,GAAG,MAAM,OAAO;AACvB,OAAOC,KAAK,MAAM,kBAAkB;AAMpC,MAAMC,WAAW,GAAG,aAAa;;AAEjC;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,QAAQ,IAAK;EACtC,IAAIC,OAAO,GAAG,IAAI;EAClB,MAAMC,aAAa,GAAG,GAAG;EAEzB,OAAO,aAA4B,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtD,MAAMC,KAAK,GAAG,MAAM;MAClB,IAAIR,KAAK,CAACS,OAAO,CAACN,QAAQ,CAAC,K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IAAIiB,IAAI,CAACC,KAAK,EAAE;MAC3B,MAAMZ,QAAQ,GAAGH,KAAK,CAACgB,iBAAiB,CAACF,IAAI,CAAC;MAE9Cd,KAAK,CAACmB,OAAO,CAAChB,QAAQ,EAAEkB,QAAQ,CAAC;IACnC;IAEA,OAAOA,QAAQ;EACjB,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA,eAAe,SAASC,cAAc,CACpCR,IAAoB,EACoC;EACxD;EACA,IAAIA,IAAI,CAACS,MAAM,EAAE;IACfT,IAAI,CAACU,OAAO,GAAG;MACb,iBAAiB,EAAEV,IAAI,CAACS;IAC1B,CAAC;EACH;EAEA,IAAIT,IAAI,CAACW,cAAc,EAAE;IACvBX,IAAI,CAACY,GAAG,GAAI,GAAEZ,IAAI,CAACY,GAAI,sBAAqB;EAC9C;;EAEA;EACA,IAAI9B,OAAO,EAAE;IACX,OAAOE,WAAW,CAACgB,IAAI,CAAC;EAC1B;EAEA,OAAOD,YAAY,CAACC,IAAI,CAAC;AAC3B"}
|
package/esm/utils/fetch/xhr.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
2
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
3
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
4
3
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
5
4
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
6
5
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
@@ -16,148 +15,123 @@ const UNAUTHORIZED_CODE = 401;
|
|
|
16
15
|
const REDIRECTION_CODE = 300;
|
|
17
16
|
const NOT_FOUND_CODE = 404;
|
|
18
17
|
const JSON_TYPE = "application/json";
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
class XHR {
|
|
24
23
|
/**
|
|
25
24
|
*/
|
|
26
25
|
constructor(options) {
|
|
27
26
|
_defineProperty(this, "_options", void 0);
|
|
28
|
-
|
|
29
27
|
_defineProperty(this, "_xmlhttp", void 0);
|
|
30
|
-
|
|
31
28
|
_defineProperty(this, "_attempts", void 0);
|
|
32
|
-
|
|
33
29
|
this._options = options;
|
|
34
30
|
this._attempts = 0;
|
|
35
31
|
}
|
|
32
|
+
|
|
36
33
|
/**
|
|
37
34
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
35
|
get xmlhttp() {
|
|
41
36
|
return this._xmlhttp;
|
|
42
37
|
}
|
|
38
|
+
|
|
43
39
|
/**
|
|
44
40
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
41
|
set xmlhttp(xmlhttp) {
|
|
48
42
|
this._xmlhttp = xmlhttp;
|
|
49
43
|
}
|
|
44
|
+
|
|
50
45
|
/**
|
|
51
46
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
47
|
get options() {
|
|
55
48
|
return this._options;
|
|
56
49
|
}
|
|
50
|
+
|
|
57
51
|
/**
|
|
58
52
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
53
|
set options(options) {
|
|
62
54
|
this._options = options;
|
|
63
55
|
}
|
|
56
|
+
|
|
64
57
|
/**
|
|
65
58
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
59
|
get attempts() {
|
|
69
60
|
return this._attempts;
|
|
70
61
|
}
|
|
62
|
+
|
|
71
63
|
/**
|
|
72
64
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
65
|
set attempts(attempts) {
|
|
76
66
|
this._attempts = attempts;
|
|
77
67
|
}
|
|
68
|
+
|
|
78
69
|
/**
|
|
79
70
|
* Create and fix url when params or both querystring and params exist.
|
|
80
71
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
72
|
get url() {
|
|
84
73
|
const {
|
|
85
74
|
url
|
|
86
75
|
} = this.options;
|
|
87
|
-
|
|
88
76
|
if (this.params !== "") {
|
|
89
|
-
var _context3;
|
|
90
|
-
|
|
91
77
|
if (_includesInstanceProperty(url).call(url, "?")) {
|
|
92
|
-
var _context, _context2;
|
|
93
|
-
|
|
94
78
|
const aUrl = url.split("?");
|
|
95
|
-
return
|
|
79
|
+
return `${aUrl[0]}?${aUrl[1]}&${this.params}`;
|
|
96
80
|
}
|
|
97
|
-
|
|
98
|
-
return _concatInstanceProperty(_context3 = "".concat(url, "?")).call(_context3, this.params);
|
|
81
|
+
return `${url}?${this.params}`;
|
|
99
82
|
}
|
|
100
|
-
|
|
101
83
|
return url;
|
|
102
84
|
}
|
|
85
|
+
|
|
103
86
|
/**
|
|
104
87
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
88
|
get params() {
|
|
108
89
|
return this.options.params || "";
|
|
109
90
|
}
|
|
91
|
+
|
|
110
92
|
/**
|
|
111
93
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
94
|
get data() {
|
|
115
95
|
return this.options.data || null;
|
|
116
96
|
}
|
|
97
|
+
|
|
117
98
|
/**
|
|
118
99
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
100
|
get method() {
|
|
122
101
|
return this.options.method || HTTP_METHODS.GET;
|
|
123
102
|
}
|
|
103
|
+
|
|
124
104
|
/**
|
|
125
105
|
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
106
|
get timeout() {
|
|
129
107
|
return this.options.timeout || getSetting("XHR_TIMEOUT_MS", 300000);
|
|
130
108
|
}
|
|
109
|
+
|
|
131
110
|
/**
|
|
132
111
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
112
|
get responseType() {
|
|
136
113
|
return this.options.responseType || "json";
|
|
137
114
|
}
|
|
115
|
+
|
|
138
116
|
/**
|
|
139
117
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
118
|
get onProgress() {
|
|
143
119
|
if (this.options.onProgress) {
|
|
144
120
|
return this.options.onProgress;
|
|
145
121
|
}
|
|
146
|
-
|
|
147
|
-
|
|
122
|
+
return () => {
|
|
123
|
+
// do nothing
|
|
148
124
|
};
|
|
149
125
|
}
|
|
126
|
+
|
|
150
127
|
/**
|
|
151
128
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
129
|
get events() {
|
|
155
130
|
return this.options.events || {};
|
|
156
131
|
}
|
|
132
|
+
|
|
157
133
|
/**
|
|
158
134
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
135
|
get headers() {
|
|
162
136
|
const baseHeaders = {
|
|
163
137
|
Accept: JSON_TYPE,
|
|
@@ -166,27 +140,24 @@ class XHR {
|
|
|
166
140
|
"X-Requested-With": "XMLHttpRequest",
|
|
167
141
|
"Accept-Language": "en"
|
|
168
142
|
};
|
|
169
|
-
|
|
170
143
|
if (this.options.headers) {
|
|
171
144
|
// $FlowFixMe[cannot-spread-indexer]
|
|
172
|
-
return {
|
|
145
|
+
return {
|
|
146
|
+
...baseHeaders,
|
|
173
147
|
...this.options.headers
|
|
174
148
|
};
|
|
175
149
|
}
|
|
176
|
-
|
|
177
150
|
return baseHeaders;
|
|
178
151
|
}
|
|
152
|
+
|
|
179
153
|
/**
|
|
180
154
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
183
155
|
timeoutHandler(reject) {
|
|
184
156
|
return reject(new TimeoutException(this.url, this.method));
|
|
185
157
|
}
|
|
158
|
+
|
|
186
159
|
/**
|
|
187
160
|
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
161
|
errorHandler(reject) {
|
|
191
162
|
let responseJSON = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
192
163
|
const {
|
|
@@ -195,137 +166,117 @@ class XHR {
|
|
|
195
166
|
const {
|
|
196
167
|
isReload
|
|
197
168
|
} = this.options;
|
|
198
|
-
|
|
199
169
|
if (status === NETWORK_ERROR_CODE) {
|
|
200
170
|
return reject(new NetworkException(this.url, this.method));
|
|
201
171
|
}
|
|
202
|
-
|
|
203
172
|
if (status === NOT_FOUND_CODE) {
|
|
204
173
|
return reject(new NotFoundException(this.url, this.method, isReload));
|
|
205
174
|
}
|
|
206
|
-
|
|
207
175
|
if (status === UNAUTHORIZED_CODE) {
|
|
208
176
|
return reject(new UnauthorizedException(this.url, this.method, responseJSON));
|
|
209
177
|
}
|
|
210
|
-
|
|
211
178
|
return reject(new FetchException(responseJSON, this.xmlhttp, this.options));
|
|
212
179
|
}
|
|
180
|
+
|
|
213
181
|
/**
|
|
214
182
|
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
183
|
getResponse() {
|
|
218
184
|
const {
|
|
219
185
|
responseType,
|
|
220
186
|
response
|
|
221
187
|
} = this.xmlhttp;
|
|
222
|
-
|
|
223
188
|
if ((responseType === "" || responseType === "text") && this.getResponseHeader("Content-Type") === JSON_TYPE) {
|
|
224
189
|
if (isPlainObject(response)) {
|
|
225
190
|
return response;
|
|
226
191
|
}
|
|
227
|
-
|
|
228
192
|
try {
|
|
229
193
|
return JSON.parse(response);
|
|
230
194
|
} catch (error) {
|
|
231
195
|
throw new JsonParseException(error);
|
|
232
196
|
}
|
|
233
197
|
}
|
|
234
|
-
|
|
235
198
|
return response;
|
|
236
199
|
}
|
|
200
|
+
|
|
237
201
|
/**
|
|
238
202
|
*/
|
|
239
|
-
|
|
240
|
-
|
|
241
203
|
responseHandler(resolve, reject) {
|
|
242
204
|
const {
|
|
243
205
|
status
|
|
244
206
|
} = this.xmlhttp;
|
|
245
207
|
let response = null;
|
|
246
|
-
|
|
247
208
|
try {
|
|
248
209
|
response = this.getResponse();
|
|
249
210
|
} catch (error) {
|
|
250
211
|
return reject(error);
|
|
251
212
|
}
|
|
252
|
-
|
|
253
213
|
if (status >= SUCCESS_CODE && status < REDIRECTION_CODE || status === CLIENT_ERROR_CODE && has(response, "formresponse")) {
|
|
254
214
|
return resolve(response);
|
|
255
215
|
}
|
|
256
|
-
|
|
257
216
|
return this.errorHandler(reject, response);
|
|
258
217
|
}
|
|
218
|
+
|
|
259
219
|
/**
|
|
260
220
|
*/
|
|
261
|
-
|
|
262
|
-
|
|
263
221
|
setEventListeners(resolve, reject) {
|
|
264
222
|
if (this.options.onProgress) {
|
|
265
223
|
["load", "loadend", "loadstart", "progress"].forEach(eventType => {
|
|
266
224
|
this.xmlhttp.addEventListener(eventType, this.onProgress);
|
|
267
225
|
});
|
|
268
226
|
}
|
|
269
|
-
|
|
270
227
|
["abort", "error"].forEach(eventType => {
|
|
271
228
|
this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));
|
|
272
229
|
});
|
|
273
230
|
this.xmlhttp.addEventListener("timeout", () => this.timeoutHandler(reject));
|
|
274
|
-
this.xmlhttp.addEventListener("load", () => this.responseHandler(resolve, reject));
|
|
231
|
+
this.xmlhttp.addEventListener("load", () => this.responseHandler(resolve, reject));
|
|
275
232
|
|
|
233
|
+
// Set custom events
|
|
276
234
|
_Object$keys(this.events).forEach(eventName => {
|
|
277
235
|
this.xmlhttp.addEventListener(eventName, this.events[eventName]);
|
|
278
236
|
});
|
|
279
237
|
}
|
|
238
|
+
|
|
280
239
|
/**
|
|
281
240
|
*/
|
|
282
|
-
|
|
283
|
-
|
|
284
241
|
openConnection() {
|
|
285
242
|
this.xmlhttp.open(this.method, this.url, true);
|
|
286
243
|
}
|
|
244
|
+
|
|
287
245
|
/**
|
|
288
246
|
*/
|
|
289
|
-
|
|
290
|
-
|
|
291
247
|
setBasicAuthentication() {
|
|
292
248
|
if (Cache.hasItem("basic")) {
|
|
293
249
|
this.xmlhttp.withCredentials = true;
|
|
294
250
|
const basicToken = Cache.getItem("basic");
|
|
295
|
-
|
|
296
251
|
if (typeof basicToken === "string") {
|
|
297
|
-
this.xmlhttp.setRequestHeader("Authorization",
|
|
252
|
+
this.xmlhttp.setRequestHeader("Authorization", `Basic ${basicToken}`);
|
|
298
253
|
}
|
|
299
254
|
}
|
|
300
255
|
}
|
|
256
|
+
|
|
301
257
|
/**
|
|
302
258
|
*/
|
|
303
|
-
|
|
304
|
-
|
|
305
259
|
getResponseHeader(headerName) {
|
|
306
260
|
return this.xmlhttp.getResponseHeader(headerName);
|
|
307
261
|
}
|
|
262
|
+
|
|
308
263
|
/**
|
|
309
264
|
*/
|
|
310
|
-
|
|
311
|
-
|
|
312
265
|
setCustomHeaders() {
|
|
313
266
|
_Object$keys(this.headers).forEach(headerName => {
|
|
314
267
|
this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);
|
|
315
268
|
});
|
|
316
269
|
}
|
|
270
|
+
|
|
317
271
|
/**
|
|
318
272
|
*/
|
|
319
|
-
|
|
320
|
-
|
|
321
273
|
setOtherOptions() {
|
|
322
274
|
this.xmlhttp.responseType = this.responseType;
|
|
323
275
|
this.xmlhttp.timeout = this.timeout;
|
|
324
276
|
}
|
|
277
|
+
|
|
325
278
|
/**
|
|
326
279
|
*/
|
|
327
|
-
|
|
328
|
-
|
|
329
280
|
sendData() {
|
|
330
281
|
if (this.data == null) {
|
|
331
282
|
this.xmlhttp.send();
|
|
@@ -334,10 +285,9 @@ class XHR {
|
|
|
334
285
|
this.xmlhttp.send(stringData);
|
|
335
286
|
}
|
|
336
287
|
}
|
|
288
|
+
|
|
337
289
|
/**
|
|
338
290
|
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
291
|
setXMLHttpRequest() {
|
|
342
292
|
return new _Promise((resolve, reject) => {
|
|
343
293
|
this.xmlhttp = new XMLHttpRequest();
|
|
@@ -349,10 +299,9 @@ class XHR {
|
|
|
349
299
|
this.sendData();
|
|
350
300
|
});
|
|
351
301
|
}
|
|
302
|
+
|
|
352
303
|
/**
|
|
353
304
|
*/
|
|
354
|
-
|
|
355
|
-
|
|
356
305
|
async fetch() {
|
|
357
306
|
try {
|
|
358
307
|
return await this.setXMLHttpRequest();
|
|
@@ -361,39 +310,31 @@ class XHR {
|
|
|
361
310
|
this.attempts += 1;
|
|
362
311
|
return this.fetch();
|
|
363
312
|
}
|
|
364
|
-
|
|
365
313
|
throw err;
|
|
366
314
|
}
|
|
367
315
|
}
|
|
368
|
-
|
|
369
316
|
}
|
|
317
|
+
|
|
370
318
|
/**
|
|
371
319
|
*/
|
|
372
|
-
|
|
373
|
-
|
|
374
320
|
const validateInputArguments = args => {
|
|
375
321
|
if (args == null) {
|
|
376
322
|
throw new IllegalArgumentException("Missing request options, expecting an object as argument for xhr");
|
|
377
323
|
}
|
|
378
|
-
|
|
379
324
|
if (!isPlainObject(args)) {
|
|
380
|
-
throw new IllegalArgumentException(
|
|
325
|
+
throw new IllegalArgumentException(`Expecting an object as argument for xhr, but received: ${args.toString()}`);
|
|
381
326
|
}
|
|
382
|
-
|
|
383
327
|
if (!has(args, "url")) {
|
|
384
|
-
throw new IllegalArgumentException(
|
|
328
|
+
throw new IllegalArgumentException(`No url property found in arguments of xhr, received: ${_JSON$stringify(args)}`);
|
|
385
329
|
}
|
|
386
|
-
|
|
387
330
|
return true;
|
|
388
331
|
};
|
|
332
|
+
|
|
389
333
|
/**
|
|
390
334
|
*/
|
|
391
|
-
|
|
392
|
-
|
|
393
335
|
const xhr = args => {
|
|
394
336
|
validateInputArguments(args);
|
|
395
337
|
return new XHR(args).fetch();
|
|
396
338
|
};
|
|
397
|
-
|
|
398
339
|
export default xhr;
|
|
399
340
|
//# sourceMappingURL=xhr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.js","names":["has","isPlainObject","IllegalArgumentException","UnauthorizedException","FetchException","TimeoutException","NotFoundException","JsonParseException","NetworkException","Cache","HTTP_METHODS","getSetting","NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","constructor","options","_options","_attempts","xmlhttp","_xmlhttp","attempts","url","params","aUrl","split","data","method","GET","timeout","responseType","onProgress","events","headers","baseHeaders","Accept","timeoutHandler","reject","errorHandler","responseJSON","status","isReload","getResponse","response","getResponseHeader","JSON","parse","error","responseHandler","resolve","setEventListeners","forEach","eventType","addEventListener","eventName","openConnection","open","setBasicAuthentication","hasItem","withCredentials","basicToken","getItem","setRequestHeader","headerName","setCustomHeaders","setOtherOptions","sendData","send","stringData","setXMLHttpRequest","XMLHttpRequest","fetch","err","validateInputArguments","args","toString","xhr"],"sources":["../../../src/utils/fetch/xhr.js"],"sourcesContent":["// @flow\nimport { has, isPlainObject } from \"../helpers/objects\";\n\nimport {\n IllegalArgumentException,\n UnauthorizedException,\n FetchException,\n TimeoutException,\n NotFoundException,\n JsonParseException,\n NetworkException,\n} from \"../../exceptions\";\n\nimport Cache from \"../browser/Cache\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { RequestOptions } from \"./types\";\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\n/**\n * @private\n */\nclass XHR {\n _options: RequestOptions;\n _xmlhttp: XMLHttpRequest;\n _attempts: number;\n\n /**\n */\n constructor(options: RequestOptions) {\n this._options = options;\n this._attempts = 0;\n }\n\n /**\n */\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n /**\n */\n set xmlhttp(xmlhttp) {\n this._xmlhttp = xmlhttp;\n }\n\n /**\n */\n get options() {\n return this._options;\n }\n\n /**\n */\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n /**\n */\n get attempts() {\n return this._attempts;\n }\n\n /**\n */\n set attempts(attempts) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n /**\n */\n get params() {\n return this.options.params || \"\";\n }\n\n /**\n */\n get data() {\n return this.options.data || null;\n }\n\n /**\n */\n get method() {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n /**\n */\n get timeout() {\n return this.options.timeout || getSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n /**\n */\n get responseType() {\n return this.options.responseType || \"json\";\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n if (this.options.onProgress) {\n return this.options.onProgress;\n }\n\n return () => {\n // do nothing\n };\n }\n\n /**\n */\n get events() {\n return this.options.events || {};\n }\n\n /**\n */\n get headers() {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": \"en\",\n };\n\n if (this.options.headers) {\n // $FlowFixMe[cannot-spread-indexer]\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n /**\n */\n timeoutHandler(reject) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n /**\n */\n errorHandler(reject, responseJSON = null) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON)\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n /**\n */\n getResponse() {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error);\n }\n }\n\n return response;\n }\n\n /**\n */\n responseHandler(resolve, reject) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response);\n }\n\n /**\n */\n setEventListeners(resolve, reject) {\n if (this.options.onProgress) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, this.onProgress);\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject)\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n /**\n */\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n /**\n */\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n this.xmlhttp.withCredentials = true;\n const basicToken = Cache.getItem(\"basic\");\n\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n /**\n */\n getResponseHeader(headerName) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n /**\n */\n setCustomHeaders() {\n Object.keys(this.headers).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);\n });\n }\n\n /**\n */\n setOtherOptions() {\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n /**\n */\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData = isPlainObject(this.data)\n ? JSON.stringify(this.data)\n : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n /**\n */\n setXMLHttpRequest() {\n return new Promise((resolve, reject) => {\n this.xmlhttp = new XMLHttpRequest();\n\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n /**\n */\n async fetch() {\n try {\n return await this.setXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\n/**\n */\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\"\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args\n )}`\n );\n }\n\n return true;\n};\n\n/**\n */\nconst xhr = (args: RequestOptions): Promise<any> => {\n validateInputArguments(args);\n\n return new XHR(args).fetch();\n};\n\nexport default xhr;\n"],"mappings":";;;;;;AACA,SAASA,GAAT,EAAcC,aAAd,QAAmC,oBAAnC;AAEA,SACEC,wBADF,EAEEC,qBAFF,EAGEC,cAHF,EAIEC,gBAJF,EAKEC,iBALF,EAMEC,kBANF,EAOEC,gBAPF,QAQO,kBARP;AAUA,OAAOC,KAAP,MAAkB,kBAAlB;AAEA,SAASC,YAAT,QAA6B,2BAA7B;AAEA,SAASC,UAAT,QAA2B,0BAA3B;AAIA,MAAMC,kBAAkB,GAAG,CAA3B;AACA,MAAMC,YAAY,GAAG,GAArB;AACA,MAAMC,iBAAiB,GAAG,GAA1B;AACA,MAAMC,iBAAiB,GAAG,GAA1B;AACA,MAAMC,gBAAgB,GAAG,GAAzB;AACA,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,SAAS,GAAG,kBAAlB;AAEA;AACA;AACA;;A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A,eAAeK,GAAf"}
|
|
1
|
+
{"version":3,"file":"xhr.js","names":["has","isPlainObject","IllegalArgumentException","UnauthorizedException","FetchException","TimeoutException","NotFoundException","JsonParseException","NetworkException","Cache","HTTP_METHODS","getSetting","NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","constructor","options","_options","_attempts","xmlhttp","_xmlhttp","attempts","url","params","aUrl","split","data","method","GET","timeout","responseType","onProgress","events","headers","baseHeaders","Accept","timeoutHandler","reject","errorHandler","responseJSON","status","isReload","getResponse","response","getResponseHeader","JSON","parse","error","responseHandler","resolve","setEventListeners","forEach","eventType","addEventListener","eventName","openConnection","open","setBasicAuthentication","hasItem","withCredentials","basicToken","getItem","setRequestHeader","headerName","setCustomHeaders","setOtherOptions","sendData","send","stringData","setXMLHttpRequest","XMLHttpRequest","fetch","err","validateInputArguments","args","toString","xhr"],"sources":["../../../src/utils/fetch/xhr.js"],"sourcesContent":["// @flow\nimport { has, isPlainObject } from \"../helpers/objects\";\n\nimport {\n IllegalArgumentException,\n UnauthorizedException,\n FetchException,\n TimeoutException,\n NotFoundException,\n JsonParseException,\n NetworkException,\n} from \"../../exceptions\";\n\nimport Cache from \"../browser/Cache\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { RequestOptions } from \"./types\";\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\n/**\n * @private\n */\nclass XHR {\n _options: RequestOptions;\n _xmlhttp: XMLHttpRequest;\n _attempts: number;\n\n /**\n */\n constructor(options: RequestOptions) {\n this._options = options;\n this._attempts = 0;\n }\n\n /**\n */\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n /**\n */\n set xmlhttp(xmlhttp) {\n this._xmlhttp = xmlhttp;\n }\n\n /**\n */\n get options() {\n return this._options;\n }\n\n /**\n */\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n /**\n */\n get attempts() {\n return this._attempts;\n }\n\n /**\n */\n set attempts(attempts) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n /**\n */\n get params() {\n return this.options.params || \"\";\n }\n\n /**\n */\n get data() {\n return this.options.data || null;\n }\n\n /**\n */\n get method() {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n /**\n */\n get timeout() {\n return this.options.timeout || getSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n /**\n */\n get responseType() {\n return this.options.responseType || \"json\";\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n if (this.options.onProgress) {\n return this.options.onProgress;\n }\n\n return () => {\n // do nothing\n };\n }\n\n /**\n */\n get events() {\n return this.options.events || {};\n }\n\n /**\n */\n get headers() {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": \"en\",\n };\n\n if (this.options.headers) {\n // $FlowFixMe[cannot-spread-indexer]\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n /**\n */\n timeoutHandler(reject) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n /**\n */\n errorHandler(reject, responseJSON = null) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON)\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n /**\n */\n getResponse() {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error);\n }\n }\n\n return response;\n }\n\n /**\n */\n responseHandler(resolve, reject) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response);\n }\n\n /**\n */\n setEventListeners(resolve, reject) {\n if (this.options.onProgress) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, this.onProgress);\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject)\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n /**\n */\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n /**\n */\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n this.xmlhttp.withCredentials = true;\n const basicToken = Cache.getItem(\"basic\");\n\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n /**\n */\n getResponseHeader(headerName) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n /**\n */\n setCustomHeaders() {\n Object.keys(this.headers).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);\n });\n }\n\n /**\n */\n setOtherOptions() {\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n /**\n */\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData = isPlainObject(this.data)\n ? JSON.stringify(this.data)\n : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n /**\n */\n setXMLHttpRequest() {\n return new Promise((resolve, reject) => {\n this.xmlhttp = new XMLHttpRequest();\n\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n /**\n */\n async fetch() {\n try {\n return await this.setXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\n/**\n */\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\"\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args\n )}`\n );\n }\n\n return true;\n};\n\n/**\n */\nconst xhr = (args: RequestOptions): Promise<any> => {\n validateInputArguments(args);\n\n return new XHR(args).fetch();\n};\n\nexport default xhr;\n"],"mappings":";;;;;AACA,SAASA,GAAG,EAAEC,aAAa,QAAQ,oBAAoB;AAEvD,SACEC,wBAAwB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