@beinformed/ui 1.18.1 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/esm/builder/index.js.map +1 -1
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/constants/index.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/exceptions/index.js.map +1 -1
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/index.js.map +1 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/esm/i18n/types.js.map +1 -1
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/index.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +2 -2
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/modularui/index.js.map +1 -1
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/index.js.map +1 -1
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/index.js.map +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/contextPath.js.map +1 -1
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/index.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/index.js.map +1 -1
- package/esm/react-theme/types.js.map +1 -1
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/actions.js.map +1 -1
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_i18n/types.js.map +1 -1
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/_router/middleware.js.map +1 -1
- package/esm/redux/_router/reducer.js.map +1 -1
- package/esm/redux/_router/types.js.map +1 -1
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/actions/index.js.map +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/connectors/index.js.map +1 -1
- package/esm/redux/index.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/reducers/index.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/types.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js.map +1 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/lib/i18n/types.js.map +1 -1
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +2 -2
- package/lib/models/list/ListModel.js.flow +1 -2
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js.map +1 -1
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js.map +1 -1
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js.map +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/contextPath.js.map +1 -1
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js.map +1 -1
- package/lib/react-theme/types.js.map +1 -1
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_i18n/types.js.map +1 -1
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/_router/types.js.map +1 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/index.js.map +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js.map +1 -1
- package/lib/redux/index.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js.map +1 -1
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/redux/types.js.map +1 -1
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/types.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +7 -7
- package/src/models/list/ListModel.js +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react-server/serverUtil.js"],"names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","getSetting","IllegalArgumentException","createReduxStore","requestHref","customReducers","history","initialEntries","toString","store","setI18n","locales","request","Array","isArray","mergedLocales","locale","code","customLocale","custLocale","forEach","some","push","enabledLocales","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","Error","handleErrors","state","getState","error","shouldThrowOnServer","dehydrate","filteredState","modularui","reduce","obj","key","status","model","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"mappings":";;;;;;;;;;;;;;;;;;AACA,SAASA,mBAAT,QAAoC,SAApC;AACA,SAASC,GAAT,QAAoB,0BAApB;AACA,OAAOC,SAAP,MAAsB,WAAtB;AAEA,OAAOC,cAAP,MAA2B,+BAA3B;AAEA,SAASC,gBAAT,QAAiC,iBAAjC;AACA,OAAOC,OAAP,MAAoB,iBAApB;AAEA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,UAAT,QAA2B,wBAA3B;AAEA,SACEC,mBADF,EAEEC,kBAFF,EAGEC,aAHF,EAIEC,0BAJF,EAKEC,mBALF,QAMO,8BANP;AAQA,SAASC,UAAT,QAA2B,uBAA3B;AAEA,SAASC,wBAAT,QAAyC,eAAzC;;AAaA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CACvBC,WADuB,EAEvBC,cAFuB,EAGR;AACf;AACA,MAAMC,OAAsB,GAAGlB,mBAAmB,CAAC;AACjDmB,IAAAA,cAAc,EAAE,CAACH,WAAW,CAACI,QAAZ,EAAD;AADiC,GAAD,CAAlD;;AAIA,wBAAkBjB,cAAc,CAACe,OAAD,EAAUD,cAAV,CAAhC;AAAA,MAAQI,KAAR,mBAAQA,KAAR;;AAEA,SAAOA,KAAP;AACD,CAZD;AAcA;AACA;;;AACA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CACdD,KADc,EAIX;AAAA,MAFHE,OAEG,uEAFmC,EAEnC;AAAA,MADHC,OACG;;AACH,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,OAAd,CAAL,EAA6B;AAC3B,UAAM,IAAIT,wBAAJ,CAA6B,qCAA7B,CAAN;AACD;;AACD,MAAI,CAACU,OAAL,EAAc;AACZ,UAAM,IAAIV,wBAAJ,CAA6B,0BAA7B,CAAN;AACD;;AA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,GAAhB,EAAqBE,KAArB,CAA2BP,SAA3B,EADG,GAEH,KAAK;AAJA,OAAX;AAOA,aAAOI,GAAP;AACD,KATU,EASR,EATQ;AAFM,IAAnB;;AAcA,SAAO,gBAAeH,aAAf,EAA8BO,OAA9B,CAAsC,IAAtC,EAA4C,SAA5C,CAAP;AACD,CAlBD;AAoBA;AACA;;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CACjBC,KADiB,EAEjBC,IAFiB,EAGjBC,aAHiB,EAIN;AACX,MAAMC,KAAK,GAAGH,KAAK,CAACI,YAAN,EAAd;AACA,MAAMC,IAAI,GAAGH,aAAa,sBAAOA,aAAa,CAACI,MAAd,CAAqBD,IAA5B,IAAoC,EAA9D;;AAEA,MAAIH,aAAJ,EAAmB;AACjB,2CACKA,aAAa,CAACI,MADnB;AAEEH,MAAAA,KAAK,EAALA,KAFF;AAGEE,MAAAA,IAAI,EAAJA;AAHF;AAKD;;AAED,SAAO;AACLF,IAAAA,KAAK,EAALA,KADK;AAELE,IAAAA,IAAI,EAAJA;AAFK,GAAP;AAID,CApBD;;AAsBA,SACE7D,gBADF,EAEEO,OAFF,EAGEuB,oBAHF,EAIEG,qBAJF,EAKEsB,UALF,EAMEd,YANF,EAOEK,SAPF","sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/actions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getSetting(\"ENABLED_LOCALES\").includes(locale.code)\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`\n );\n }\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const filteredState = {\n ...state,\n modularui: Object.keys(state.modularui).reduce((obj, key) => {\n obj[key] = {\n status: state.modularui[key].status,\n model: state.modularui[key].model\n ? state.modularui[key].model.dehydrate()\n : void 0,\n };\n\n return obj;\n }, {}),\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"file":"serverUtil.js"}
|
|
1
|
+
{"version":3,"file":"serverUtil.js","names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","getSetting","IllegalArgumentException","createReduxStore","requestHref","customReducers","history","initialEntries","toString","store","setI18n","locales","request","Array","isArray","mergedLocales","locale","code","customLocale","custLocale","forEach","some","push","enabledLocales","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","Error","handleErrors","state","getState","error","shouldThrowOnServer","dehydrate","filteredState","modularui","reduce","obj","key","status","model","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"sources":["../../src/react-server/serverUtil.js"],"sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/actions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getSetting(\"ENABLED_LOCALES\").includes(locale.code)\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`\n );\n }\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const filteredState = {\n ...state,\n modularui: Object.keys(state.modularui).reduce((obj, key) => {\n obj[key] = {\n status: state.modularui[key].status,\n model: state.modularui[key].model\n ? state.modularui[key].model.dehydrate()\n : void 0,\n };\n\n return obj;\n }, {}),\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AACA,SAASA,mBAAT,QAAoC,SAApC;AACA,SAASC,GAAT,QAAoB,0BAApB;AACA,OAAOC,SAAP,MAAsB,WAAtB;AAEA,OAAOC,cAAP,MAA2B,+BAA3B;AAEA,SAASC,gBAAT,QAAiC,iBAAjC;AACA,OAAOC,OAAP,MAAoB,iBAApB;AAEA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,UAAT,QAA2B,wBAA3B;AAEA,SACEC,mBADF,EAEEC,kBAFF,EAGEC,aAHF,EAIEC,0BAJF,EAKEC,mBALF,QAMO,8BANP;AAQA,SAASC,UAAT,QAA2B,uBAA3B;AAEA,SAASC,wBAAT,QAAyC,eAAzC;;AAaA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CACvBC,WADuB,EAEvBC,cAFuB,EAGR;EACf;EACA,IAAMC,OAAsB,GAAGlB,mBAAmB,CAAC;IACjDmB,cAAc,EAAE,CAACH,WAAW,CAACI,QAAZ,EAAD;EADiC,CAAD,CAAlD;;EAIA,sBAAkBjB,cAAc,CAACe,OAAD,EAAUD,cAAV,CAAhC;EAAA,IAAQI,KAAR,mBAAQA,KAAR;;EAEA,OAAOA,KAAP;AACD,CAZD;AAcA;AACA;;;AACA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CACdD,KADc,EAIX;EAAA,IAFHE,OAEG,uEAFmC,EAEnC;EAAA,IADHC,OACG;;EACH,IAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,OAAd,CAAL,EAA6B;IAC3B,MAAM,IAAIT,wBAAJ,CAA6B,qCAA7B,CAAN;EACD;;EACD,IAAI,CAACU,OAAL,EAAc;IACZ,MAAM,IAAIV,wBAAJ,CAA6B,0BAA7B,CAAN;EACD;;EAED,IAAMa,aAAa,GAAG,qBAAAvB,gBAAgB,MAAhB,CAAAA,g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IAAtC,EAA4C,SAA5C,CAAP;AACD,CAlBD;AAoBA;AACA;;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CACjBC,KADiB,EAEjBC,IAFiB,EAGjBC,aAHiB,EAIN;EACX,IAAMC,KAAK,GAAGH,KAAK,CAACI,YAAN,EAAd;EACA,IAAMC,IAAI,GAAGH,aAAa,sBAAOA,aAAa,CAACI,MAAd,CAAqBD,IAA5B,IAAoC,EAA9D;;EAEA,IAAIH,aAAJ,EAAmB;IACjB,uCACKA,aAAa,CAACI,MADnB;MAEEH,KAAK,EAALA,KAFF;MAGEE,IAAI,EAAJA;IAHF;EAKD;;EAED,OAAO;IACLF,KAAK,EAALA,KADK;IAELE,IAAI,EAAJA;EAFK,CAAP;AAID,CApBD;;AAsBA,SACE7D,gBADF,EAEEO,OAFF,EAGEuB,oBAHF,EAIEG,qBAJF,EAKEsB,UALF,EAMEd,YANF,EAOEK,SAPF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","names":["useSelector","ThemeProvider","SCThemeProvider","createTheme","theme","children","storedTheme","preferences","finalTheme","displayName"],"sources":["../../src/react-theme/ThemeProvider.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { ThemeProvider as SCThemeProvider } from \"styled-components\";\n\nimport createTheme from \"./createTheme\";\n\nimport type { Node } from \"react\";\nimport type { Theme } from \"./types\";\n\nexport type Props = {\n +theme: Theme | Array<Theme>,\n +children: Node,\n};\n\n/**\n */\nconst ThemeProvider = ({ theme, children }: Props): Node => {\n const storedTheme = useSelector(({ preferences }) => preferences.theme);\n const finalTheme = createTheme(storedTheme, theme);\n\n return <SCThemeProvider theme={finalTheme}>{children}</SCThemeProvider>;\n};\nThemeProvider.displayName = \"BI.ThemeProvider\";\n\nexport default ThemeProvider;\n"],"mappings":"AACA,SAASA,WAAT,QAA4B,aAA5B;AACA,SAASC,aAAa,IAAIC,eAA1B,QAAiD,mBAAjD;AAEA,OAAOC,WAAP,MAAwB,eAAxB;;;AAUA;AACA;AACA,IAAMF,aAAa,GAAG,SAAhBA,aAAgB,OAAsC;EAAA,IAAnCG,KAAmC,QAAnCA,KAAmC;EAAA,IAA5BC,QAA4B,QAA5BA,QAA4B;EAC1D,IAAMC,WAAW,GAAGN,WAAW,CAAC;IAAA,IAAGO,WAAH,SAAGA,WAAH;IAAA,OAAqBA,WAAW,CAACH,KAAjC;EAAA,CAAD,CAA/B;EACA,IAAMI,UAAU,GAAGL,WAAW,CAACG,WAAD,EAAcF,KAAd,CAA9B;EAEA,oBAAO,KAAC,eAAD;IAAiB,KAAK,EAAEI,UAAxB;IAAA,UAAqCH;EAArC,EAAP;AACD,CALD;;AAMAJ,aAAa,CAACQ,WAAd,GAA4B,kBAA5B;AAEA,eAAeR,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"createTheme.js","names":["flattenDeep","isPlainObject","setSettings","replacePlaceholders","inputTheme","possibleKeys","key","join","re","RegExp","forEach","value","replace","match","capture","generateTheme","storedTheme","generatedTheme","themeElements","element","createTheme","themeConfigs","customTheme","settings"],"sources":["../../src/react-theme/createTheme.js"],"sourcesContent":["// @flow\nimport flattenDeep from \"lodash/flattenDeep\";\n\nimport { isPlainObject } from \"../utils/helpers/objects\";\n\nimport { setSettings } from \"../constants/Settings\";\n\nimport type { Theme } from \"./types\";\n\nconst replacePlaceholders = (inputTheme) => {\n const possibleKeys = Object.keys(inputTheme)\n .map((key) => `\\\\b${key}\\\\b`)\n .join(\"|\");\n\n const re = new RegExp(`\\\\$(${possibleKeys})`, \"g\");\n Object.entries(inputTheme).forEach(([key, value]) => {\n if (typeof value === \"string\") {\n inputTheme[key] = value.replace(\n re,\n (match, capture) => inputTheme[capture]\n );\n }\n });\n\n return inputTheme;\n};\n\nconst generateTheme = (storedTheme, ...themeElements) => {\n let generatedTheme = {};\n for (const element of themeElements) {\n if (typeof element === \"function\") {\n generatedTheme = element(replacePlaceholders(generatedTheme));\n } else if (isPlainObject(element)) {\n generatedTheme = { ...generatedTheme, ...element, ...storedTheme };\n }\n }\n\n // final - replace any assignments inside the theme\n return replacePlaceholders(generatedTheme);\n};\n\n/**\n * Create a theme from multiple theme configuration objects.\n * Properties are overwriten by iterating the configuration objects from left to right.\n *\n * The first argument represents a stored theme part, this is optional. The stored theme part will overwrite every part in the collection of theme parts.\n * Thus a stored configuration is leading as it can be configured by a modeller through the repository.\n *\n * Placeholders can be used, they are replaced before calling a function theme part or at the end of the theme creation.\n *\n * Both objects and function can be used, where a function receives the previous objects as input arguments.\n * For example using the method createTheme(ThemeObject, ThemeObject2, ThemeFunction, ThemeFunction2), will be handled as:\n *\n * ThemeFunction2(ThemeFunction1({ ...ThemeObject, ...ThemeObject2 }))\n *\n * @example\n * Example where the primary color of the default theme is overwritten with a primary color of the custom theme,\n * but the button bg still uses the yiq function of the default theme:\n *\n * const DefaultTheme = {\n * PRIMARY_COLOR: \"#0000ff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * BUTTON_COLOR: \"$PRIMARY_COLOR\"\n * }\n *\n * const createDefaultTheme = (input) => ({\n * ...input,\n * BUTTON_BG: getContrastYIQ(input.BUTTON_COLOR)\n * })\n *\n * const CustomTheme = {\n * PRIMARY_COLOR: \"#ff0000\"\n * }\n *\n * createTheme(null, DefaultTheme, CustomTheme, createDefaultTheme);\n *\n * // Result:\n * {\n * PRIMARY_COLOR: \"#ff0000\",\n * BUTTON_COLOR: \"#ff0000\",\n * BUTTON_BG: \"#fff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * }\n */\nconst createTheme = (\n storedTheme: Theme,\n ...themeConfigs: Array<Theme | Array<Theme>>\n):\n | any\n | {}\n | {\n INPUT_FOCUS_BORDER_COLOR?: string,\n LINK_HOVER_COLOR?: string,\n PAGING_HOVER_COLOR?: string,\n settings?: { [settingName: string]: string },\n } => {\n const customTheme = generateTheme(storedTheme, ...flattenDeep(themeConfigs));\n\n if (customTheme) {\n setSettings(customTheme.settings);\n }\n\n return customTheme;\n};\n\nexport default createTheme;\n"],"mappings":";;;;;;;;;;;;;;;;AACA,OAAOA,WAAP,MAAwB,oBAAxB;AAEA,SAASC,aAAT,QAA8B,0BAA9B;AAEA,SAASC,WAAT,QAA4B,uBAA5B;;AAIA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,UAAD,EAAgB;EAAA;;EAC1C,IAAMC,YAAY,GAAG,6CAAYD,UAAZ,kBACd,UAACE,GAAD;IAAA,oBAAeA,GAAf;EAAA,CADc,EAElBC,IAFkB,CAEb,GAFa,CAArB;;EAIA,IAAMC,EAAE,GAAG,IAAIC,MAAJ,eAAkBJ,YAAlB,QAAmC,GAAnC,CAAX;;EACA,gBAAeD,UAAf,EAA2BM,OAA3B,CAAmC,gBAAkB;IAAA;IAAA,IAAhBJ,GAAgB;IAAA,IAAXK,KAAW;;IACnD,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;MAC7BP,UAAU,CAACE,GAAD,CAAV,GAAkBK,KAAK,CAACC,OAAN,CAChBJ,EADgB,EAEhB,UAACK,KAAD,EAAQC,OAAR;QAAA,OAAoBV,UAAU,CAACU,OAAD,CAA9B;MAAA,CAFgB,CAAlB;IAID;EACF,CAPD;;EASA,OAAOV,UAAP;AACD,CAhBD;;AAkBA,IAAMW,aAAa,GAAG,SAAhBA,aAAgB,CAACC,WAAD,EAAmC;EACvD,IAAIC,cAAc,GAAG,EAArB;;EADuD,kCAAlBC,aAAkB;IAAlBA,aAAkB;EAAA;;EAEvD,kCAAsBA,aAAtB,oCAAqC;IAAhC,IAAMC,OAAO,qBAAb;;IACH,IAAI,OAAOA,OAAP,KAAmB,UAAvB,EAAmC;MACjCF,cAAc,GAAGE,OAAO,CAAChB,mBAAmB,CAACc,cAAD,CAApB,CAAxB;IACD,CAFD,MAEO,IAAIhB,aAAa,CAACkB,OAAD,CAAjB,EAA4B;MACjCF,cAAc,iDAAQA,cAAR,GAA2BE,OAA3B,GAAuCH,WAAvC,CAAd;IACD;EACF,CARsD,CAUvD;;;EACA,OAAOb,mBAAmB,CAACc,cAAD,CAA1B;AACD,CAZD;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAMG,WAAW,GAAG,SAAdA,WAAc,CAClBJ,WADkB,EAWX;EAAA;;EAAA,mCATJK,YASI;IATJA,YASI;EAAA;;EACP,IAAMC,WAAW,GAAGP,aAAa,MAAb,8CAAcC,WAAd,sCAA8BhB,WAAW,CAACqB,YAAD,CAAzC,GAApB;;EAEA,IAAIC,WAAJ,EAAiB;IACfpB,WAAW,CAACoB,WAAW,CAACC,QAAb,CAAX;EACD;;EAED,OAAOD,WAAP;AACD,CAnBD;;AAqBA,eAAeF,WAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","createTheme","ThemeProvider"],"sources":["../../src/react-theme/index.js"],"sourcesContent":["// @flow\nexport { default as createTheme } from \"./createTheme\";\nexport { default as ThemeProvider } from \"./ThemeProvider\";\n\nexport * from \"./useTheme\";\n\nexport * from \"./utils/themeProps\";\n\nexport * from \"./utils/background\";\nexport * from \"./utils/colors\";\nexport * from \"./utils/contrast\";\nexport * from \"./utils/corners\";\nexport * from \"./utils/spacers\";\n\nexport type * from \"./types\";\n"],"mappings":"AACA,SAASA,OAAO,IAAIC,WAApB,QAAuC,eAAvC;AACA,SAASD,OAAO,IAAIE,aAApB,QAAyC,iBAAzC;AAEA,cAAc,YAAd;AAEA,cAAc,oBAAd;AAEA,cAAc,oBAAd;AACA,cAAc,gBAAd;AACA,cAAc,kBAAd;AACA,cAAc,iBAAd;AACA,cAAc,iBAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/react-theme/types.js"],"sourcesContent":["// @flow\nexport type ThemePropValue =\n | string\n | number\n | { [key: string]: ThemePropValue, ... };\n\nexport type UtilThemeProps = {\n theme: Theme,\n ...\n};\n\nexport type Theme = {\n settings: { [settingName: string]: string },\n [key: string]: ThemePropValue,\n ...\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useTheme.js","names":["useContext","ThemeContext","useTheme"],"sources":["../../src/react-theme/useTheme.js"],"sourcesContent":["// @flow\nimport { useContext } from \"react\";\nimport { ThemeContext } from \"styled-components\";\n\nimport type { Theme } from \"./types\";\n\n/**\n */\nconst useTheme = (): Theme => {\n return useContext(ThemeContext);\n};\n\nexport { useTheme };\n"],"mappings":"AACA,SAASA,UAAT,QAA2B,OAA3B;AACA,SAASC,YAAT,QAA6B,mBAA7B;;AAIA;AACA;AACA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,GAAa;EAC5B,OAAOF,UAAU,CAACC,YAAD,CAAjB;AACD,CAFD;;AAIA,SAASC,QAAT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"background.js","names":["getThemeProp","renderBackground","path","defaultValue","theme","value"],"sources":["../../../src/react-theme/utils/background.js"],"sourcesContent":["// @flow\nimport { getThemeProp } from \"./themeProps\";\n\nimport type { ThemePropValue, UtilThemeProps } from \"../types\";\n\n/**\n */\nconst renderBackground =\n (path: string, defaultValue?: string): ((UtilThemeProps) => ThemePropValue) =>\n ({ theme }: UtilThemeProps) => {\n const value = getThemeProp(theme, path, defaultValue);\n\n if (typeof value === \"string\") {\n return `background: ${value}`;\n }\n\n return value;\n };\n\nexport { renderBackground };\n"],"mappings":"AACA,SAASA,YAAT,QAA6B,cAA7B;;AAIA;AACA;AACA,IAAMC,gBAAgB,GACpB,SADIA,gBACJ,CAACC,IAAD,EAAeC,YAAf;EAAA,OACA,gBAA+B;IAAA,IAA5BC,KAA4B,QAA5BA,KAA4B;IAC7B,IAAMC,KAAK,GAAGL,YAAY,CAACI,KAAD,EAAQF,IAAR,EAAcC,YAAd,CAA1B;;IAEA,IAAI,OAAOE,KAAP,KAAiB,QAArB,EAA+B;MAC7B,6BAAsBA,KAAtB;IACD;;IAED,OAAOA,KAAP;EACD,CATD;AAAA,CADF;;AAYA,SAASJ,gBAAT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"colors.js","names":["darken","hsl","lighten","parseToHsl","getThemeProp","darkenColor","amount","path","defaultValue","theme","lightenColor","changeHSL","color","saturation","lightness","hueAdjustment","hue"],"sources":["../../../src/react-theme/utils/colors.js"],"sourcesContent":["// @flow\nimport { darken, hsl, lighten, parseToHsl } from \"polished\";\nimport { getThemeProp } from \"./themeProps\";\n\nimport type { UtilThemeProps } from \"../types\";\n\n/*\n * Themed color x amount darkened\n */\n/**\n */\nconst darkenColor =\n (\n amount: number | string,\n path: string,\n defaultValue?: string\n ): ((UtilThemeProps) => string) =>\n ({ theme }: UtilThemeProps) =>\n darken(amount, getThemeProp(theme, path, defaultValue));\n\n/*\n * Themed color x amount lightened\n */\n/**\n */\nconst lightenColor =\n (\n amount: number | string,\n path: string,\n defaultValue?: string\n ): ((UtilThemeProps) => string) =>\n ({ theme }: UtilThemeProps) =>\n lighten(amount, getThemeProp(theme, path, defaultValue));\n\n/*\n * Make a color lighter or darker in the same color family\n */\n/**\n */\nconst changeHSL = (\n color: string,\n saturation?: number,\n lightness?: number,\n hueAdjustment: number = 0\n): string => hsl(parseToHsl(color).hue + hueAdjustment, saturation, lightness);\n\nexport { darkenColor, lightenColor, changeHSL };\n"],"mappings":"AACA,SAASA,MAAT,EAAiBC,GAAjB,EAAsBC,OAAtB,EAA+BC,UAA/B,QAAiD,UAAjD;AACA,SAASC,YAAT,QAA6B,cAA7B;;AAIA;AACA;AACA;;AACA;AACA;AACA,IAAMC,WAAW,GACf,SADIA,WACJ,CACEC,MADF,EAEEC,IAFF,EAGEC,YAHF;EAAA,OAKA;IAAA,IAAGC,KAAH,QAAGA,KAAH;IAAA,OACET,MAAM,CAACM,MAAD,EAASF,YAAY,CAACK,KAAD,EAAQF,IAAR,EAAcC,YAAd,CAArB,CADR;EAAA,CALA;AAAA,CADF;AASA;AACA;AACA;;AACA;AACA;;;AACA,IAAME,YAAY,GAChB,SADIA,YACJ,CACEJ,MADF,EAEEC,IAFF,EAGEC,YAHF;EAAA,OAKA;IAAA,IAAGC,KAAH,SAAGA,KAAH;IAAA,OACEP,OAAO,CAACI,MAAD,EAASF,YAAY,CAACK,KAAD,EAAQF,IAAR,EAAcC,YAAd,CAArB,CADT;EAAA,CALA;AAAA,CADF;AASA;AACA;AACA;;AACA;AACA;;;AACA,IAAMG,SAAS,GAAG,SAAZA,SAAY,CAChBC,KADgB,EAEhBC,UAFgB,EAGhBC,SAHgB;EAAA,IAIhBC,aAJgB,uEAIQ,CAJR;EAAA,OAKLd,GAAG,CAACE,UAAU,CAACS,KAAD,CAAV,CAAkBI,GAAlB,GAAwBD,aAAzB,EAAwCF,UAAxC,EAAoDC,SAApD,CALE;AAAA,CAAlB;;AAOA,SAAST,WAAT,EAAsBK,YAAtB,EAAoCC,SAApC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"contrast.js","names":["getLuminance","parseToRgb","getThemeStringProp","getProp","ThemePropertyException","getColorContrast","color1","color2","luminance1","luminance2","parseFloat","toFixed","getYIQ","color","rgb","red","green","blue","getContrastYIQ","dark","light","preferredColor","yiqColor","darkColor","lightColor","getBackgroundColor","theme","bgColorProperty","defaultValue","bgColor","backgroundColor","renderContrastColor","preferredColorProperty","standardDarkProperty","standardLightProperty"],"sources":["../../../src/react-theme/utils/contrast.js"],"sourcesContent":["// @flow\nimport { getLuminance, parseToRgb } from \"polished\";\n\nimport { getThemeStringProp, getProp } from \"./themeProps\";\n\nimport { ThemePropertyException } from \"../../exceptions\";\n\nimport type { Theme, UtilThemeProps } from \"../types\";\n\n/**\n * calculate the contrast ratio of two colors\n */\nconst getColorContrast = (color1: string, color2: string): number => {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return parseFloat(\n (luminance1 > luminance2\n ? (luminance1 + 0.05) / (luminance2 + 0.05)\n : (luminance2 + 0.05) / (luminance1 + 0.05)\n ).toFixed(2)\n );\n};\n\n/*\n * The YIQ equation converts the RGB color (0 to 255) into a YIQ color space.\n * YIQ is the standard formula for calculating the perceived brightness of a color,\n * and is recommended by the World Wide Web Consortium (W3C).\n */\n/**\n */\nconst getYIQ = (color: string): number => {\n const rgb = parseToRgb(color);\n\n return (rgb.red * 299 + rgb.green * 587 + rgb.blue * 114) / 1000;\n};\n\n/**\n * Get dark or light color, depending on the given color\n * When the contrast between the color and the light or dark color is too low,\n * the preferred color is returned\n */\nconst getContrastYIQ = (\n color: string,\n dark: string = \"#212529\",\n light: string = \"#fff\",\n preferredColor?: string\n): string => {\n const yiqColor = getYIQ(color);\n\n if (preferredColor && getColorContrast(color, preferredColor) >= 4.5) {\n return preferredColor;\n }\n\n const darkColor = getYIQ(dark) < 127.5 ? dark : \"#212529\";\n const lightColor = getYIQ(light) > 127.5 ? light : \"#fff\";\n\n if (yiqColor > 127.5) {\n if (getColorContrast(color, darkColor) < 3) {\n return \"#212529\";\n }\n\n return darkColor;\n }\n\n if (getColorContrast(color, lightColor) < 3) {\n return \"#fff\";\n }\n return lightColor;\n};\n\n/**\n */\nconst getBackgroundColor = (\n theme: Theme,\n bgColorProperty: string,\n defaultValue: string\n) => {\n let bgColor = getProp(theme, bgColorProperty, defaultValue);\n\n if (typeof bgColor === \"object\") {\n bgColor = bgColor?.backgroundColor ?? defaultValue;\n }\n\n if (typeof bgColor === \"string\") {\n return bgColor;\n }\n\n throw new ThemePropertyException(\n `${bgColorProperty} is not a string, but: ${typeof bgColor}`\n );\n};\n\n/**\n * Retrieve the contrast color for the given background property,\n * based on theme properties\n */\nconst renderContrastColor =\n (\n bgColorProperty: string,\n preferredColorProperty?: string,\n standardDarkProperty: string = \"YIQ_DARK_COLOR\",\n standardLightProperty: string = \"YIQ_LIGHT_COLOR\"\n ): ((UtilThemeProps) => string) =>\n ({ theme = {} }: UtilThemeProps) => {\n const bgColor = getBackgroundColor(theme, bgColorProperty, \"#ffffff\");\n const preferredColor = getThemeStringProp(theme, preferredColorProperty);\n const darkColor = getThemeStringProp(\n theme,\n standardDarkProperty,\n \"#212529\"\n );\n const lightColor = getThemeStringProp(theme, standardLightProperty, \"#fff\");\n\n return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);\n };\n\nexport { getColorContrast, getYIQ, getContrastYIQ, renderContrastColor };\n"],"mappings":";;AACA,SAASA,YAAT,EAAuBC,UAAvB,QAAyC,UAAzC;AAEA,SAASC,kBAAT,EAA6BC,OAA7B,QAA4C,cAA5C;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAIA;AACA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,MAAD,EAAiBC,MAAjB,EAA4C;EACnE,IAAMC,UAAU,GAAGR,YAAY,CAACM,MAAD,CAA/B;EACA,IAAMG,UAAU,GAAGT,YAAY,CAACO,MAAD,CAA/B;EACA,OAAOG,UAAU,CACf,CAACF,UAAU,GAAGC,UAAb,GACG,CAACD,UAAU,GAAG,IAAd,KAAuBC,UAAU,GAAG,IAApC,CADH,GAEG,CAACA,UAAU,GAAG,IAAd,KAAuBD,UAAU,GAAG,IAApC,CAFJ,EAGEG,OAHF,CAGU,CAHV,CADe,CAAjB;AAMD,CATD;AAWA;AACA;AACA;AACA;AACA;;AACA;AACA;;;AACA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD,EAA2B;EACxC,IAAMC,GAAG,GAAGb,UAA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mB,QAAvB,EAAiC;IAAA;;IAC/BA,OAAO,wCAAGA,OAAH,6CAAG,SAASC,eAAZ,yEAA+BF,YAAtC;EACD;;EAED,IAAI,OAAOC,OAAP,KAAmB,QAAvB,EAAiC;IAC/B,OAAOA,OAAP;EACD;;EAED,MAAM,IAAIzB,sBAAJ,8CACDuB,eADC,qDAC+CE,OAD/C,GAAN;AAGD,CAlBD;AAoBA;AACA;AACA;AACA;;;AACA,IAAME,mBAAmB,GACvB,SADIA,mBACJ,CACEJ,eADF,EAEEK,sBAFF;EAAA,IAGEC,oBAHF,uEAGiC,gBAHjC;EAAA,IAIEC,qBAJF,uEAIkC,iBAJlC;EAAA,OAMA,gBAAoC;IAAA,sBAAjCR,KAAiC;IAAA,IAAjCA,KAAiC,2BAAzB,EAAyB;IAClC,IAAMG,OAAO,GAAGJ,kBAAkB,CAACC,KAAD,EAAQC,eAAR,EAAyB,SAAzB,CAAlC;IACA,IAAMN,cAAc,GAAGnB,kBAAkB,CAACwB,KAAD,EAAQM,sBAAR,CAAzC;IACA,IAAMT,SAAS,GAAGrB,kBAAkB,CAClCwB,KADkC,EAElCO,oBAFkC,EAGlC,SAHkC,CAApC;IAKA,IAAMT,UAAU,GAAGtB,kBAAkB,CAACwB,KAAD,EAAQQ,qBAAR,EAA+B,MAA/B,CAArC;IAEA,OAAOhB,cAAc,CAACW,OAAD,EAAUN,SAAV,EAAqBC,UAArB,EAAiCH,cAAjC,CAArB;EACD,CAjBD;AAAA,CADF;;AAoBA,SAAShB,gBAAT,EAA2BO,MAA3B,EAAmCM,cAAnC,EAAmDa,mBAAnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"corners.js","names":["getThemeStringProp","DEFAULT_CORNER_PROPERTY","roundedCorners","property","path","defaultValue","theme","ROUNDED_CORNERS","propertyName"],"sources":["../../../src/react-theme/utils/corners.js"],"sourcesContent":["// @flow\nimport { getThemeStringProp } from \"./themeProps\";\n\nimport type { UtilThemeProps } from \"../types\";\n\nconst DEFAULT_CORNER_PROPERTY = \"border-radius\";\n\n/*\n * Border radius based on the theme setting for rounded corners\n * When ROUNDED_CORNERS is not true in the theme, no rounded corners are returned\n */\n/**\n */\nconst roundedCorners =\n (\n property: string = DEFAULT_CORNER_PROPERTY,\n path: string = \"BORDER_RADIUS\",\n defaultValue: string = \"0.25rem\"\n ): ((UtilThemeProps) => string) =>\n ({ theme = {} }: UtilThemeProps) => {\n if (theme.ROUNDED_CORNERS) {\n const propertyName =\n property && property !== DEFAULT_CORNER_PROPERTY\n ? `border-${property}-radius`\n : DEFAULT_CORNER_PROPERTY;\n\n return `${propertyName}: ${getThemeStringProp(\n theme,\n path,\n defaultValue\n )}`;\n }\n\n return \"\";\n };\n\nexport { roundedCorners };\n"],"mappings":";AACA,SAASA,kBAAT,QAAmC,cAAnC;AAIA,IAAMC,uBAAuB,GAAG,eAAhC;AAEA;AACA;AACA;AACA;;AACA;AACA;;AACA,IAAMC,cAAc,GAClB,SADIA,cACJ;EAAA,IACEC,QADF,uEACqBF,uBADrB;EAAA,IAEEG,IAFF,uEAEiB,eAFjB;EAAA,IAGEC,YAHF,uEAGyB,SAHzB;EAAA,OAKA,gBAAoC;IAAA,sBAAjCC,KAAiC;IAAA,IAAjCA,KAAiC,2BAAzB,EAAyB;;IAClC,IAAIA,KAAK,CAACC,eAAV,EAA2B;MAAA;;MACzB,IAAMC,YAAY,GAChBL,QAAQ,IAAIA,QAAQ,KAAKF,uBAAzB,oBACcE,QADd,eAEIF,uBAHN;MAKA,oDAAUO,YAAV,wBAA2BR,kBAAkB,CAC3CM,KAD2C,EAE3CF,IAF2C,EAG3CC,YAH2C,CAA7C;IAKD;;IAED,OAAO,EAAP;EACD,CApBD;AAAA,CADF;;AAuBA,SAASH,cAAT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"spacers.js","names":["Big","IllegalArgumentException","IllegalStateException","getSize","theme","ratio","path","unit","size","times","spacer","spacers","ratios","join","gutter"],"sources":["../../../src/react-theme/utils/spacers.js"],"sourcesContent":["// @flow\nimport Big from \"big.js\";\n\nimport type { Theme, UtilThemeProps } from \"../types\";\nimport IllegalArgumentException from \"../../exceptions/IllegalArgumentException\";\nimport IllegalStateException from \"../../exceptions/IllegalStateException\";\n\n/**\n */\nconst getSize = (\n theme: Theme,\n ratio: number | string = 1,\n path: string = \"SPACER\",\n unit: string = \"rem\"\n) => {\n if (typeof ratio === \"string\") {\n return ratio;\n }\n\n if (typeof ratio === \"number\") {\n if (typeof theme[path] === \"number\") {\n const size = Big(ratio).times(theme[path]);\n return `${size}${unit}`;\n }\n throw new IllegalStateException(`Size ${path} must be a number`);\n }\n\n throw new IllegalArgumentException(\n `Ratio ${JSON.stringify(ratio)} must be a string or number`\n );\n};\n\n/*\n * Render spacers based on the given ratio * theme SPACER\n */\n/**\n */\nconst spacer =\n (ratio: number = 1): ((UtilThemeProps) => string) =>\n ({ theme = {} }: UtilThemeProps) =>\n getSize(theme, ratio);\n\n/*\n * Render spacers based on the given ratio * theme SPACER\n * Ratio's can be given clockwise with shorthand,\n * spacers(0.5, 1) with a spacer of 0.8 will give \"0.4rem 1rem\";\n */\n/**\n */\nconst spacers =\n (...ratios: Array<number | \"auto\">): ((UtilThemeProps) => string) =>\n ({ theme = {} }: UtilThemeProps) =>\n ratios.map((ratio) => getSize(theme, ratio)).join(\" \");\n\n/*\n * Render a gutter based on GUTTER property\n */\n/**\n */\nconst gutter =\n (ratio: number = 1): ((UtilThemeProps) => string) =>\n ({ theme = {} }: UtilThemeProps) =>\n getSize(theme, ratio, \"GRID_GUTTER\", \"px\");\n\nexport { spacer, spacers, gutter };\n"],"mappings":";;;AACA,OAAOA,GAAP,MAAgB,QAAhB;AAGA,OAAOC,wBAAP,MAAqC,2CAArC;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AAEA;AACA;;AACA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CACdC,KADc,E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EAAA,IAACT,KAAD,uEAAiB,CAAjB;EAAA,OACA;IAAA,wBAAGD,KAAH;IAAA,IAAGA,KAAH,4BAAW,EAAX;IAAA,OACED,OAAO,CAACC,KAAD,EAAQC,KAAR,EAAe,aAAf,EAA8B,IAA9B,CADT;EAAA,CADA;AAAA,CADF;;AAKA,SAASK,MAAT,EAAiBC,OAAjB,EAA0BG,MAA1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"themeProps.js","names":["get","ThemePropertyException","getProp","theme","path","defaultValue","getThemeProp","value","getThemeStringProp","toString","getThemeNumberProp","themeProp"],"sources":["../../../src/react-theme/utils/themeProps.js"],"sourcesContent":["// @flow\nimport { get } from \"../../utils/helpers/objects\";\n\nimport { ThemePropertyException } from \"../../exceptions\";\n\nimport type { Theme, ThemePropValue } from \"../types\";\n\n/**\n */\nexport const getProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: ThemePropValue = \"\"\n): ?ThemePropValue => {\n return path === \"\" ? defaultValue : get(theme, path, defaultValue);\n};\n\n/**\n */\nexport const getThemeProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: ThemePropValue = \"\"\n): ThemePropValue => {\n const value = getProp(theme, path, defaultValue);\n\n if (\n value != null &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"object\")\n ) {\n return value;\n }\n\n throw new ThemePropertyException(\n `${path} is not a string, number or plain object, but: ${typeof value}`\n );\n};\n\n/**\n */\nexport const getThemeStringProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: string = \"\"\n): string => {\n const value = getProp(theme, path, defaultValue);\n\n if (typeof value === \"string\") {\n return value;\n } else if (typeof value === \"number\") {\n return value.toString();\n }\n\n throw new ThemePropertyException(\n `${path} is not a string, but: ${typeof value}`\n );\n};\n\n/**\n */\nexport const getThemeNumberProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: number = 0\n): number => {\n const value = getProp(theme, path, defaultValue);\n\n if (typeof value === \"number\") {\n return value;\n }\n\n throw new ThemePropertyException(\n `${path} is not a number, but: ${typeof value}`\n );\n};\n\n/*\n * Retrieve property value from theme property of styled component\n */\n/**\n */\nexport const themeProp =\n (\n path: string,\n defaultValue?: ThemePropValue\n ): (({ theme: Theme }) => ThemePropValue) =>\n ({ theme }: { theme: Theme }) =>\n getThemeProp(theme, path, defaultValue);\n"],"mappings":";;AACA,SAASA,GAAT,QAAoB,6BAApB;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAIA;AACA;AACA,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAU,GAID;EAAA,IAHpBC,KAGoB,uEAHG,EAGH;EAAA,IAFpBC,IAEoB,uEAFL,EAEK;EAAA,IADpBC,YACoB,uEADW,EACX;EACpB,OAAOD,IAAI,KAAK,EAAT,GAAcC,YAAd,GAA6BL,GAAG,CAACG,KAAD,EAAQC,IAAR,EAAcC,YAAd,CAAvC;AACD,CANM;AAQP;AACA;;AACA,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAe,GAIP;EAAA;;EAAA,IAHnBH,KAGmB,uEAHI,EAGJ;EAAA,IAFnBC,IAEmB,uEAFJ,EAEI;EAAA,IADnBC,YACmB,uEADY,EACZ;EACnB,IAAME,KAAK,GAAGL,OAAO,CAACC,KAAD,EAAQC,IAAR,EAAcC,YAAd,CAArB;;EAEA,IACEE,KAAK,IAAI,IAAT,KACC,OAAOA,KAAP,KAAiB,QAAjB,IACC,OAAOA,KAAP,KAAiB,QADlB,IAEC,QAAOA,KAAP,MAAiB,QAHnB,CADF,EAKE;IACA,OAAOA,KAAP;EACD;;EAED,MAAM,IAAIN,sBAAJ,8CACDG,IADC,6EAC4DG,KAD5D,GAAN;AAGD,CAnBM;AAqBP;AACA;;AACA,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,GAIrB;EAAA;;EAAA,IAHXL,KAGW,uEAHY,EAGZ;EAAA,IAFXC,IAEW,uEAFI,EAEJ;EAAA,IADXC,YACW,uEADY,EACZ;EACX,IAAME,KAAK,GAAGL,OAAO,CAACC,KAAD,EAAQC,IAAR,EAAcC,YAAd,CAArB;;EAEA,IAAI,OAAOE,KAAP,KAAiB,QAArB,EAA+B;IAC7B,OAAOA,KAAP;EACD,CAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;IACpC,OAAOA,KAAK,CAACE,QAAN,EAAP;EACD;;EAED,MAAM,IAAIR,sBAAJ,+CACDG,IADC,sDACoCG,KADpC,GAAN;AAGD,CAhBM;AAkBP;AACA;;AACA,OAAO,IAAMG,kBAAkB,GAAG,SAArBA,kBAAqB,GAIrB;EAAA;;EAAA,IAHXP,KAGW,uEAHY,EAGZ;EAAA,IAFXC,IAEW,uEAFI,EAEJ;EAAA,IADXC,YACW,uEADY,CACZ;EACX,IAAME,KAAK,GAAGL,OAAO,CAACC,KAAD,EAAQC,IAAR,EAAcC,YAAd,CAArB;;EAEA,IAAI,OAAOE,KAAP,KAAiB,QAArB,EAA+B;IAC7B,OAAOA,KAAP;EACD;;EAED,MAAM,IAAIN,sBAAJ,+CACDG,IADC,sDACoCG,KADpC,GAAN;AAGD,CAdM;AAgBP;AACA;AACA;;AACA;AACA;;AACA,OAAO,IAAMI,SAAS,GACpB,SADWA,SACX,CACEP,IADF,EAEEC,YAFF;EAAA,OAIA;IAAA,IAAGF,KAAH,QAAGA,KAAH;IAAA,OACEG,YAAY,CAACH,KAAD,EAAQC,IAAR,EAAcC,YAAd,CADd;EAAA,CAJA;AAAA,CADK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"actions.js","names":["startProgress","finishProgress","receiveLocale","locale","type","payload","updateLocale","dispatch","setLocales","locales"],"sources":["../../../src/redux/_i18n/actions.js"],"sourcesContent":["// @flow\nimport { startProgress, finishProgress } from \"../actions/ProgressIndicator\";\n\nimport type Locales from \"../../i18n/Locales\";\nimport type { SetLocalesAction, UpdateLocaleAction } from \"./types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n * Update current locale\n */\nexport const receiveLocale = (locale: string): UpdateLocaleAction => ({\n type: \"UPDATE_LOCALE\",\n payload: locale,\n});\n\n/**\n * Change locale of application and redirect\n */\nexport const updateLocale =\n (locale: string): ThunkAction =>\n (dispatch) => {\n dispatch(startProgress());\n dispatch(receiveLocale(locale));\n\n dispatch(finishProgress());\n };\n\n/**\n */\nexport const setLocales = (\n locales: Locales,\n locale: string\n): SetLocalesAction => ({\n type: \"SET_LOCALES\",\n payload: {\n locales,\n locale,\n },\n});\n"],"mappings":"AACA,SAASA,aAAT,EAAwBC,cAAxB,QAA8C,8BAA9C;;AAMA;AACA;AACA;AACA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,MAAD;EAAA,OAAyC;IACpEC,IAAI,EAAE,eAD8D;IAEpEC,OAAO,EAAEF;EAF2D,CAAzC;AAAA,CAAtB;AAKP;AACA;AACA;;AACA,OAAO,IAAMG,YAAY,GACvB,SADWA,YACX,CAACH,MAAD;EAAA,OACA,UAACI,QAAD,EAAc;IACZA,QAAQ,CAACP,aAAa,EAAd,CAAR;IACAO,QAAQ,CAACL,aAAa,CAACC,MAAD,CAAd,CAAR;IAEAI,QAAQ,CAACN,cAAc,EAAf,CAAR;EACD,CAND;AAAA,CADK;AASP;AACA;;AACA,OAAO,IAAMO,UAAU,GAAG,SAAbA,UAAa,CACxBC,OADwB,EAExBN,MAFwB;EAAA,OAGF;IACtBC,IAAI,EAAE,aADgB;IAEtBC,OAAO,EAAE;MACPI,OAAO,EAAPA,OADO;MAEPN,MAAM,EAANA;IAFO;EAFa,CAHE;AAAA,CAAnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/_i18n/index.js"],"sourcesContent":["// @flow\nexport * from \"./reducer\";\n\nexport * from \"./actions\";\n\nexport type * from \"./types\";\n"],"mappings":"AACA,cAAc,WAAd;AAEA,cAAc,WAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"reducer.js","names":["Cache","setCookie","Locales","updateLocale","state","locale","clear","setLocales","locales","initialState","I18nReducer","action","type","payload"],"sources":["../../../src/redux/_i18n/reducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport { setCookie } from \"../../utils/browser/Cookies\";\n\nimport Locales from \"../../i18n/Locales\";\n\nimport type { Reducer } from \"redux\";\nimport type { I18nState } from \"./types\";\nimport type { ReduxAction } from \"../types\";\n\n/**\n */\nconst updateLocale = (state, locale) => {\n // set locale in cookie\n setCookie(\"locale\", locale);\n\n // clear cache because of cached contributions\n Cache.clear();\n\n return {\n ...state,\n locale,\n };\n};\n\n/**\n */\nconst setLocales = (state, { locale, locales }) => {\n // set locale in cookie\n setCookie(\"locale\", locale);\n\n if (locale) {\n return {\n ...state,\n locales,\n locale,\n };\n }\n\n return {\n ...state,\n locales,\n };\n};\n\n// REDUCER\nconst initialState: I18nState = {\n locales: new Locales(),\n locale: \"en\",\n};\n\n/**\n * Form reducer\n */\nexport const I18nReducer: Reducer<I18nState, ReduxAction> = (\n state = initialState,\n action = void 0\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"SET_LOCALES\":\n return setLocales(state, action.payload);\n\n case \"UPDATE_LOCALE\":\n return updateLocale(state, action.payload);\n\n default:\n return state;\n }\n};\n"],"mappings":";;;;;;;;;;;AACA,OAAOA,KAAP,MAAkB,2BAAlB;AACA,SAASC,SAAT,QAA0B,6BAA1B;AAEA,OAAOC,OAAP,MAAoB,oBAApB;;AAMA;AACA;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAQC,MAAR,EAAmB;EACtC;EACAJ,SAAS,CAAC,QAAD,EAAWI,MAAX,CAAT,CAFsC,CAItC;;EACAL,KAAK,CAACM,KAAN;EAEA,uCACKF,KADL;IAEEC,MAAM,EAANA;EAFF;AAID,CAXD;AAaA;AACA;;;AACA,IAAME,UAAU,GAAG,SAAbA,UAAa,CAACH,KAAD,QAAgC;EAAA,IAAtBC,MAAsB,QAAtBA,MAAsB;EAAA,IAAdG,OAAc,QAAdA,OAAc;EACjD;EACAP,SAAS,CAAC,QAAD,EAAWI,MAAX,CAAT;;EAEA,IAAIA,MAAJ,EAAY;IACV,uCACKD,KADL;MAEEI,OAAO,EAAPA,OAFF;MAGEH,MAAM,EAANA;IAHF;EAKD;;EAED,uCACKD,KADL;IAEEI,OAAO,EAAPA;EAFF;AAID,CAhBD,C,CAkBA;;;AACA,IAAMC,YAAuB,GAAG;EAC9BD,OAAO,EAAE,IAAIN,OAAJ,EADqB;EAE9BG,MAAM,EAAE;AAFsB,CAAhC;AAKA;AACA;AACA;;AACA,OAAO,IAAMK,WAA4C,GAAG,SAA/CA,WAA+C,GAGvD;EAAA,IAFHN,KAEG,uEAFKK,YAEL;EAAA,IADHE,MACG,uEADM,KAAK,CACX;;EACH,IAAI,CAACA,MAAL,EAAa;IACX,OAAOP,KAAP;EACD;;EAED,QAAQO,MAAM,CAACC,IAAf;IACE,KAAK,aAAL;MACE,OAAOL,UAAU,CAACH,KAAD,EAAQO,MAAM,CAACE,OAAf,CAAjB;;IAEF,KAAK,eAAL;MACE,OAAOV,YAAY,CAACC,KAAD,EAAQO,MAAM,CAACE,OAAf,CAAnB;;IAEF;MACE,OAAOT,KAAP;EARJ;AAUD,CAlBM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"actions.js","names":["HTTP_METHODS","MODULARUI_STATUS","Href","ErrorResponse","finishProgress","startProgress","handleError","setModel","key","model","connectKey","type","payload","updateModel","removeModelByKey","resetModularUI","updateStatus","status","loadModelSuccessAction","modelToUpdate","clonedModel","clone","update","Error","loadModel","href","options","method","GET","data","locale","childmodels","targetModel","successAction","errorAction","error","errorResponse","isChangePassword","isResourceNotFoundAfterReload","isInvalidUsername","ERROR","loadModularUI","dispatch","LOADING","loadModelPromise","resolve","then","response","FINISHED","catch","reloadModel","selfhref","isReload"],"sources":["../../../src/redux/_modularui/actions.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS, MODULARUI_STATUS } from \"../../constants/Constants\";\nimport Href from \"../../models/href/Href\";\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\nimport { finishProgress, startProgress } from \"../actions/ProgressIndicator\";\nimport { handleError } from \"../actions/Error\";\n\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { Dispatch, ThunkAction } from \"../types\";\nimport type {\n ModularUIAction,\n SetModelAction,\n UpdateModelAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n UpdateStatusAction,\n} from \"./types\";\nimport type { RequestBaseOptions } from \"../../utils/fetch/types\";\n\n/**\n */\nexport const setModel = (\n key: string,\n model: ModularUIModel\n): SetModelAction => {\n // set key on model for later reference\n model.connectKey = key;\n return {\n type: \"MODULARUI/SET\",\n payload: {\n key,\n model,\n },\n };\n};\n\n/**\n */\nexport const updateModel = (model: ModularUIModel): UpdateModelAction => ({\n type: \"MODULARUI/UPDATE\",\n payload: model,\n});\n\n/**\n */\nexport const removeModelByKey = (key: string): RemoveModelByKeyAction => ({\n type: \"MODULARUI/REMOVE_KEY\",\n payload: key,\n});\n\n/**\n * Removes all models except the application model from the modular ui reducer\n */\nexport const resetModularUI = (): ResetModularUIAction => ({\n type: \"MODULARUI/RESET\",\n});\n\n/**\n */\nexport const updateStatus = (\n key: string,\n status: $Keys<typeof MODULARUI_STATUS>\n): UpdateStatusAction => ({\n type: \"MODULARUI/STATUS\",\n payload: { key, status },\n});\n\n/**\n */\nconst loadModelSuccessAction = (\n key: string,\n model: ModularUIModel,\n modelToUpdate\n): UpdateModelAction | SetModelAction => {\n if (modelToUpdate) {\n // $FlowFixMe[prop-missing]\n if (typeof modelToUpdate[\"update\"] === \"function\") {\n const clonedModel = modelToUpdate.clone();\n clonedModel.update(model);\n\n return updateModel(clonedModel);\n }\n\n throw new Error(\n `loadModel action: updateModel is set as option for ${key}, but the model is missing an update methode`\n );\n }\n\n return setModel(key, model);\n};\n\n/**\n */\nexport const loadModel = (\n key: string,\n href: Href | string,\n options?: RequestBaseOptions\n): ModularUIAction => ({\n type: \"MODULARUI/FETCH\",\n payload: {\n href: href instanceof Href ? href : new Href(href),\n method: options?.method ?? HTTP_METHODS.GET,\n data: options?.data,\n locale: options?.locale ?? \"en\",\n childmodels: options?.childmodels,\n targetModel: options?.targetModel,\n /**\n */\n successAction: (model) =>\n loadModelSuccessAction(key, model, options?.updateModel),\n /**\n */\n errorAction: (error) => {\n const errorResponse = new ErrorResponse(error, key);\n if (errorResponse.isChangePassword) {\n return {\n type: \"NO_ACTION\",\n };\n } else if (\n errorResponse.isResourceNotFoundAfterReload ||\n errorResponse.isInvalidUsername\n ) {\n return removeModelByKey(key);\n }\n\n return updateStatus(key, MODULARUI_STATUS.ERROR);\n },\n },\n});\n\n/**\n */\nexport const loadModularUI =\n (\n key: string,\n href: Href | string,\n options?: RequestBaseOptions\n ): ThunkAction =>\n (dispatch: Dispatch) => {\n dispatch(updateStatus(key, MODULARUI_STATUS.LOADING));\n dispatch(startProgress());\n\n const loadModelPromise = dispatch(loadModel(key, href, options));\n\n return Promise.resolve(loadModelPromise)\n .then((response) => {\n if (response?.type === \"FINISH_PROGRESS\") {\n dispatch(updateStatus(key, MODULARUI_STATUS.FINISHED));\n }\n\n return dispatch(finishProgress());\n })\n .catch((error) => dispatch(handleError(error)));\n };\n\n/**\n */\nexport const reloadModel = (\n model: ModularUIModel,\n options?: RequestBaseOptions\n): ThunkAction =>\n loadModularUI(model.connectKey, model.selfhref, {\n ...options,\n isReload: true,\n });\n"],"mappings":";;;;;;;;;;;;AACA,SAASA,YAAT,EAAuBC,gBAAvB,QAA+C,2BAA/C;AACA,OAAOC,IAAP,MAAiB,wBAAjB;AACA,OAAOC,aAAP,MAA0B,kCAA1B;AACA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,8BAA9C;AACA,SAASC,WAAT,QAA4B,kBAA5B;;AAcA;AACA;AACA,OAAO,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CACtBC,GADsB,EAEtBC,KAFsB,EAGH;EACnB;EACAA,KAAK,CAACC,UAAN,GAAmBF,GAAnB;EACA,OAAO;IACLG,IAAI,EAAE,eADD;IAELC,OAAO,EAAE;MACPJ,GAAG,EAAHA,GADO;MAEPC,KAAK,EAALA;IAFO;EAFJ,CAAP;AAOD,CAbM;AAeP;AACA;;AACA,OAAO,IAAMI,WAAW,GAAG,SAAdA,WAAc,CAACJ,KAAD;EAAA,OAA+C;IACxEE,IAAI,EAAE,kBADkE;IAExEC,OAAO,EAAEH;EAF+D,CAA/C;AAAA,CAApB;AAKP;AACA;;AACA,OAAO,IAAMK,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACN,GAAD;EAAA,OAA0C;IACxEG,IAAI,EAAE,sBADkE;IAExEC,OAAO,EAAEJ;EAF+D,CAA1C;AAAA,CAAzB;AAKP;AACA;AACA;;AACA,OAAO,IAAMO,cAAc,GAAG,SAAjBA,cAAiB;EAAA,OAA6B;IACzDJ,IAAI,EAAE;EADmD,CAA7B;AAAA,CAAvB;AAIP;AACA;;AACA,OAAO,IAAMK,YAAY,GAAG,SAAfA,YAAe,CAC1BR,GAD0B,EAE1BS,MAF0B;EAAA,OAGF;IACxBN,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;MAED,OAAON,QAAQ,CAACtC,cAAc,EAAf,CAAf;IACD,CAPI,EAQJ6C,KARI,CAQE,UAACd,KAAD;MAAA,OAAWO,QAAQ,CAACpC,WAAW,CAAC6B,KAAD,CAAZ,CAAnB;IAAA,CARF,CAAP;EASD,CApBD;AAAA,CADK;AAuBP;AACA;;AACA,OAAO,IAAMe,WAAW,GAAG,SAAdA,WAAc,CACzBzC,KADyB,EAEzBiB,OAFyB;EAAA,OAIzBe,aAAa,CAAChC,KAAK,CAACC,UAAP,EAAmBD,KAAK,CAAC0C,QAAzB,kCACRzB,OADQ;IAEX0B,QAAQ,EAAE;EAFC,GAJY;AAAA,CAApB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"connector.js","names":["useEffect","useDispatch","useSelector","useLocation","loadModularUI","reloadModel","removeModelByKey","Href","getDisplayName","useUrl","useReload","useModularUI","connector","name","resource","options","propName","removeOnUnmount","otherOptions","Component","WrappedComponent","props","dispatch","location","url","displayName","contextId","modelEntry","modelKey","model","connectKey","handleManualReload","reloadOptions","handleFetch","href","fetchOptions","reload","state","doReload","isReload","locale","i18n","newProps","status","lastModification","Boolean"],"sources":["../../../src/redux/_modularui/connector.js"],"sourcesContent":["// @flow\nimport { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useLocation } from \"react-router\";\n\nimport { loadModularUI, reloadModel, removeModelByKey } from \"./actions\";\n\nimport Href from \"../../models/href/Href\";\nimport { getDisplayName } from \"../../react/utils\";\n\nimport { useUrl, useReload } from \"./modularuiUtils\";\nimport { useModularUI } from \"../../hooks/useModularUI\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { Location } from \"react-router\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { ModularUIOptions } from \"./types\";\n\nexport type InjectedProps = {\n +modelKey: string,\n +location: Location,\n +status: string | null,\n +lastModification: number | null,\n +hasModel: boolean,\n +locale: string,\n +fetchModularUI: (href: string | Href, fetchOptions: Object) => void,\n +reloadModel: (model: ModularUIModel, options: Object) => void,\n +data?: ?ModularUIModel,\n};\n\n/**\n */\nconst connector = (\n name: string,\n resource: string | Function,\n options: ModularUIOptions = { propName: \"data\", removeOnUnmount: false }\n): ((Component: ComponentType<any>) => (props: any) => Node) => {\n const {\n propName = \"data\",\n removeOnUnmount = false,\n ...otherOptions\n } = options;\n\n return (Component: ComponentType<any>) => {\n const WrappedComponent = (props: any) => {\n const dispatch = useDispatch();\n const location = useLocation();\n\n const url = useUrl(resource, { location, ...props });\n const displayName = getDisplayName(Component, name, props.contextId);\n\n // Load the model through the useModUI hook\n const modelEntry = useModularUI(displayName, url, otherOptions);\n const modelKey = modelEntry?.model?.connectKey;\n\n // handle manual reload of model\n const handleManualReload = (\n model: ModularUIModel,\n reloadOptions?: Object\n ) => {\n dispatch(reloadModel(model, reloadOptions));\n };\n\n // Provide connected models with a fetchModularUI method to be able\n // to run the loadModularUI action from a handler / callback in the component\n const handleFetch = (href: string | Href, fetchOptions: Object) => {\n dispatch(loadModularUI(modelKey, href, fetchOptions));\n };\n\n // Check if current model needs a reload\n const reload = location?.state?.reload ?? 0;\n const doReload = useReload(modelEntry, reload);\n useEffect(() => {\n if (doReload) {\n dispatch(\n loadModularUI(modelKey, url, { ...otherOptions, isReload: true })\n );\n }\n }, [dispatch, doReload, url, modelKey]);\n\n // Remove model when hoc unloads\n useEffect(() => {\n return () => {\n if (removeOnUnmount) {\n dispatch(removeModelByKey(modelKey));\n }\n };\n }, [dispatch, modelKey]);\n\n // Create new properties object to inject modularui properties to own props\n const locale = useSelector((state) => state.i18n.locale);\n const newProps: InjectedProps = {\n modelKey,\n [propName]: modelEntry ? modelEntry.model : null,\n location,\n status: modelEntry ? modelEntry.status : null,\n lastModification: modelEntry ? modelEntry.lastModification : null,\n hasModel: Boolean(modelEntry),\n locale,\n fetchModularUI: handleFetch,\n reloadModel: handleManualReload,\n };\n\n return <Component {...props} {...newProps} />;\n };\n\n WrappedComponent.displayName = `BI.modularui(${getDisplayName(\n WrappedComponent,\n name\n )}`;\n\n return WrappedComponent;\n };\n};\n\nexport default connector;\n"],"mappings":";;;;;;;;;;;;;AACA,SAASA,SAAT,QAA0B,OAA1B;AACA,SAASC,WAAT,EAAsBC,WAAtB,QAAyC,aAAzC;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,SAASC,aAAT,EAAwBC,WAAxB,EAAqCC,gBAArC,QAA6D,WAA7D;AAEA,OAAOC,IAAP,MAAiB,wBAAjB;AACA,SAASC,cAAT,QAA+B,mBAA/B;AAEA,SAASC,MAAT,EAAiBC,SAAjB,QAAkC,kBAAlC;AACA,SAASC,YAAT,QAA6B,0BAA7B;;;AAmBA;AACA;AACA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAChBC,IADgB,EAEhBC,QAFgB,EAI8C;EAAA,IAD9DC,OAC8D,uEADlC;IAAEC,QAAQ,EAAE,MAAZ;IAAoBC,eAAe,EAAE;EAArC,CACkC;;EAC9D,wBAIIF,OAJJ,CACEC,QADF;EAAA,IACEA,QADF,kCACa,MADb;EAAA,4BAIID,OAJJ,CAEEE,eAFF;EAAA,IAEEA,eAFF,sCAEoB,KAFpB;EAAA,IAGKC,YAHL,4BAIIH,OAJJ;;EAMA,OAAO,UAACI,SAAD,EAAmC;IACxC,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAgB;MAAA;;MACvC,IAAMC,QAAQ,GAAGrB,WAAW,EAA5B;MACA,IAAMsB,QAAQ,GAAGpB,WAAW,EAA5B;MAEA,IAAMqB,GAAG,GAAGf,MAAM,CAACK,QAAD;QAAaS,QAAQ,EAARA;MAAb,GAA0BF,KAA1B,EAAlB;MACA,IAAMI,WAAW,GAAGjB,cAAc,CAACW,SAAD,EAAYN,IAAZ,EAAkBQ,KAAK,CAACK,SAAxB,CAAlC,CALuC,CAOvC;;MACA,IAAMC,UAAU,GAAGhB,YAAY,CAACc,WAAD,EAAcD,GAAd,EAAm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AN,CAAWD,MAAtB;MAAA,CAAD,CAA1B;MACA,IAAME,QAAuB;QAC3Bd,QAAQ,EAARA;MAD2B,8BAE1BZ,QAF0B,EAEfW,UAAU,GAAGA,UAAU,CAACE,KAAd,GAAsB,IAFjB,0CAG3BN,QAH2B,wCAInBI,UAAU,GAAGA,UAAU,CAACgB,MAAd,GAAuB,IAJd,kDAKThB,UAAU,GAAGA,UAAU,CAACiB,gBAAd,GAAiC,IALlC,0CAMjBC,OAAO,CAAClB,UAAD,CANU,wCAO3Ba,MAP2B,gDAQXP,WARW,6CASdF,kBATc,aAA7B;MAYA,oBAAO,KAAC,SAAD,kCAAeV,KAAf,GAA0BqB,QAA1B,EAAP;IACD,CA5DD;;IA8DAtB,gBAAgB,CAACK,WAAjB,0BAA+CjB,cAAc,CAC3DY,gBAD2D,EAE3DP,IAF2D,CAA7D;IAKA,OAAOO,gBAAP;EACD,CArED;AAsED,CAjFD;;AAmFA,eAAeR,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","modularui","withModularUI"],"sources":["../../../src/redux/_modularui/index.js"],"sourcesContent":["// @flow\nexport * from \"./middleware\";\nexport * from \"./reducer\";\nexport { default as modularui } from \"./connector\";\nexport { default as withModularUI } from \"./withModularUI\";\n\nexport * from \"./modularuiUtils\";\nexport * from \"./actions\";\nexport * from \"./selectors\";\n\nexport type * from \"./types\";\n"],"mappings":"AACA,cAAc,cAAd;AACA,cAAc,WAAd;AACA,SAASA,OAAO,IAAIC,SAApB,QAAqC,aAArC;AACA,SAASD,OAAO,IAAIE,aAApB,QAAyC,iBAAzC;AAEA,cAAc,kBAAd;AACA,cAAc,WAAd;AACA,cAAc,aAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"middleware.js","names":["ModularUIRequest","HTTP_METHODS","startProgress","finishProgress","handleError","createRequest","modularui","request","href","method","GET","data","locale","childmodels","isReload","targetModel","responseHandler","next","dispatch","successAction","model","successResult","then","result","catch","error","Error","errorHandler","errorAction","err","errorResult","handleFetch","action","payload","requestOptions","modularuiRequest","fetch","modularuiMiddleware","api","type","getState","i18n"],"sources":["../../../src/redux/_modularui/middleware.js"],"sourcesContent":["// @flow\nimport ModularUIRequest from \"../../modularui/ModularUIRequest\";\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport { startProgress, finishProgress } from \"../actions/ProgressIndicator\";\n\nimport { handleError } from \"../actions/Error\";\n\nimport type { Middleware, MiddlewareAPI } from \"redux\";\nimport type {\n ReduxAction,\n ReduxState,\n Dispatch,\n PossibleAction,\n} from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { ModularUIAction } from \"./types\";\n\ntype RequestOptions = {\n href: Href,\n method?: $Keys<typeof HTTP_METHODS>,\n data?: string | { [key: string]: string },\n locale: string,\n childmodels?: boolean,\n targetModel?: Class<ModularUIModel>,\n isReload?: boolean,\n};\n\n/**\n * Symbol key that carries API call info interpreted by this Redux middleware.\n */\nconst createRequest = (modularui: RequestOptions) => {\n const request = new ModularUIRequest(modularui.href, {\n method: modularui.method || HTTP_METHODS.GET,\n data: modularui.data || {},\n locale: modularui.locale,\n childmodels: modularui.childmodels ?? true,\n isReload: modularui.isReload,\n });\n\n if (modularui.targetModel) {\n request.targetModel = modularui.targetModel;\n }\n\n return request;\n};\n\n/**\n */\nconst responseHandler = (next, dispatch, successAction, model) => {\n if (successAction) {\n const successResult = successAction(model);\n\n if (successResult instanceof Promise) {\n successResult\n .then((result) => {\n dispatch(result);\n })\n .catch((error) => {\n next(handleError(error));\n });\n } else {\n try {\n dispatch(successResult);\n } catch (error) {\n throw new Error(\n `Result of successResult is not a valid redux action: ${error}`\n );\n }\n }\n }\n\n return next(finishProgress());\n};\n\n/**\n */\nconst errorHandler = (next, dispatch, errorAction, err) => {\n dispatch(finishProgress());\n\n if (errorAction) {\n const errorResult = errorAction(err);\n\n if (errorResult instanceof Promise) {\n errorResult.then((result) => dispatch(result));\n } else {\n dispatch(errorResult);\n }\n }\n\n return next(handleError(err));\n};\n\n/**\n */\nconst handleFetch = (action: ModularUIAction, locale, dispatch, next) => {\n dispatch(startProgress());\n\n const { successAction, errorAction, ...requestOptions } = action.payload;\n requestOptions.locale = locale;\n\n const modularuiRequest = createRequest(requestOptions);\n\n return modularuiRequest\n .fetch()\n .then((model) => responseHandler(next, dispatch, successAction, model))\n .catch((error) => errorHandler(next, dispatch, errorAction, error));\n};\n\n/**\n */\nexport const modularuiMiddleware: Middleware<\n ReduxState,\n ReduxAction,\n Dispatch\n> =\n (api: MiddlewareAPI<ReduxState, ReduxAction, Dispatch>) =>\n (next: Dispatch) =>\n (action: PossibleAction) => {\n if (action.type === \"MODULARUI/FETCH\") {\n return handleFetch(\n // $FlowExpectedError[incompatible-exact]\n action,\n api.getState().i18n.locale,\n api.dispatch,\n next\n );\n }\n\n return next(action);\n };\n"],"mappings":";;;AACA,OAAOA,gBAAP,MAA6B,kCAA7B;AACA,SAASC,YAAT,QAA6B,2BAA7B;AAEA,SAASC,aAAT,EAAwBC,cAAxB,QAA8C,8BAA9C;AAEA,SAASC,WAAT,QAA4B,kBAA5B;;AAuBA;AACA;AACA;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,SAAD,EAA+B;EAAA;;EACnD,IAAMC,OAAO,GAAG,IAAIP,gBAAJ,CAAqBM,SAAS,CAACE,IAA/B,EAAqC;IACnDC,MAAM,EAAEH,SAAS,CAACG,MAAV,IAAoBR,YAAY,CAACS,GADU;IAEnDC,IAAI,EAAEL,SAAS,CAACK,IAAV,IAAkB,EAF2B;IAGnDC,MAAM,EAAEN,SAAS,CAACM,MAHiC;IAInDC,WAAW,2BAAEP,SAAS,CAACO,WAAZ,yEAA2B,IAJa;IAKnDC,QAAQ,EAAER,SAAS,CAACQ;EAL+B,CAArC,CAAhB;;EAQA,IAAIR,SAAS,CAACS,WAA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;AACA;;;AACA,IAAME,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD,EAA0BpB,MAA1B,EAAkCM,QAAlC,EAA4CD,IAA5C,EAAqD;EACvEC,QAAQ,CAAChB,aAAa,EAAd,CAAR;;EAEA,sBAA0D8B,MAAM,CAACC,OAAjE;EAAA,IAAQd,aAAR,mBAAQA,aAAR;EAAA,IAAuBS,WAAvB,mBAAuBA,WAAvB;EAAA,IAAuCM,cAAvC;;EACAA,cAAc,CAACtB,MAAf,GAAwBA,MAAxB;EAEA,IAAMuB,gBAAgB,GAAG9B,aAAa,CAAC6B,cAAD,CAAtC;EAEA,OAAOC,gBAAgB,CACpBC,KADI,GAEJd,IAFI,CAEC,UAACF,KAAD;IAAA,OAAWJ,eAAe,CAACC,IAAD,EAAOC,QAAP,EAAiBC,aAAjB,EAAgCC,KAAhC,CAA1B;EAAA,CAFD,EAGJI,KAHI,CAGE,UAACC,KAAD;IAAA,OAAWE,YAAY,CAACV,IAAD,EAAOC,QAAP,EAAiBU,WAAjB,EAA8BH,KAA9B,CAAvB;EAAA,CAHF,CAAP;AAID,CAZD;AAcA;AACA;;;AACA,OAAO,IAAMY,mBAIZ,GACC,SALWA,mBAKX,CAACC,GAAD;EAAA,OACA,UAACrB,IAAD;IAAA,OACA,UAACe,MAAD,EAA4B;MAC1B,IAAIA,MAAM,CAACO,IAAP,KAAgB,iBAApB,EAAuC;QACrC,OAAOR,WAAW,EAChB;QACAC,MAFgB,EAGhBM,GAAG,CAACE,QAAJ,GAAeC,IAAf,CAAoB7B,MAHJ,EAIhB0B,GAAG,CAACpB,QAJY,EAKhBD,IALgB,CAAlB;MAOD;;MAED,OAAOA,IAAI,CAACe,MAAD,CAAX;IACD,CAbD;EAAA,CADA;AAAA,CALK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"modularuiUtils.js","names":["useState","getDisplayName","MODULARUI_STATUS","Href","getUrl","resource","props","url","toString","useUrl","previousUrl","setPreviousUrl","previousExact","setPreviousExact","match","isDifferentUrl","hasDifferentStartUriPart","isExact","getKey","WrappedComponent","name","split","useReload","modelEntry","reload","isFullyLoaded","status","FINISHED","lastModification"],"sources":["../../../src/redux/_modularui/modularuiUtils.js"],"sourcesContent":["// @flow\nimport { useState } from \"react\";\n\nimport { getDisplayName } from \"../../react/utils\";\nimport { MODULARUI_STATUS } from \"../../constants/Constants\";\nimport Href from \"../../models/href/Href\";\n\nimport type { ComponentType } from \"react\";\n\n/**\n * Generate modular ui url\n */\nconst getUrl = (resource: string | Function, props: Object) => {\n const url = typeof resource === \"function\" ? resource(props) : resource;\n\n if (url instanceof Href) {\n return url.toString();\n }\n\n return url || \"\";\n};\n\n/**\n */\nexport const useUrl = (resource: string | Function, props: Object): string => {\n const [previousUrl, setPreviousUrl] = useState(\"\");\n const [previousExact, setPreviousExact] = useState(false);\n\n const url = getUrl(resource, props);\n\n const { match } = props;\n\n // when match is not available through props,\n // this is a direct call to the modular ui hoc, not using a route\n if (!match) {\n return url;\n }\n\n const isDifferentUrl = url !== previousUrl;\n if (!isDifferentUrl) {\n return previousUrl;\n }\n\n const hasDifferentStartUriPart =\n previousUrl !== \"\" && !previousUrl.startsWith(match.url);\n\n // Always create an url when the match is exact\n // Or when the match is not exact AND the original match also was not exact\n // Or when the new start uri is different from the previous url\n if (\n match.isExact === true ||\n previousExact === match.isExact ||\n hasDifferentStartUriPart\n ) {\n setPreviousUrl(url);\n setPreviousExact(match.isExact);\n\n return url;\n }\n\n return previousUrl;\n};\n\n/**\n * Create key for modularui request based on component name and requested url\n */\nexport const getKey = (\n WrappedComponent: ComponentType<any>,\n name: string,\n url: string\n): string => {\n if (url) {\n return `${getDisplayName(WrappedComponent, name)}(${url.split(\"?\")[0]})`;\n }\n\n return getDisplayName(WrappedComponent, name);\n};\n\n/**\n * Check if the model corresponding to a modular ui service should be reloaded\n */\nexport const useReload = (modelEntry: Object, reload: number = 0): boolean => {\n if (reload > 0) {\n const isFullyLoaded = modelEntry?.status === MODULARUI_STATUS.FINISHED;\n const lastModification = modelEntry?.lastModification ?? 0;\n\n if (isFullyLoaded && lastModification < reload) {\n return true;\n }\n }\n\n return false;\n};\n"],"mappings":";;;AACA,SAASA,QAAT,QAAyB,OAAzB;AAEA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,gBAAT,QAAiC,2BAAjC;AACA,OAAOC,IAAP,MAAiB,wBAAjB;;AAIA;AACA;AACA;AACA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,QAAD,EAA8BC,KAA9B,EAAgD;EAC7D,IAAMC,GAAG,GAAG,OAAOF,QAAP,KAAoB,UAApB,GAAiCA,QAAQ,CAACC,KAAD,CAAzC,GAAmDD,QAA/D;;EAEA,IAAIE,GAAG,YAAYJ,IAAnB,EAAyB;IACvB,OAAOI,GAAG,CAACC,QAAJ,EAAP;EACD;;EAED,OAAOD,GAAG,IAAI,EAAd;AACD,CARD;AAUA;AACA;;;AACA,OAAO,IAAME,MAAM,GAAG,SAATA,MAAS,CAACJ,QAAD,EAA8BC,KAA9B,EAAwD;EAC5E,gBAAsCN,QAAQ,CAAC,EAAD,CAA9C;EAAA;EAAA,IAAOU,WAAP;EAAA,IAAoBC,cAApB;;EACA,iBAA0CX,QAAQ,CAAC,KAAD,CAAlD;EAAA;EAAA,IAAOY,aAAP;EAAA,IAAsBC,gBAAtB;;EAEA,IAAMN,GAAG,GAAGH,MAAM,CAACC,QAAD,EAAWC,KAAX,CAAlB;EAEA,IAAQQ,KAAR,GAAkBR,KAAlB,CAAQQ,KAAR,CAN4E,CAQ5E;EACA;;EACA,IAAI,CAACA,KAAL,EAAY;IACV,OAAOP,GAAP;EACD;;EAED,IAAMQ,cAAc,GAAGR,GAAG,KAAKG,WAA/B;;EACA,IAAI,CAACK,cAAL,EAAqB;IACnB,OAAOL,WAAP;EACD;;EAED,IAAMM,wBAAwB,GAC5BN,WAAW,KAAK,EAAhB,IAAsB,CAAC,4BAAAA,WAAW,MAAX,C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STATUS","ApplicationModel","updateStatus","state","key","status","LOADING","lastModification","Date","now","setModel","model","getModelKey","connectKey","updateModel","modelKey","Error","removeKey","_","newState","resetModularUI","initialState","ModularUIReducer","action","type","payload"],"sources":["../../../src/redux/_modularui/reducer.js"],"sourcesContent":["// @flow\nimport { IllegalArgumentException } from \"../../exceptions\";\nimport { MODULARUI_STATUS } from \"../../constants/Constants\";\nimport { ApplicationModel } from \"../../models\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction } from \"../types\";\nimport type { ModularUIState } from \"./types\";\n\n/**\n */\nconst updateStatus = (state, { key, status }) => {\n // model should always be available when status is not loading\n if (status !== MODULARUI_STATUS.LOADING && !state[key]) {\n return state;\n }\n\n return {\n ...state,\n [key]: {\n ...state[key],\n status,\n lastModification: Date.now(),\n },\n };\n};\n\n/**\n */\nconst setModel = (state, { key, model }) => {\n if (!state[key]) {\n return state;\n }\n\n if (model) {\n return {\n ...state,\n [key]: {\n ...state[key],\n model,\n lastModification: Date.now(),\n },\n };\n }\n\n throw new IllegalArgumentException(\"No model for setModel\");\n};\n\n/**\n */\nconst getModelKey = (state, model) =>\n Object.keys(state).find((key) => {\n const connectKey = state[key]?.model?.connectKey ?? \"\";\n return connectKey === model.connectKey;\n });\n\n/**\n */\nconst updateModel = (state, model) => {\n const modelKey = getModelKey(state, model);\n\n if (modelKey) {\n return setModel(state, { key: modelKey, model });\n }\n\n throw new Error(\n `ModularUIReducer: Cannot update model with key ${model.connectKey}`\n );\n};\n\n/**\n */\nconst removeKey = (modelKey: string, state: ModularUIState): ModularUIState => {\n // eslint-disable-next-line no-unused-vars\n const { [modelKey]: _, ...newState } = state;\n\n return newState;\n};\n\n/**\n * Remove all but application models\n */\nconst resetModularUI = (state: ModularUIState) => {\n const newState = {};\n\n for (const key in state) {\n if (state[key].model instanceof ApplicationModel) {\n newState[key] = { ...state[key] };\n }\n }\n\n return newState;\n};\n\nconst initialState: ModularUIState = {};\n\n/**\n * Modular UI Reducer\n */\nexport const ModularUIReducer: Reducer<ModularUIState, ReduxAction> = (\n state = initialState,\n action\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"MODULARUI/RESET\":\n return resetModularUI(state);\n\n case \"MODULARUI/STATUS\":\n return updateStatus(state, action.payload);\n\n case \"MODULARUI/SET\":\n return setModel(state, action.payload);\n\n case \"MODULARUI/UPDATE\":\n return updateModel(state, action.payload);\n\n case \"MODULARUI/REMOVE_KEY\":\n return removeKey(action.payload, state);\n\n default:\n return state;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,SAASA,wBAAT,QAAyC,kBAAzC;AACA,SAASC,gBAAT,QAAiC,2BAAjC;AACA,SAASC,gBAAT,QAAiC,cAAjC;;AAMA;AACA;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,QAA4B;EAAA,IAAlBC,GAAkB,QAAlBA,GAAkB;EAAA,IAAbC,MAAa,QAAbA,MAAa;;EAC/C;EACA,IAAIA,MAAM,KAAKL,gBAAgB,CAACM,OAA5B,IAAuC,CAACH,KAAK,CAACC,GAAD,CAAjD,EAAwD;IACtD,OAAOD,KAAP;EACD;;EAED,uCACKA,KADL,2BAEGC,GAFH,kCAGOD,KAAK,CAACC,GAAD,CAHZ;IAIIC,MAAM,EAANA,MAJJ;IAKIE,gBAAgB,EAAEC,IAAI,CAACC,GAAL;EALtB;AAQD,CAdD;AAgBA;AACA;;;AACA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACP,KAAD,SAA2B;EAAA,IAAjBC,GAAiB,SAAjBA,GAAiB;EAAA,IAAZO,KAAY,SAAZA,KAAY;;EAC1C,IAAI,CAACR,KAAK,CAACC,GAAD,CAAV,EAAiB;IACf,OAAOD,KAAP;EACD;;EAED,IAAIQ,KAAJ,EAAW;IACT,uCACKR,KADL,2BAEGC,GAFH,kCAGOD,KAAK,CAACC,GAAD,CAHZ;MAIIO,KAAK,EAALA,KAJJ;MAKIJ,gBAAgB,EAAEC,IAA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,gBAAhC,EAAkD;MAChDkB,QAAQ,CAACf,GAAD,CAAR,qBAAqBD,KAAK,CAACC,GAAD,CAA1B;IACD;EACF;;EAED,OAAOe,QAAP;AACD,CAVD;;AAYA,IAAME,YAA4B,GAAG,EAArC;AAEA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAsD,GAAG,SAAzDA,gBAAyD,GAGjE;EAAA,IAFHnB,KAEG,uEAFKkB,YAEL;EAAA,IADHE,MACG;;EACH,IAAI,CAACA,MAAL,EAAa;IACX,OAAOpB,KAAP;EACD;;EAED,QAAQoB,MAAM,CAACC,IAAf;IACE,KAAK,iBAAL;MACE,OAAOJ,cAAc,CAACjB,KAAD,CAArB;;IAEF,KAAK,kBAAL;MACE,OAAOD,YAAY,CAACC,KAAD,EAAQoB,MAAM,CAACE,OAAf,CAAnB;;IAEF,KAAK,eAAL;MACE,OAAOf,QAAQ,CAACP,KAAD,EAAQoB,MAAM,CAACE,OAAf,CAAf;;IAEF,KAAK,kBAAL;MACE,OAAOX,WAAW,CAACX,KAAD,EAAQoB,MAAM,CAACE,OAAf,CAAlB;;IAEF,KAAK,sBAAL;MACE,OAAOR,SAAS,CAACM,MAAM,CAACE,OAAR,EAAiBtB,KAAjB,CAAhB;;IAEF;MACE,OAAOA,KAAP;EAjBJ;AAmBD,CA3BM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/redux/_modularui/selectors.js"],"names":["createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","key","model","getFirstModelByInstance","getActiveModelByInstance","location","getLocation","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","findHref","modelConfigKey","equals","keyByHref","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encod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EAE3BmD,cAF2B,EAGA;AAC3B,MAAInD,KAAK,IAAIA,KAAK,CAACoD,WAAnB,EAAgC;AAC9B,WAAOpD,KAAK,CAACoD,WAAN,CAAkBD,cAAlB,CAAP;AACD;;AAED,SAAO,IAAP;AACD,CATM;AAWP;AACA;AACA;;AACA,OAAO,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAC7BrD,KAD6B,EAE7B+B,IAF6B,EAGH;AAC1B,MAAI/B,KAAK,IAAIA,KAAK,CAACI,SAAnB,EAA8B;AAAA;;AAC5B,WAAO,kFAAYJ,KAAK,CAACI,SAAlB,mBAEH,UAACC,GAAD;AAAA,aACEL,KAAK,CAACI,SAAN,CAAgBC,GAAhB,KACAL,KAAK,CAACI,SAAN,CAAgBC,GAAhB,EAAqBC,KADrB,IAEAN,KAAK,CAACI,SAAN,CAAgBC,GAAhB,EAAqBC,KAArB,CAA2ByB,IAA3B,KAAoCA,IAHtC;AAAA,KAFG,mBAOA,UAAC1B,GAAD;AAAA,aAASL,KAAK,CAACI,SAAN,CAAgBC,GAAhB,EAAqBC,KAA9B;AAAA,KAPA,CAAP;AAQD;;AAED,SAAO,EAAP;AACD,CAhBM","sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n */\nconst getLocation = (state): string => state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other)\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\"\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath)\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n"],"file":"selectors.js"}
|
|
1
|
+
{"version":3,"file":"selectors.js","names":["createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","key","model","getFirstModelByInstance","getActiveModelByInstance","location","getLocation","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","findHref","modelConfigKey","equals","keyByHref","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType"],"sources":["../../../src/redux/_modularui/selectors.js"],"sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n */\nconst getLocation = (state): string => state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other)\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\"\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath)\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAASA,qBAAT,EAAgCC,cAAhC,QAAsD,UAAtD;AACA,SAASC,GAAT,QAAoB,6BAApB;AAEA,OAAOC,IAAP,MAAiB,wBAAjB;AACA,OAAOC,YAAP,MAAyB,mCAAzB;AACA,OAAOC,eAAP,MAA4B,sCAA5B;AACA,OAAOC,gBAAP,MAA6B,2CAA7B;AACA,OAAOC,QAAP,MAAqB,2BAArB;AACA,OAAOC,aAAP,MAA0B,qCAA1B;AACA,OAAOC,SAAP,MAAsB,6BAAtB;;AAKA;AACA;AACA,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCC,KADoC,EAEpCC,QAFoC,EAGV;EAAA;;EAC1B,IAAMC,MAAM,GAAG,CAAAF,KAAK,SAAL,IAAAA,KAAK,WAAL,2BAAAA,KAAK,CAAEG,IAAP,4DAAaD,MAAb,KAAuB,IAAtC;EACA,IAAME,SAAS,GAAGJ,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEI,SAAzB;;EAEA,IAAIA,SAAJ,EAAe;IAAA;;IACb,OAAO,iFAAYA,SAA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