@beinformed/ui 1.17.3 → 1.18.2
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 +21 -0
- package/esm/builder/index.js.map +1 -1
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js +4 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +25 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/constants/index.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/exceptions/index.js.map +1 -1
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js +1 -11
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js +2 -1
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/index.js.map +1 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/esm/i18n/types.js.map +1 -1
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/index.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +2 -2
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +9 -9
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/modularui/index.js.map +1 -1
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/index.js.map +1 -1
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +3 -2
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/index.js.map +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/contextPath.js.map +1 -1
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/index.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +2 -1
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/index.js.map +1 -1
- package/esm/react-theme/types.js.map +1 -1
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/actions.js.map +1 -1
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_i18n/types.js.map +1 -1
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/_router/middleware.js.map +1 -1
- package/esm/redux/_router/reducer.js.map +1 -1
- package/esm/redux/_router/types.js.map +1 -1
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +5 -11
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +32 -2
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/actions/index.js.map +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/connectors/index.js.map +1 -1
- package/esm/redux/index.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js +5 -1
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/reducers/index.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/types.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js +9 -1
- package/lib/constants/Constants.js.flow +5 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +37 -1
- package/lib/constants/Settings.js.flow +25 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js.map +1 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js +2 -15
- package/lib/hooks/useForm.js.flow +0 -14
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js +2 -1
- package/lib/i18n/Locale.js.flow +4 -2
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/__tests__/Locale.spec.js.flow +3 -2
- 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/types.js.map +1 -1
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +2 -2
- package/lib/models/list/ListModel.js.flow +1 -2
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +10 -10
- package/lib/modularui/Authenticate.js.flow +11 -7
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js.map +1 -1
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js.map +1 -1
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +2 -1
- package/lib/react-client/client.js.flow +5 -1
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js.map +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/__tests__/serverUtil.spec.js.flow +18 -0
- package/lib/react-server/contextPath.js.map +1 -1
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +1 -0
- package/lib/react-server/serverUtil.js.flow +2 -0
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js.map +1 -1
- package/lib/react-theme/types.js.map +1 -1
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_i18n/types.js.map +1 -1
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/_router/types.js.map +1 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +6 -15
- package/lib/redux/actions/FormAttributeSet.js.flow +3 -16
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +41 -1
- package/lib/redux/actions/Preferences.js.flow +49 -2
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/__tests__/Preferences.spec.js.flow +11 -0
- package/lib/redux/actions/index.js.map +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js.map +1 -1
- package/lib/redux/index.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +5 -1
- package/lib/redux/reducers/PreferencesReducer.js.flow +8 -1
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/__tests__/PreferencesReducer.spec.js.flow +12 -0
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js.map +1 -1
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/redux/types.js.flow +5 -0
- package/lib/redux/types.js.map +1 -1
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/types.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +20 -18
- package/src/constants/Constants.js +5 -0
- package/src/constants/Settings.js +25 -1
- package/src/hooks/useForm.js +0 -14
- package/src/i18n/Locale.js +4 -2
- package/src/i18n/__tests__/Locale.spec.js +3 -2
- package/src/models/list/ListModel.js +1 -2
- package/src/modularui/Authenticate.js +11 -7
- package/src/react-client/client.js +5 -1
- package/src/react-server/__tests__/serverUtil.spec.js +18 -0
- package/src/react-server/serverUtil.js +2 -0
- package/src/redux/actions/FormAttributeSet.js +3 -16
- package/src/redux/actions/Preferences.js +49 -2
- package/src/redux/actions/__tests__/Preferences.spec.js +11 -0
- package/src/redux/reducers/PreferencesReducer.js +8 -1
- package/src/redux/reducers/__tests__/PreferencesReducer.spec.js +12 -0
- package/src/redux/types.js +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useDeepCompareEffect.js","names":["useDeepCompareMemoize","value","ref","React","useRef","signalRef","current","useDeepCompareEffect","callback","dependencies","useEffect"],"sources":["../../src/hooks/useDeepCompareEffect.js"],"sourcesContent":["// @flow\nimport * as React from \"react\";\nimport { dequal as deepEqual } from \"dequal/lite\";\n\ntype Callback = () => void | (() => void);\ntype DependencyList = Array<mixed>;\n\n/**\n * As copied from https://github.com/kentcdodds/use-deep-compare-effect/\n * Need to copy this, because the dependency on dequal breaks in ie11\n */\nconst useDeepCompareMemoize = (value: DependencyList) => {\n const ref = React.useRef<DependencyList | null>(null); // NOSONAR\n const signalRef = React.useRef<number>(0);\n\n if (!deepEqual(value, ref.current)) {\n ref.current = value;\n signalRef.current += 1;\n }\n\n return [signalRef.current];\n};\n\n/**\n */\nexport function useDeepCompareEffect(\n callback: Callback,\n dependencies: DependencyList\n): void {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useEffect(callback, useDeepCompareMemoize(dependencies));\n}\n\nexport default useDeepCompareEffect;\n"],"mappings":";;;;;;;;;;;;;;AACA;;AACA;;;;;;AAKA;AACA;AACA;AACA;AACA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACC,KAAD,EAA2B;EACvD,IAAMC,GAAG,GAAGC,KAAK,CAACC,MAAN,CAAoC,IAApC,CAAZ,CADuD,CACA;;EACvD,IAAMC,SAAS,GAAGF,KAAK,CAACC,MAAN,CAAqB,CAArB,CAAlB;;EAEA,IAAI,CAAC,kBAAUH,KAAV,EAAiBC,GAAG,CAACI,OAArB,CAAL,EAAoC;IAClCJ,GAAG,CAACI,OAAJ,GAAcL,KAAd;IACAI,SAAS,CAACC,OAAV,IAAqB,CAArB;EACD;;EAED,OAAO,CAACD,SAAS,CAACC,OAAX,CAAP;AACD,CAVD;AAYA;AACA;;;AACO,SAASC,oBAAT,CACLC,QADK,EAELC,YAFK,EAGC;EACN;EACA,OAAON,KAAK,CAACO,SAAN,CAAgBF,QAAhB,EAA0BR,qBAAqB,CAACS,YAAD,CAA/C,CAAP;AACD;;eAEcF,oB"}
|
package/lib/hooks/useForm.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.useFormNavigation = exports.useForm = exports.
|
|
8
|
+
exports.useFormNavigation = exports.useForm = exports.useAttributeUpdate = exports.useAttributeSet = void 0;
|
|
9
9
|
|
|
10
10
|
var _reactRedux = require("react-redux");
|
|
11
11
|
|
|
@@ -97,25 +97,12 @@ var useAttributeUpdate = function useAttributeUpdate(form, object) {
|
|
|
97
97
|
return dispatch((0, _actions.updateFormAttribute)(form, object, attribute, value, options));
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
/**
|
|
101
|
-
* Validate attributes of a form
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
exports.useAttributeUpdate = useAttributeUpdate;
|
|
106
|
-
|
|
107
|
-
var useAttributeValidate = function useAttributeValidate(form) {
|
|
108
|
-
var dispatch = (0, _reactRedux.useDispatch)();
|
|
109
|
-
return function () {
|
|
110
|
-
return dispatch((0, _actions.validateFormAttribute)(form));
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
100
|
/**
|
|
114
101
|
* Attributeset actions
|
|
115
102
|
*/
|
|
116
103
|
|
|
117
104
|
|
|
118
|
-
exports.
|
|
105
|
+
exports.useAttributeUpdate = useAttributeUpdate;
|
|
119
106
|
|
|
120
107
|
var useAttributeSet = function useAttributeSet(form) {
|
|
121
108
|
var dispatch = (0, _reactRedux.useDispatch)();
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
removeRepeatableAttributeSet,
|
|
17
17
|
showFormNotification,
|
|
18
18
|
updateFormAttribute,
|
|
19
|
-
validateFormAttribute,
|
|
20
19
|
} from "../redux/actions";
|
|
21
20
|
|
|
22
21
|
import FormModel from "../models/form/FormModel";
|
|
@@ -48,8 +47,6 @@ type AttributeUpdateHook = (
|
|
|
48
47
|
options: UpdateFormOptions
|
|
49
48
|
) => void;
|
|
50
49
|
|
|
51
|
-
type AttributeValidateHook = () => void;
|
|
52
|
-
|
|
53
50
|
/**
|
|
54
51
|
* Load a form by href
|
|
55
52
|
*/
|
|
@@ -122,17 +119,6 @@ export const useAttributeUpdate = (
|
|
|
122
119
|
) => dispatch(updateFormAttribute(form, object, attribute, value, options));
|
|
123
120
|
};
|
|
124
121
|
|
|
125
|
-
/**
|
|
126
|
-
* Validate attributes of a form
|
|
127
|
-
*/
|
|
128
|
-
export const useAttributeValidate = (
|
|
129
|
-
form: FormModel
|
|
130
|
-
): AttributeValidateHook => {
|
|
131
|
-
const dispatch = useDispatch();
|
|
132
|
-
|
|
133
|
-
return () => dispatch(validateFormAttribute(form));
|
|
134
|
-
};
|
|
135
|
-
|
|
136
122
|
/**
|
|
137
123
|
* Attributeset actions
|
|
138
124
|
*/
|
package/lib/hooks/useForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useForm.js","names":["useForm","href","formHref","Href","addParameter","form","method","HTTP_METHODS","POST","targetModel","FormModel","removeOnUnmount","model","useFormNavigation","dispatch","previous","cancel","submit","connectKey","selfhref","data","formdata","updateModel","remove","showFormNotificationAction","showFormNotification","useAttributeUpdate","object","attribute","value","options","useAttributeSet","save"],"sources":["../../src/hooks/useForm.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport Href from \"../models/href/Href\";\n\nimport { getSetting, HTTP_METHODS } from \"../constants\";\n\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport {\n addRepeatableAttributeSet,\n cancelForm,\n cancelRepeatableAttributeSet,\n previousObject,\n removeRepeatableAttributeSet,\n showFormNotification,\n updateFormAttribute,\n} from \"../redux/actions\";\n\nimport FormModel from \"../models/form/FormModel\";\n\nimport type { FormObjectModel, AttributeType } from \"../models\";\nimport type { UpdateFormOptions } from \"../redux/types\";\nimport type {\n RemoveModelByKeyAction,\n UpdateModelAction,\n} from \"../redux/_modularui\";\n\ntype FormNavigationHook = {\n previous: (form: FormModel) => UpdateModelAction,\n cancel: (form: FormModel) => void,\n submit: (form: FormModel) => void,\n showFormNotification: (form: FormModel) => void,\n remove: (form: FormModel) => RemoveModelByKeyAction,\n};\n\ntype AttributeSetHook = {\n save: () => UpdateModelAction,\n cancel: (object: FormObjectModel) => UpdateModelAction,\n remove: (object: FormObjectModel) => UpdateModelAction,\n};\n\ntype AttributeUpdateHook = (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n) => void;\n\n/**\n * Load a form by href\n */\nexport const useForm = (href: string | Href): ?FormModel => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n });\n\n if (form?.model) {\n return form.model;\n }\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = (): FormNavigationHook => {\n const dispatch = useDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n loadModularUI(form.connectKey, form.selfhref, {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateModel: form,\n targetModel: FormModel,\n })\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Update attributes of a form\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n object: FormObjectModel\n): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n ) => dispatch(updateFormAttribute(form, object, attribute, value, options));\n};\n\n/**\n * Attributeset actions\n */\nexport const useAttributeSet = (form: FormModel): AttributeSetHook => {\n const dispatch = useDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAEA;;AAUA;;AA6BA;AACA;AACA;AACO,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAAqC;EAC1D,IAAMC,QAAQ,GAAG,IAAIC,aAAJ,CAASF,IAAT,CAAjB;;EAEA,IAAI,CAAC,2BAAW,oBAAX,CAAL,EAAuC;IACrCC,QAAQ,CAACE,YAAT,CAAsB,QAAtB,EAAgC,OAAhC;EACD;;EAED,IAAMC,IAAI,GAAG,gCAAa,MAAb,EAAqBH,QAArB,EAA+B;IAC1CI,MAAM,EAAEC,wBAAaC,IADqB;IAE1CC,WAAW,EAAEC,kBAF6B;IAG1CC,eAAe,EAAE;EAHyB,CAA/B,CAAb;;EAMA,IAAIN,IAAJ,aAAIA,IAAJ,eAAIA,IAAI,CAAEO,KAAV,EAAiB;IACf,OAAOP,IAAI,CAACO,KAAZ;EACD;AACF,CAhBM;AAkBP;AACA;AACA;;;;;AACO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,GAA0B;EACzD,IAAMC,QAAQ,GAAG,8BAAjB;;EAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACV,IAAD;IAAA,OAAqBS,QAAQ,CAAC,6BAAeT,IAAf,CAAD,CAA7B;EAAA,CAAjB;;EAEA,IAAMW,MAAM,GAAG,SAATA,MAAS,CAACX,IAAD;IAAA,OAAqBS,QAAQ,CAAC,yBAAWT,IAAX,CAAD,CAA7B;EAAA,CAAf;;EAEA,IAAMY,MAAM,GAAG,SAATA,MAAS,CAACZ,IAAD;IAAA,OACbS,QAAQ,CACN,8BAAcT,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2CAA6BT,IAA7B,EAAmCsB,MAAnC,CAAD,CADF;IAAA,CAFH;IAILJ,MAAM,EAAE,gBAACI,MAAD;MAAA,OACNb,QAAQ,CAAC,2CAA6BT,IAA7B,EAAmCsB,MAAnC,CAAD,CADF;IAAA;EAJH,CAAP;AAOD,CAVM"}
|
package/lib/hooks/useI18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useI18n.js","names":["getLocaleCode","state","i18n","locale","getLocales","locales","getMessage","localeCode","id","defaultMessage","placeholders","getLocale","args","useMessage","useTranslate"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nconst getLocaleCode = (state) => state.i18n.locale || \"en\";\nconst getLocales = (state) => state.i18n.locales;\n\nconst getMessage = createSelector(\n [getLocales, getLocaleCode],\n (locales, localeCode) =>\n memoize(\n (\n id?: string | null,\n defaultMessage?: string | null,\n placeholders?: Object\n ) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args)\n )\n);\n\n/**\n */\nconst useMessage = (\n id?: string | null,\n defaultMessage?: string | null,\n placeholders?: Object | null\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\nexport { useTranslate, useMessage };\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,IAAN,CAAWC,MAAX,IAAqB,IAAhC;AAAA,CAAtB;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACH,KAAD;EAAA,OAAWA,KAAK,CAACC,IAAN,CAAWG,OAAtB;AAAA,CAAnB;;AAEA,IAAMC,UAAU,GAAG,8BACjB,CAACF,UAAD,EAAaJ,aAAb,CADiB,EAEjB,UAACK,OAAD,EAAUE,UAAV;EAAA,OACE,sBACE,UACEC,EADF,EAEEC,cAFF,EAGEC,YAHF;IAAA,OAKEL,OAAO,CACJM,SADH,CACaJ,UADb,EAEGD,UAFH,CAEcE,EAFd,EAEkBC,cAFlB,EAEkCC,YAFlC,CALF;EAAA,CADF,EASE;IAAA,kCAAIE,IAAJ;MAAIA,IAAJ;IAAA;;IAAA,OAAa,wBAAeA,IAAf,CAAb;EAAA,CATF,CADF;AAAA,CAFiB,CAAnB;AAgBA;AACA;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CACjBL,EADiB,EAEjBC,cAFiB,EAGjBC,YAHiB;EAAA,OAIT,6BAAYJ,UAAZ,EAAwBE,EAAxB,EAA4BC,cAA5B,EAA4CC,YAA5C,CAJS;AAAA,CAAnB;AAMA;AACA;;;;;AACA,IAAMI,YAAY,GAAG,SAAfA,YAAe;EAAA,OAAyB,6BAAYR,UAAZ,CAAzB;AAAA,CAArB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModal.js","names":["useModal","modalId","IllegalArgumentException","dispatch","modal","modals","m","key","show","close","size","visible"],"sources":["../../src/hooks/useModal.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { showModal, closeModal } from \"../redux/actions/Modals\";\nimport { IllegalArgumentException } from \"../exceptions\";\n\ntype ModalHook = (modalId: string) => {\n key: string | null,\n size: string | null,\n visible: boolean,\n show: () => void,\n close: () => void,\n};\n\n/**\n * Manage modals\n */\nexport const useModal: ModalHook = (modalId: string) => {\n if (!modalId) {\n throw new IllegalArgumentException(\n \"Missing modalId argument for useModal hook\"\n );\n }\n\n const dispatch = useDispatch();\n const modal = useSelector(({ modals }) =>\n modals.modals.find((m) => m.key === modalId)\n );\n\n const show = useCallback(() => {\n dispatch(showModal(modalId));\n }, [dispatch, modalId]);\n\n const close = useCallback(() => {\n dispatch(closeModal(modalId));\n }, [dispatch, modalId]);\n\n return {\n key: modal ? modal.key : null,\n size: modal ? modal.size : null,\n visible: modal ? modal.visible : false,\n show,\n close,\n };\n};\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAUA;AACA;AACA;AACO,IAAMA,QAAmB,GAAG,SAAtBA,QAAsB,CAACC,OAAD,EAAqB;EACtD,IAAI,CAACA,OAAL,EAAc;IACZ,MAAM,IAAIC,oCAAJ,CACJ,4CADI,CAAN;EAGD;;EAED,IAAMC,QAAQ,GAAG,8BAAjB;EACA,IAAMC,KAAK,GAAG,6BAAY;IAAA;;IAAA,IAAGC,MAAH,QAAGA,MAAH;IAAA,OACxB,8BAAAA,MAAM,CAACA,MAAP,iBAAmB,UAACC,CAAD;MAAA,OAAOA,CAAC,CAACC,GAAF,KAAUN,OAAjB;IAAA,CAAnB,CADwB;EAAA,CAAZ,CAAd;EAIA,IAAMO,IAAI,GAAG,wBAAY,YAAM;IAC7BL,QAAQ,CAAC,uBAAUF,OAAV,CAAD,CAAR;EACD,CAFY,EAEV,CAACE,QAAD,EAAWF,OAAX,CAFU,CAAb;EAIA,IAAMQ,KAAK,GAAG,wBAAY,YAAM;IAC9BN,QAAQ,CAAC,wBAAWF,OAAX,CAAD,CAAR;EACD,CAFa,EAEX,CAACE,QAAD,EAAWF,OAAX,CAFW,CAAd;EAIA,OAAO;IACLM,GAAG,EAAEH,KAAK,GAAGA,KAAK,CAACG,GAAT,GAAe,IADpB;IAELG,IAAI,EAAEN,KAAK,GAAGA,KAAK,CAACM,IAAT,GAAgB,IAFtB;IAGLC,OAAO,EAAEP,KAAK,GAAGA,KAAK,CAACO,OAAT,GAAmB,KAH5B;IAILH,IAAI,EAAJA,IAJK;IAKLC,KAAK,EAALA;EALK,CAAP;AAOD,CA3BM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["useModelCatalog","expectedModels","targetModel","ModelCatalogModel","useConceptIndex","href","ConceptIndexModel","getHref","context","dynamic","location","replace","search","useConceptDetail","concept","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel =>\n useModularUIBasic(\"conceptindex\", href, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n\nconst getHref = (context, dynamic, location) => {\n let href = dynamic;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search) {\n href = `${href}${location.search}`;\n }\n\n return href;\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = getHref(\"concepts\", concept, location);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel =>\n useModularUIBasic(\"contentindex\", href, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = getHref(\"content\", content, location);\n return useModularUIBasic(\"contenttoc\", href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (contentSection: string): ?ContentModel => {\n const href = getHref(\"content\", contentSection);\n return useModularUIBasic(\"content\", href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (contentType: string): ?ContentTypeModel => {\n const href = getHref(\"contenttypes\", contentType);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;AACA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB;EAAA,OAC7B,0CAAkB,cAAlB,EAAkC,eAAlC,EAAmD;IACjDC,cAAc,EAAE,CAAC,cAAD,CADiC;IAEjDC,WAAW,EAAEC;EAFoC,CAAnD,CAD6B;AAAA,CAAxB;AAMP;AACA;;;;;AACO,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,IAAD;EAAA,OAC7B,0CAAkB,cAAlB,EAAkCA,IAAlC,EAAwC;IACtCJ,cAAc,EAAE,CAAC,cAAD,CADsB;IAEtCC,WAAW,EAAEI;EAFyB,CAAxC,CAD6B;AAAA,CAAxB;;;;AAMP,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,OAAD,EAAUC,OAAV,EAAmBC,QAAnB,EAAgC;EAC9C,IAAIL,IAAI,GAAGI,OAAX;;EACA,IAAI,CAAC,yBAAAJ,IAAI,MAAJ,CAAAA,IAAI,aAAgBG,OAAhB,OAAT,EAAsC;IA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CAACC,cAAD,EAA2C;EACnE,IAAMhB,IAAI,GAAGE,OAAO,CAAC,SAAD,EAAYc,cAAZ,CAApB;EACA,OAAO,0CAAkB,SAAlB,EAA6BhB,IAA7B,EAAmC;IACxCJ,cAAc,EAAE,CAAC,SAAD,CADwB;IAExCC,WAAW,EAAEoB;EAF2B,CAAnC,CAAP;AAID,CANM;AAQP;AACA;;;;;AACO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,WAAD,EAA4C;EACxE,IAAMnB,IAAI,GAAGE,OAAO,CAAC,cAAD,EAAiBiB,WAAjB,CAApB;EACA,OAAO,0CAAkB,cAAlB,EAAkCnB,IAAlC,EAAwC;IAC7CJ,cAAc,EAAE,CAAC,aAAD,CAD6B;IAE7CC,WAAW,EAAEuB;EAFgC,CAAxC,CAAP;AAID,CANM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModels.js","names":["useModels","dispatch","reload","model","options"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/actions\";\n\nimport type { ModularUIModel } from \"../models/types\";\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: any) => void,\n};\n\n/**\n * Hook that contains the reload property that can be used to reload a model\n */\nexport const useModels: UseModels = () => {\n const dispatch = useDispatch();\n return {\n reload: (model: ModularUIModel, options?: Object) => {\n dispatch(reloadModel(model, options));\n },\n };\n};\n"],"mappings":";;;;;;;AACA;;AAEA;;AAQA;AACA;AACA;AACO,IAAMA,SAAoB,GAAG,SAAvBA,SAAuB,GAAM;EACxC,IAAMC,QAAQ,GAAG,8BAAjB;EACA,OAAO;IACLC,MAAM,EAAE,gBAACC,KAAD,EAAwBC,OAAxB,EAA6C;MACnDH,QAAQ,CAAC,0BAAYE,KAAZ,EAAmBC,OAAnB,CAAD,CAAR;IACD;EAHI,CAAP;AAKD,CAPM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModularUI.js","names":["useKeyForHook","modelKey","url","locale","state","i18n","split","useModularUI","options","method","HTTP_METHODS","GET","removeOnUnmount","dispatch","href","toString","key","prevOptions","prevHref","isOldReload","current","isReload","modularui"],"sources":["../../src/hooks/useModularUI.js"],"sourcesContent":["// @flow\nimport { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { HTTP_METHODS } from \"../constants\";\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui/actions\";\n\nimport useDeepCompareEffect from \"./useDeepCompareEffect\";\n\nimport type Href from \"../models/href/Href\";\nimport type { RequestBaseOptions } from \"../utils\";\n\n/**\n */\nconst useKeyForHook = (modelKey: string, url: string) => {\n const locale = useSelector((state) => state.i18n.locale);\n\n return `${modelKey}(${url.split(\"?\")[0]})(${locale})`;\n};\n\n/**\n * Use redux action and selector to retrieve the correct modular ui service model\n */\nexport const useModularUI = (\n modelKey: string,\n url: string | Href,\n options: RequestBaseOptions = {\n method: HTTP_METHODS.GET,\n removeOnUnmount: false,\n }\n): any => {\n const dispatch = useDispatch();\n const href = url.toString();\n const key = useKeyForHook(modelKey, href);\n\n const prevOptions = useRef(options);\n const prevHref = useRef(href);\n\n // dispatch loadModularUI\n useDeepCompareEffect(() => {\n // prevent reloads when previous option had the isReload, but the new options not\n const isOldReload =\n prevHref.current === href &&\n prevOptions.current.isReload &&\n !options.isReload;\n\n if (!isOldReload) {\n dispatch(loadModularUI(key, href, options));\n }\n\n prevOptions.current = options;\n prevHref.current = href;\n }, [key, href, options]);\n\n const { removeOnUnmount = false } = options;\n useEffect(() => {\n return () => {\n if (removeOnUnmount) {\n dispatch(removeModelByKey(key));\n }\n };\n }, [dispatch, key, removeOnUnmount]);\n\n // retrieve current model from modularui reducer\n return useSelector((state) => {\n return state.modularui[key];\n });\n};\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA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CAA0B,KAA1B;EACA,sBAAU,YAAM;IACd,OAAO,YAAM;MACX,IAAIA,eAAJ,EAAqB;QACnBC,QAAQ,CAAC,+BAAiBG,GAAjB,CAAD,CAAR;MACD;IACF,CAJD;EAKD,CAND,EAMG,CAACH,QAAD,EAAWG,GAAX,EAAgBJ,eAAhB,CANH,EAzBQ,CAiCR;;EACA,OAAO,6BAAY,UAACR,KAAD,EAAW;IAC5B,OAAOA,KAAK,CAACkB,SAAN,CAAgBN,GAAhB,CAAP;EACD,CAFM,CAAP;AAGD,CA5CM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModularUIBasic.js","names":["useModularUIBasic","key","href","options","expectedModels","targetModel","undefined","location","IllegalArgumentException","useModularUIOptions","state","reload","pathname","toString","isReload","modularUI","model","length","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useModularUI } from \"./useModularUI\";\n\nimport { useLocation } from \"./useRouter\";\n\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\ntype UseModularUIBasicOptions<T> = {\n expectedModels: Array<string>,\n targetModel?: Class<T>,\n};\n\n/**\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n }\n): ?T => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = {};\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n }\n\n // reload when the modular service starts with the current location\n if (location.state?.reload && location.pathname.startsWith(href.toString())) {\n useModularUIOptions.isReload = true;\n }\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n\n if (modularUI?.model) {\n const { model } = modularUI;\n if (options.expectedModels.length > 0) {\n const isCorrectModel = options.expectedModels.some((expectedModel) => {\n return model.type === expectedModel;\n });\n\n if (!isCorrectModel) {\n console.error(modularUI, \"is not of instance\", options.expectedModels);\n throw new IllegalStateException(\"Resolved model has incorrect type\");\n }\n }\n\n return model;\n }\n};\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AAEA;;AASA;AACA;AACO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,GAD+B,EAE/BC,IAF+B,EAOxB;EAAA;;EAAA,IAJPC,OAIO,uEAJgC;IACrCC,cAAc,EAAE,EADqB;IAErCC,WAAW,EAAEC;EAFwB,CAIhC;EACP,IAAMC,QAAQ,GAAG,6BAAjB;;EACA,IAAI,CAACL,IAAL,EAAW;IACT,MAAM,IAAIM,oCAAJ,CAA6B,cAA7B,CAAN;EACD;;EAED,IAAMC,mBAAmB,GAAG,EAA5B;;EACA,IAAIN,OAAO,CAACE,WAAZ,EAAyB;IACvBI,mBAAmB,CAACJ,WAApB,GAAkCF,OAAO,CAACE,WAA1C;EACD,CATM,CAWP;;;EACA,IAAI,mBAAAE,QAAQ,CAACG,KAAT,4DAAgBC,MAAhB,IAA0B,oCAAAJ,QAAQ,CAACK,QAAT,iBAA6BV,IAAI,CAACW,QAAL,EAA7B,CAA9B,EAA6E;IAC3EJ,mBAAmB,CAACK,QAApB,GAA+B,IAA/B;EACD;;EAED,IAAMC,SAAS,GAAG,gCAAad,GAAb,EAAkBC,IAAlB,EAAwBO,mBAAxB,CAAlB;;EAEA,IAAIM,SAAJ,aAAIA,SAAJ,eAAIA,SAAS,CAAEC,KAAf,EAAsB;IACpB,IAAQA,KAAR,GAAkBD,SAAlB,CAAQC,KAAR;;IACA,IAAIb,OAAO,CAACC,cAAR,CAAuBa,MAAvB,GAAgC,CAApC,EAAuC;MACrC,IAAMC,cAAc,GAAGf,OAAO,CAACC,cAAR,CAAuBe,IAAvB,CAA4B,UAACC,aAAD,EAAmB;QACpE,OAAOJ,KAAK,CAACK,IAAN,KAAeD,aAAtB;MACD,CAFsB,CAAvB;;MAIA,IAAI,CAACF,cAAL,EAAqB;QACnBI,OAAO,CAACC,KAAR,CAAcR,SAAd,EAAyB,oBAAzB,EAA+CZ,OAAO,CAACC,cAAvD;QACA,MAAM,IAAIoB,iCAAJ,CAA0B,mCAA1B,CAAN;MACD;IACF;;IAED,OAAOR,KAAP;EACD;AACF,CAxCM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModularUIModel.js","names":["useApplication","expectedModels","targetModel","ApplicationModel","useTab","href","TabModel","useCaseView","CaseViewModel","usePanel","useList","ListModel","useListDetail","ListDetailModel","useGroupingPanel","GroupingPanelModel","useDetailPanel","DetailModel","useQuicksearch","CaseSearchModel","useUserProfile","UserProfileModel"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\n/**\n * Load application\n */\nexport const useApplication = (): ?ApplicationModel =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (href: string): ?TabModel =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (href: string): ?CaseViewModel =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n });\n\n/**\n */\nexport const usePanel = (\n href: string\n): ?ListModel | ?GroupingPanelModel | ?DetailModel =>\n useModularUIBasic(\"panel\", href, {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n });\n\n/**\n */\nexport const useList = (href: string): ?ListModel =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n });\n\n/**\n */\nexport const useListDetail = (href: string): ?ListDetailModel =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n });\n\n/**\n */\nexport const useGroupingPanel = (href: string): ?GroupingPanelModel =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n });\n\n/**\n */\nexport const useDetailPanel = (href: string): ?DetailModel =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n });\n\n/**\n */\nexport const useQuicksearch = (href: string): ?CaseSearchModel =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useUserProfile = (href: string): ?UserProfileModel =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n });\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;AACA;AACA;AACO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB;EAAA,OAC5B,0CAAkB,aAAlB,EAAiC,GAAjC,EAAsC;IACpCC,cAAc,EAAE,CAAC,aAAD,CADoB;IAEpCC,WAAW,EAAEC;EAFuB,CAAtC,CAD4B;AAAA,CAAvB;AAMP;AACA;AACA;;;;;AACO,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,IAAD;EAAA,OACpB,0CAAkB,KAAlB,EAAyBA,IAAzB,EAA+B;IAC7BJ,cAAc,EAAE,CAAC,KAAD,CADa;IA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C;IACrCJ,cAAc,EAAE,CAAC,QAAD,CADqB;IAErCC,WAAW,EAAEe;EAFwB,CAAvC,CAD4B;AAAA,CAAvB;AAMP;AACA;;;;;AACO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACb,IAAD;EAAA,OAC5B,0CAAkB,aAAlB,EAAiCA,IAAjC,EAAuC;IACrCJ,cAAc,EAAE,CAAC,YAAD,CADqB;IAErCC,WAAW,EAAEiB;EAFwB,CAAvC,CAD4B;AAAA,CAAvB;AAMP;AACA;;;;;AACO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACf,IAAD;EAAA,OAC5B,0CAAkB,aAAlB,EAAiCA,IAAjC,EAAuC;IACrCJ,cAAc,EAAE,CAAC,aAAD,CADqB;IAErCC,WAAW,EAAEmB;EAFwB,CAAvC,CAD4B;AAAA,CAAvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useModularUIRequest.js","names":["getModularUIRequest","state","i18n","locale","localeCode","href","options","request","ModularUIRequest","useModularUIRequest"],"sources":["../../src/hooks/useModularUIRequest.js"],"sourcesContent":["// @flow\nimport { createSelector } from \"reselect\";\nimport { useSelector } from \"react-redux\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\n\nimport type { RequestBaseOptions } from \"../utils\";\nimport type Href from \"../models/href/Href\";\n\nconst getModularUIRequest = createSelector(\n [(state) => state.i18n.locale ?? \"en\"],\n (localeCode) => {\n return (href: Href, options?: $Shape<RequestBaseOptions>) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\n };\n }\n);\n\n/**\n * Creates a ModularUIRequest with the locale as available in the redux store\n */\nexport const useModularUIRequest = (): ((\n href: Href,\n options?: $Shape<RequestBaseOptions>\n) => ModularUIRequest) => useSelector(getModularUIRequest);\n"],"mappings":";;;;;;;;;AACA;;AACA;;AAEA;;AAKA,IAAMA,mBAAmB,GAAG,8BAC1B,CAAC,UAACC,KAAD;EAAA;;EAAA,6BAAWA,KAAK,CAACC,IAAN,CAAWC,MAAtB,mEAAgC,IAAhC;AAAA,CAAD,CAD0B,EAE1B,UAACC,UAAD,EAAgB;EACd,OAAO,UAACC,IAAD,EAAaC,OAAb,EAAsD;IAC3D,IAAMC,OAAO,GAAG,IAAIC,yBAAJ,CAAqBH,IAArB,EAA2BC,OAA3B,CAAhB;IACAC,OAAO,CAACJ,MAAR,GAAiBC,UAAjB;IACA,OAAOG,OAAP;EACD,CAJD;AAKD,CARyB,CAA5B;AAWA;AACA;AACA;;AACO,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,OAGT,6BAAYT,mBAAZ,CAHS;AAAA,CAA5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useNotification.js","names":["useNotification","dispatch","state","notification","render","messageType","message","error","dismiss"],"sources":["../../src/hooks/useNotification.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { dismissNotification } from \"../redux/actions\";\n\nimport type {\n DismissNotificationAction,\n NotificationState,\n} from \"../redux/types\";\ntype NotificationHook = {\n ...NotificationState,\n dismiss: () => DismissNotificationAction,\n};\n\n/**\n */\nexport const useNotification = (): NotificationHook => {\n const dispatch = useDispatch();\n const { render, messageType, message, error } = useSelector(\n (state) => state.notification\n );\n\n return {\n render,\n messageType,\n message,\n error,\n dismiss: () => dispatch(dismissNotification()),\n };\n};\n"],"mappings":";;;;;;;AACA;;AACA;;AAWA;AACA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,GAAwB;EACrD,IAAMC,QAAQ,GAAG,8BAAjB;;EACA,mBAAgD,6BAC9C,UAACC,KAAD;IAAA,OAAWA,KAAK,CAACC,YAAjB;EAAA,CAD8C,CAAhD;EAAA,IAAQC,MAAR,gBAAQA,MAAR;EAAA,IAAgBC,WAAhB,gBAAgBA,WAAhB;EAAA,IAA6BC,OAA7B,gBAA6BA,OAA7B;EAAA,IAAsCC,KAAtC,gBAAsCA,KAAtC;;EAIA,OAAO;IACLH,MAAM,EAANA,MADK;IAELC,WAAW,EAAXA,WAFK;IAGLC,OAAO,EAAPA,OAHK;IAILC,KAAK,EAALA,KAJK;IAKLC,OAAO,EAAE;MAAA,OAAMP,QAAQ,CAAC,mCAAD,CAAd;IAAA;EALJ,CAAP;AAOD,CAbM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"usePreference.js","names":["usePreference","preferenceNames","requestedPreferences","Array","isArray","state","preferences"],"sources":["../../src/hooks/usePreference.js"],"sourcesContent":["// @flow\nimport pick from \"lodash/pick\";\nimport { useSelector } from \"react-redux\";\n\nimport type { PreferencesState } from \"../redux/types\";\n\n/**\n */\nexport const usePreference = (\n preferenceNames: string | Array<string>\n): PreferencesState => {\n const requestedPreferences = Array.isArray(preferenceNames)\n ? preferenceNames\n : [preferenceNames];\n\n return useSelector((state) => pick(state.preferences, requestedPreferences));\n};\n"],"mappings":";;;;;;;;;AACA;;AACA;;AAIA;AACA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAC3BC,eAD2B,EAEN;EACrB,IAAMC,oBAAoB,GAAGC,KAAK,CAACC,OAAN,CAAcH,eAAd,IACzBA,eADyB,GAEzB,CAACA,eAAD,CAFJ;EAIA,OAAO,6BAAY,UAACI,KAAD;IAAA,OAAW,mBAAKA,KAAK,CAACC,WAAX,EAAwBJ,oBAAxB,CAAX;EAAA,CAAZ,CAAP;AACD,CARM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useProgressIndicator.js","names":["useProgressIndicator","dispatch","progress","state","progressindicator","start","finish","reset","update","percentComplete"],"sources":["../../src/hooks/useProgressIndicator.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n startProgress,\n finishProgress,\n resetProgress,\n updateProgress,\n} from \"../redux/actions/ProgressIndicator\";\nimport type { ProgressIndicatorState } from \"../redux/types\";\n\ntype ProgressIndicatorHook = {\n ...ProgressIndicatorState,\n start: () => void,\n finish: () => void,\n reset: () => void,\n update: (percentComplete: number) => void,\n};\n\n/**\n */\nexport const useProgressIndicator = (): ProgressIndicatorHook => {\n const dispatch = useDispatch();\n const progress = useSelector((state) => state.progressindicator);\n\n return {\n ...progress,\n start: () => dispatch(startProgress()),\n finish: () => dispatch(finishProgress()),\n reset: () => dispatch(resetProgress()),\n update: (percentComplete: number) =>\n dispatch(updateProgress(percentComplete)),\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;;;;;AAgBA;AACA;AACO,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,GAA6B;EAC/D,IAAMC,QAAQ,GAAG,8BAAjB;EACA,IAAMC,QAAQ,GAAG,6BAAY,UAACC,KAAD;IAAA,OAAWA,KAAK,CAACC,iBAAjB;EAAA,CAAZ,CAAjB;EAEA,uCACKF,QADL;IAEEG,KAAK,EAAE;MAAA,OAAMJ,QAAQ,CAAC,uCAAD,CAAd;IAAA,CAFT;IAGEK,MAAM,EAAE;MAAA,OAAML,QAAQ,CAAC,wCAAD,CAAd;IAAA,CAHV;IAIEM,KAAK,EAAE;MAAA,OAAMN,QAAQ,CAAC,uCAAD,CAAd;IAAA,CAJT;IAKEO,MAAM,EAAE,gBAACC,eAAD;MAAA,OACNR,QAAQ,CAAC,uCAAeQ,eAAf,CAAD,CADF;IAAA;EALV;AAQD,CAZM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useRouter.js","names":["useLocation","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","push","replace","go","delta","goBack","goForward"],"sources":["../../src/hooks/useRouter.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport type { Location, LocationShape } from \"react-router\";\n\nimport { push, replace, go, goBack, goForward } from \"../redux/_router/actions\";\nimport type {\n GoAction,\n GoBackAction,\n GoForwardAction,\n PushAction,\n ReplaceAction,\n} from \"../redux\";\n\ntype UseLocationHook = () => Location;\ntype UseLocationKeyHook = () => string;\ntype UseQuerystringHook = () => string;\ntype UsePathnameHook = () => string;\ntype UseNavigationHook = () => {\n push: (location: LocationShape | string, state?: { ... }) => PushAction,\n replace: (location: LocationShape | string, state?: { ... }) => ReplaceAction,\n go: (delta: number) => GoAction,\n goBack: () => GoBackAction,\n goForward: () => GoForwardAction,\n};\n\n/**\n */\nexport const useLocation: UseLocationHook = () =>\n useSelector((state) => state.router.location);\n\n/**\n */\nexport const useLocationKey: UseLocationKeyHook = () =>\n useLocation()?.key ?? \"\";\n\n/**\n */\nexport const useQuerystring: UseQuerystringHook = () => useLocation()?.search;\n\n/**\n */\nexport const usePathname: UsePathnameHook = () => useLocation()?.pathname;\n\n/**\n */\nexport const useNavigation: UseNavigationHook = () => {\n const dispatch = useDispatch();\n\n return {\n push: (location: LocationShape | string, state?: { ... }) =>\n dispatch(push(location, state)),\n replace: (location: LocationShape | string, state?: { ... }) =>\n dispatch(replace(location, state)),\n go: (delta: number) => dispatch(go(delta)),\n goBack: () => dispatch(goBack()),\n goForward: () => dispatch(goForward()),\n };\n};\n"],"mappings":";;;;;;;AACA;;AAGA;;AAqBA;AACA;AACO,IAAMA,WAA4B,GAAG,SAA/BA,WAA+B;EAAA,OAC1C,6BAAY,UAACC,KAAD;IAAA,OAAWA,KAAK,CAACC,MAAN,CAAaC,QAAxB;EAAA,CAAZ,CAD0C;AAAA,CAArC;AAGP;AACA;;;;;AACO,IAAMC,cAAkC,GAAG,SAArCA,cAAqC;EAAA;;EAAA,2CAChDJ,WAAW,EADqC,iDAChD,aAAeK,GADiC,+DAC1B,EAD0B;AAAA,CAA3C;AAGP;AACA;;;;;AACO,IAAMC,cAAkC,GAAG,SAArCA,cAAqC;EAAA;;EAAA,wBAAMN,WAAW,EAAjB,kDAAM,cAAeO,MAArB;AAAA,CAA3C;AAEP;AACA;;;;;AACO,IAAMC,WAA4B,GAAG,SAA/BA,WAA+B;EAAA;;EAAA,wBAAMR,WAAW,EAAjB,kDAAM,cAAeS,QAArB;AAAA,CAArC;AAEP;AACA;;;;;AACO,IAAMC,aAAgC,GAAG,SAAnCA,aAAmC,GAAM;EACpD,IAAMC,QAAQ,GAAG,8BAAjB;EAEA,OAAO;IACLC,IAAI,EAAE,cAACT,QAAD,EAAmCF,KAAnC;MAAA,OACJU,QAAQ,CAAC,mBAAKR,QAAL,EAAeF,KAAf,CAAD,CADJ;IAAA,CADD;IAGLY,OAAO,EAAE,iBAACV,QAAD,EAAmCF,KAAnC;MAAA,OACPU,QAAQ,CAAC,sBAAQR,QAAR,EAAkBF,KAAlB,CAAD,CADD;IAAA,CAHJ;IAKLa,EAAE,EAAE,YAACC,KAAD;MAAA,OAAmBJ,QAAQ,CAAC,iBAAGI,KAAH,CAAD,CAA3B;IAAA,CALC;IAMLC,MAAM,EAAE;MAAA,OAAML,QAAQ,CAAC,sBAAD,CAAd;IAAA,CANH;IAOLM,SAAS,EAAE;MAAA,OAAMN,QAAQ,CAAC,yBAAD,CAAd;IAAA;EAPN,CAAP;AASD,CAZM"}
|
package/lib/i18n/Locale.js
CHANGED
|
@@ -156,7 +156,8 @@ var Locale = /*#__PURE__*/function () {
|
|
|
156
156
|
if ((typeof process === "undefined" || process.env.NODE_ENV !== "production") && !messageFromLocale && id && (0, _constants.getSetting)("DEBUG_I18N_MESSAGE_NOT_FOUND")) {
|
|
157
157
|
var _context;
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
// eslint-disable-next-line no-console
|
|
160
|
+
console.debug((0, _concat.default)(_context = "Message with id ".concat(id, " not found for locale ")).call(_context, this.code, " in layout translations"));
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;
|
package/lib/i18n/Locale.js.flow
CHANGED
|
@@ -107,9 +107,11 @@ class Locale {
|
|
|
107
107
|
id &&
|
|
108
108
|
getSetting("DEBUG_I18N_MESSAGE_NOT_FOUND")
|
|
109
109
|
) {
|
|
110
|
-
|
|
110
|
+
// eslint-disable-next-line no-console
|
|
111
|
+
console.debug(
|
|
112
|
+
`Message with id ${id} not found for locale ${this.code} in layout translations`
|
|
113
|
+
);
|
|
111
114
|
}
|
|
112
|
-
|
|
113
115
|
return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;
|
|
114
116
|
}
|
|
115
117
|
|
package/lib/i18n/Locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Locale.js","names":["Locale","locale","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","formatMessage","setup","missingTranslation","aLocale","split","length","language","languages","lang","toUpperCase","IllegalStateException","message","replace","JSON","parse","id","defaultMessage","messageFromLocale","process","env","NODE_ENV","console","debug","fixPlaceHolders","parameters","getBaseMessage"],"sources":["../../src/i18n/Locale.js"],"sourcesContent":["// @flow\nimport formatMessage from \"format-message\";\n\nimport languages from \"./languages\";\nimport { IllegalStateException } from \"../exceptions\";\n\nimport { getSetting } from \"../constants\";\n\nimport type { LocaleConfiguration, MessageParameters } from \"./types\";\n\n/**\n * Create a locale\n */\nclass Locale {\n _code: string;\n _messages: { [string]: string };\n _errors: { [string]: string };\n _nativeName: ?string;\n\n constructor(locale: LocaleConfiguration) {\n this._code = locale.code;\n\n this._messages = this.fixPlaceHoldersInObject(locale.messages);\n this._errors = this.fixPlaceHoldersInObject(locale.errors);\n\n this._nativeName = locale.nativeName;\n\n formatMessage.setup({\n missingTranslation: \"ignore\",\n });\n }\n\n /**\n * Retrieve locale code\n */\n get code(): string {\n return this._code;\n }\n\n /**\n * Retrieve nativeName\n */\n get nativeName(): string {\n if (this._nativeName) {\n return this._nativeName;\n }\n\n const aLocale = this.code.split(\"-\");\n\n if (aLocale.length > 0) {\n const language = languages.lang[aLocale[0]];\n\n if (language) {\n return (\n language[1] + (aLocale[1] ? ` (${aLocale[1].toUpperCase()})` : \"\")\n );\n }\n }\n\n throw new IllegalStateException(\n `Can not find language name based on locale: ${this.code}`\n );\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHolders(message: ?string): null | string {\n if (typeof message === \"string\") {\n return message\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\");\n }\n\n return null;\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHoldersInObject(messages: Object = {}): Object {\n return JSON.parse(\n JSON.stringify(messages)\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\")\n );\n }\n\n /**\n * Retrieve message by id\n */\n getBaseMessage(id: string, defaultMessage?: string): string {\n if (!id && !defaultMessage) {\n return \"[message: id or defaultMessage missing]\";\n }\n\n const messageFromLocale = this._messages[id] || this._errors[id];\n\n if (\n (typeof process === \"undefined\" ||\n process.env.NODE_ENV !== \"production\") &&\n !messageFromLocale &&\n id &&\n getSetting(\"DEBUG_I18N_MESSAGE_NOT_FOUND\")\n ) {\n // eslint-disable-next-line no-console\n console.debug(\n `Message with id ${id} not found for locale ${this.code} in layout translations`\n );\n }\n return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;\n }\n\n /**\n * Format message using formatMessage library\n */\n formatMessage(message: string, parameters?: MessageParameters): string {\n if (parameters) {\n return formatMessage(message, parameters);\n }\n\n return message;\n }\n\n /**\n * Retrieve a messages with replaced parameters\n */\n getMessage(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters\n ): string {\n const message = this.getBaseMessage(id, defaultMessage);\n return this.formatMessage(message, parameters);\n }\n\n /**\n * Add or change messages for this locale. It is not possible to remove messages.\n */\n update(messages: Object = {}, errors: Object = {}) {\n this._messages = {\n ...this._messages,\n ...this.fixPlaceHoldersInObject(messages),\n };\n\n this._errors = {\n ...this._errors,\n ...this.fixPlaceHoldersInObject(errors),\n };\n }\n}\n\nexport default Locale;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;AAIA;AACA;AACA;IACMA,M;EAMJ,gBAAYC,MAAZ,EAAyC;IAAA;IAAA;IAAA;IAAA;IAAA;IACvC,KAAKC,KAAL,GAAaD,MAAM,CAACE,IAApB;IAEA,KAAKC,SAAL,GAAiB,KAAKC,uBAAL,CAA6BJ,MAAM,CAACK,QAApC,CAAjB;IACA,KAAKC,OAAL,GAAe,KAAKF,uBAAL,CAA6BJ,MAAM,CAACO,MAApC,CAAf;IAEA,KAAKC,WAAL,GAAmBR,MAAM,CAACS,UAA1B;;IAEAC,wBAAcC,KAAd,CAAoB;MAClBC,kBAAkB,EAAE;IADF,CAApB;EAGD;EAED;AACF;AACA;;;;;SACE,eAAmB;MACjB,OAAO,KAAKX,KAAZ;IACD;IAED;AACF;AACA;;;;SACE,eAAyB;MACvB,IAAI,KAAKO,WAAT,EAAsB;QACpB,OAAO,KAAKA,WAAZ;MACD;;MAED,IAAMK,OAAO,GAAG,KAAKX,IAAL,CAAUY,KAAV,CAAgB,GAAhB,CAAhB;;MAEA,IAAID,OAAO,CAACE,MAAR,GAAiB,CAArB,EAAwB;QACtB,IAAMC,QAAQ,GAAGC,mBAAUC,IAAV,CAAeL,OAAO,CAAC,CAAD,CAAtB,CAAjB;;QAEA,IAAIG,QAAJ,EAAc;UACZ,OACEA,QAAQ,CAAC,CAAD,CAAR,IAAeH,OAAO,CAAC,CAAD,CAAP,eAAkBA,OAAO,CAAC,CAAD,CAAP,CAAWM,WAAX,EAAlB,SAAgD,EAA/D,CADF;QAGD;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OAAO,6BAAcb,OAAd,EAAuBa,UAAvB,CAAP;MACD;;MAED,OAAOb,OAAP;IACD;IAED;AACF;AACA;;;;WACE,oBACEI,EADF,EAEEC,cAFF,EAGEQ,UAHF,EAIU;MACR,IAAMb,OAAO,GAAG,KAAKc,cAAL,CAAoBV,EAApB,EAAwBC,cAAxB,CAAhB;MACA,OAAO,KAAKhB,aAAL,CAAmBW,OAAnB,EAA4Ba,UAA5B,CAAP;IACD;IAED;AACF;AACA;;;;WACE,kBAAmD;MAAA,IAA5C7B,QAA4C,uEAAzB,EAAyB;MAAA,IAArBE,MAAqB,uEAAJ,EAAI;MACjD,KAAKJ,SAAL,mCACK,KAAKA,SADV,GAEK,KAAKC,uBAAL,CAA6BC,QAA7B,CAFL;MAKA,KAAKC,OAAL,mCACK,KAAKA,OADV,GAEK,KAAKF,uBAAL,CAA6BG,MAA7B,CAFL;IAID;;;;;eAGYR,M"}
|
package/lib/i18n/Locales.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Locales.js","names":["availableLocales","code","messages","errors","englishErrors","dutchErrors","createLocalesWithConfiguredErrors","configuredErrors","availableLocale","Locales","locales","locale","Locale","localeCode","some","item","hasLocale","IllegalArgumentException","acceptLanguageHeader","acceptLanguages","match","preferredLocales","availableLocaleCodes","length","getLocale","update","add","hydatedLocales","_collection","_code","_messages","_errors","BaseCollection"],"sources":["../../src/i18n/Locales.js"],"sourcesContent":["// @flow\nimport Locale from \"./Locale\";\n\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl\";\n\nimport BaseCollection from \"../models/base/BaseCollection\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = {\n [languageCode: string]: {\n [messageID: string]: string,\n },\n};\n\ntype HydratedLocales = {\n _collection: Array<{\n _code: string,\n _messages: {\n [string]: string,\n },\n _errors: {\n [string]: string,\n },\n }>,\n};\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: Array<LocaleConfiguration> = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject\n): Array<Object> =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nclass Locales extends BaseCollection<Locale> {\n constructor(locales: Array<LocaleConfiguration> = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales._collection) {\n return new Locales(\n hydatedLocales._collection.map((locale) => ({\n code: locale._code,\n messages: locale._messages,\n errors: locale._errors,\n }))\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string): boolean {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string): Locale {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes(): Array<string> {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null): void | string {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(locale: string, messages: Object = {}, errors: Object = {}) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n })\n );\n }\n }\n}\n\nexport default Locales;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;;;;;;;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,gBAA4C,GAAG,CAC1D;EACEC,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEC;AAHV,CAD0D,EAM1D;EACEH,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEE;AAHV,CAN0D,CAArD;AAaP;AACA;AACA;;;;AACO,IAAMC,iCAAiC,GAAG,SAApCA,iCAAoC,CAC/CC,gBAD+C;EAAA,OAG/C,kBAAAP,gBAAgB,MAAhB,CAAAA,gBAAgB,EAAK,UAACQ,eAAD,EAAqB;IACxC,IAAID,gBAAgB,CAACC,eAAe,CAACP,IAAjB,CAApB,EAA4C;MAC1C,uCACKO,eADL;QAEEL,MAAM,kCACDK,eAAe,CAACL,MADf,GAEDI,gBAAgB,CAACC,eAAe,CAACP,IAAjB,CAFf;MAFR;IAOD;;IAED,OAAOO,eAAP;EACD,CAZe,CAH+B;AAAA,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CADK,CAAP;MAOD;;MAED,OAAO,IAAItB,OAAJ,CAAY,EAAZ,CAAP;IACD;;;EApBmBuB,wB;;eAkGPvB,O"}
|
package/lib/i18n/Message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Message.js","names":["Message","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","styles","__html","displayName"],"sources":["../../src/i18n/Message.js"],"sourcesContent":["// @flow\nimport { memo } from \"react\";\nimport { hideVisually } from \"polished\";\n\nimport { useMessage } from \"../hooks/useI18n\";\n\ntype MessageProps = {\n +className?: string,\n +id?: string | null,\n +defaultMessage?: string | null,\n +children?: string,\n +data?: Object | null,\n +screenreaderOnly?: boolean,\n +allowHTML?: boolean,\n};\n\n/**\n * Message React component\n */\nconst Message: React$AbstractComponent<MessageProps, mixed> =\n memo<MessageProps>(\n ({\n className,\n id,\n defaultMessage,\n children,\n data,\n screenreaderOnly = false,\n allowHTML = false,\n }: MessageProps) => {\n const translatedMessage = useMessage(\n id,\n defaultMessage || children,\n data\n );\n\n if (screenreaderOnly) {\n const styles = {\n ...hideVisually(),\n };\n\n return (\n <span className={className} style={styles}>\n {translatedMessage}\n </span>\n );\n }\n\n if (allowHTML) {\n return (\n <span\n className={className}\n dangerouslySetInnerHTML={{\n __html: translatedMessage,\n }}\n />\n );\n }\n\n return <span className={className}>{translatedMessage}</span>;\n }\n );\n\nMessage.displayName = \"BI.Message\";\n\nexport default Message;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;;;;;;;AAYA;AACA;AACA;AACA,IAAMA,OAAqD,gBACzD,iBACE,gBAQoB;EAAA,IAPlBC,SAOkB,QAPlBA,SAOkB;EAAA,IANlBC,EAMkB,QANlBA,EAMkB;EAAA,IALlBC,cAKkB,QALlBA,cAKkB;EAAA,IAJlBC,QAIkB,QAJlBA,QAIkB;EAAA,IAHlBC,IAGkB,QAHlBA,IAGkB;EAAA,iCAFlBC,gBAEkB;EAAA,IAFlBA,gBAEkB,sCAFC,KAED;EAAA,0BADlBC,SACkB;EAAA,IADlBA,SACkB,+BADN,KACM;EAClB,IAAMC,iBAAiB,GAAG,yBACxBN,EADwB,EAExBC,cAAc,IAAIC,QAFM,EAGxBC,IAHwB,CAA1B;;EAMA,IAAIC,gBAAJ,EAAsB;IACpB,IAAMG,MAAM,qBACP,6BADO,CAAZ;;IAIA,oBACE;MAAM,SAAS,EAAER,SAAjB;MAA4B,KAAK,EAAEQ,MAAnC;MAAA,UACGD;IADH,EADF;EAKD;;EAED,IAAID,SAAJ,EAAe;IACb,oBACE;MACE,SAAS,EAAEN,SADb;MAEE,uBAAuB,EAAE;QACvBS,MAAM,EAAEF;MADe;IAF3B,EADF;EAQD;;EAED,oBAAO;IAAM,SAAS,EAAEP,SAAjB;IAAA,UAA6BO;EAA7B,EAAP;AACD,CAxCH,CADF;AA4CAR,OAAO,CAACW,WAAR,GAAsB,YAAtB;eAEeX,O"}
|
|
@@ -6,6 +6,7 @@ import { setSetting } from "../../constants";
|
|
|
6
6
|
|
|
7
7
|
global.console = {
|
|
8
8
|
warn: jest.fn(),
|
|
9
|
+
debug: jest.fn(),
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
jest.mock(
|
|
@@ -89,8 +90,8 @@ describe("locale", () => {
|
|
|
89
90
|
|
|
90
91
|
const msg = locale.getMessage("non-existing");
|
|
91
92
|
expect(msg).toBe("non-existing");
|
|
92
|
-
expect(global.console.
|
|
93
|
-
"Message with id non-existing not found for locale de"
|
|
93
|
+
expect(global.console.debug).toHaveBeenCalledWith(
|
|
94
|
+
"Message with id non-existing not found for locale de in layout translations"
|
|
94
95
|
);
|
|
95
96
|
|
|
96
97
|
const msgWithDefault = locale.getMessage("non-existing", "Default");
|
package/lib/i18n/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/i18n/index.js"],"sourcesContent":["// @flow\nexport {\n default as Locales,\n availableLocales,\n createLocalesWithConfiguredErrors,\n} from \"./Locales\";\n\nexport { default as Message } from \"./Message\";\nexport { default as withMessage } from \"./withMessage\";\nexport { useMessage, useTranslate } from \"../hooks/useI18n\";\n\nexport type * from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAMA;;AACA;;AACA"}
|