@beinformed/ui 1.31.0 → 1.31.3
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 +20 -0
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.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.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/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 +8 -2
- package/esm/hooks/usePreference.js.map +1 -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/withMessage.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/ChoiceAttributeModel.js +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 +8 -0
- 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/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/_createAttribute.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/MandatoryConstraint.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/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/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/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/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/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/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.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/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/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js.map +1 -1
- 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/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.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/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/modularui/CaptchaRequest.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/UploadRequest.js.map +1 -1
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/client.js +1 -0
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/createSSRComplete.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/serverUtil.js.map +1 -1
- package/esm/react-theme/createTheme.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/I18nActions.js.map +1 -1
- package/esm/redux/_i18n/I18nReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/esm/redux/_modularui/ModularUIUtils.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/RouterActions.js.map +1 -1
- package/esm/redux/_router/RouterConnectors.js.map +1 -1
- package/esm/redux/_router/RouterReducer.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/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/Notification.js.map +1 -1
- 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/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/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.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.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/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.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/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/__tests__/mergeLayoutHintConfigurations.spec.js.flow +4 -4
- package/lib/builder/mergeLayoutHintConfigurations.js.flow +3 -3
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/LayoutHints.js.flow +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js.flow +2 -2
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/FetchException.js.flow +2 -2
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/NetworkException.js.flow +1 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js.flow +1 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +9 -9
- package/lib/hooks/__tests__/useAuthentication.spec.js.flow +2 -2
- package/lib/hooks/__tests__/useForm.spec.js.flow +2 -2
- package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +7 -7
- package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +2 -2
- package/lib/hooks/__tests__/usePreference.spec.js.flow +1 -1
- package/lib/hooks/useAllFormsOnModel.js.flow +2 -2
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js.flow +2 -2
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js.flow +1 -1
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js.flow +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js.flow +4 -4
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js.flow +3 -3
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js.flow +2 -2
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.flow +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModularUI.js.flow +1 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js.flow +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.flow +1 -1
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js.flow +1 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js.flow +2 -2
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +8 -2
- package/lib/hooks/usePreference.js.flow +17 -7
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/i18n/Locale.js.flow +4 -4
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js.flow +8 -8
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js.flow +2 -2
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/__tests__/Locale.spec.js.flow +3 -3
- package/lib/i18n/__tests__/Locales.spec.js.flow +15 -13
- package/lib/i18n/withMessage.js.flow +4 -4
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/actions/ActionCollection.js.flow +4 -4
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js.flow +4 -4
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/actions/__tests__/ActionCollection.spec.js.flow +3 -3
- package/lib/models/actions/__tests__/ActionModel.spec.js.flow +1 -1
- package/lib/models/application/ApplicationModel.js.flow +3 -3
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.flow +7 -7
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js.flow +9 -9
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.flow +9 -9
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.flow +24 -24
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js.flow +1 -1
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js.flow +4 -4
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +7 -7
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +15 -15
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +8 -0
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +19 -11
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +10 -10
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.flow +7 -7
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +6 -6
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js.flow +9 -9
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js.flow +8 -8
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js.flow +3 -3
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js.flow +5 -5
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeCollection.spec.js.flow +11 -11
- package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +7 -7
- package/lib/models/attributes/__tests__/AttributeModel.spec.js.flow +5 -5
- package/lib/models/attributes/__tests__/AttributeSetModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/BooleanAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/ChoiceAttributeModel.spec.js.flow +8 -8
- package/lib/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js.flow +8 -8
- package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/DateAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/DatetimeAttributeModel.spec.js.flow +11 -11
- package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +3 -3
- package/lib/models/attributes/__tests__/MemoAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/MoneyAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/NumberAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/PasswordAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/StringAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/TimeAttributeModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/TimestampModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/UploadAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/_createAttribute.spec.js.flow +6 -6
- package/lib/models/attributes/__tests__/createAttributeComposite.spec.js.flow +3 -3
- package/lib/models/attributes/__tests__/createAttributeDynamicSchema.spec.js.flow +3 -3
- package/lib/models/attributes/_createAttribute.js.flow +5 -5
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.flow +5 -5
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.flow +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.flow +6 -6
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.flow +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.flow +6 -6
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.flow +2 -2
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.flow +2 -2
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js.flow +1 -1
- package/lib/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js.flow +6 -6
- package/lib/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js.flow +5 -5
- package/lib/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js.flow +6 -6
- package/lib/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js.flow +3 -3
- package/lib/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js.flow +1 -1
- package/lib/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js.flow +4 -4
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +4 -4
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +15 -15
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.flow +2 -2
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.flow +2 -2
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js.flow +22 -22
- package/lib/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js.flow +4 -4
- package/lib/models/base/BaseCollection.js.flow +6 -6
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js.flow +1 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js.flow +5 -5
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/base/__tests__/ResourceCollection.spec.js.flow +1 -1
- package/lib/models/caseview/CaseViewModel.js.flow +4 -4
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +3 -3
- package/lib/models/concepts/BusinessScenarioModel.js.flow +9 -9
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.flow +17 -17
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.flow +2 -2
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js.flow +6 -4
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js.flow +5 -5
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js.flow +2 -2
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js.flow +2 -2
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +1 -1
- package/lib/models/content/ContentIndexModel.js.flow +3 -3
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js.flow +11 -9
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js.flow +2 -2
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.flow +4 -4
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/SectionModel.js.flow +4 -4
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js.flow +2 -2
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/content/__tests__/ContentModel.spec.js.flow +16 -16
- package/lib/models/contentconfiguration/ContentConfiguration.js.flow +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.flow +5 -5
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.flow +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.flow +2 -2
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +12 -12
- package/lib/models/detail/DetailModel.js.flow +5 -5
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js.flow +4 -4
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js.flow +1 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/__tests__/ErrorModel.spec.js.flow +1 -1
- package/lib/models/filters/AssignmentFilterModel.js.flow +3 -3
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js.flow +3 -3
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.flow +5 -5
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/__tests__/AssignmentFilterModel.spec.js.flow +4 -4
- package/lib/models/filters/__tests__/FilterCollection.spec.js.flow +11 -11
- package/lib/models/filters/__tests__/FilterModel.spec.js.flow +1 -1
- package/lib/models/filters/__tests__/RangeFilterModel.spec.js.flow +1 -1
- package/lib/models/form/FormModel.js.flow +39 -39
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js.flow +16 -16
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/form/__tests__/FormModel.instrument.spec.js.flow +7 -7
- package/lib/models/form/__tests__/FormModel.repeating.spec.js.flow +2 -2
- package/lib/models/form/__tests__/FormModel.selfhref.spec.js.flow +1 -1
- package/lib/models/form/__tests__/FormModel.spec.js.flow +6 -6
- package/lib/models/form/__tests__/FormResultData.spec.js.flow +1 -1
- package/lib/models/form/__tests__/FormWithContent.spec.js.flow +3 -3
- package/lib/models/grouping/GroupingModel.js.flow +7 -7
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/grouping/__tests__/GroupingModel.spec.js.flow +2 -2
- package/lib/models/href/Href.js.flow +6 -6
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/__tests__/Href.spec.js.flow +18 -16
- package/lib/models/layouthint/LayoutHintCollection.js.flow +3 -3
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js.flow +4 -4
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js.flow +3 -3
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/__tests__/LinkModel.spec.js.flow +4 -4
- package/lib/models/links/normalizeLinkJSON.js.flow +6 -6
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js.flow +7 -7
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js.flow +2 -2
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js.flow +2 -2
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js.flow +6 -6
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +4 -4
- package/lib/models/list/__tests__/ListItemCollection.spec.js.flow +1 -1
- package/lib/models/list/__tests__/ListModel.spec.js.flow +3 -3
- package/lib/models/list/__tests__/ListResultDetail.spec.js.flow +3 -3
- package/lib/models/lookup/LookupOptionCollection.js.flow +1 -1
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js.flow +4 -4
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/lookup/__tests__/LookupOptionsModel.spec.js.flow +3 -3
- package/lib/models/modelcatalog/ModelCatalogModel.js.flow +2 -2
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js.flow +1 -1
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/paging/__tests__/PagingModel.spec.js.flow +2 -2
- package/lib/models/panels/GroupingPanelModel.js.flow +5 -5
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +8 -8
- package/lib/models/parameter/__tests__/Parameter.spec.js.flow +5 -5
- package/lib/models/process/ProcessStatusSettingsModel.js.flow +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/process/__tests__/ProcessStatusSettingsModel.spec.js.flow +1 -1
- package/lib/models/resolveModel.js.flow +4 -4
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js.flow +4 -4
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/sorting/__tests__/SortingModel.spec.js.flow +3 -3
- package/lib/models/tab/TabModel.js.flow +3 -3
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/tab/__tests__/TabModel.spec.js.flow +5 -5
- package/lib/models/taskgroup/TaskGroupModel.js.flow +2 -2
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserProfileModel.js.flow +1 -1
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/__tests__/UserModel.spec.js.flow +2 -2
- package/lib/models/user/__tests__/UserProfileModel.spec.js.flow +2 -2
- package/lib/models/user/__tests__/UserServicesModel.spec.js.flow +1 -1
- package/lib/modularui/CaptchaRequest.js.flow +1 -1
- package/lib/modularui/CaptchaRequest.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.flow +26 -26
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/UploadRequest.js.flow +6 -6
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/modularui/__tests__/ModularUIError.spec.js.flow +1 -1
- package/lib/modularui/__tests__/ModularUIRequest.spec.js.flow +9 -9
- package/lib/react/utils.js.flow +1 -1
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/client.js +1 -0
- package/lib/react-client/client.js.flow +11 -10
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js.flow +2 -2
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/rehydrate.js.flow +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/__tests__/serverUtil.spec.js.flow +2 -2
- package/lib/react-server/createSSRComplete.js.flow +3 -3
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js.flow +4 -4
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js.flow +1 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js.flow +2 -2
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverUtil.js.flow +8 -8
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/__tests__/createTheme.spec.js.flow +4 -4
- package/lib/react-theme/createTheme.js.flow +1 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/utils/__tests__/background.spec.js.flow +2 -2
- package/lib/react-theme/utils/__tests__/contrast.spec.js.flow +1 -1
- package/lib/react-theme/utils/__tests__/corners.spec.js.flow +3 -3
- package/lib/react-theme/utils/__tests__/spacers.spec.js.flow +1 -1
- package/lib/react-theme/utils/__tests__/themeProps.spec.js.flow +9 -9
- package/lib/react-theme/utils/colors.js.flow +3 -3
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js.flow +6 -6
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js.flow +2 -2
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js.flow +2 -2
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js.flow +8 -8
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/I18nActions.js.flow +1 -1
- package/lib/redux/_i18n/I18nActions.js.map +1 -1
- package/lib/redux/_i18n/I18nReducer.js.flow +2 -2
- package/lib/redux/_i18n/I18nReducer.js.map +1 -1
- package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +2 -2
- package/lib/redux/_modularui/ModularUIActions.js.flow +8 -8
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js.flow +4 -4
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js.flow +6 -6
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js.flow +5 -5
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js.flow +11 -11
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js.flow +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_modularui/__tests__/reducer.spec.js.flow +13 -13
- package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +3 -3
- package/lib/redux/_modularui/types.js.flow +4 -4
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.flow +3 -3
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/RouterActions.js.flow +3 -3
- package/lib/redux/_router/RouterActions.js.map +1 -1
- package/lib/redux/_router/RouterConnectors.js.flow +5 -5
- package/lib/redux/_router/RouterConnectors.js.map +1 -1
- package/lib/redux/_router/RouterReducer.js.flow +1 -1
- package/lib/redux/_router/RouterReducer.js.map +1 -1
- package/lib/redux/_router/__tests__/reducer.spec.js.flow +2 -2
- package/lib/redux/actions/Application.js.flow +1 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js.flow +1 -1
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js.flow +3 -3
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js.flow +2 -2
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +3 -3
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js.flow +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js.flow +3 -3
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Notification.js.flow +4 -4
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js.flow +11 -11
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js.flow +1 -1
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js.flow +3 -3
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/__tests__/Authorization.spec.js.flow +2 -2
- package/lib/redux/actions/__tests__/Error-server.spec.js.flow +13 -13
- package/lib/redux/actions/__tests__/Error.spec.js.flow +6 -6
- package/lib/redux/actions/__tests__/Notification.spec.js.flow +1 -1
- package/lib/redux/actions/__tests__/Preferences.spec.js.flow +2 -2
- package/lib/redux/connectors/Application.js.flow +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js.flow +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js.flow +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.flow +2 -2
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js.flow +5 -5
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.flow +6 -6
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js.flow +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js.flow +1 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js.flow +1 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js.flow +2 -2
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.flow +3 -3
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js.flow +1 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.flow +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js.flow +2 -2
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js.flow +1 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js.flow +1 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js.flow +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js.flow +1 -1
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js.flow +1 -1
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.flow +1 -1
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js.flow +1 -1
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js.flow +1 -1
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.flow +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/__tests__/AuthReducer.spec.js.flow +10 -10
- package/lib/redux/reducers/__tests__/ErrorReducer.spec.js.flow +1 -1
- package/lib/redux/reducers/__tests__/ModalsReducer.spec.js.flow +3 -3
- package/lib/redux/reducers/__tests__/NotificationReducer.spec.js.flow +3 -3
- package/lib/redux/reducers/__tests__/PreferencesReducer.spec.js.flow +2 -2
- package/lib/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js.flow +8 -8
- package/lib/redux/store/beforeRenderHooks.js.flow +1 -1
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js.flow +3 -3
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cookies.js.flow +1 -1
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/browser/__tests__/Cookies.spec.js.flow +1 -1
- package/lib/utils/datetime/DateTimeUtil.js.flow +15 -15
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/datetime/__tests__/DateTime.spec.js.flow +84 -81
- package/lib/utils/fetch/__tests__/xhr.spec.js.flow +2 -2
- package/lib/utils/fetch/universalFetch.js.flow +1 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.flow +6 -6
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/__tests__/sanitizeHTML.spec.js.flow +8 -8
- package/lib/utils/helpers/sanitizeHtml.js.flow +3 -3
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js.flow +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js.flow +2 -2
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/__tests__/formatValue.spec.js.flow +1 -1
- package/lib/utils/number/formatValue.js.flow +2 -2
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.flow +7 -7
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +20 -20
- package/src/builder/__tests__/mergeLayoutHintConfigurations.spec.js +4 -4
- package/src/builder/mergeLayoutHintConfigurations.js +3 -3
- package/src/constants/LayoutHints.js +1 -1
- package/src/constants/Settings.js +2 -2
- package/src/exceptions/FetchException.js +2 -2
- package/src/exceptions/NetworkException.js +1 -1
- package/src/exceptions/UnauthorizedException.js +1 -1
- package/src/hooks/__tests__/UseModularUIModel.spec.js +9 -9
- package/src/hooks/__tests__/useAuthentication.spec.js +2 -2
- package/src/hooks/__tests__/useForm.spec.js +2 -2
- package/src/hooks/__tests__/useModelCatalog.spec.js +7 -7
- package/src/hooks/__tests__/useModularUIBasic.spec.js +2 -2
- package/src/hooks/__tests__/usePreference.spec.js +1 -1
- package/src/hooks/useAllFormsOnModel.js +2 -2
- package/src/hooks/useAuthentication.js +2 -2
- package/src/hooks/useContent.js +1 -1
- package/src/hooks/useDeepCompareEffect.js +1 -1
- package/src/hooks/useForm.js +4 -4
- package/src/hooks/useI18n.js +3 -3
- package/src/hooks/useModal.js +2 -2
- package/src/hooks/useModelCatalog.js +1 -1
- package/src/hooks/useModularUI.js +1 -1
- package/src/hooks/useModularUIBasic.js +1 -1
- package/src/hooks/useModularUIModel.js +1 -1
- package/src/hooks/useModularUIRequest.js +1 -1
- package/src/hooks/useNotification.js +2 -2
- package/src/hooks/usePreference.js +17 -7
- package/src/i18n/Locale.js +4 -4
- package/src/i18n/Locales.js +8 -8
- package/src/i18n/Message.js +2 -2
- package/src/i18n/__tests__/Locale.spec.js +3 -3
- package/src/i18n/__tests__/Locales.spec.js +15 -13
- package/src/i18n/withMessage.js +4 -4
- package/src/models/actions/ActionCollection.js +4 -4
- package/src/models/actions/ActionModel.js +4 -4
- package/src/models/actions/__tests__/ActionCollection.spec.js +3 -3
- package/src/models/actions/__tests__/ActionModel.spec.js +1 -1
- package/src/models/application/ApplicationModel.js +3 -3
- package/src/models/attributes/AttributeCollection.js +7 -7
- package/src/models/attributes/AttributeContent.js +9 -9
- package/src/models/attributes/AttributeDataHelper.js +9 -9
- package/src/models/attributes/AttributeModel.js +24 -24
- package/src/models/attributes/AttributeSetModel.js +1 -1
- package/src/models/attributes/BooleanAttributeModel.js +4 -4
- package/src/models/attributes/ChoiceAttributeModel.js +7 -7
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +15 -15
- package/src/models/attributes/ChoiceAttributeOptionModel.js +19 -11
- package/src/models/attributes/CompositeAttributeChildCollection.js +10 -10
- package/src/models/attributes/CompositeAttributeModel.js +7 -7
- package/src/models/attributes/DatetimeAttributeModel.js +6 -6
- package/src/models/attributes/NumberAttributeModel.js +9 -9
- package/src/models/attributes/PasswordAttributeModel.js +8 -8
- package/src/models/attributes/StringAttributeModel.js +3 -3
- package/src/models/attributes/UploadAttributeModel.js +5 -5
- package/src/models/attributes/__tests__/AttributeCollection.spec.js +11 -11
- package/src/models/attributes/__tests__/AttributeContent.spec.js +7 -7
- package/src/models/attributes/__tests__/AttributeModel.spec.js +5 -5
- package/src/models/attributes/__tests__/AttributeSetModel.spec.js +2 -2
- package/src/models/attributes/__tests__/BooleanAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/ChoiceAttributeModel.spec.js +8 -8
- package/src/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js +8 -8
- package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
- package/src/models/attributes/__tests__/DateAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/DatetimeAttributeModel.spec.js +11 -11
- package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +3 -3
- package/src/models/attributes/__tests__/MemoAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/MoneyAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/NumberAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/PasswordAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/StringAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/TimeAttributeModel.spec.js +2 -2
- package/src/models/attributes/__tests__/TimestampModel.spec.js +2 -2
- package/src/models/attributes/__tests__/UploadAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/_createAttribute.spec.js +6 -6
- package/src/models/attributes/__tests__/createAttributeComposite.spec.js +3 -3
- package/src/models/attributes/__tests__/createAttributeDynamicSchema.spec.js +3 -3
- package/src/models/attributes/_createAttribute.js +5 -5
- package/src/models/attributes/input-constraints/ConstraintCollection.js +5 -5
- package/src/models/attributes/input-constraints/ConstraintModel.js +1 -1
- package/src/models/attributes/input-constraints/DateBoundaryConstraint.js +6 -6
- package/src/models/attributes/input-constraints/MandatoryConstraint.js +1 -1
- package/src/models/attributes/input-constraints/NumberBoundaryConstraint.js +6 -6
- package/src/models/attributes/input-constraints/NumberFormatConstraint.js +2 -2
- package/src/models/attributes/input-constraints/NumberGroupingConstraint.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js +1 -1
- package/src/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js +6 -6
- package/src/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js +5 -5
- package/src/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js +6 -6
- package/src/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js +3 -3
- package/src/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js +1 -1
- package/src/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js +4 -4
- package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +4 -4
- package/src/models/attributes/layouthint-rules/DependentAttribute.js +15 -15
- package/src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +2 -2
- package/src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +2 -2
- package/src/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js +22 -22
- package/src/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js +1 -1
- package/src/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js +4 -4
- package/src/models/base/BaseCollection.js +6 -6
- package/src/models/base/BaseModel.js +1 -1
- package/src/models/base/ResourceModel.js +5 -5
- package/src/models/base/__tests__/ResourceCollection.spec.js +1 -1
- package/src/models/caseview/CaseViewModel.js +4 -4
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +3 -3
- package/src/models/concepts/BusinessScenarioModel.js +9 -9
- package/src/models/concepts/ConceptDetailModel.js +17 -17
- package/src/models/concepts/ConceptIndexModel.js +2 -2
- package/src/models/concepts/ConceptLinkModel.js +6 -4
- package/src/models/concepts/ConceptRelationCollection.js +5 -5
- package/src/models/concepts/SourceReferenceCollection.js +2 -2
- package/src/models/concepts/SourceReferenceModel.js +2 -2
- package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +1 -1
- package/src/models/content/ContentIndexModel.js +3 -3
- package/src/models/content/ContentLinkModel.js +11 -9
- package/src/models/content/ContentModel.js +2 -2
- package/src/models/content/ContentTOCModel.js +4 -4
- package/src/models/content/SectionModel.js +4 -4
- package/src/models/content/SubSectionModel.js +2 -2
- package/src/models/content/__tests__/ContentModel.spec.js +16 -16
- package/src/models/contentconfiguration/ContentConfiguration.js +1 -1
- package/src/models/contentconfiguration/ContentConfigurationElements.js +5 -5
- package/src/models/contentconfiguration/ContentConfigurationEndResults.js +1 -1
- package/src/models/contentconfiguration/ContentConfigurationQuestions.js +2 -2
- package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +12 -12
- package/src/models/detail/DetailModel.js +5 -5
- package/src/models/error/ErrorCollection.js +4 -4
- package/src/models/error/ErrorModel.js +1 -1
- package/src/models/error/__tests__/ErrorModel.spec.js +1 -1
- package/src/models/filters/AssignmentFilterModel.js +3 -3
- package/src/models/filters/BaseFilterModel.js +3 -3
- package/src/models/filters/FilterCollection.js +5 -5
- package/src/models/filters/__tests__/AssignmentFilterModel.spec.js +4 -4
- package/src/models/filters/__tests__/FilterCollection.spec.js +11 -11
- package/src/models/filters/__tests__/FilterModel.spec.js +1 -1
- package/src/models/filters/__tests__/RangeFilterModel.spec.js +1 -1
- package/src/models/form/FormModel.js +39 -39
- package/src/models/form/FormObjectModel.js +16 -16
- package/src/models/form/__tests__/FormModel.instrument.spec.js +7 -7
- package/src/models/form/__tests__/FormModel.repeating.spec.js +2 -2
- package/src/models/form/__tests__/FormModel.selfhref.spec.js +1 -1
- package/src/models/form/__tests__/FormModel.spec.js +6 -6
- package/src/models/form/__tests__/FormResultData.spec.js +1 -1
- package/src/models/form/__tests__/FormWithContent.spec.js +3 -3
- package/src/models/grouping/GroupingModel.js +7 -7
- package/src/models/grouping/__tests__/GroupingModel.spec.js +2 -2
- package/src/models/href/Href.js +6 -6
- package/src/models/href/__tests__/Href.spec.js +18 -16
- package/src/models/layouthint/LayoutHintCollection.js +3 -3
- package/src/models/links/LinkCollection.js +4 -4
- package/src/models/links/LinkModel.js +3 -3
- package/src/models/links/__tests__/LinkModel.spec.js +4 -4
- package/src/models/links/normalizeLinkJSON.js +6 -6
- package/src/models/list/ListDetailModel.js +7 -7
- package/src/models/list/ListItemCollection.js +2 -2
- package/src/models/list/ListItemModel.js +2 -2
- package/src/models/list/ListModel.js +6 -6
- package/src/models/list/__tests__/ListDetailModel.spec.js +4 -4
- package/src/models/list/__tests__/ListItemCollection.spec.js +1 -1
- package/src/models/list/__tests__/ListModel.spec.js +3 -3
- package/src/models/list/__tests__/ListResultDetail.spec.js +3 -3
- package/src/models/lookup/LookupOptionCollection.js +1 -1
- package/src/models/lookup/LookupOptionsModel.js +4 -4
- package/src/models/lookup/__tests__/LookupOptionsModel.spec.js +3 -3
- package/src/models/modelcatalog/ModelCatalogModel.js +2 -2
- package/src/models/paging/PagingModel.js +1 -1
- package/src/models/paging/__tests__/PagingModel.spec.js +2 -2
- package/src/models/panels/GroupingPanelModel.js +5 -5
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +8 -8
- package/src/models/parameter/__tests__/Parameter.spec.js +5 -5
- package/src/models/process/ProcessStatusSettingsModel.js +1 -1
- package/src/models/process/__tests__/ProcessStatusSettingsModel.spec.js +1 -1
- package/src/models/resolveModel.js +4 -4
- package/src/models/sorting/SortingModel.js +4 -4
- package/src/models/sorting/__tests__/SortingModel.spec.js +3 -3
- package/src/models/tab/TabModel.js +3 -3
- package/src/models/tab/__tests__/TabModel.spec.js +5 -5
- package/src/models/taskgroup/TaskGroupModel.js +2 -2
- package/src/models/types.js +1 -1
- package/src/models/user/UserProfileModel.js +1 -1
- package/src/models/user/__tests__/UserModel.spec.js +2 -2
- package/src/models/user/__tests__/UserProfileModel.spec.js +2 -2
- package/src/models/user/__tests__/UserServicesModel.spec.js +1 -1
- package/src/modularui/CaptchaRequest.js +1 -1
- package/src/modularui/ModularUIRequest.js +26 -26
- package/src/modularui/UploadRequest.js +6 -6
- package/src/modularui/__tests__/ModularUIError.spec.js +1 -1
- package/src/modularui/__tests__/ModularUIRequest.spec.js +9 -9
- package/src/react/utils.js +1 -1
- package/src/react-client/client.js +11 -10
- package/src/react-client/contextPath.js +2 -2
- package/src/react-client/rehydrate.js +1 -1
- package/src/react-server/__tests__/serverUtil.spec.js +2 -2
- package/src/react-server/createSSRComplete.js +3 -3
- package/src/react-server/renderSSRComplete.js +4 -4
- package/src/react-server/renderSSRMinimal.js +1 -1
- package/src/react-server/requestInformation.js +2 -2
- package/src/react-server/serverUtil.js +8 -8
- package/src/react-theme/__tests__/createTheme.spec.js +4 -4
- package/src/react-theme/createTheme.js +1 -1
- package/src/react-theme/utils/__tests__/background.spec.js +2 -2
- package/src/react-theme/utils/__tests__/contrast.spec.js +1 -1
- package/src/react-theme/utils/__tests__/corners.spec.js +3 -3
- package/src/react-theme/utils/__tests__/spacers.spec.js +1 -1
- package/src/react-theme/utils/__tests__/themeProps.spec.js +9 -9
- package/src/react-theme/utils/colors.js +3 -3
- package/src/react-theme/utils/contrast.js +6 -6
- package/src/react-theme/utils/corners.js +2 -2
- package/src/react-theme/utils/spacers.js +2 -2
- package/src/react-theme/utils/themeProps.js +8 -8
- package/src/redux/_i18n/I18nActions.js +1 -1
- package/src/redux/_i18n/I18nReducer.js +2 -2
- package/src/redux/_i18n/__tests__/reducer.spec.js +2 -2
- package/src/redux/_modularui/ModularUIActions.js +8 -8
- package/src/redux/_modularui/ModularUIConnector.js +4 -4
- package/src/redux/_modularui/ModularUIMiddleware.js +6 -6
- package/src/redux/_modularui/ModularUIReducer.js +5 -5
- package/src/redux/_modularui/ModularUISelectors.js +11 -11
- package/src/redux/_modularui/ModularUIUtils.js +1 -1
- package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
- package/src/redux/_modularui/__tests__/reducer.spec.js +13 -13
- package/src/redux/_modularui/__tests__/selectors.spec.js +3 -3
- package/src/redux/_modularui/types.js +4 -4
- package/src/redux/_modularui/withModularUI.js +3 -3
- package/src/redux/_router/RouterActions.js +3 -3
- package/src/redux/_router/RouterConnectors.js +5 -5
- package/src/redux/_router/RouterReducer.js +1 -1
- package/src/redux/_router/__tests__/reducer.spec.js +2 -2
- package/src/redux/actions/Application.js +1 -1
- package/src/redux/actions/Authorization.js +1 -1
- package/src/redux/actions/Error.js +3 -3
- package/src/redux/actions/FormAttributeSet.js +2 -2
- package/src/redux/actions/FormAttributeSetRepeatable.js +3 -3
- package/src/redux/actions/FormAutosave.js +1 -1
- package/src/redux/actions/FormAutosubmit.js +1 -1
- package/src/redux/actions/FormValidations.js +3 -3
- package/src/redux/actions/Notification.js +4 -4
- package/src/redux/actions/Preferences.js +11 -11
- package/src/redux/actions/ProgressIndicator.js +1 -1
- package/src/redux/actions/SignIn.js +3 -3
- package/src/redux/actions/__tests__/Authorization.spec.js +2 -2
- package/src/redux/actions/__tests__/Error-server.spec.js +13 -13
- package/src/redux/actions/__tests__/Error.spec.js +6 -6
- package/src/redux/actions/__tests__/Notification.spec.js +1 -1
- package/src/redux/actions/__tests__/Preferences.spec.js +2 -2
- package/src/redux/connectors/Application.js +1 -1
- package/src/redux/connectors/Breadcrumb.js +1 -1
- package/src/redux/connectors/CaseView.js +1 -1
- package/src/redux/connectors/ConceptDetail.js +1 -1
- package/src/redux/connectors/ContentBrowser.js +1 -1
- package/src/redux/connectors/ContentDetail.js +1 -1
- package/src/redux/connectors/ContentDetailSection.js +2 -2
- package/src/redux/connectors/Form.js +5 -5
- package/src/redux/connectors/FormAttributeSet.js +6 -6
- package/src/redux/connectors/ListDetail.js +1 -1
- package/src/redux/connectors/Modal.js +1 -1
- package/src/redux/connectors/ModelCatalog.js +1 -1
- package/src/redux/connectors/Notification.js +1 -1
- package/src/redux/connectors/PanelRenderer.js +2 -2
- package/src/redux/connectors/Preferences.js +3 -3
- package/src/redux/connectors/Progress.js +1 -1
- package/src/redux/connectors/ProgressIndicator.js +1 -1
- package/src/redux/connectors/QuickSearch.js +2 -2
- package/src/redux/connectors/SignIn.js +1 -1
- package/src/redux/connectors/SignOut.js +1 -1
- package/src/redux/connectors/Tab.js +1 -1
- package/src/redux/reducers/AuthReducer.js +1 -1
- package/src/redux/reducers/ErrorReducer.js +1 -1
- package/src/redux/reducers/ModalsReducer.js +1 -1
- package/src/redux/reducers/NotificationReducer.js +1 -1
- package/src/redux/reducers/PreferencesReducer.js +1 -1
- package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
- package/src/redux/reducers/__tests__/AuthReducer.spec.js +10 -10
- package/src/redux/reducers/__tests__/ErrorReducer.spec.js +1 -1
- package/src/redux/reducers/__tests__/ModalsReducer.spec.js +3 -3
- package/src/redux/reducers/__tests__/NotificationReducer.spec.js +3 -3
- package/src/redux/reducers/__tests__/PreferencesReducer.spec.js +2 -2
- package/src/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js +8 -8
- package/src/redux/store/beforeRenderHooks.js +1 -1
- package/src/redux/store/configureStore.js +3 -3
- package/src/utils/browser/Cookies.js +1 -1
- package/src/utils/browser/__tests__/Cookies.spec.js +1 -1
- package/src/utils/datetime/DateTimeUtil.js +15 -15
- package/src/utils/datetime/__tests__/DateTime.spec.js +84 -81
- package/src/utils/fetch/__tests__/xhr.spec.js +2 -2
- package/src/utils/fetch/universalFetch.js +1 -1
- package/src/utils/fetch/xhr.js +6 -6
- package/src/utils/helpers/__tests__/sanitizeHTML.spec.js +8 -8
- package/src/utils/helpers/sanitizeHtml.js +3 -3
- package/src/utils/helpers/text.js +1 -1
- package/src/utils/number/DecimalFormat.js +2 -2
- package/src/utils/number/__tests__/formatValue.spec.js +1 -1
- package/src/utils/number/formatValue.js +2 -2
- package/src/utils/number/parseNumbers.js +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIBasic.js","names":["_useModularUI","require","_useRouter","_exceptions","useModularUIBasic","key","href","_context","options","arguments","length","undefined","expectedModels","targetModel","forceTargetModel","location","useLocation","IllegalArgumentException","useModularUIOptions","isReload","state","reload","_startsWith","default","pathname","call","toString","modularUI","useModularUI","model","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException","exports"],"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: ModularUIModel> = {\n expectedModels: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\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 forceTargetModel: false,\n }
|
|
1
|
+
{"version":3,"file":"useModularUIBasic.js","names":["_useModularUI","require","_useRouter","_exceptions","useModularUIBasic","key","href","_context","options","arguments","length","undefined","expectedModels","targetModel","forceTargetModel","location","useLocation","IllegalArgumentException","useModularUIOptions","isReload","state","reload","_startsWith","default","pathname","call","toString","modularUI","useModularUI","model","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException","exports"],"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: ModularUIModel> = {\n expectedModels: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\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 forceTargetModel: false,\n },\n): T | null => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n };\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n useModularUIOptions.forceTargetModel = options.forceTargetModel;\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 // $FlowFixMe[incompatible-call]\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 return null;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAUA;AACA;AACO,MAAMG,iBAAiB,GAAG,SAAAA,CAC/BC,GAAW,EACXC,IAAmB,EAMN;EAAA,IAAAC,QAAA;EAAA,IALbC,OAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IACrCG,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAE;EACpB,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,sBAAW,EAAC,CAAC;EAC9B,IAAI,CAACV,IAAI,EAAE;IACT,MAAM,IAAIW,oCAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMC,mBAAmB,GAAG;IAC1BL,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAEH,SAAS;IAC3BQ,QAAQ,EAAE;EACZ,CAAC;EACD,IAAIX,OAAO,CAACK,WAAW,EAAE;IACvBK,mBAAmB,CAACL,WAAW,GAAGL,OAAO,CAACK,WAAW;IACrDK,mBAAmB,CAACJ,gBAAgB,GAAGN,OAAO,CAACM,gBAAgB;EACjE;;EAEA;EACA,IAAIC,QAAQ,CAACK,KAAK,EAAEC,MAAM,IAAI,IAAAC,WAAA,CAAAC,OAAA,EAAAhB,QAAA,GAAAQ,QAAQ,CAACS,QAAQ,EAAAC,IAAA,CAAAlB,QAAA,EAAYD,IAAI,CAACoB,QAAQ,CAAC,CAAC,CAAC,EAAE;IAC3ER,mBAAmB,CAACC,QAAQ,GAAG,IAAI;EACrC;;EAEA;EACA,MAAMQ,SAAS,GAAG,IAAAC,0BAAY,EAACvB,GAAG,EAAEC,IAAI,EAAEY,mBAAmB,CAAC;EAE9D,IAAIS,SAAS,EAAEE,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGF,SAAS;IAC3B,IAAInB,OAAO,CAACI,cAAc,CAACF,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMoB,cAAc,GAAGtB,OAAO,CAACI,cAAc,CAACmB,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOH,KAAK,CAACI,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACR,SAAS,EAAE,oBAAoB,EAAEnB,OAAO,CAACI,cAAc,CAAC;QACtE,MAAM,IAAIwB,iCAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOP,KAAK;EACd;EAEA,OAAO,IAAI;AACb,CAAC;AAACQ,OAAA,CAAAjC,iBAAA,GAAAA,iBAAA"}
|
|
@@ -41,7 +41,7 @@ export const useCaseView = (href: string): CaseViewModel | null =>
|
|
|
41
41
|
/**
|
|
42
42
|
*/
|
|
43
43
|
export const usePanel = (
|
|
44
|
-
href: string
|
|
44
|
+
href: string,
|
|
45
45
|
): ListModel | GroupingPanelModel | DetailModel | null =>
|
|
46
46
|
useModularUIBasic("panel", href, {
|
|
47
47
|
expectedModels: ["List", "GroupingPanel", "Detail"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIModel.js","names":["_ApplicationModel","_interopRequireDefault","require","_CaseViewModel","_TabModel","_ListModel","_GroupingPanelModel","_DetailModel","_CaseSearchModel","_ListDetailModel","_UserProfileModel","_useModularUIBasic","useApplication","useModularUIBasic","expectedModels","targetModel","ApplicationModel","exports","useTab","href","TabModel","useCaseView","CaseViewModel","usePanel","useList","ListModel","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useGroupingPanel","GroupingPanelModel","useDetailPanel","useQuicksearch","CaseSearchModel","useSearch","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 | null =>\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 | null =>\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 | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n });\n\n/**\n */\nexport const usePanel = (\n href: string
|
|
1
|
+
{"version":3,"file":"useModularUIModel.js","names":["_ApplicationModel","_interopRequireDefault","require","_CaseViewModel","_TabModel","_ListModel","_GroupingPanelModel","_DetailModel","_CaseSearchModel","_ListDetailModel","_UserProfileModel","_useModularUIBasic","useApplication","useModularUIBasic","expectedModels","targetModel","ApplicationModel","exports","useTab","href","TabModel","useCaseView","CaseViewModel","usePanel","useList","ListModel","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useGroupingPanel","GroupingPanelModel","useDetailPanel","useQuicksearch","CaseSearchModel","useSearch","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 | null =>\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 | null =>\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 | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n });\n\n/**\n */\nexport const usePanel = (\n href: string,\n): ListModel | GroupingPanelModel | DetailModel | null =>\n useModularUIBasic(\"panel\", href, {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n });\n\n/**\n */\nexport const useList = (href: string): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n });\n\n/**\n */\nexport const useListOrDetail = (href: string): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n });\n\n/**\n */\nexport const useListDetail = (href: string): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n });\n\n/**\n */\nexport const useGroupingPanel = (href: string): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n });\n\n/**\n */\nexport const useDetailPanel = (href: string): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n });\n\n/**\n */\nexport const useQuicksearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useSearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useUserProfile = (href: string): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n });\n"],"mappings":"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"}
|
|
@@ -21,5 +21,5 @@ const getModularUIRequest = createSelector([getLocale], (localeCode) => {
|
|
|
21
21
|
*/
|
|
22
22
|
export const useModularUIRequest = (): ((
|
|
23
23
|
href: Href,
|
|
24
|
-
options?: $Shape<RequestModularUIOptions
|
|
24
|
+
options?: $Shape<RequestModularUIOptions>,
|
|
25
25
|
) => ModularUIRequest) => useSelector(getModularUIRequest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIRequest.js","names":["_reselect","require","_reactRedux","_ModularUIRequest","_interopRequireDefault","_i18n","getModularUIRequest","createSelector","getLocale","localeCode","href","options","request","ModularUIRequest","locale","useModularUIRequest","useSelector","exports"],"sources":["../../src/hooks/useModularUIRequest.js"],"sourcesContent":["// @flow\nimport { createSelector } from \"reselect\";\nimport { useSelector } from \"react-redux\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport type { RequestModularUIOptions } from \"../utils\";\nimport type Href from \"../models/href/Href\";\n\nconst getModularUIRequest = createSelector([getLocale], (localeCode) => {\n return (href: Href, options?: $Shape<RequestModularUIOptions>) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\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<RequestModularUIOptions
|
|
1
|
+
{"version":3,"file":"useModularUIRequest.js","names":["_reselect","require","_reactRedux","_ModularUIRequest","_interopRequireDefault","_i18n","getModularUIRequest","createSelector","getLocale","localeCode","href","options","request","ModularUIRequest","locale","useModularUIRequest","useSelector","exports"],"sources":["../../src/hooks/useModularUIRequest.js"],"sourcesContent":["// @flow\nimport { createSelector } from \"reselect\";\nimport { useSelector } from \"react-redux\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport type { RequestModularUIOptions } from \"../utils\";\nimport type Href from \"../models/href/Href\";\n\nconst getModularUIRequest = createSelector([getLocale], (localeCode) => {\n return (href: Href, options?: $Shape<RequestModularUIOptions>) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\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<RequestModularUIOptions>,\n) => ModularUIRequest) => useSelector(getModularUIRequest);\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,MAAMK,mBAAmB,GAAG,IAAAC,wBAAc,EAAC,CAACC,eAAS,CAAC,EAAGC,UAAU,IAAK;EACtE,OAAO,CAACC,IAAU,EAAEC,OAAyC,KAAK;IAChE,MAAMC,OAAO,GAAG,IAAIC,yBAAgB,CAACH,IAAI,EAAEC,OAAO,CAAC;IACnDC,OAAO,CAACE,MAAM,GAAGL,UAAU;IAC3B,OAAOG,OAAO;EAChB,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AACO,MAAMG,mBAAmB,GAAGA,CAAA,KAGT,IAAAC,uBAAW,EAACV,mBAAmB,CAAC;AAACW,OAAA,CAAAF,mBAAA,GAAAA,mBAAA"}
|
|
@@ -18,7 +18,7 @@ type NotificationHook = {
|
|
|
18
18
|
};
|
|
19
19
|
type ErrorNotificationHook = (
|
|
20
20
|
message: MessageObject,
|
|
21
|
-
error?: ?ErrorResponse
|
|
21
|
+
error?: ?ErrorResponse,
|
|
22
22
|
) => ShowNotificationAction;
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -26,7 +26,7 @@ type ErrorNotificationHook = (
|
|
|
26
26
|
export const useNotification = (): NotificationHook => {
|
|
27
27
|
const dispatch = useDispatch();
|
|
28
28
|
const { render, messageType, message, error } = useSelector(
|
|
29
|
-
(state) => state.notification
|
|
29
|
+
(state) => state.notification,
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotification.js","names":["_reactRedux","require","_actions","_constants","useNotification","dispatch","useDispatch","render","messageType","message","error","useSelector","state","notification","dismiss","dismissNotification","exports","useErrorNotification","showNotification","NOTIFICATION_TYPES","ERROR"],"sources":["../../src/hooks/useNotification.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { dismissNotification, showNotification } from \"../redux/actions\";\n\nimport type {\n DismissNotificationAction,\n NotificationState,\n ShowNotificationAction,\n} from \"../redux/types\";\n\nimport { NOTIFICATION_TYPES } from \"../constants\";\n\nimport type { MessageObject } from \"../i18n\";\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\ntype NotificationHook = {\n ...NotificationState,\n dismiss: () => DismissNotificationAction,\n};\ntype ErrorNotificationHook = (\n message: MessageObject,\n error?: ?ErrorResponse
|
|
1
|
+
{"version":3,"file":"useNotification.js","names":["_reactRedux","require","_actions","_constants","useNotification","dispatch","useDispatch","render","messageType","message","error","useSelector","state","notification","dismiss","dismissNotification","exports","useErrorNotification","showNotification","NOTIFICATION_TYPES","ERROR"],"sources":["../../src/hooks/useNotification.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { dismissNotification, showNotification } from \"../redux/actions\";\n\nimport type {\n DismissNotificationAction,\n NotificationState,\n ShowNotificationAction,\n} from \"../redux/types\";\n\nimport { NOTIFICATION_TYPES } from \"../constants\";\n\nimport type { MessageObject } from \"../i18n\";\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\ntype NotificationHook = {\n ...NotificationState,\n dismiss: () => DismissNotificationAction,\n};\ntype ErrorNotificationHook = (\n message: MessageObject,\n error?: ?ErrorResponse,\n) => ShowNotificationAction;\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\n/**\n */\nexport const useErrorNotification = (): ErrorNotificationHook => {\n const dispatch = useDispatch();\n return (message: MessageObject, error?: ?ErrorResponse) => {\n return dispatch(showNotification(NOTIFICATION_TYPES.ERROR, message, error));\n };\n};\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AAaA;AACA;AACO,MAAMG,eAAe,GAAGA,CAAA,KAAwB;EACrD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAG,IAAAC,uBAAW,EACxDC,KAAK,IAAKA,KAAK,CAACC,YACnB,CAAC;EAED,OAAO;IACLN,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,KAAK;IACLI,OAAO,EAAEA,CAAA,KAAMT,QAAQ,CAAC,IAAAU,4BAAmB,EAAC,CAAC;EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AADAC,OAAA,CAAAZ,eAAA,GAAAA,eAAA;AAEO,MAAMa,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMZ,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,OAAO,CAACG,OAAsB,EAAEC,KAAsB,KAAK;IACzD,OAAOL,QAAQ,CAAC,IAAAa,yBAAgB,EAACC,6BAAkB,CAACC,KAAK,EAAEX,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC7E,CAAC;AACH,CAAC;AAACM,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -7,11 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.usePreference = void 0;
|
|
8
8
|
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
9
9
|
var _reactRedux = require("react-redux");
|
|
10
|
+
var _reselect = require("reselect");
|
|
11
|
+
const getPreferences = state => state.preferences;
|
|
12
|
+
const getPreferenceNames = (state, preferenceNames) => Array.isArray(preferenceNames) ? preferenceNames : [preferenceNames];
|
|
13
|
+
const selectPreference = (0, _reselect.createSelector)([getPreferences, getPreferenceNames], (preferences, preferenceNames) => {
|
|
14
|
+
return (0, _pick.default)(preferences, preferenceNames);
|
|
15
|
+
});
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
*/
|
|
12
19
|
const usePreference = preferenceNames => {
|
|
13
|
-
|
|
14
|
-
return (0, _reactRedux.useSelector)(state => (0, _pick.default)(state.preferences, requestedPreferences));
|
|
20
|
+
return (0, _reactRedux.useSelector)(state => selectPreference(state, preferenceNames));
|
|
15
21
|
};
|
|
16
22
|
exports.usePreference = usePreference;
|
|
17
23
|
//# sourceMappingURL=usePreference.js.map
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import pick from "lodash/pick";
|
|
3
3
|
import { useSelector } from "react-redux";
|
|
4
|
+
import { createSelector } from "reselect";
|
|
4
5
|
|
|
5
|
-
import type { PreferencesState } from "../redux/types";
|
|
6
|
+
import type { PreferencesState, ReduxState } from "../redux/types";
|
|
7
|
+
|
|
8
|
+
const getPreferences = (state: ReduxState) => state.preferences;
|
|
9
|
+
const getPreferenceNames = (
|
|
10
|
+
state: ReduxState,
|
|
11
|
+
preferenceNames: string | Array<string>,
|
|
12
|
+
) => (Array.isArray(preferenceNames) ? preferenceNames : [preferenceNames]);
|
|
13
|
+
|
|
14
|
+
const selectPreference = createSelector(
|
|
15
|
+
[getPreferences, getPreferenceNames],
|
|
16
|
+
(preferences, preferenceNames) => {
|
|
17
|
+
return pick(preferences, preferenceNames);
|
|
18
|
+
},
|
|
19
|
+
);
|
|
6
20
|
|
|
7
21
|
/**
|
|
8
22
|
*/
|
|
9
23
|
export const usePreference = (
|
|
10
|
-
preferenceNames: string | Array<string
|
|
24
|
+
preferenceNames: string | Array<string>,
|
|
11
25
|
): PreferencesState => {
|
|
12
|
-
|
|
13
|
-
? preferenceNames
|
|
14
|
-
: [preferenceNames];
|
|
15
|
-
|
|
16
|
-
return useSelector((state) => pick(state.preferences, requestedPreferences));
|
|
26
|
+
return useSelector((state) => selectPreference(state, preferenceNames));
|
|
17
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreference.js","names":["_pick","_interopRequireDefault","require","_reactRedux","
|
|
1
|
+
{"version":3,"file":"usePreference.js","names":["_pick","_interopRequireDefault","require","_reactRedux","_reselect","getPreferences","state","preferences","getPreferenceNames","preferenceNames","Array","isArray","selectPreference","createSelector","pick","usePreference","useSelector","exports"],"sources":["../../src/hooks/usePreference.js"],"sourcesContent":["// @flow\nimport pick from \"lodash/pick\";\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport type { PreferencesState, ReduxState } from \"../redux/types\";\n\nconst getPreferences = (state: ReduxState) => state.preferences;\nconst getPreferenceNames = (\n state: ReduxState,\n preferenceNames: string | Array<string>,\n) => (Array.isArray(preferenceNames) ? preferenceNames : [preferenceNames]);\n\nconst selectPreference = createSelector(\n [getPreferences, getPreferenceNames],\n (preferences, preferenceNames) => {\n return pick(preferences, preferenceNames);\n },\n);\n\n/**\n */\nexport const usePreference = (\n preferenceNames: string | Array<string>,\n): PreferencesState => {\n return useSelector((state) => selectPreference(state, preferenceNames));\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAIA,MAAMG,cAAc,GAAIC,KAAiB,IAAKA,KAAK,CAACC,WAAW;AAC/D,MAAMC,kBAAkB,GAAGA,CACzBF,KAAiB,EACjBG,eAAuC,KACnCC,KAAK,CAACC,OAAO,CAACF,eAAe,CAAC,GAAGA,eAAe,GAAG,CAACA,eAAe,CAAE;AAE3E,MAAMG,gBAAgB,GAAG,IAAAC,wBAAc,EACrC,CAACR,cAAc,EAAEG,kBAAkB,CAAC,EACpC,CAACD,WAAW,EAAEE,eAAe,KAAK;EAChC,OAAO,IAAAK,aAAI,EAACP,WAAW,EAAEE,eAAe,CAAC;AAC3C,CACF,CAAC;;AAED;AACA;AACO,MAAMM,aAAa,GACxBN,eAAuC,IAClB;EACrB,OAAO,IAAAO,uBAAW,EAAEV,KAAK,IAAKM,gBAAgB,CAACN,KAAK,EAAEG,eAAe,CAAC,CAAC;AACzE,CAAC;AAACQ,OAAA,CAAAF,aAAA,GAAAA,aAAA"}
|
package/lib/i18n/Locale.js.flow
CHANGED
|
@@ -58,7 +58,7 @@ class Locale {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
throw new IllegalStateException(
|
|
61
|
-
`Can not find language name based on locale: ${this.code}
|
|
61
|
+
`Can not find language name based on locale: ${this.code}`,
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -86,7 +86,7 @@ class Locale {
|
|
|
86
86
|
return JSON.parse(
|
|
87
87
|
JSON.stringify(messages)
|
|
88
88
|
.replace(/'\$\{(?<key>.*?)}'/g, "''{$<key>}''")
|
|
89
|
-
.replace(/\$\{(?<key>.*?)}/g, "{$<key>}")
|
|
89
|
+
.replace(/\$\{(?<key>.*?)}/g, "{$<key>}"),
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -109,7 +109,7 @@ class Locale {
|
|
|
109
109
|
) {
|
|
110
110
|
// eslint-disable-next-line no-console
|
|
111
111
|
console.debug(
|
|
112
|
-
`Message with id ${id} not found for locale ${this.code} in layout translations
|
|
112
|
+
`Message with id ${id} not found for locale ${this.code} in layout translations`,
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;
|
|
@@ -132,7 +132,7 @@ class Locale {
|
|
|
132
132
|
getMessage(
|
|
133
133
|
id: string,
|
|
134
134
|
defaultMessage?: string,
|
|
135
|
-
parameters?: MessageParameters
|
|
135
|
+
parameters?: MessageParameters,
|
|
136
136
|
): string {
|
|
137
137
|
const message = this.getBaseMessage(id, defaultMessage);
|
|
138
138
|
return this.formatMessage(message, parameters);
|
package/lib/i18n/Locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Locale.js","names":["_formatMessage","_interopRequireDefault","require","_languages","_exceptions","_constants","Locale","constructor","locale","_defineProperty2","default","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","formatMessage","setup","missingTranslation","aLocale","split","length","language","languages","lang","toUpperCase","IllegalStateException","fixPlaceHolders","message","replace","arguments","undefined","JSON","parse","_stringify","getBaseMessage","id","defaultMessage","messageFromLocale","process","env","NODE_ENV","getSetting","console","debug","parameters","getMessage","update","_default","exports"],"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}
|
|
1
|
+
{"version":3,"file":"Locale.js","names":["_formatMessage","_interopRequireDefault","require","_languages","_exceptions","_constants","Locale","constructor","locale","_defineProperty2","default","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","formatMessage","setup","missingTranslation","aLocale","split","length","language","languages","lang","toUpperCase","IllegalStateException","fixPlaceHolders","message","replace","arguments","undefined","JSON","parse","_stringify","getBaseMessage","id","defaultMessage","messageFromLocale","process","env","NODE_ENV","getSetting","console","debug","parameters","getMessage","update","_default","exports"],"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":"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"}
|
package/lib/i18n/Locales.js.flow
CHANGED
|
@@ -51,7 +51,7 @@ export const availableLocales: Array<LocaleConfiguration> = [
|
|
|
51
51
|
* Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.
|
|
52
52
|
*/
|
|
53
53
|
export const createLocalesWithConfiguredErrors = (
|
|
54
|
-
configuredErrors: ErrorMessageObject
|
|
54
|
+
configuredErrors: ErrorMessageObject,
|
|
55
55
|
): Array<Object> =>
|
|
56
56
|
availableLocales.map((availableLocale) => {
|
|
57
57
|
if (configuredErrors[availableLocale.code]) {
|
|
@@ -85,7 +85,7 @@ class Locales extends BaseCollection<Locale> {
|
|
|
85
85
|
code: locale._code,
|
|
86
86
|
messages: locale._messages,
|
|
87
87
|
errors: locale._errors,
|
|
88
|
-
}))
|
|
88
|
+
})),
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -110,7 +110,7 @@ class Locales extends BaseCollection<Locale> {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
throw new IllegalArgumentException(
|
|
113
|
-
`Locale configuration for locale ${localeCode} not found
|
|
113
|
+
`Locale configuration for locale ${localeCode} not found`,
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -132,13 +132,13 @@ class Locales extends BaseCollection<Locale> {
|
|
|
132
132
|
const preferredLocales = acceptLanguages
|
|
133
133
|
.filter((locale) =>
|
|
134
134
|
this.availableLocaleCodes.some((availableLocale) =>
|
|
135
|
-
locale.startsWith(availableLocale)
|
|
136
|
-
)
|
|
135
|
+
locale.startsWith(availableLocale),
|
|
136
|
+
),
|
|
137
137
|
)
|
|
138
138
|
.map((locale) =>
|
|
139
139
|
this.availableLocaleCodes.find((availableLocale) =>
|
|
140
|
-
locale.startsWith(availableLocale)
|
|
141
|
-
)
|
|
140
|
+
locale.startsWith(availableLocale),
|
|
141
|
+
),
|
|
142
142
|
);
|
|
143
143
|
|
|
144
144
|
if (preferredLocales.length > 0) {
|
|
@@ -162,7 +162,7 @@ class Locales extends BaseCollection<Locale> {
|
|
|
162
162
|
code: locale,
|
|
163
163
|
messages,
|
|
164
164
|
errors,
|
|
165
|
-
})
|
|
165
|
+
}),
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
}
|
package/lib/i18n/Locales.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Locales.js","names":["_Locale","_interopRequireDefault","require","_beinformed_error_messages_en","_beinformed_error_messages_nl","_BaseCollection","_exceptions","availableLocales","code","messages","errors","englishErrors","dutchErrors","exports","createLocalesWithConfiguredErrors","configuredErrors","_map","default","call","availableLocale","Locales","BaseCollection","constructor","locales","arguments","length","undefined","locale","Locale","rehydrate","hydatedLocales","_collection","_context","_code","_messages","_errors","hasLocale","localeCode","some","item","_startsWith","getLocale","_context2","_find","IllegalArgumentException","availableLocaleCodes","_context3","getPreferredLocale","acceptLanguageHeader","_context4","acceptLanguages","match","preferredLocales","_filter","_context5","update","add","_default"],"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
|
|
1
|
+
{"version":3,"file":"Locales.js","names":["_Locale","_interopRequireDefault","require","_beinformed_error_messages_en","_beinformed_error_messages_nl","_BaseCollection","_exceptions","availableLocales","code","messages","errors","englishErrors","dutchErrors","exports","createLocalesWithConfiguredErrors","configuredErrors","_map","default","call","availableLocale","Locales","BaseCollection","constructor","locales","arguments","length","undefined","locale","Locale","rehydrate","hydatedLocales","_collection","_context","_code","_messages","_errors","hasLocale","localeCode","some","item","_startsWith","getLocale","_context2","_find","IllegalArgumentException","availableLocaleCodes","_context3","getPreferredLocale","acceptLanguageHeader","_context4","acceptLanguages","match","preferredLocales","_filter","_context5","update","add","_default"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,6BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,6BAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMK,gBAA4C,GAAG,CAC1D;EACEC,IAAI,EAAE,IAAI;EACVC,QAAQ,EAAE,CAAC,CAAC;EACZC,MAAM,EAAEC;AACV,CAAC,EACD;EACEH,IAAI,EAAE,IAAI;EACVC,QAAQ,EAAE,CAAC,CAAC;EACZC,MAAM,EAAEE;AACV,CAAC,CACF;;AAED;AACA;AACA;AAFAC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA;AAGO,MAAMO,iCAAiC,GAC5CC,gBAAoC,IAEpC,IAAAC,IAAA,CAAAC,OAAA,EAAAV,gBAAgB,EAAAW,IAAA,CAAhBX,gBAAgB,EAAMY,eAAe,IAAK;EACxC,IAAIJ,gBAAgB,CAACI,eAAe,CAACX,IAAI,CAAC,EAAE;IAC1C,OAAO;MACL,GAAGW,eAAe;MAClBT,MAAM,EAAE;QACN,GAAGS,eAAe,CAACT,MAAM;QACzB,GAAGK,gBAAgB,CAACI,eAAe,CAACX,IAAI;MAC1C;IACF,CAAC;EACH;EAEA,OAAOW,eAAe;AACxB,CAAC,CAAC;;AAEJ;AACA;AACA;AAFAN,OAAA,CAAAC,iCAAA,GAAAA,iCAAA;AAGA,MAAMM,OAAO,SAASC,uBAAc,CAAS;EAC3CC,WAAWA,CAAA,EAAyD;IAAA,IAAxDC,OAAmC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGjB,gBAAgB;IAChE,KAAK,CAAC,IAAAS,IAAA,CAAAC,OAAA,EAAAM,OAAO,EAAAL,IAAA,CAAPK,OAAO,EAAMI,MAAM,IAAK,IAAIC,eAAM,CAACD,MAAM,CAAC,CAAC,CAAC;EACpD;;EAEA;AACF;AACA;EACE,OAAOE,SAASA,CAACC,cAA+B,EAAW;IACzD,IAAIA,cAAc,IAAIA,cAAc,CAACC,WAAW,EAAE;MAAA,IAAAC,QAAA;MAChD,OAAO,IAAIZ,OAAO,CAChB,IAAAJ,IAAA,CAAAC,OAAA,EAAAe,QAAA,GAAAF,cAAc,CAACC,WAAW,EAAAb,IAAA,CAAAc,QAAA,EAAML,MAAM,KAAM;QAC1CnB,IAAI,EAAEmB,MAAM,CAACM,KAAK;QAClBxB,QAAQ,EAAEkB,MAAM,CAACO,SAAS;QAC1BxB,MAAM,EAAEiB,MAAM,CAACQ;MACjB,CAAC,CAAC,CACJ,CAAC;IACH;IAEA,OAAO,IAAIf,OAAO,CAAC,EAAE,CAAC;EACxB;;EAEA;AACF;AACA;EACEgB,SAASA,CAACC,UAAkB,EAAW;IACrC,OAAO,IAAI,CAACC,IAAI,CAAEC,IAAI,IAAK,IAAAC,WAAA,CAAAvB,OAAA,EAAAoB,UAAU,EAAAnB,IAAA,CAAVmB,UAAU,EAAYE,IAAI,CAAC/B,IAAI,CAAC,CAAC;EAC9D;;EAEA;AACF;AACA;EACEiC,SAASA,CAACJ,UAAkB,EAAU;IACpC,IAAI,IAAI,CAACD,SAAS,CAACC,UAAU,CAAC,EAAE;MAAA,IAAAK,SAAA;MAC9B,MAAMf,MAAM,GAAG,IAAAgB,KAAA,CAAA1B,OAAA,EAAAyB,SAAA,OAAI,EAAAxB,IAAA,CAAAwB,SAAA,EAAOH,IAAI,IAAK,IAAAC,WAAA,CAAAvB,OAAA,EAAAoB,UAAU,EAAAnB,IAAA,CAAVmB,UAAU,EAAYE,IAAI,CAAC/B,IAAI,CAAC,CAAC;MACpE,IAAImB,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;IACF;IACA,MAAM,IAAIiB,oCAAwB,CAC/B,mCAAkCP,UAAW,YAChD,CAAC;EACH;;EAEA;AACF;AACA;EACE,IAAIQ,oBAAoBA,CAAA,EAAkB;IAAA,IAAAC,SAAA;IACxC,OAAO,IAAA9B,IAAA,CAAAC,OAAA,EAAA6B,SAAA,OAAI,EAAA5B,IAAA,CAAA4B,SAAA,EAAMnB,MAAM,IAAKA,MAAM,CAACnB,IAAI,CAAC;EAC1C;;EAEA;AACF;AACA;EACEuC,kBAAkBA,CAACC,oBAAmC,EAAiB;IACrE,IAAIA,oBAAoB,IAAI,IAAI,EAAE;MAAA,IAAAC,SAAA;MAChC,MAAMC,eAAe,GACnBF,oBAAoB,CAACG,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE;MAEvD,MAAMC,gBAAgB,GAAG,IAAApC,IAAA,CAAAC,OAAA,EAAAgC,SAAA,OAAAI,OAAA,CAAApC,OAAA,EAAAiC,eAAe,EAAAhC,IAAA,CAAfgC,eAAe,EAC7BvB,MAAM,IACb,IAAI,CAACkB,oBAAoB,CAACP,IAAI,CAAEnB,eAAe,IAC7C,IAAAqB,WAAA,CAAAvB,OAAA,EAAAU,MAAM,EAAAT,IAAA,CAANS,MAAM,EAAYR,eAAe,CACnC,CACF,CAAC,EAAAD,IAAA,CAAA+B,SAAA,EACKtB,MAAM;QAAA,IAAA2B,SAAA;QAAA,OACV,IAAAX,KAAA,CAAA1B,OAAA,EAAAqC,SAAA,OAAI,CAACT,oBAAoB,EAAA3B,IAAA,CAAAoC,SAAA,EAAOnC,eAAe,IAC7C,IAAAqB,WAAA,CAAAvB,OAAA,EAAAU,MAAM,EAAAT,IAAA,CAANS,MAAM,EAAYR,eAAe,CACnC,CAAC;MAAA,CACH,CAAC;MAEH,IAAIiC,gBAAgB,CAAC3B,MAAM,GAAG,CAAC,EAAE;QAC/B,OAAO2B,gBAAgB,CAAC,CAAC,CAAC;MAC5B;IACF;IAEA,OAAO,IAAI,CAACP,oBAAoB,CAAC,CAAC,CAAC;EACrC;;EAEA;AACF;AACA;AACA;EACEU,MAAMA,CAAC5B,MAAc,EAA8C;IAAA,IAA5ClB,QAAgB,GAAAe,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,IAAEd,MAAc,GAAAc,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAC/D,IAAI,IAAI,CAACY,SAAS,CAACT,MAAM,CAAC,EAAE;MAC1B,IAAI,CAACc,SAAS,CAACd,MAAM,CAAC,CAAC4B,MAAM,CAAC9C,QAAQ,EAAEC,MAAM,CAAC;IACjD,CAAC,MAAM;MACL,IAAI,CAAC8C,GAAG,CACN,IAAI5B,eAAM,CAAC;QACTpB,IAAI,EAAEmB,MAAM;QACZlB,QAAQ;QACRC;MACF,CAAC,CACH,CAAC;IACH;EACF;AACF;AAAC,IAAA+C,QAAA,GAEcrC,OAAO;AAAAP,OAAA,CAAAI,OAAA,GAAAwC,QAAA"}
|
package/lib/i18n/Message.js.flow
CHANGED
|
@@ -31,7 +31,7 @@ const Message: React$AbstractComponent<MessageProps, mixed> =
|
|
|
31
31
|
const translatedMessage = useMessage(
|
|
32
32
|
id,
|
|
33
33
|
defaultMessage || children,
|
|
34
|
-
data
|
|
34
|
+
data,
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
if (screenreaderOnly) {
|
|
@@ -58,7 +58,7 @@ const Message: React$AbstractComponent<MessageProps, mixed> =
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return <span className={className}>{translatedMessage}</span>;
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
Message.displayName = "BI.Message";
|
package/lib/i18n/Message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","names":["_react","require","_polished","_useI18n","_jsxRuntime","Message","memo","_ref","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","useMessage","styles","hideVisually","jsx","style","dangerouslySetInnerHTML","__html","displayName","_default","exports","default"],"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,\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
|
|
1
|
+
{"version":3,"file":"Message.js","names":["_react","require","_polished","_useI18n","_jsxRuntime","Message","memo","_ref","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","useMessage","styles","hideVisually","jsx","style","dangerouslySetInnerHTML","__html","displayName","_default","exports","default"],"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,\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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAA8C,IAAAG,WAAA,GAAAH,OAAA;AAY9C;AACA;AACA;AACA,MAAMI,OAAqD,gBACzD,IAAAC,WAAI,EACFC,IAAA,IAQoB;EAAA,IARnB;IACCC,SAAS;IACTC,EAAE;IACFC,cAAc;IACdC,QAAQ;IACRC,IAAI;IACJC,gBAAgB,GAAG,KAAK;IACxBC,SAAS,GAAG;EACA,CAAC,GAAAP,IAAA;EACb,MAAMQ,iBAAiB,GAAG,IAAAC,mBAAU,EAClCP,EAAE,EACFC,cAAc,IAAIC,QAAQ,EAC1BC,IACF,CAAC;EAED,IAAIC,gBAAgB,EAAE;IACpB,MAAMI,MAAM,GAAG;MACb,GAAG,IAAAC,sBAAY,EAAC;IAClB,CAAC;IAED,oBACE,IAAAd,WAAA,CAAAe,GAAA;MAAMX,SAAS,EAAEA,SAAU;MAACY,KAAK,EAAEH,MAAO;MAAAN,QAAA,EACvCI;IAAiB,CACd,CAAC;EAEX;EAEA,IAAID,SAAS,EAAE;IACb,oBACE,IAAAV,WAAA,CAAAe,GAAA;MACEX,SAAS,EAAEA,SAAU;MACrBa,uBAAuB,EAAE;QACvBC,MAAM,EAAEP;MACV;IAAE,CACH,CAAC;EAEN;EAEA,oBAAO,IAAAX,WAAA,CAAAe,GAAA;IAAMX,SAAS,EAAEA,SAAU;IAAAG,QAAA,EAAEI;EAAiB,CAAO,CAAC;AAC/D,CACF,CAAC;AAEHV,OAAO,CAACkB,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEpBnB,OAAO;AAAAoB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -16,7 +16,7 @@ jest.mock(
|
|
|
16
16
|
messageWithParams: "Param 1: {param1}, Param 2: {param2}",
|
|
17
17
|
messageWithJavaParams: "Param 1: ${param1}, Param 2: ${param2}", // NOSONAR
|
|
18
18
|
}),
|
|
19
|
-
{ virtual: true }
|
|
19
|
+
{ virtual: true },
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
describe("locale", () => {
|
|
@@ -81,7 +81,7 @@ describe("locale", () => {
|
|
|
81
81
|
expect(
|
|
82
82
|
locale.getMessage("code", "", {
|
|
83
83
|
parameter: "parameterName",
|
|
84
|
-
})
|
|
84
|
+
}),
|
|
85
85
|
).toBe("Parameter 'parameterName' is niet toegestaan");
|
|
86
86
|
});
|
|
87
87
|
|
|
@@ -91,7 +91,7 @@ describe("locale", () => {
|
|
|
91
91
|
const msg = locale.getMessage("non-existing");
|
|
92
92
|
expect(msg).toBe("non-existing");
|
|
93
93
|
expect(global.console.debug).toHaveBeenCalledWith(
|
|
94
|
-
"Message with id non-existing not found for locale de in layout translations"
|
|
94
|
+
"Message with id non-existing not found for locale de in layout translations",
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
const msgWithDefault = locale.getMessage("non-existing", "Default");
|
|
@@ -8,7 +8,7 @@ jest.mock(
|
|
|
8
8
|
messageWithParams: "Param 1: {param1}, Param 2: {param2}",
|
|
9
9
|
messageWithJavaParams: "Param 1: ${param1}, Param 2: ${param2}", // NOSONAR
|
|
10
10
|
}),
|
|
11
|
-
{ virtual: true }
|
|
11
|
+
{ virtual: true },
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
describe("locales", () => {
|
|
@@ -30,7 +30,9 @@ describe("locales", () => {
|
|
|
30
30
|
const locales = new Locales();
|
|
31
31
|
expect(locales.getPreferredLocale()).toBe("en");
|
|
32
32
|
expect(
|
|
33
|
-
locales.getPreferredLocale(
|
|
33
|
+
locales.getPreferredLocale(
|
|
34
|
+
"fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5",
|
|
35
|
+
),
|
|
34
36
|
).toBe("en");
|
|
35
37
|
});
|
|
36
38
|
|
|
@@ -45,10 +47,10 @@ describe("locales", () => {
|
|
|
45
47
|
const englishLocale = locales.getLocale("en");
|
|
46
48
|
|
|
47
49
|
expect(englishLocale.getMessage("testMessage", "exists")).toBe(
|
|
48
|
-
"testMessage"
|
|
50
|
+
"testMessage",
|
|
49
51
|
);
|
|
50
52
|
expect(englishLocale.getMessage("notPresent", "not exists")).toBe(
|
|
51
|
-
"not exists"
|
|
53
|
+
"not exists",
|
|
52
54
|
);
|
|
53
55
|
expect(englishLocale.getMessage("notPresent")).toBe("notPresent");
|
|
54
56
|
|
|
@@ -56,14 +58,14 @@ describe("locales", () => {
|
|
|
56
58
|
englishLocale.getMessage("messageWithParams", "default message", {
|
|
57
59
|
param1: "first parameter",
|
|
58
60
|
param2: "second parameter",
|
|
59
|
-
})
|
|
61
|
+
}),
|
|
60
62
|
).toBe("Param 1: first parameter, Param 2: second parameter");
|
|
61
63
|
|
|
62
64
|
expect(
|
|
63
65
|
englishLocale.getMessage("messageWithJavaParams", "default message", {
|
|
64
66
|
param1: "first parameter",
|
|
65
67
|
param2: "second parameter",
|
|
66
|
-
})
|
|
68
|
+
}),
|
|
67
69
|
).toBe("Param 1: first parameter, Param 2: second parameter");
|
|
68
70
|
|
|
69
71
|
expect(
|
|
@@ -73,12 +75,12 @@ describe("locales", () => {
|
|
|
73
75
|
{
|
|
74
76
|
param1: "first parameter",
|
|
75
77
|
param2: "second parameter",
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
+
},
|
|
79
|
+
),
|
|
78
80
|
).toBe("Param 1: first parameter, Param 2: second parameter");
|
|
79
81
|
|
|
80
82
|
expect(englishLocale.getMessage()).toBe(
|
|
81
|
-
"[message: id or defaultMessage missing]"
|
|
83
|
+
"[message: id or defaultMessage missing]",
|
|
82
84
|
);
|
|
83
85
|
});
|
|
84
86
|
|
|
@@ -90,7 +92,7 @@ describe("locales", () => {
|
|
|
90
92
|
});
|
|
91
93
|
|
|
92
94
|
expect(
|
|
93
|
-
customMessages.find((msg) => msg.code === "en").errors.customError
|
|
95
|
+
customMessages.find((msg) => msg.code === "en").errors.customError,
|
|
94
96
|
).toBe("Custom error message");
|
|
95
97
|
});
|
|
96
98
|
|
|
@@ -112,7 +114,7 @@ describe("locales", () => {
|
|
|
112
114
|
const locales = Locales.rehydrate(data);
|
|
113
115
|
|
|
114
116
|
expect(locales.getLocale("fr").getMessage("Login.Username")).toBe(
|
|
115
|
-
"Nom d'utilisateur"
|
|
117
|
+
"Nom d'utilisateur",
|
|
116
118
|
);
|
|
117
119
|
|
|
118
120
|
expect(locales.size).toBe(1);
|
|
@@ -124,12 +126,12 @@ describe("locales", () => {
|
|
|
124
126
|
locales.update("en", { newMessage: "New message" });
|
|
125
127
|
|
|
126
128
|
expect(locales.getLocale("en").getMessage("newMessage")).toBe(
|
|
127
|
-
"New message"
|
|
129
|
+
"New message",
|
|
128
130
|
);
|
|
129
131
|
|
|
130
132
|
locales.update("fr", { newMessage: "Nouveau message" });
|
|
131
133
|
expect(locales.getLocale("fr").getMessage("newMessage")).toBe(
|
|
132
|
-
"Nouveau message"
|
|
134
|
+
"Nouveau message",
|
|
133
135
|
);
|
|
134
136
|
});
|
|
135
137
|
});
|
|
@@ -13,7 +13,7 @@ type StateProps = {
|
|
|
13
13
|
+message: (
|
|
14
14
|
id: string,
|
|
15
15
|
defaultMessage: string,
|
|
16
|
-
placeholders: { ... }
|
|
16
|
+
placeholders: { ... },
|
|
17
17
|
) => string,
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -30,8 +30,8 @@ const getMessage = createSelector(
|
|
|
30
30
|
locales
|
|
31
31
|
.getLocale(localeCode)
|
|
32
32
|
.getMessage(id, defaultMessage, placeholders),
|
|
33
|
-
(...args) => JSON.stringify(args)
|
|
34
|
-
)
|
|
33
|
+
(...args) => JSON.stringify(args),
|
|
34
|
+
),
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
const mapStateToProps = (state: ReduxState): StateProps => ({
|
|
@@ -41,7 +41,7 @@ const mapStateToProps = (state: ReduxState): StateProps => ({
|
|
|
41
41
|
/**
|
|
42
42
|
*/
|
|
43
43
|
const withMessage: ComponentType<any> = connect<Props, {}, StateProps, _, _, _>(
|
|
44
|
-
mapStateToProps
|
|
44
|
+
mapStateToProps,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
export default withMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMessage.js","names":["_reactRedux","require","_reselect","_memoize","_interopRequireDefault","_i18n","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","_len","arguments","length","args","Array","_key","_stringify","default","mapStateToProps","state","message","withMessage","connect","_default","exports"],"sources":["../../src/i18n/withMessage.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nimport type { ReduxState } from \"../redux/types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n +message: (\n id: string,\n defaultMessage: string,\n placeholders: { ... }
|
|
1
|
+
{"version":3,"file":"withMessage.js","names":["_reactRedux","require","_reselect","_memoize","_interopRequireDefault","_i18n","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","_len","arguments","length","args","Array","_key","_stringify","default","mapStateToProps","state","message","withMessage","connect","_default","exports"],"sources":["../../src/i18n/withMessage.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nimport type { ReduxState } from \"../redux/types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n +message: (\n id: string,\n defaultMessage: string,\n placeholders: { ... },\n ) => string,\n};\n\ntype Props = {\n ...StateProps,\n ...\n};\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\nconst mapStateToProps = (state: ReduxState): StateProps => ({\n message: getMessage(state),\n});\n\n/**\n */\nconst withMessage: ComponentType<any> = connect<Props, {}, StateProps, _, _, _>(\n mapStateToProps,\n);\n\nexport default withMessage;\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAkBA,MAAMK,UAAU,GAAG,IAAAC,wBAAc,EAC/B,CAACC,gBAAU,EAAEC,eAAS,CAAC,EACvB,CAACC,OAAO,EAAEC,UAAU,KAClB,IAAAC,gBAAO,EACL,CAACC,EAAU,EAAEC,cAAuB,EAAEC,YAAqB,KACzDL,OAAO,CACJD,SAAS,CAACE,UAAU,CAAC,CACrBL,UAAU,CAACO,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC,EACjD;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAIC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAAA,OAAK,IAAAC,UAAA,CAAAC,OAAA,EAAeJ,IAAI,CAAC;AAAA,CACnC,CACJ,CAAC;AAED,MAAMK,eAAe,GAAIC,KAAiB,KAAkB;EAC1DC,OAAO,EAAEpB,UAAU,CAACmB,KAAK;AAC3B,CAAC,CAAC;;AAEF;AACA;AACA,MAAME,WAA+B,GAAG,IAAAC,mBAAO,EAC7CJ,eACF,CAAC;AAAC,IAAAK,QAAA,GAEaF,WAAW;AAAAG,OAAA,CAAAP,OAAA,GAAAM,QAAA"}
|
|
@@ -16,7 +16,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
16
16
|
const actionModels = [];
|
|
17
17
|
for (const actionData of actions) {
|
|
18
18
|
const actionContribution = actionsContributions.find(
|
|
19
|
-
(actionContribution) => actionContribution.name === actionData.name
|
|
19
|
+
(actionContribution) => actionContribution.name === actionData.name,
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
if (actionContribution) {
|
|
@@ -46,7 +46,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
46
46
|
const newCollection = new ActionCollection();
|
|
47
47
|
|
|
48
48
|
newCollection.collection = this.filter((action) =>
|
|
49
|
-
Array.isArray(type) ? type.includes(action.type) : action.type === type
|
|
49
|
+
Array.isArray(type) ? type.includes(action.type) : action.type === type,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
return newCollection;
|
|
@@ -59,7 +59,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
59
59
|
const newCollection = new ActionCollection();
|
|
60
60
|
|
|
61
61
|
newCollection.collection = this.filter((action) =>
|
|
62
|
-
action.layouthint.has(...hints)
|
|
62
|
+
action.layouthint.has(...hints),
|
|
63
63
|
);
|
|
64
64
|
|
|
65
65
|
return newCollection;
|
|
@@ -77,7 +77,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
77
77
|
*/
|
|
78
78
|
get routePath(): string {
|
|
79
79
|
const enabledRoutes = this.collection.filter(
|
|
80
|
-
(action) => !action.isDisabled
|
|
80
|
+
(action) => !action.isDisabled,
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
if (enabledRoutes.length === 0) {
|