@beinformed/ui 1.23.3-beta.0 → 1.23.4
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 +7 -1
- package/esm/builder/index.js +0 -1
- package/esm/builder/index.js.map +1 -1
- package/esm/builder/mergeLayoutHintConfigurations.js +11 -1
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js +28 -23
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js +0 -1
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +27 -11
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +15 -9
- package/esm/constants/Settings.js.map +1 -1
- package/esm/constants/index.js +0 -1
- 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 +28 -9
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js +2 -1
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js +2 -1
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js +2 -1
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js +2 -1
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js +2 -1
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js +10 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js +2 -1
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +11 -1
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js +2 -1
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js +2 -1
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js +6 -1
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js +10 -1
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js +2 -1
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/exceptions/index.js +0 -1
- package/esm/exceptions/index.js.map +1 -1
- package/esm/hooks/index.js +0 -1
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js +16 -0
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js +23 -9
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js +10 -3
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js +6 -2
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js +13 -4
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js +7 -3
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js +3 -0
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +21 -10
- 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 +11 -7
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +12 -2
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +10 -11
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +1 -2
- 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 +2 -3
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js +10 -7
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js +40 -15
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +33 -13
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js +5 -3
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/index.js +0 -1
- package/esm/i18n/index.js.map +1 -1
- package/esm/i18n/languages.js +0 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js +0 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js +0 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/esm/i18n/withMessage.js +4 -1
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +26 -13
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +60 -23
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +34 -14
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +81 -27
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +56 -23
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +83 -33
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +258 -102
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +17 -6
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +76 -29
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +8 -5
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +108 -38
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +80 -27
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +102 -34
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +64 -23
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +99 -40
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +145 -51
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js +17 -7
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js +8 -4
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js +10 -6
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js +10 -5
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +49 -22
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +65 -23
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +72 -29
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js +62 -21
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js +10 -5
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +21 -7
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js +19 -8
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +10 -3
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +22 -6
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +59 -16
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +22 -8
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +22 -8
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +28 -10
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +18 -7
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +24 -10
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js +13 -6
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js +15 -8
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +25 -8
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +53 -17
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +41 -15
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +39 -15
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +20 -8
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +12 -7
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +17 -7
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +17 -7
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +22 -8
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js +57 -22
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js +18 -7
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js +50 -14
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js +17 -8
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +17 -9
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +84 -30
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +11 -5
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +10 -4
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js +67 -27
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +39 -14
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js +5 -2
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js +53 -21
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +46 -16
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +39 -10
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +85 -32
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +36 -12
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +45 -16
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +20 -7
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +22 -8
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +25 -12
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +5 -2
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +21 -10
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +37 -13
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +56 -19
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +59 -22
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +45 -17
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +16 -8
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js +57 -20
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js +43 -16
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js +20 -6
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +48 -11
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +13 -3
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +15 -5
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +32 -13
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js +54 -21
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js +29 -11
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js +21 -8
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +93 -37
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +45 -19
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +58 -25
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +5 -1
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +44 -11
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js +1 -2
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +6 -1
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +332 -136
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +141 -55
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +58 -20
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js +121 -47
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js +32 -11
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/index.js +0 -1
- package/esm/models/index.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +32 -9
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js +44 -15
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js +57 -21
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +21 -5
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +79 -31
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js +28 -10
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +20 -4
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +23 -7
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +115 -38
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +6 -4
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +16 -5
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +14 -6
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js +12 -4
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js +26 -11
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +41 -14
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +41 -14
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js +24 -10
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js +7 -2
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +9 -3
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +41 -15
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +28 -9
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +41 -14
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js +2 -1
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +17 -7
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/user/UserModel.js +10 -5
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +10 -2
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +27 -11
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +56 -21
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js +8 -3
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +194 -77
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js +37 -13
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/modularui/index.js +0 -1
- package/esm/modularui/index.js.map +1 -1
- package/esm/react/ErrorBoundary.js +12 -2
- 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 +0 -1
- package/esm/react/index.js.map +1 -1
- package/esm/react/utils.js +7 -3
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js +2 -1
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +29 -15
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js +8 -3
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/index.js +0 -1
- package/esm/react-client/index.js.map +1 -1
- package/esm/react-client/rehydrate.js +19 -4
- 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 +12 -2
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js +12 -25
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/index.js +0 -1
- 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 +2 -1
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js +18 -9
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +7 -3
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js +2 -1
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +37 -13
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +2 -1
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +20 -7
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/index.js +0 -1
- package/esm/react-theme/index.js.map +1 -1
- package/esm/react-theme/useTheme.js +2 -1
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js +5 -2
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js +9 -3
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +27 -8
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +10 -4
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +22 -7
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js +22 -8
- 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 +0 -1
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_i18n/reducer.js +16 -13
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_modularui/actions.js +48 -36
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js +18 -21
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/index.js +0 -1
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/middleware.js +22 -8
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js +25 -10
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js +39 -19
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js +62 -20
- 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 +5 -7
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js +14 -11
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/index.js +0 -1
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/_router/middleware.js +1 -2
- 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 +4 -2
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +14 -8
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +13 -5
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +3 -2
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +9 -1
- 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 +6 -4
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +4 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +7 -3
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js +1 -3
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js +10 -5
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +26 -14
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js +4 -5
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js +8 -5
- 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 +0 -1
- 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 +3 -2
- 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 +5 -2
- 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 +5 -2
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +5 -2
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +10 -3
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js +3 -2
- 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 +5 -1
- 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 +3 -2
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +5 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js +4 -2
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js +1 -2
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js +3 -2
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +1 -2
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +6 -3
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js +6 -4
- 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 +0 -1
- package/esm/redux/connectors/index.js.map +1 -1
- package/esm/redux/index.js +7 -16
- package/esm/redux/index.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +14 -13
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js +4 -3
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js +15 -11
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js +8 -7
- 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 +15 -11
- 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 +0 -1
- package/esm/redux/reducers/index.js.map +1 -1
- package/esm/redux/selectors/i18n.js +4 -5
- package/esm/redux/selectors/i18n.js.map +1 -1
- package/esm/redux/selectors/index.js +0 -1
- package/esm/redux/selectors/index.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js +1 -2
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js +7 -3
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/browser/Cache.js +44 -17
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js +9 -4
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +110 -53
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js +8 -2
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +17 -6
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js +101 -42
- 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 +5 -3
- 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 +8 -5
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js +9 -7
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js +3 -2
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/index.js +3 -8
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js +124 -43
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js +18 -5
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +17 -5
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js +3 -0
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +13 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js +32 -25
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +29 -9
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +38 -9
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js +7 -0
- package/lib/constants/index.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js +2 -0
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js +27 -9
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +3 -0
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +3 -0
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +3 -0
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +3 -0
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +3 -0
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +10 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +3 -0
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +10 -1
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +3 -0
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +3 -0
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +10 -1
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +9 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +3 -0
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js +16 -0
- package/lib/exceptions/index.js.map +1 -1
- package/lib/hooks/index.js +33 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAllFormsOnModel.js +23 -0
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js +35 -8
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js +16 -3
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +12 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js +27 -3
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js +15 -3
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js +9 -0
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +45 -9
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +3 -0
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +19 -6
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +17 -2
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +39 -9
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +7 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js +7 -1
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +4 -0
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js +4 -2
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js +20 -6
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js +44 -15
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +44 -13
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +8 -2
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js +9 -0
- 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 +10 -1
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +33 -12
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +68 -23
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +41 -14
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +87 -27
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +65 -23
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +89 -32
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +254 -101
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +20 -5
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +83 -29
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +10 -3
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +115 -38
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +84 -26
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +108 -34
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +70 -23
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +109 -40
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +159 -51
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js +20 -5
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js +11 -3
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js +13 -4
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js +14 -4
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +61 -21
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +75 -23
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +79 -28
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js +66 -21
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js +16 -4
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +41 -7
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +19 -6
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +15 -3
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +19 -6
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +58 -16
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +22 -8
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +22 -8
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +27 -10
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +20 -7
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +26 -10
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +14 -5
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +15 -6
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +25 -8
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +51 -17
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +44 -15
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +40 -15
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +20 -8
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +12 -5
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +18 -7
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +18 -7
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +24 -8
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +57 -22
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +19 -7
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +50 -13
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +17 -6
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +18 -8
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +88 -30
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +19 -4
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +13 -3
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +73 -26
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +40 -14
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +6 -1
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +53 -21
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +54 -16
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +44 -10
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +90 -32
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +42 -12
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +49 -16
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +25 -6
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +23 -8
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +26 -11
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +11 -1
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +22 -9
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +44 -12
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +61 -19
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +67 -21
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +55 -17
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +18 -7
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +62 -19
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js +51 -15
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js +25 -5
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +45 -10
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +17 -2
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +16 -4
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +37 -12
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js +61 -21
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js +35 -10
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js +17 -6
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +96 -36
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +45 -19
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +60 -24
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +9 -0
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +55 -11
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js +3 -0
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +10 -1
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +328 -135
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +144 -55
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js +58 -20
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js +123 -47
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js +29 -11
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js +97 -0
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js +40 -8
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js +51 -15
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js +62 -20
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +21 -5
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +84 -31
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js +30 -10
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +24 -4
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +29 -7
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +123 -38
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +8 -2
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +19 -5
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +17 -4
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js +13 -4
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js +26 -10
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +47 -14
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +42 -13
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +29 -9
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js +33 -1
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +12 -3
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +39 -13
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +35 -8
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +48 -14
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js +4 -0
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +19 -6
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/user/UserModel.js +12 -4
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +14 -2
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +30 -11
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +66 -20
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js +7 -3
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +201 -77
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +34 -13
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js +4 -0
- package/lib/modularui/index.js.map +1 -1
- package/lib/react/ErrorBoundary.js +14 -2
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +8 -1
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js +5 -0
- package/lib/react/index.js.map +1 -1
- package/lib/react/utils.js +13 -2
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js +8 -0
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +49 -16
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js +9 -2
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js +4 -0
- package/lib/react-client/index.js.map +1 -1
- package/lib/react-client/rehydrate.js +23 -3
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/contextPath.js +2 -1
- package/lib/react-server/contextPath.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +16 -2
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +16 -25
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js +12 -0
- package/lib/react-server/index.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +16 -3
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +10 -0
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js +28 -8
- package/lib/react-server/requestInformation.js.flow +8 -3
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +14 -2
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +8 -0
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +60 -13
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +6 -0
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +23 -7
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js +18 -0
- package/lib/react-theme/index.js.map +1 -1
- package/lib/react-theme/useTheme.js +3 -0
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js +5 -1
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js +12 -2
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +35 -7
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +14 -3
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +30 -6
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js +35 -7
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js +8 -2
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js +5 -0
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_i18n/reducer.js +21 -12
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_modularui/actions.js +69 -36
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js +28 -20
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js +14 -0
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/middleware.js +28 -8
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js +36 -10
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js +45 -19
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js +97 -20
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +11 -2
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js +16 -5
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js +15 -10
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js +9 -0
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/_router/middleware.js +2 -0
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js +4 -2
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/actions/Application.js +8 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +25 -6
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +24 -4
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +12 -1
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +14 -0
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +8 -2
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +12 -3
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +6 -0
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +13 -2
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js +4 -1
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js +19 -4
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +44 -13
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js +11 -3
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js +28 -5
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +9 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/index.js +31 -0
- package/lib/redux/actions/index.js.map +1 -1
- package/lib/redux/connectors/Application.js +2 -0
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +4 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +2 -0
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +7 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +2 -0
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +7 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +8 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +19 -2
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +5 -1
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +3 -0
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +7 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +2 -0
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +4 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +7 -0
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js +5 -1
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js +4 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +3 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +7 -1
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +8 -2
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +8 -3
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +2 -0
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js +21 -0
- package/lib/redux/connectors/index.js.map +1 -1
- package/lib/redux/index.js +17 -0
- package/lib/redux/index.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +14 -12
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +4 -2
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +18 -11
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +8 -6
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +7 -6
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +15 -10
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js +11 -0
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js +10 -0
- package/lib/redux/reducers/index.js.map +1 -1
- package/lib/redux/selectors/i18n.js +7 -3
- package/lib/redux/selectors/i18n.js.map +1 -1
- package/lib/redux/selectors/index.js +3 -0
- package/lib/redux/selectors/index.js.map +1 -1
- package/lib/redux/store/beforeRenderHooks.js +2 -0
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js +13 -2
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +49 -16
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js +14 -3
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +115 -52
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js +13 -2
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +25 -6
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +111 -42
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js +11 -5
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js +6 -1
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +2 -0
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js +15 -3
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js +13 -6
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js +4 -0
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js +25 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js +121 -43
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +22 -3
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +19 -3
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +29 -29
- package/src/react-server/requestInformation.js +8 -3
|
@@ -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,IAAT,QAAqB,2BAArB;AACA,SAASC,cAAT,QAA+B,kBAA/B;;AAIA;AACA;AACA;AACA,eAAe,SAASC,WAAT,CAAqBC,IAArB,EAAyD;EAAA;;EACtE;EACA,MAAMC,SAAS,GAAG,qCAAAD,IAAI,CAACE,GAAL,iBAAkB,MAAlB,IACdF,IAAI,CAACE,GADS,GAEdF,IAAI,CAACE,GAAL,CAASC,OAAT,CAAiBN,IAAjB,EAAuB,EAAvB,CAFJ;EAGA,MAAMO,MAAM,GAAGJ,IAAI,CAACI,MAAL,GACXJ,IAAI,CAACI,MAAL,CAAYD,OAAZ,CAAoB,qBAApB,EAA2C,EAA3C,CADW,GAEX,EAFJ;EAGA,MAAMD,GAAG,GAAGE,MAAM,KAAK,EAAX,GAAgBH,SAAhB,iDAA+BA,SAA/B,wBAA4CG,MAA5C,CAAZ;EAEA,MAAMC,IAAI,GAAGC,WAAW,CAACC,KAAZ,CAAkBL,GAAlB,EAAuBF,IAAvB,CAAb;;EAEA,IAAI;IACF,MAAMQ,QAAQ,GAAGC,IAAI,CAACC,KAAL,CAAWL,IAAX,CAAjB;;IAEA,IAAIG,QAAQ,CAACG,KAAb,EAAoB;MAClB,OAAO,SAAQC,MAAR,CAAe,IAAId,cAAJ,CAAmBU,QAAnB,EAA6B,IAA7B,EAAmCR,IAAnC,CAAf,CAAP;IACD;;IAED,OAAO,SAAQa,OAAR,CAAgBL,QAAhB,CAAP;EACD,CARD,CAQE,OAAOG,KAAP,EAAc;IACd,OAAO,SAAQC,MAAR,CAAeD,KAAf,CAAP;EACD;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
|
-
|
|
9
8
|
/**
|
|
10
9
|
* Checks each x ms if a cache item is set after fetching the item.
|
|
11
10
|
* @private
|
|
12
11
|
*/
|
|
12
|
+
|
|
13
13
|
const waitForCachedItem = cacheKey => {
|
|
14
14
|
let TIMEOUT = 3000;
|
|
15
15
|
const CHECK_TIMEOUT = 100;
|
|
@@ -17,6 +17,7 @@ const waitForCachedItem = cacheKey => {
|
|
|
17
17
|
const check = () => {
|
|
18
18
|
if (Cache.getItem(cacheKey) !== IS_FETCHING) {
|
|
19
19
|
const cachedItem = Cache.getItem(cacheKey);
|
|
20
|
+
|
|
20
21
|
if (cachedItem != null) {
|
|
21
22
|
resolve(cachedItem);
|
|
22
23
|
} else {
|
|
@@ -29,18 +30,22 @@ const waitForCachedItem = cacheKey => {
|
|
|
29
30
|
setTimeout(check, CHECK_TIMEOUT);
|
|
30
31
|
}
|
|
31
32
|
};
|
|
33
|
+
|
|
32
34
|
setTimeout(check, CHECK_TIMEOUT);
|
|
33
35
|
});
|
|
34
36
|
};
|
|
35
|
-
|
|
36
37
|
/**
|
|
37
38
|
* @private
|
|
38
39
|
*/
|
|
40
|
+
|
|
41
|
+
|
|
39
42
|
const browserFetch = args => {
|
|
40
43
|
if (USE_CACHE && args.cache) {
|
|
41
44
|
const cacheKey = Cache.createResourceKey(args);
|
|
45
|
+
|
|
42
46
|
if (Cache.hasItem(cacheKey)) {
|
|
43
47
|
const cacheItem = Cache.getItem(cacheKey);
|
|
48
|
+
|
|
44
49
|
if (cacheItem != null) {
|
|
45
50
|
if (cacheItem === IS_FETCHING) {
|
|
46
51
|
return waitForCachedItem(cacheKey);
|
|
@@ -49,20 +54,24 @@ const browserFetch = args => {
|
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
56
|
}
|
|
57
|
+
|
|
52
58
|
Cache.addItem(cacheKey, IS_FETCHING);
|
|
53
59
|
}
|
|
60
|
+
|
|
54
61
|
return xhr(args).then(response => {
|
|
55
62
|
if (USE_CACHE && args.cache) {
|
|
56
63
|
const cacheKey = Cache.createResourceKey(args);
|
|
57
64
|
Cache.addItem(cacheKey, response);
|
|
58
65
|
}
|
|
66
|
+
|
|
59
67
|
return response;
|
|
60
68
|
});
|
|
61
69
|
};
|
|
62
|
-
|
|
63
70
|
/**
|
|
64
71
|
* Request data from server, uses server datafetcher or xhr in browser.
|
|
65
72
|
*/
|
|
73
|
+
|
|
74
|
+
|
|
66
75
|
export default function universalFetch(args) {
|
|
67
76
|
// Set locale as Accept-Language header
|
|
68
77
|
if (args.locale) {
|
|
@@ -70,14 +79,16 @@ export default function universalFetch(args) {
|
|
|
70
79
|
"Accept-Language": args.locale
|
|
71
80
|
};
|
|
72
81
|
}
|
|
82
|
+
|
|
73
83
|
if (args.includeContext) {
|
|
74
|
-
args.url =
|
|
75
|
-
}
|
|
84
|
+
args.url = "".concat(args.url, "?includeContext=true");
|
|
85
|
+
} // server side no access to the browser cache apis, no cache available
|
|
86
|
+
|
|
76
87
|
|
|
77
|
-
// server side no access to the browser cache apis, no cache available
|
|
78
88
|
if (IS_SYNC) {
|
|
79
89
|
return serverFetch(args);
|
|
80
90
|
}
|
|
91
|
+
|
|
81
92
|
return browserFetch(args);
|
|
82
93
|
}
|
|
83
94
|
//# 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,aAAT,QAA8B,oBAA9B;AAEA,SAASC,OAAT,EAAkBC,SAAlB,QAAmC,2BAAnC;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,GAAP,MAAgB,OAAhB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AAMA,MAAMC,WAAW,GAAG,aAApB;AAEA;AACA;AACA;AACA;;AACA,MAAMC,iBAAiB,GAAIC,QAAD,IAAc;EACtC,IAAIC,OAAO,GAAG,IAAd;EACA,MAAMC,aAAa,GAAG,GAAtB;EAEA,OAAO,aAA4B,CAACC,OAAD,EAAUC,MAAV,KAAqB;IACtD,MAAMC,KAAK,GAAG,MAAM;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ACe,IAAD,CAAH,CAAUM,IAAV,CAAgBC,QAAD,IAAc;IAClC,IAAIxB,SAAS,IAAIiB,IAAI,CAACC,KAAtB,EAA6B;MAC3B,MAAMZ,QAAQ,GAAGH,KAAK,CAACgB,iBAAN,CAAwBF,IAAxB,CAAjB;MAEAd,KAAK,CAACmB,OAAN,CAAchB,QAAd,EAAwBkB,QAAxB;IACD;;IAED,OAAOA,QAAP;EACD,CARM,CAAP;AASD,CA5BD;AA8BA;AACA;AACA;;;AACA,eAAe,SAASC,cAAT,CACbR,IADa,EAE2C;EACxD;EACA,IAAIA,IAAI,CAACS,MAAT,EAAiB;IACfT,IAAI,CAACU,OAAL,GAAe;MACb,mBAAmBV,IAAI,CAACS;IADX,CAAf;EAGD;;EAED,IAAIT,IAAI,CAACW,cAAT,EAAyB;IACvBX,IAAI,CAACY,GAAL,aAAcZ,IAAI,CAACY,GAAnB;EACD,CAVuD,CAYxD;;;EACA,IAAI9B,OAAJ,EAAa;IACX,OAAOE,WAAW,CAACgB,IAAD,CAAlB;EACD;;EAED,OAAOD,YAAY,CAACC,IAAD,CAAnB;AACD"}
|
package/esm/utils/fetch/xhr.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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";
|
|
3
4
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
5
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
5
6
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
@@ -15,123 +16,148 @@ const UNAUTHORIZED_CODE = 401;
|
|
|
15
16
|
const REDIRECTION_CODE = 300;
|
|
16
17
|
const NOT_FOUND_CODE = 404;
|
|
17
18
|
const JSON_TYPE = "application/json";
|
|
18
|
-
|
|
19
19
|
/**
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
+
|
|
22
23
|
class XHR {
|
|
23
24
|
/**
|
|
24
25
|
*/
|
|
25
26
|
constructor(options) {
|
|
26
27
|
_defineProperty(this, "_options", void 0);
|
|
28
|
+
|
|
27
29
|
_defineProperty(this, "_xmlhttp", void 0);
|
|
30
|
+
|
|
28
31
|
_defineProperty(this, "_attempts", void 0);
|
|
32
|
+
|
|
29
33
|
this._options = options;
|
|
30
34
|
this._attempts = 0;
|
|
31
35
|
}
|
|
32
|
-
|
|
33
36
|
/**
|
|
34
37
|
*/
|
|
38
|
+
|
|
39
|
+
|
|
35
40
|
get xmlhttp() {
|
|
36
41
|
return this._xmlhttp;
|
|
37
42
|
}
|
|
38
|
-
|
|
39
43
|
/**
|
|
40
44
|
*/
|
|
45
|
+
|
|
46
|
+
|
|
41
47
|
set xmlhttp(xmlhttp) {
|
|
42
48
|
this._xmlhttp = xmlhttp;
|
|
43
49
|
}
|
|
44
|
-
|
|
45
50
|
/**
|
|
46
51
|
*/
|
|
52
|
+
|
|
53
|
+
|
|
47
54
|
get options() {
|
|
48
55
|
return this._options;
|
|
49
56
|
}
|
|
50
|
-
|
|
51
57
|
/**
|
|
52
58
|
*/
|
|
59
|
+
|
|
60
|
+
|
|
53
61
|
set options(options) {
|
|
54
62
|
this._options = options;
|
|
55
63
|
}
|
|
56
|
-
|
|
57
64
|
/**
|
|
58
65
|
*/
|
|
66
|
+
|
|
67
|
+
|
|
59
68
|
get attempts() {
|
|
60
69
|
return this._attempts;
|
|
61
70
|
}
|
|
62
|
-
|
|
63
71
|
/**
|
|
64
72
|
*/
|
|
73
|
+
|
|
74
|
+
|
|
65
75
|
set attempts(attempts) {
|
|
66
76
|
this._attempts = attempts;
|
|
67
77
|
}
|
|
68
|
-
|
|
69
78
|
/**
|
|
70
79
|
* Create and fix url when params or both querystring and params exist.
|
|
71
80
|
*/
|
|
81
|
+
|
|
82
|
+
|
|
72
83
|
get url() {
|
|
73
84
|
const {
|
|
74
85
|
url
|
|
75
86
|
} = this.options;
|
|
87
|
+
|
|
76
88
|
if (this.params !== "") {
|
|
89
|
+
var _context3;
|
|
90
|
+
|
|
77
91
|
if (_includesInstanceProperty(url).call(url, "?")) {
|
|
92
|
+
var _context, _context2;
|
|
93
|
+
|
|
78
94
|
const aUrl = url.split("?");
|
|
79
|
-
return
|
|
95
|
+
return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "".concat(aUrl[0], "?")).call(_context2, aUrl[1], "&")).call(_context, this.params);
|
|
80
96
|
}
|
|
81
|
-
|
|
97
|
+
|
|
98
|
+
return _concatInstanceProperty(_context3 = "".concat(url, "?")).call(_context3, this.params);
|
|
82
99
|
}
|
|
100
|
+
|
|
83
101
|
return url;
|
|
84
102
|
}
|
|
85
|
-
|
|
86
103
|
/**
|
|
87
104
|
*/
|
|
105
|
+
|
|
106
|
+
|
|
88
107
|
get params() {
|
|
89
108
|
return this.options.params || "";
|
|
90
109
|
}
|
|
91
|
-
|
|
92
110
|
/**
|
|
93
111
|
*/
|
|
112
|
+
|
|
113
|
+
|
|
94
114
|
get data() {
|
|
95
115
|
return this.options.data || null;
|
|
96
116
|
}
|
|
97
|
-
|
|
98
117
|
/**
|
|
99
118
|
*/
|
|
119
|
+
|
|
120
|
+
|
|
100
121
|
get method() {
|
|
101
122
|
return this.options.method || HTTP_METHODS.GET;
|
|
102
123
|
}
|
|
103
|
-
|
|
104
124
|
/**
|
|
105
125
|
*/
|
|
126
|
+
|
|
127
|
+
|
|
106
128
|
get timeout() {
|
|
107
129
|
return this.options.timeout || getSetting("XHR_TIMEOUT_MS", 300000);
|
|
108
130
|
}
|
|
109
|
-
|
|
110
131
|
/**
|
|
111
132
|
*/
|
|
133
|
+
|
|
134
|
+
|
|
112
135
|
get responseType() {
|
|
113
136
|
return this.options.responseType || "json";
|
|
114
137
|
}
|
|
115
|
-
|
|
116
138
|
/**
|
|
117
139
|
*/
|
|
140
|
+
|
|
141
|
+
|
|
118
142
|
get onProgress() {
|
|
119
143
|
if (this.options.onProgress) {
|
|
120
144
|
return this.options.onProgress;
|
|
121
145
|
}
|
|
122
|
-
|
|
123
|
-
|
|
146
|
+
|
|
147
|
+
return () => {// do nothing
|
|
124
148
|
};
|
|
125
149
|
}
|
|
126
|
-
|
|
127
150
|
/**
|
|
128
151
|
*/
|
|
152
|
+
|
|
153
|
+
|
|
129
154
|
get events() {
|
|
130
155
|
return this.options.events || {};
|
|
131
156
|
}
|
|
132
|
-
|
|
133
157
|
/**
|
|
134
158
|
*/
|
|
159
|
+
|
|
160
|
+
|
|
135
161
|
get headers() {
|
|
136
162
|
const baseHeaders = {
|
|
137
163
|
Accept: JSON_TYPE,
|
|
@@ -140,24 +166,27 @@ class XHR {
|
|
|
140
166
|
"X-Requested-With": "XMLHttpRequest",
|
|
141
167
|
"Accept-Language": "en"
|
|
142
168
|
};
|
|
169
|
+
|
|
143
170
|
if (this.options.headers) {
|
|
144
171
|
// $FlowFixMe[cannot-spread-indexer]
|
|
145
|
-
return {
|
|
146
|
-
...baseHeaders,
|
|
172
|
+
return { ...baseHeaders,
|
|
147
173
|
...this.options.headers
|
|
148
174
|
};
|
|
149
175
|
}
|
|
176
|
+
|
|
150
177
|
return baseHeaders;
|
|
151
178
|
}
|
|
152
|
-
|
|
153
179
|
/**
|
|
154
180
|
*/
|
|
181
|
+
|
|
182
|
+
|
|
155
183
|
timeoutHandler(reject) {
|
|
156
184
|
return reject(new TimeoutException(this.url, this.method));
|
|
157
185
|
}
|
|
158
|
-
|
|
159
186
|
/**
|
|
160
187
|
*/
|
|
188
|
+
|
|
189
|
+
|
|
161
190
|
errorHandler(reject) {
|
|
162
191
|
let responseJSON = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
163
192
|
const {
|
|
@@ -166,117 +195,137 @@ class XHR {
|
|
|
166
195
|
const {
|
|
167
196
|
isReload
|
|
168
197
|
} = this.options;
|
|
198
|
+
|
|
169
199
|
if (status === NETWORK_ERROR_CODE) {
|
|
170
200
|
return reject(new NetworkException(this.url, this.method));
|
|
171
201
|
}
|
|
202
|
+
|
|
172
203
|
if (status === NOT_FOUND_CODE) {
|
|
173
204
|
return reject(new NotFoundException(this.url, this.method, isReload));
|
|
174
205
|
}
|
|
206
|
+
|
|
175
207
|
if (status === UNAUTHORIZED_CODE) {
|
|
176
208
|
return reject(new UnauthorizedException(this.url, this.method, responseJSON));
|
|
177
209
|
}
|
|
210
|
+
|
|
178
211
|
return reject(new FetchException(responseJSON, this.xmlhttp, this.options));
|
|
179
212
|
}
|
|
180
|
-
|
|
181
213
|
/**
|
|
182
214
|
*/
|
|
215
|
+
|
|
216
|
+
|
|
183
217
|
getResponse() {
|
|
184
218
|
const {
|
|
185
219
|
responseType,
|
|
186
220
|
response
|
|
187
221
|
} = this.xmlhttp;
|
|
222
|
+
|
|
188
223
|
if ((responseType === "" || responseType === "text") && this.getResponseHeader("Content-Type") === JSON_TYPE) {
|
|
189
224
|
if (isPlainObject(response)) {
|
|
190
225
|
return response;
|
|
191
226
|
}
|
|
227
|
+
|
|
192
228
|
try {
|
|
193
229
|
return JSON.parse(response);
|
|
194
230
|
} catch (error) {
|
|
195
231
|
throw new JsonParseException(error);
|
|
196
232
|
}
|
|
197
233
|
}
|
|
234
|
+
|
|
198
235
|
return response;
|
|
199
236
|
}
|
|
200
|
-
|
|
201
237
|
/**
|
|
202
238
|
*/
|
|
239
|
+
|
|
240
|
+
|
|
203
241
|
responseHandler(resolve, reject) {
|
|
204
242
|
const {
|
|
205
243
|
status
|
|
206
244
|
} = this.xmlhttp;
|
|
207
245
|
let response = null;
|
|
246
|
+
|
|
208
247
|
try {
|
|
209
248
|
response = this.getResponse();
|
|
210
249
|
} catch (error) {
|
|
211
250
|
return reject(error);
|
|
212
251
|
}
|
|
252
|
+
|
|
213
253
|
if (status >= SUCCESS_CODE && status < REDIRECTION_CODE || status === CLIENT_ERROR_CODE && has(response, "formresponse")) {
|
|
214
254
|
return resolve(response);
|
|
215
255
|
}
|
|
256
|
+
|
|
216
257
|
return this.errorHandler(reject, response);
|
|
217
258
|
}
|
|
218
|
-
|
|
219
259
|
/**
|
|
220
260
|
*/
|
|
261
|
+
|
|
262
|
+
|
|
221
263
|
setEventListeners(resolve, reject) {
|
|
222
264
|
if (this.options.onProgress) {
|
|
223
265
|
["load", "loadend", "loadstart", "progress"].forEach(eventType => {
|
|
224
266
|
this.xmlhttp.addEventListener(eventType, this.onProgress);
|
|
225
267
|
});
|
|
226
268
|
}
|
|
269
|
+
|
|
227
270
|
["abort", "error"].forEach(eventType => {
|
|
228
271
|
this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));
|
|
229
272
|
});
|
|
230
273
|
this.xmlhttp.addEventListener("timeout", () => this.timeoutHandler(reject));
|
|
231
|
-
this.xmlhttp.addEventListener("load", () => this.responseHandler(resolve, reject));
|
|
274
|
+
this.xmlhttp.addEventListener("load", () => this.responseHandler(resolve, reject)); // Set custom events
|
|
232
275
|
|
|
233
|
-
// Set custom events
|
|
234
276
|
_Object$keys(this.events).forEach(eventName => {
|
|
235
277
|
this.xmlhttp.addEventListener(eventName, this.events[eventName]);
|
|
236
278
|
});
|
|
237
279
|
}
|
|
238
|
-
|
|
239
280
|
/**
|
|
240
281
|
*/
|
|
282
|
+
|
|
283
|
+
|
|
241
284
|
openConnection() {
|
|
242
285
|
this.xmlhttp.open(this.method, this.url, true);
|
|
243
286
|
}
|
|
244
|
-
|
|
245
287
|
/**
|
|
246
288
|
*/
|
|
289
|
+
|
|
290
|
+
|
|
247
291
|
setBasicAuthentication() {
|
|
248
292
|
if (Cache.hasItem("basic")) {
|
|
249
293
|
this.xmlhttp.withCredentials = true;
|
|
250
294
|
const basicToken = Cache.getItem("basic");
|
|
295
|
+
|
|
251
296
|
if (typeof basicToken === "string") {
|
|
252
|
-
this.xmlhttp.setRequestHeader("Authorization",
|
|
297
|
+
this.xmlhttp.setRequestHeader("Authorization", "Basic ".concat(basicToken));
|
|
253
298
|
}
|
|
254
299
|
}
|
|
255
300
|
}
|
|
256
|
-
|
|
257
301
|
/**
|
|
258
302
|
*/
|
|
303
|
+
|
|
304
|
+
|
|
259
305
|
getResponseHeader(headerName) {
|
|
260
306
|
return this.xmlhttp.getResponseHeader(headerName);
|
|
261
307
|
}
|
|
262
|
-
|
|
263
308
|
/**
|
|
264
309
|
*/
|
|
310
|
+
|
|
311
|
+
|
|
265
312
|
setCustomHeaders() {
|
|
266
313
|
_Object$keys(this.headers).forEach(headerName => {
|
|
267
314
|
this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);
|
|
268
315
|
});
|
|
269
316
|
}
|
|
270
|
-
|
|
271
317
|
/**
|
|
272
318
|
*/
|
|
319
|
+
|
|
320
|
+
|
|
273
321
|
setOtherOptions() {
|
|
274
322
|
this.xmlhttp.responseType = this.responseType;
|
|
275
323
|
this.xmlhttp.timeout = this.timeout;
|
|
276
324
|
}
|
|
277
|
-
|
|
278
325
|
/**
|
|
279
326
|
*/
|
|
327
|
+
|
|
328
|
+
|
|
280
329
|
sendData() {
|
|
281
330
|
if (this.data == null) {
|
|
282
331
|
this.xmlhttp.send();
|
|
@@ -285,9 +334,10 @@ class XHR {
|
|
|
285
334
|
this.xmlhttp.send(stringData);
|
|
286
335
|
}
|
|
287
336
|
}
|
|
288
|
-
|
|
289
337
|
/**
|
|
290
338
|
*/
|
|
339
|
+
|
|
340
|
+
|
|
291
341
|
setXMLHttpRequest() {
|
|
292
342
|
return new _Promise((resolve, reject) => {
|
|
293
343
|
this.xmlhttp = new XMLHttpRequest();
|
|
@@ -299,9 +349,10 @@ class XHR {
|
|
|
299
349
|
this.sendData();
|
|
300
350
|
});
|
|
301
351
|
}
|
|
302
|
-
|
|
303
352
|
/**
|
|
304
353
|
*/
|
|
354
|
+
|
|
355
|
+
|
|
305
356
|
async fetch() {
|
|
306
357
|
try {
|
|
307
358
|
return await this.setXMLHttpRequest();
|
|
@@ -310,31 +361,39 @@ class XHR {
|
|
|
310
361
|
this.attempts += 1;
|
|
311
362
|
return this.fetch();
|
|
312
363
|
}
|
|
364
|
+
|
|
313
365
|
throw err;
|
|
314
366
|
}
|
|
315
367
|
}
|
|
316
|
-
}
|
|
317
368
|
|
|
369
|
+
}
|
|
318
370
|
/**
|
|
319
371
|
*/
|
|
372
|
+
|
|
373
|
+
|
|
320
374
|
const validateInputArguments = args => {
|
|
321
375
|
if (args == null) {
|
|
322
376
|
throw new IllegalArgumentException("Missing request options, expecting an object as argument for xhr");
|
|
323
377
|
}
|
|
378
|
+
|
|
324
379
|
if (!isPlainObject(args)) {
|
|
325
|
-
throw new IllegalArgumentException(
|
|
380
|
+
throw new IllegalArgumentException("Expecting an object as argument for xhr, but received: ".concat(args.toString()));
|
|
326
381
|
}
|
|
382
|
+
|
|
327
383
|
if (!has(args, "url")) {
|
|
328
|
-
throw new IllegalArgumentException(
|
|
384
|
+
throw new IllegalArgumentException("No url property found in arguments of xhr, received: ".concat(_JSON$stringify(args)));
|
|
329
385
|
}
|
|
386
|
+
|
|
330
387
|
return true;
|
|
331
388
|
};
|
|
332
|
-
|
|
333
389
|
/**
|
|
334
390
|
*/
|
|
391
|
+
|
|
392
|
+
|
|
335
393
|
const xhr = args => {
|
|
336
394
|
validateInputArguments(args);
|
|
337
395
|
return new XHR(args).fetch();
|
|
338
396
|
};
|
|
397
|
+
|
|
339
398
|
export default xhr;
|
|
340
399
|
//# 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,GAAG,EAAEC,aAAa,QAAQ,oBAAoB;AAEvD,SACEC,wBAAwB,EACxBC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,gBAAgB,QACX,kBAAkB;AAEzB,OAAOC,KAAK,MAAM,kBAAkB;AAEpC,SAASC,YAAY,QAAQ,2BAA2B;AAExD,SAASC,UAAU,QAAQ,0BAA0B;AAIrD,MAAMC,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,YAAY,GAAG,GAAG;AACxB,MAAMC,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,iBAAiB,GAA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ACF;;AAEA;AACA;AACA,MAAMC,sBAAsB,GAAIC,IAAoB,IAAK;EACvD,IAAIA,IAAI,IAAI,IAAI,EAAE;IAChB,MAAM,IAAI7E,wBAAwB,CAChC,kEAAkE,CACnE;EACH;EAEA,IAAI,CAACD,aAAa,CAAC8E,IAAI,CAAC,EAAE;IACxB,MAAM,IAAI7E,wBAAwB,CAC/B,0DAAyD6E,IAAI,CAACC,QAAQ,EAAG,EAAC,CAC5E;EACH;EAEA,IAAI,CAAChF,GAAG,CAAC+E,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,MAAM,IAAI7E,wBAAwB,CAC/B,wDAAuD,gBACtD6E,IAAI,CACJ,EAAC,CACJ;EACH;EAEA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA,MAAME,GAAG,GAAIF,IAAoB,IAAmB;EAClDD,sBAAsB,CAACC,IAAI,CAAC;EAE5B,OAAO,IAAI5D,GAAG,CAAC4D,IAAI,CAAC,CAACH,KAAK,EAAE;AAC9B,CAAC;AAED,eAAeK,GAAG"}
|
|
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;;AACA,MAAMC,GAAN,CAAU;EAKR;AACF;EACEC,WAAW,CAACC,OAAD,EAA0B;IAAA;;IAAA;;IAAA;;IACnC,KAAKC,QAAL,GAAgBD,OAAhB;IACA,KAAKE,SAAL,GAAiB,CAAjB;EACD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