@beinformed/ui 1.45.1 → 1.45.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 +8 -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/filters/StringFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +16 -10
- 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.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/CaptchaRequest.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/UploadRequest.js.map +1 -1
- package/esm/modularui/index.js.map +1 -1
- package/esm/modularui/types.js.map +1 -1
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +1 -2
- 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/I18nActions.js.map +1 -1
- package/esm/redux/_i18n/I18nReducer.js.map +1 -1
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_i18n/types.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/RouterActions.js.map +1 -1
- package/esm/redux/_router/RouterConnectors.js.map +1 -1
- package/esm/redux/_router/RouterMiddleware.js.map +1 -1
- package/esm/redux/_router/RouterReducer.js.map +1 -1
- package/esm/redux/_router/index.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/selectors/i18n.js.map +1 -1
- package/esm/redux/selectors/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/createHref.js.map +1 -1
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/index.js.map +1 -1
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/repositoryResource.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 +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 +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/filters/StringFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +16 -10
- package/lib/models/form/FormObjectModel.js.flow +13 -9
- 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 +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.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/CaptchaRequest.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/UploadRequest.js.map +1 -1
- package/lib/modularui/index.js.map +1 -1
- package/lib/modularui/types.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 +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/I18nActions.js.map +1 -1
- package/lib/redux/_i18n/I18nReducer.js.map +1 -1
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_i18n/types.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/lib/redux/_modularui/index.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/RouterActions.js.map +1 -1
- package/lib/redux/_router/RouterConnectors.js.map +1 -1
- package/lib/redux/_router/RouterMiddleware.js.map +1 -1
- package/lib/redux/_router/RouterReducer.js.map +1 -1
- package/lib/redux/_router/index.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/selectors/i18n.js.map +1 -1
- package/lib/redux/selectors/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/createHref.js.map +1 -1
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/index.js.map +1 -1
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/repositoryResource.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 +1 -1
- package/src/models/form/FormObjectModel.js +13 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependentAttribute.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_constants","_ChoiceAttributeModel","_BooleanAttributeModel","_exceptions","EQUALS","INCLUDES","NOT_EQUALS","NOT_INCLUDES","NOT_IS_EMPTY","IS_EMPTY","SHOW","HIDE","DependentAttribute","BaseLayoutHintRule","constructor","arguments","_defineProperty2","default","isApplicableForHint","hint","regex","RegExp","DEPENDENT_ATTRIBUTE","test","getRuleInstance","initHint","rule","OPERATORS","DEPENDENT_ATTRIBUTE_CONTROL","isEmpyNotIsEmptRegex","result","match","action","control","operator","options","ConfigurationException","_action","_control","_operator","_options","_context","_map","split","call","option","_trim","processEqualsOptions","controlAttribute","ChoiceAttributeModel","BooleanAttributeModel","every","_context2","_includes","selected","processIncludesOptions","some","_context3","handleOperator","length","getControlAttribute","attributes","attribute","getAttributeByLayoutHint","process","processLayoutHintRules","isHidden","hide","label","_default","exports"],"sources":["../../../../src/models/attributes/layouthint-rules/DependentAttribute.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport {\n DEPENDENT_ATTRIBUTE_CONTROL,\n DEPENDENT_ATTRIBUTE,\n} from \"../../../constants\";\n\nimport ChoiceAttributeModel from \"../ChoiceAttributeModel\";\nimport BooleanAttributeModel from \"../BooleanAttributeModel\";\n\nimport { ConfigurationException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\nconst EQUALS = \"equals\";\nconst INCLUDES = \"includes\";\nconst NOT_EQUALS = \"notEquals\";\nconst NOT_INCLUDES = \"notIncludes\";\nconst NOT_IS_EMPTY = \"notIsEmpty\";\nconst IS_EMPTY = \"isEmpty\";\n\nconst SHOW = \"show\";\nconst HIDE = \"hide\";\n\n/**\n * Depending attributes hint logic\n */\nclass DependentAttribute extends BaseLayoutHintRule {\n _action: string;\n _control: string;\n _operator: string;\n _options: Array<string>;\n\n /**\n */\n static checkHintApplicability: boolean = true;\n\n /**\n */\n static isApplicableForHint(hint: string): boolean {\n const regex = new RegExp(\n `^${DEPENDENT_ATTRIBUTE}\\\\s?(${SHOW}|${HIDE})`,\n \"i\",\n );\n\n return regex.test(hint);\n }\n\n /**\n * Used on initHint to create an instance of this rule\n */\n static getRuleInstance(): DependentAttribute {\n return new DependentAttribute();\n }\n\n /**\n */\n static initHint(hint: string): any {\n const rule = this.getRuleInstance();\n\n const OPERATORS = `${EQUALS}|${INCLUDES}|${NOT_EQUALS}|${NOT_INCLUDES}|${NOT_IS_EMPTY}|${IS_EMPTY}`;\n const regex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})\\\\s(.*)`,\n \"i\",\n );\n const isEmpyNotIsEmptRegex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})`,\n \"i\",\n );\n\n const result = hint.match(regex)\n ? hint.match(regex)\n : hint.match(isEmpyNotIsEmptRegex);\n\n if (result) {\n rule.action = result[1];\n rule.control = result[2];\n rule.operator = result[3];\n rule.options = !result[4] ? \"\" : result[4];\n } else {\n throw new ConfigurationException(\n `No dependent information found on layout hint: ${hint}`,\n );\n }\n\n return rule;\n }\n\n /**\n */\n get action(): string {\n return this._action;\n }\n\n /**\n */\n set action(action: string) {\n this._action = action;\n }\n\n /**\n */\n get control(): string {\n return this._control;\n }\n\n /**\n */\n set control(control: string) {\n this._control = control;\n }\n\n /**\n */\n get operator(): string {\n return this._operator;\n }\n\n /**\n */\n set operator(operator: string) {\n this._operator = operator;\n }\n\n /**\n */\n get options(): Array<string> {\n return this._options;\n }\n\n /**\n */\n set options(options: string): void {\n this._options = options.split(\"|\").map((option) => option.trim());\n }\n\n /**\n */\n processEqualsOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (\n controlAttribute instanceof ChoiceAttributeModel ||\n controlAttribute instanceof BooleanAttributeModel\n ) {\n return this.options.every((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with equals operator must be a choice, string or number attribute\",\n );\n }\n\n /**\n */\n processIncludesOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (controlAttribute instanceof ChoiceAttributeModel) {\n return this.options.some((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with includes operator must be a choice attribute\",\n );\n }\n\n /**\n */\n handleOperator(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n switch (this.operator) {\n case EQUALS:\n return this.processEqualsOptions(controlAttribute);\n case INCLUDES:\n return this.processIncludesOptions(controlAttribute);\n case NOT_EQUALS:\n return !this.processEqualsOptions(controlAttribute);\n case NOT_INCLUDES:\n return !this.processIncludesOptions(controlAttribute);\n case NOT_IS_EMPTY:\n return controlAttribute?.selected.length !== 0;\n case IS_EMPTY:\n return controlAttribute?.selected.length === 0;\n default:\n throw new ConfigurationException(\n `Unsupported operator for dependent question: ${this.operator}`,\n );\n }\n }\n\n /**\n */\n getControlAttribute(\n attributes: AttributeCollection,\n ): ChoiceAttributeModel | BooleanAttributeModel | null {\n const attribute = attributes.getAttributeByLayoutHint(\n `${DEPENDENT_ATTRIBUTE_CONTROL}:${this.control}`,\n `${DEPENDENT_ATTRIBUTE_CONTROL}: ${this.control}`,\n );\n\n if (\n attribute instanceof ChoiceAttributeModel ||\n attribute instanceof BooleanAttributeModel\n ) {\n return attribute;\n }\n\n return null;\n }\n\n /**\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n const controlAttribute = this.getControlAttribute(attributes);\n if (!controlAttribute) {\n return;\n }\n\n controlAttribute.processLayoutHintRules(attributes);\n if (controlAttribute.isHidden) {\n attribute.hide();\n return;\n }\n\n const result = this.handleOperator(controlAttribute);\n if (this.action === SHOW) {\n attribute.isHidden = !result;\n } else if (this.action === HIDE) {\n attribute.isHidden = result;\n } else {\n throw new ConfigurationException(\n `Unsupported action ${this.action} for dependent question on attribute: ${attribute.label}`,\n );\n }\n }\n}\n\nexport default DependentAttribute;\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,sBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,MAAMK,MAAM,GAAG,QAAQ;AACvB,MAAMC,QAAQ,GAAG,UAAU;AAC3B,MAAMC,UAAU,GAAG,WAAW;AAC9B,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,YAAY,GAAG,YAAY;AACjC,MAAMC,QAAQ,GAAG,SAAS;AAE1B,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,IAAI,GAAG,MAAM;;AAEnB;AACA;AACA;AACA,MAAMC,kBAAkB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBA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I;AAAA,IAAAyD,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAgNhCL,kBAAkB"}
|
|
1
|
+
{"version":3,"file":"DependentAttribute.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_constants","_ChoiceAttributeModel","_BooleanAttributeModel","_exceptions","EQUALS","INCLUDES","NOT_EQUALS","NOT_INCLUDES","NOT_IS_EMPTY","IS_EMPTY","SHOW","HIDE","DependentAttribute","BaseLayoutHintRule","constructor","arguments","_defineProperty2","default","isApplicableForHint","hint","regex","RegExp","DEPENDENT_ATTRIBUTE","test","getRuleInstance","initHint","rule","OPERATORS","DEPENDENT_ATTRIBUTE_CONTROL","isEmpyNotIsEmptRegex","result","match","action","control","operator","options","ConfigurationException","_action","_control","_operator","_options","_context","_map","split","call","option","_trim","processEqualsOptions","controlAttribute","ChoiceAttributeModel","BooleanAttributeModel","every","_context2","_includes","selected","processIncludesOptions","some","_context3","handleOperator","length","getControlAttribute","attributes","attribute","getAttributeByLayoutHint","process","processLayoutHintRules","isHidden","hide","label","_default","exports"],"sources":["../../../../src/models/attributes/layouthint-rules/DependentAttribute.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport {\n DEPENDENT_ATTRIBUTE_CONTROL,\n DEPENDENT_ATTRIBUTE,\n} from \"../../../constants\";\n\nimport ChoiceAttributeModel from \"../ChoiceAttributeModel\";\nimport BooleanAttributeModel from \"../BooleanAttributeModel\";\n\nimport { ConfigurationException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\nconst EQUALS = \"equals\";\nconst INCLUDES = \"includes\";\nconst NOT_EQUALS = \"notEquals\";\nconst NOT_INCLUDES = \"notIncludes\";\nconst NOT_IS_EMPTY = \"notIsEmpty\";\nconst IS_EMPTY = \"isEmpty\";\n\nconst SHOW = \"show\";\nconst HIDE = \"hide\";\n\n/**\n * Depending attributes hint logic\n */\nclass DependentAttribute extends BaseLayoutHintRule {\n _action: string;\n _control: string;\n _operator: string;\n _options: Array<string>;\n\n /**\n */\n static checkHintApplicability: boolean = true;\n\n /**\n */\n static isApplicableForHint(hint: string): boolean {\n const regex = new RegExp(\n `^${DEPENDENT_ATTRIBUTE}\\\\s?(${SHOW}|${HIDE})`,\n \"i\",\n );\n\n return regex.test(hint);\n }\n\n /**\n * Used on initHint to create an instance of this rule\n */\n static getRuleInstance(): DependentAttribute {\n return new DependentAttribute();\n }\n\n /**\n */\n static initHint(hint: string): any {\n const rule = this.getRuleInstance();\n\n const OPERATORS = `${EQUALS}|${INCLUDES}|${NOT_EQUALS}|${NOT_INCLUDES}|${NOT_IS_EMPTY}|${IS_EMPTY}`;\n const regex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})\\\\s(.*)`,\n \"i\",\n );\n const isEmpyNotIsEmptRegex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})`,\n \"i\",\n );\n\n const result = hint.match(regex)\n ? hint.match(regex)\n : hint.match(isEmpyNotIsEmptRegex);\n\n if (result) {\n rule.action = result[1];\n rule.control = result[2];\n rule.operator = result[3];\n rule.options = !result[4] ? \"\" : result[4];\n } else {\n throw new ConfigurationException(\n `No dependent information found on layout hint: ${hint}`,\n );\n }\n\n return rule;\n }\n\n /**\n */\n get action(): string {\n return this._action;\n }\n\n /**\n */\n set action(action: string) {\n this._action = action;\n }\n\n /**\n */\n get control(): string {\n return this._control;\n }\n\n /**\n */\n set control(control: string) {\n this._control = control;\n }\n\n /**\n */\n get operator(): string {\n return this._operator;\n }\n\n /**\n */\n set operator(operator: string) {\n this._operator = operator;\n }\n\n /**\n */\n get options(): Array<string> {\n return this._options;\n }\n\n /**\n */\n set options(options: string): void {\n this._options = options.split(\"|\").map((option) => option.trim());\n }\n\n /**\n */\n processEqualsOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (\n controlAttribute instanceof ChoiceAttributeModel ||\n controlAttribute instanceof BooleanAttributeModel\n ) {\n return this.options.every((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with equals operator must be a choice, string or number attribute\",\n );\n }\n\n /**\n */\n processIncludesOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (controlAttribute instanceof ChoiceAttributeModel) {\n return this.options.some((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with includes operator must be a choice attribute\",\n );\n }\n\n /**\n */\n handleOperator(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n switch (this.operator) {\n case EQUALS:\n return this.processEqualsOptions(controlAttribute);\n case INCLUDES:\n return this.processIncludesOptions(controlAttribute);\n case NOT_EQUALS:\n return !this.processEqualsOptions(controlAttribute);\n case NOT_INCLUDES:\n return !this.processIncludesOptions(controlAttribute);\n case NOT_IS_EMPTY:\n return controlAttribute?.selected.length !== 0;\n case IS_EMPTY:\n return controlAttribute?.selected.length === 0;\n default:\n throw new ConfigurationException(\n `Unsupported operator for dependent question: ${this.operator}`,\n );\n }\n }\n\n /**\n */\n getControlAttribute(\n attributes: AttributeCollection,\n ): ChoiceAttributeModel | BooleanAttributeModel | null {\n const attribute = attributes.getAttributeByLayoutHint(\n `${DEPENDENT_ATTRIBUTE_CONTROL}:${this.control}`,\n `${DEPENDENT_ATTRIBUTE_CONTROL}: ${this.control}`,\n );\n\n if (\n attribute instanceof ChoiceAttributeModel ||\n attribute instanceof BooleanAttributeModel\n ) {\n return attribute;\n }\n\n return null;\n }\n\n /**\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n const controlAttribute = this.getControlAttribute(attributes);\n if (!controlAttribute) {\n return;\n }\n\n controlAttribute.processLayoutHintRules(attributes);\n if (controlAttribute.isHidden) {\n attribute.hide();\n return;\n }\n\n const result = this.handleOperator(controlAttribute);\n if (this.action === SHOW) {\n attribute.isHidden = !result;\n } else if (this.action === HIDE) {\n attribute.isHidden = result;\n } else {\n throw new ConfigurationException(\n `Unsupported action ${this.action} for dependent question on attribute: ${attribute.label}`,\n );\n }\n }\n}\n\nexport default DependentAttribute;\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,sBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,MAAMK,MAAM,GAAG,QAAQ;AACvB,MAAMC,QAAQ,GAAG,UAAU;AAC3B,MAAMC,UAAU,GAAG,WAAW;AAC9B,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,YAAY,GAAG,YAAY;AACjC,MAAMC,QAAQ,GAAG,SAAS;AAE1B,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,IAAI,GAAG,MAAM;;AAEnB;AACA;AACA;AACA,MAAMC,kBAAkB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;EAAA;EAUlD;AACF;EACE,OAAOC,mBAAmBA,CAACC,IAAY,EAAW;IAChD,MAAMC,KAAK,GAAG,IAAIC,MAAM,CACrB,IAAGC,8BAAoB,QAAOZ,IAAK,IAAGC,IAAK,GAAE,EAC9C,GACF,CAAC;IAED,OAAOS,KAAK,CAACG,IAAI,CAACJ,IAAI,CAAC;EACzB;;E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6BAAoB,IACzCa,SAAS,YAAYZ,8BAAqB,EAC1C;MACA,OAAOY,SAAS;IAClB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,OAAOA,CAACF,SAAyB,EAAED,UAA+B,EAAQ;IACxE,MAAMb,gBAAgB,GAAG,IAAI,CAACY,mBAAmB,CAACC,UAAU,CAAC;IAC7D,IAAI,CAACb,gBAAgB,EAAE;MACrB;IACF;IAEAA,gBAAgB,CAACiB,sBAAsB,CAACJ,UAAU,CAAC;IACnD,IAAIb,gBAAgB,CAACkB,QAAQ,EAAE;MAC7BJ,SAAS,CAACK,IAAI,CAAC,CAAC;MAChB;IACF;IAEA,MAAMrC,MAAM,GAAG,IAAI,CAAC4B,cAAc,CAACV,gBAAgB,CAAC;IACpD,IAAI,IAAI,CAAChB,MAAM,KAAKtB,IAAI,EAAE;MACxBoD,SAAS,CAACI,QAAQ,GAAG,CAACpC,MAAM;IAC9B,CAAC,MAAM,IAAI,IAAI,CAACE,MAAM,KAAKrB,IAAI,EAAE;MAC/BmD,SAAS,CAACI,QAAQ,GAAGpC,MAAM;IAC7B,CAAC,MAAM;MACL,MAAM,IAAIM,kCAAsB,CAC7B,sBAAqB,IAAI,CAACJ,MAAO,yCAAwC8B,SAAS,CAACM,KAAM,EAC5F,CAAC;IACH;EACF;AACF;AAhNE;AACF;AADE,IAAApD,gBAAA,CAAAC,OAAA,EANIL,kBAAkB,4BAQmB,IAAI;AAAA,IAAAyD,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAgNhCL,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintRuleCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_BaseLayoutHintRule","_DependentAttribute","_RemainingTotalUploadSize","_exceptions","layoutHintRules","DependentAttribute","RemainingTotalUploadSize","addLayoutHintRule","rule","push","exports","updateLayoutHintRules","updater","newRules","Array","isArray","IllegalReturnException","LayoutHintRuleCollection","BaseCollection","allRules","setLayoutHintRules","attribute","rules","forEach","isApplicableForAttribute","checkHintApplicability","layouthint","hint","isApplicableForHint","add","initHint","initAttribute","process","attributes","all","_default","default"],"sources":["../../../../src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../../base/BaseCollection\";\n\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport DependentAttribute from \"./DependentAttribute\";\nimport RemainingTotalUploadSize from \"./RemainingTotalUploadSize\";\n\nimport { IllegalReturnException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * Array of available layout hint rules\n * @private\n */\nlet layoutHintRules: Array<Class<BaseLayoutHintRule>> = [\n DependentAttribute,\n RemainingTotalUploadSize,\n];\n\n/**\n * Add custom layout hint rules\n */\nexport const addLayoutHintRule = (rule: Class<BaseLayoutHintRule>) => {\n layoutHintRules.push(rule);\n};\n\ntype LayoutHintRulesUpdater = (\n rules: Array<Class<BaseLayoutHintRule>>,\n) => Array<Class<BaseLayoutHintRule>>;\n\n/**\n * Update existing array of layout hint rules, use this to update or remove standard rules\n *\n * @example\n * // remove RemainingTotalUploadSize rule\n * updateLayoutHintRules((rules) => {\n * return rules.filter(rule => rule !== RemainingTotalUploadSize));\n * });\n */\nexport const updateLayoutHintRules = (updater: LayoutHintRulesUpdater) => {\n const newRules = updater(layoutHintRules);\n if (Array.isArray(newRules)) {\n layoutHintRules = newRules;\n } else {\n throw new IllegalReturnException(\n \"Result of updater of updateLayoutHintRules is not an array\",\n );\n }\n};\n\n/**\n * Collection of layout hint rules\n */\nclass LayoutHintRuleCollection extends BaseCollection<ILayoutHintRule> {\n /**\n * Retrieve all rules available in the collection\n */\n get allRules(): Array<Class<BaseLayoutHintRule>> {\n return layoutHintRules;\n }\n\n /**\n * Set layout hint rules on the applicable attributes\n */\n static setLayoutHintRules<T: AttributeType>(attribute: T): T {\n const rules = new LayoutHintRuleCollection();\n\n layoutHintRules.forEach((rule) => {\n if (rule.isApplicableForAttribute(attribute)) {\n if (rule.checkHintApplicability) {\n attribute.layouthint.forEach((hint) => {\n if (rule.isApplicableForHint(hint)) {\n rules.add(rule.initHint(hint));\n }\n });\n } else {\n rules.add(rule.initAttribute(attribute));\n }\n }\n });\n\n attribute.layoutHintRules = rules;\n\n return attribute;\n }\n\n /**\n * Process layout hint rules in the collection\n */\n process(attribute: AttributeModel, attributes: AttributeCollection) {\n this.all.forEach((rule) => {\n rule.process(attribute, attributes);\n });\n }\n}\n\nexport default LayoutHintRuleCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,yBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAMA;AACA;AACA;AACA;AACA,IAAIK,eAAiD,GAAG,CACtDC,2BAAkB,EAClBC,iCAAwB,CACzB;;AAED;AACA;AACA;AACO,MAAMC,iBAAiB,GAAIC,IAA+B,IAAK;EACpEJ,eAAe,CAACK,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAMF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAIC,OAA+B,IAAK;EACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACR,eAAe,CAAC;EACzC,IAAIU,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3BT,eAAe,GAAGS,QAAQ;EAC5B,CAAC,MAAM;IACL,MAAM,IAAIG,kCAAsB,CAC9B,4DACF,CAAC;EACH;AACF,CAAC;;AAED;AACA;AACA;AAFAN,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGA,MAAMM,wBAAwB,SAASC,uBAAc,CAAkB;EACrE;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAqC;IAC/C,OAAOf,eAAe;EACxB;;EAEA;AACF;AACA;EACE,OAAOgB,kBAAkBA,CAAmBC,SAAY,EAAK;IAC3D,MAAMC,KAAK,GAAG,IAAIL,wBAAwB,CAAC,CAAC;IAE5Cb,eAAe,CAACmB,OAAO,CAAEf,IAAI,IAAK;MAChC,IAAIA,IAAI,CAACgB,wBAAwB,CAACH,SAAS,CAAC,EAAE;QAC5C,IAAIb,IAAI,CAACiB,sBAAsB,EAAE;UAC/BJ,SAAS,CAACK,UAAU,CAACH,OAAO,CAAEI,IAAI,IAAK;YACrC,IAAInB,IAAI,CAACoB,mBAAmB,CAACD,IAAI,CAAC,EAAE;cAClCL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACsB,QAAQ,CAACH,IAAI,CAAC,CAAC;YAChC;UACF,CAAC,CAAC;QACJ,CAAC,MAAM;UACLL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACuB,aAAa,CAACV,SAAS,CAAC,CAAC;QAC1C;MACF;IACF,CAAC,CAAC;IAEFA,SAAS,CAACjB,eAAe,GAAGkB,KAAK;IAEjC,OAAOD,SAAS;EAClB;;EAEA;AACF;AACA;EACEW,OAAOA,CAACX,SAAyB,EAAEY,UAA+B,EAAE;IAClE,IAAI,CAACC,GAAG,CAACX,OAAO,CAAEf,IAAI,IAAK;MACzBA,IAAI,CAACwB,OAAO,CAACX,SAAS,EAAEY,UAAU,CAAC;IACrC,CAAC,CAAC;EACJ;AACF;AAAC,IAAAE,QAAA,GAAAzB,OAAA,CAAA0B,OAAA,GAEcnB,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"LayoutHintRuleCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_BaseLayoutHintRule","_DependentAttribute","_RemainingTotalUploadSize","_exceptions","layoutHintRules","DependentAttribute","RemainingTotalUploadSize","addLayoutHintRule","rule","push","exports","updateLayoutHintRules","updater","newRules","Array","isArray","IllegalReturnException","LayoutHintRuleCollection","BaseCollection","allRules","setLayoutHintRules","attribute","rules","forEach","isApplicableForAttribute","checkHintApplicability","layouthint","hint","isApplicableForHint","add","initHint","initAttribute","process","attributes","all","_default","default"],"sources":["../../../../src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../../base/BaseCollection\";\n\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport DependentAttribute from \"./DependentAttribute\";\nimport RemainingTotalUploadSize from \"./RemainingTotalUploadSize\";\n\nimport { IllegalReturnException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * Array of available layout hint rules\n * @private\n */\nlet layoutHintRules: Array<Class<BaseLayoutHintRule>> = [\n DependentAttribute,\n RemainingTotalUploadSize,\n];\n\n/**\n * Add custom layout hint rules\n */\nexport const addLayoutHintRule = (rule: Class<BaseLayoutHintRule>) => {\n layoutHintRules.push(rule);\n};\n\ntype LayoutHintRulesUpdater = (\n rules: Array<Class<BaseLayoutHintRule>>,\n) => Array<Class<BaseLayoutHintRule>>;\n\n/**\n * Update existing array of layout hint rules, use this to update or remove standard rules\n *\n * @example\n * // remove RemainingTotalUploadSize rule\n * updateLayoutHintRules((rules) => {\n * return rules.filter(rule => rule !== RemainingTotalUploadSize));\n * });\n */\nexport const updateLayoutHintRules = (updater: LayoutHintRulesUpdater) => {\n const newRules = updater(layoutHintRules);\n if (Array.isArray(newRules)) {\n layoutHintRules = newRules;\n } else {\n throw new IllegalReturnException(\n \"Result of updater of updateLayoutHintRules is not an array\",\n );\n }\n};\n\n/**\n * Collection of layout hint rules\n */\nclass LayoutHintRuleCollection extends BaseCollection<ILayoutHintRule> {\n /**\n * Retrieve all rules available in the collection\n */\n get allRules(): Array<Class<BaseLayoutHintRule>> {\n return layoutHintRules;\n }\n\n /**\n * Set layout hint rules on the applicable attributes\n */\n static setLayoutHintRules<T: AttributeType>(attribute: T): T {\n const rules = new LayoutHintRuleCollection();\n\n layoutHintRules.forEach((rule) => {\n if (rule.isApplicableForAttribute(attribute)) {\n if (rule.checkHintApplicability) {\n attribute.layouthint.forEach((hint) => {\n if (rule.isApplicableForHint(hint)) {\n rules.add(rule.initHint(hint));\n }\n });\n } else {\n rules.add(rule.initAttribute(attribute));\n }\n }\n });\n\n attribute.layoutHintRules = rules;\n\n return attribute;\n }\n\n /**\n * Process layout hint rules in the collection\n */\n process(attribute: AttributeModel, attributes: AttributeCollection) {\n this.all.forEach((rule) => {\n rule.process(attribute, attributes);\n });\n }\n}\n\nexport default LayoutHintRuleCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,yBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAMA;AACA;AACA;AACA;AACA,IAAIK,eAAiD,GAAG,CACtDC,2BAAkB,EAClBC,iCAAwB,CACzB;;AAED;AACA;AACA;AACO,MAAMC,iBAAiB,GAAIC,IAA+B,IAAK;EACpEJ,eAAe,CAACK,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAMF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAIC,OAA+B,IAAK;EACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACR,eAAe,CAAC;EACzC,IAAIU,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3BT,eAAe,GAAGS,QAAQ;EAC5B,CAAC,MAAM;IACL,MAAM,IAAI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ize.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_UploadAttributeModel","_constants","RemainingTotalUploadSize","BaseLayoutHintRule","isApplicableForAttribute","attribute","UploadAttributeModel","initAttribute","processUploadInformation","attributes","uploadInformationAttributes","getAttributesByLayoutHint","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","length","firstHasInitialTotalFileSize","layouthint","has","initialTotalFileSize","value","maxTotalFileSize","process","_default","exports","default"],"sources":["../../../../src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport UploadAttributeModel from \"../UploadAttributeModel\";\n\nimport { INITIAL_TOTAL_FILESIZE, MAX_TOTAL_FILESIZE } from \"../../../constants\";\n\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * This pattern enables showing the upload file size remaining when uploading resources<br>\n * The rule depends on other attributes with the INITIAL_TOTAL_FILESIZE and MAX_TOTAL_FILESIZE layout hints\n */\nclass RemainingTotalUploadSize extends BaseLayoutHintRule {\n /**\n */\n static isApplicableForAttribute(attribute: AttributeType): boolean {\n return attribute instanceof UploadAttributeModel;\n }\n\n /**\n */\n static initAttribute(): ILayoutHintRule {\n return new RemainingTotalUploadSize();\n }\n\n /**\n */\n processUploadInformation(\n attribute: UploadAttributeModel,\n attributes: AttributeCollection,\n ) {\n const uploadInformationAttributes = attributes.getAttributesByLayoutHint(\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n );\n\n if (uploadInformationAttributes.length === 2) {\n const firstHasInitialTotalFileSize =\n uploadInformationAttributes[0].layouthint.has(INITIAL_TOTAL_FILESIZE);\n\n const initialTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[0].value\n : uploadInformationAttributes[1].value;\n\n const maxTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[1].value\n : uploadInformationAttributes[0].value;\n\n attribute.initialTotalFileSize = initialTotalFileSize;\n attribute.maxTotalFileSize = maxTotalFileSize;\n }\n }\n\n /**\n * Sets tresholds for initial and maximum upload file size\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n if (attribute instanceof UploadAttributeModel) {\n this.processUploadInformation(attribute, attributes);\n }\n }\n}\n\nexport default RemainingTotalUploadSize;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA,MAAMG,wBAAwB,SAASC,2BAAkB,CAAC;EACxD;AACF;EACE,OAAOC,wBAAwBA,CAACC,SAAwB,EAAW;IACjE,OAAOA,SAAS,YAAYC,6BAAoB;EAClD;;EAEA;AACF;EACE,OAAOC,aAAaA,CAAA,EAAoB;IACtC,OAAO,IAAIL,wBAAwB,CAAC,CAAC;EACvC;;EAEA;AACF;EACEM,wBAAwBA,CACtBH,SAA+B,EAC/BI,UAA+B,EAC/B;IACA,MAAMC,2BAA2B,GAAGD,UAAU,CAACE,yBAAyB,CACtEC,iCAAsB,EACtBC,6BACF,CAAC;IAED,IAAIH,2BAA2B,CAACI,MAAM,KAAK,CAAC,EAAE;MAC5C,MAAMC,4BAA4B,GAChCL,2BAA2B,CAAC,CAAC,CAAC,CAACM,UAAU,CAACC,GAAG,CAACL,iCAAsB,CAAC;MAEvE,MAAMM,oBAAoB,GAAGH,4BAA4B,GACrDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExC,MAAMC,gBAAgB,GAAGL,4BAA4B,GACjDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExCd,SAAS,CAACa,oBAAoB,GAAGA,oBAAoB;MACrDb,SAAS,CAACe,gBAAgB,GAAGA,gBAAgB;IAC/C;EACF;;EAEA;AACF;AACA;EACEC,OAAOA,CAAChB,SAAyB,EAAEI,UAA+B,EAAQ;IACxE,IAAIJ,SAAS,YAAYC,6BAAoB,EAAE;MAC7C,IAAI,CAACE,wBAAwB,CAACH,SAAS,EAAEI,UAAU,CAAC;IACtD;EACF;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"RemainingTotalUploadSize.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_UploadAttributeModel","_constants","RemainingTotalUploadSize","BaseLayoutHintRule","isApplicableForAttribute","attribute","UploadAttributeModel","initAttribute","processUploadInformation","attributes","uploadInformationAttributes","getAttributesByLayoutHint","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","length","firstHasInitialTotalFileSize","layouthint","has","initialTotalFileSize","value","maxTotalFileSize","process","_default","exports","default"],"sources":["../../../../src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport UploadAttributeModel from \"../UploadAttributeModel\";\n\nimport { INITIAL_TOTAL_FILESIZE, MAX_TOTAL_FILESIZE } from \"../../../constants\";\n\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * This pattern enables showing the upload file size remaining when uploading resources<br>\n * The rule depends on other attributes with the INITIAL_TOTAL_FILESIZE and MAX_TOTAL_FILESIZE layout hints\n */\nclass RemainingTotalUploadSize extends BaseLayoutHintRule {\n /**\n */\n static isApplicableForAttribute(attribute: AttributeType): boolean {\n return attribute instanceof UploadAttributeModel;\n }\n\n /**\n */\n static initAttribute(): ILayoutHintRule {\n return new RemainingTotalUploadSize();\n }\n\n /**\n */\n processUploadInformation(\n attribute: UploadAttributeModel,\n attributes: AttributeCollection,\n ) {\n const uploadInformationAttributes = attributes.getAttributesByLayoutHint(\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n );\n\n if (uploadInformationAttributes.length === 2) {\n const firstHasInitialTotalFileSize =\n uploadInformationAttributes[0].layouthint.has(INITIAL_TOTAL_FILESIZE);\n\n const initialTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[0].value\n : uploadInformationAttributes[1].value;\n\n const maxTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[1].value\n : uploadInformationAttributes[0].value;\n\n attribute.initialTotalFileSize = initialTotalFileSize;\n attribute.maxTotalFileSize = maxTotalFileSize;\n }\n }\n\n /**\n * Sets tresholds for initial and maximum upload file size\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n if (attribute instanceof UploadAttributeModel) {\n this.processUploadInformation(attribute, attributes);\n }\n }\n}\n\nexport default RemainingTotalUploadSize;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA,MAAMG,wBAAwB,SAASC,2BAAkB,CAAC;EACxD;AACF;EACE,OAAOC,wBAAwBA,CAACC,SAAwB,EAAW;IACjE,OAAOA,SAAS,YAAYC,6BAAoB;EAClD;;EAEA;AACF;EACE,OAAOC,aAAaA,CAAA,EAAoB;IACtC,OAAO,IAAIL,wBAAwB,CAAC,CAAC;EACvC;;EAEA;AACF;EACEM,wBAAwBA,CACtBH,SAA+B,EAC/BI,UAA+B,EAC/B;IACA,MAAMC,2BAA2B,GAAGD,UAAU,CAACE,yBAAyB,CACtEC,iCAAsB,EACtBC,6BACF,CAAC;IAED,IAAIH,2BAA2B,CAACI,MAAM,KAAK,CAAC,EAAE;MAC5C,MAAMC,4BAA4B,GAChCL,2BAA2B,CAAC,CAAC,CAAC,CAACM,UAAU,CAACC,GAAG,CAACL,iCAAsB,CAAC;MAEvE,MAAMM,oBAAoB,GAAGH,4BAA4B,GACrDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExC,MAAMC,gBAAgB,GAAGL,4BAA4B,GACjDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExCd,SAAS,CAACa,oBAAoB,GAAGA,oBAAoB;MACrDb,SAAS,CAACe,gBAAgB,GAAGA,gBAAgB;IAC/C;EACF;;EAEA;AACF;AACA;EACEC,OAAOA,CAAChB,SAAyB,EAAEI,UAA+B,EAAQ;IACxE,IAAIJ,SAAS,YAAYC,6BAAoB,EAAE;MAC7C,IAAI,CAACE,wBAAwB,CAACH,SAAS,EAAEI,UAAU,CAAC;IACtD;EACF;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,wBAAwB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCollection.js","names":["_full","require","BaseCollection","constructor","initCollection","arguments","length","undefined","_defineProperty2","default","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","_context","_context2","_slice","call","hasItems","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","_context3","_find","filter","_context4","_filter","some","every","map","_context5","_map","forEach","sort","compareFn","_context6","_sort","sorted","_context7","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseCollection.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\n/**\n * Base class for collections of models\n */\nclass BaseCollection<T> {\n _collection: Array<T>;\n\n /**\n * Construct base collection\n */\n constructor(initCollection: Array<T> = []) {\n this.collection = initCollection;\n }\n\n /**\n * Retrieve current collection\n */\n get collection(): Array<T> {\n return this._collection;\n }\n\n /**\n * Replace current collection with a new collection\n */\n set collection(collection: Array<T>) {\n this._collection = collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | Array<T> | T): BaseCollection<T> {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n // $FlowExpectedError[incompatible-type]\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n\n return this;\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n get hasItems(): boolean {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n get isEmpty(): boolean {\n return !this.hasItems;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all(): Array<T> {\n return this.collection;\n }\n\n /**\n * Get the size of this collection\n */\n get size(): number {\n return this.length;\n }\n\n /**\n * Get the size of this collection\n */\n get length(): number {\n return this.collection.length;\n }\n\n /**\n * Return first link in collection\n */\n get first(): T | null {\n return this.collection[0] ?? null;\n }\n\n /**\n */\n get last(): T | null {\n return this.collection[this.collection.length - 1] ?? null;\n }\n\n /**\n */\n get(index: number): T | null {\n return this.collection[index] ?? null;\n }\n\n /**\n * Find item\n */\n find(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): T | null {\n return this.collection.find(callbackfn, thisArg) ?? null;\n }\n\n /**\n * Filter items\n */\n filter(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): Array<T> {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.some(callbackfn, thisArg);\n }\n\n /**\n */\n every(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.every(callbackfn, thisArg);\n }\n\n /**\n */\n map<U>(\n callbackfn: (value: T, index: number, array: Array<T>) => U,\n thisArg?: T,\n ): Array<U> {\n return this.collection.map<U, ?T>(callbackfn, thisArg);\n }\n\n /**\n */\n forEach(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n /**\n */\n sort(compareFn?: (a: T, b: T) => number): Array<T> {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted(): Array<T> {\n return this.collection.sort();\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): this {\n return klona(this);\n }\n}\n\nexport default BaseCollection;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,cAAc,CAAI;EAGtB;AACF;AACA;EACEC,WAAWA,CAAA,EAAgC;IAAA,IAA/BC,cAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IACvC,IAAI,CAACC,UAAU,GAAGN,cAAc;EAClC;;EAEA;AACF;AACA;EACE,IAAIM,UAAUA,CAAA,EAAa;IACzB,OAAO,IAAI,CAACC,WAAW;EACzB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAACA,UAAoB,EAAE;IACnC,IAAI,CAACC,WAAW,GAAGD,UAAU;EAC/B;;EAEA;AACF;AACA;EACEE,GAAGA,CAACC,KAAuC,EAAqB;IAC9D,IAAIA,KAAK,YAAYX,cAAc,EAAE;MACnC,IAAI,CAACQ,UAAU,GAAG,CAAC,GAAG,IAAI,CAACA,UAAU,EAAE,GAAGG,KAAK,CAACC,GAAG,CAAC;IACtD,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;MA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OA,CACLZ,UAA6D,EAC7DC,OAAa,EACb;IACA,IAAI,CAACtB,UAAU,CAACiC,OAAO,CAACZ,UAAU,EAAEC,OAAO,CAAC;EAC9C;;EAEA;AACF;EACEY,IAAIA,CAACC,SAAkC,EAAY;IAAA,IAAAC,SAAA;IACjD,OAAO,IAAAC,KAAA,CAAAtC,OAAA,EAAAqC,SAAA,OAAI,CAACpC,UAAU,EAAAY,IAAA,CAAAwB,SAAA,EAAMD,SAAS,CAAC;EACxC;;EAEA;AACF;AACA;EACE,IAAIG,MAAMA,CAAA,EAAa;IAAA,IAAAC,SAAA;IACrB,OAAO,IAAAF,KAAA,CAAAtC,OAAA,EAAAwC,SAAA,OAAI,CAACvC,UAAU,EAAAY,IAAA,CAAA2B,SAAM,CAAC;EAC/B;;EAEA;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEcP,cAAc"}
|
|
1
|
+
{"version":3,"file":"BaseCollection.js","names":["_full","require","BaseCollection","constructor","initCollection","arguments","length","undefined","_defineProperty2","default","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","_context","_context2","_slice","call","hasItems","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","_context3","_find","filter","_context4","_filter","some","every","map","_context5","_map","forEach","sort","compareFn","_context6","_sort","sorted","_context7","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseCollection.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\n/**\n * Base class for collections of models\n */\nclass BaseCollection<T> {\n _collection: Array<T>;\n\n /**\n * Construct base collection\n */\n constructor(initCollection: Array<T> = []) {\n this.collection = initCollection;\n }\n\n /**\n * Retrieve current collection\n */\n get collection(): Array<T> {\n return this._collection;\n }\n\n /**\n * Replace current collection with a new collection\n */\n set collection(collection: Array<T>) {\n this._collection = collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | Array<T> | T): BaseCollection<T> {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n // $FlowExpectedError[incompatible-type]\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n\n return this;\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n get hasItems(): boolean {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n get isEmpty(): boolean {\n return !this.hasItems;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all(): Array<T> {\n return this.collection;\n }\n\n /**\n * Get the size of this collection\n */\n get size(): number {\n return this.length;\n }\n\n /**\n * Get the size of this collection\n */\n get length(): number {\n return this.collection.length;\n }\n\n /**\n * Return first link in collection\n */\n get first(): T | null {\n return this.collection[0] ?? null;\n }\n\n /**\n */\n get last(): T | null {\n return this.collection[this.collection.length - 1] ?? null;\n }\n\n /**\n */\n get(index: number): T | null {\n return this.collection[index] ?? null;\n }\n\n /**\n * Find item\n */\n find(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): T | null {\n return this.collection.find(callbackfn, thisArg) ?? null;\n }\n\n /**\n * Filter items\n */\n filter(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): Array<T> {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.some(callbackfn, thisArg);\n }\n\n /**\n */\n every(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.every(callbackfn, thisArg);\n }\n\n /**\n */\n map<U>(\n callbackfn: (value: T, index: number, array: Array<T>) => U,\n thisArg?: T,\n ): Array<U> {\n return this.collection.map<U, ?T>(callbackfn, thisArg);\n }\n\n /**\n */\n forEach(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n /**\n */\n sort(compareFn?: (a: T, b: T) => number): Array<T> {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted(): Array<T> {\n return this.collection.sort();\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): this {\n return klona(this);\n }\n}\n\nexport default BaseCollection;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,cAAc,CAAI;EAGtB;AACF;AACA;EACEC,WAAWA,CAAA,EAAgC;IAAA,IAA/BC,cAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IACvC,IAAI,CAACC,UAAU,GAAGN,cAAc;EAClC;;EAEA;AACF;AACA;EACE,IAAIM,UAAUA,CAAA,EAAa;IACzB,OAAO,IAAI,CAACC,WAAW;EACzB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAACA,UAAoB,EAAE;IACnC,IAAI,CAACC,WAAW,GAAGD,UAAU;EAC/B;;EAEA;AACF;AACA;EACEE,GAAGA,CAACC,KAAuC,EAAqB;IAC9D,IAAIA,KAAK,YAAYX,cAAc,EAAE;MACnC,IAAI,CAACQ,UAAU,GAAG,CAAC,GAAG,IAAI,CAACA,UAAU,EAAE,GAAGG,KAAK,CAACC,GAAG,CAAC;IACtD,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;MAC/B;MACA,IAAI,CAACH,UAAU,GAAG,CAAC,GAAG,IAAI,CAACA,UAAU,EA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C,OAAO,CAACZ,UAAU,EAAEC,OAAO,CAAC;EAC9C;;EAEA;AACF;EACEY,IAAIA,CAACC,SAAkC,EAAY;IAAA,IAAAC,SAAA;IACjD,OAAO,IAAAC,KAAA,CAAAtC,OAAA,EAAAqC,SAAA,OAAI,CAACpC,UAAU,EAAAY,IAAA,CAAAwB,SAAA,EAAMD,SAAS,CAAC;EACxC;;EAEA;AACF;AACA;EACE,IAAIG,MAAMA,CAAA,EAAa;IAAA,IAAAC,SAAA;IACrB,OAAO,IAAAF,KAAA,CAAAtC,OAAA,EAAAwC,SAAA,OAAI,CAACvC,UAAU,EAAAY,IAAA,CAAA2B,SAAM,CAAC;EAC/B;;EAEA;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEcP,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseModel.js","names":["_full","require","_LayoutHintCollection","_interopRequireDefault","BaseModel","constructor","data","contributions","_defineProperty2","default","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","arguments","length","undefined","layouthint","hasData","_keys","connectKey","key","_connectKey","dehydrate","rehydrate","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseModel.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nexport type BaseDehydrateData = {\n +data: Object,\n +contributions: Object,\n connectKey: string,\n ...\n};\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nclass BaseModel {\n _data: Object;\n _contributions: Object;\n _layouthint: LayoutHintCollection;\n _connectKey: string;\n\n /**\n * constructor\n */\n constructor(data: Object, contributions: Object) {\n this._data = data;\n this._contributions = contributions;\n this._layouthint = new LayoutHintCollection(\n this.getContribution(\"layouthint\", []),\n );\n }\n\n /**\n * Retrieve data\n */\n get data(): Object {\n return this._data || {};\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n getData(propName: string, defaultValue: any = null): any {\n return this.data[propName] ?? defaultValue;\n }\n\n /**\n * Retrieve contributions\n */\n get contributions(): Object {\n return this._contributions || {};\n }\n\n /**\n * Retrieve property from the contributions of the model, mostly used internal\n */\n getContribution(propName: string, defaultValue: any = null): any {\n return this.contributions[propName] ?? defaultValue;\n }\n\n /**\n * Getting the layouthint\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n * Set the layouthint\n */\n set layouthint(layouthint: Array<string>) {\n this._layouthint = new LayoutHintCollection(layouthint);\n }\n\n /**\n * Indicates if the model has data\n */\n get hasData(): boolean {\n return Object.keys(this.data).length > 0;\n }\n\n /**\n * Set the unique key for this model\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n * Get the unique key of this model\n */\n get connectKey(): string {\n return this._connectKey;\n }\n\n /**\n * Dehydrate internal data, returns the information that is needed to recreate the model\n */\n dehydrate(): BaseDehydrateData {\n return {\n data: this._data,\n contributions: this._contributions,\n connectKey: this._connectKey,\n };\n }\n\n /**\n * Recreate the model with the given data\n */\n rehydrate(data: BaseDehydrateData) {\n this._connectKey = data.connectKey;\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): any {\n return klona(this);\n }\n}\n\nexport default BaseModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,CAAC;EAMd;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA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C;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAUA,CAACC,GAAW,EAAE;IAC1B,IAAI,CAACC,WAAW,GAAGD,GAAG;EACxB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACE,WAAW;EACzB;;EAEA;AACF;AACA;EACEC,SAASA,CAAA,EAAsB;IAC7B,OAAO;MACLrB,IAAI,EAAE,IAAI,CAACI,KAAK;MAChBH,aAAa,EAAE,IAAI,CAACI,cAAc;MAClCa,UAAU,EAAE,IAAI,CAACE;IACnB,CAAC;EACH;;EAEA;AACF;AACA;EACEE,SAASA,CAACtB,IAAuB,EAAE;IACjC,IAAI,CAACoB,WAAW,GAAGpB,IAAI,CAACkB,UAAU;EACpC;;EAEA;AACF;AACA;EACEK,KAAKA,CAAA,EAAQ;IACX,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcL,SAAS"}
|
|
1
|
+
{"version":3,"file":"BaseModel.js","names":["_full","require","_LayoutHintCollection","_interopRequireDefault","BaseModel","constructor","data","contributions","_defineProperty2","default","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","arguments","length","undefined","layouthint","hasData","_keys","connectKey","key","_connectKey","dehydrate","rehydrate","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseModel.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nexport type BaseDehydrateData = {\n +data: Object,\n +contributions: Object,\n connectKey: string,\n ...\n};\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nclass BaseModel {\n _data: Object;\n _contributions: Object;\n _layouthint: LayoutHintCollection;\n _connectKey: string;\n\n /**\n * constructor\n */\n constructor(data: Object, contributions: Object) {\n this._data = data;\n this._contributions = contributions;\n this._layouthint = new LayoutHintCollection(\n this.getContribution(\"layouthint\", []),\n );\n }\n\n /**\n * Retrieve data\n */\n get data(): Object {\n return this._data || {};\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n getData(propName: string, defaultValue: any = null): any {\n return this.data[propName] ?? defaultValue;\n }\n\n /**\n * Retrieve contributions\n */\n get contributions(): Object {\n return this._contributions || {};\n }\n\n /**\n * Retrieve property from the contributions of the model, mostly used internal\n */\n getContribution(propName: string, defaultValue: any = null): any {\n return this.contributions[propName] ?? defaultValue;\n }\n\n /**\n * Getting the layouthint\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n * Set the layouthint\n */\n set layouthint(layouthint: Array<string>) {\n this._layouthint = new LayoutHintCollection(layouthint);\n }\n\n /**\n * Indicates if the model has data\n */\n get hasData(): boolean {\n return Object.keys(this.data).length > 0;\n }\n\n /**\n * Set the unique key for this model\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n * Get the unique key of this model\n */\n get connectKey(): string {\n return this._connectKey;\n }\n\n /**\n * Dehydrate internal data, returns the information that is needed to recreate the model\n */\n dehydrate(): BaseDehydrateData {\n return {\n data: this._data,\n contributions: this._contributions,\n connectKey: this._connectKey,\n };\n }\n\n /**\n * Recreate the model with the given data\n */\n rehydrate(data: BaseDehydrateData) {\n this._connectKey = data.connectKey;\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): any {\n return klona(this);\n }\n}\n\nexport default BaseModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,CAAC;EAMd;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC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AAC,CAACa,MAAM,GAAG,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAUA,CAACC,GAAW,EAAE;IAC1B,IAAI,CAACC,WAAW,GAAGD,GAAG;EACxB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACE,WAAW;EACzB;;EAEA;AACF;AACA;EACEC,SAASA,CAAA,EAAsB;IAC7B,OAAO;MACLrB,IAAI,EAAE,IAAI,CAACI,KAAK;MAChBH,aAAa,EAAE,IAAI,CAACI,cAAc;MAClCa,UAAU,EAAE,IAAI,CAACE;IACnB,CAAC;EACH;;EAEA;AACF;AACA;EACEE,SAASA,CAACtB,IAAuB,EAAE;IACjC,IAAI,CAACoB,WAAW,GAAGpB,IAAI,CAACkB,UAAU;EACpC;;EAEA;AACF;AACA;EACEK,KAAKA,CAAA,EAAQ;IACX,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcL,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","ResourceCollection","BaseCollection","getInitialChildModelLinks","initialChildModelLinks","collection","forEach","item","push","setChildModels","models","_default","exports","default"],"sources":["../../../src/models/base/ResourceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"./BaseCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * The ResourceCollection makes it possible to add child models to a collection of models\n * These child models are fetched using the ModularUI util\n */\nclass ResourceCollection<T: IModelWithChildModels> extends BaseCollection<T> {\n /**\n * Retrieve all child model links and flatten it into an array with single entries, removing all undefined items\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const initialChildModelLinks = [];\n\n this.collection.forEach((item: T) => {\n // $FlowFixMe[method-unbinding]\n if (typeof item?.getInitialChildModelLinks === \"function\") {\n initialChildModelLinks.push(...item.getInitialChildModelLinks());\n }\n });\n\n return initialChildModelLinks;\n }\n\n /**\n * Pass through models for setchildmodels to items of this collection\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.collection.forEach((item) => {\n // $FlowFixMe[prop-missing]\n if (typeof item[\"setChildModels\"] === \"function\") {\n item.setChildModels(models);\n }\n });\n }\n}\n\nexport default ResourceCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAAmCC,uBAAc,CAAI;EAC3E;AACF;AACA;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,sBAAsB,GAAG,EAAE;IAEjC,IAAI,CAACC,UAAU,CAACC,OAAO,CAAEC,IAAO,IAAK;MACnC;MACA,IAAI,OAAOA,IAAI,EAAEJ,yBAAyB,KAAK,UAAU,EAAE;QACzDC,sBAAsB,CAACI,IAAI,CAAC,GAAGD,IAAI,CAACJ,yBAAyB,CAAC,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;IAEF,OAAOC,sBAAsB;EAC/B;;EAEA;AACF;AACA;EACEK,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACL,UAAU,CAACC,OAAO,CAAEC,IAAI,IAAK;MAChC;MACA,IAAI,OAAOA,IAAI,CAAC,gBAAgB,CAAC,KAAK,UAAU,EAAE;QAChDA,IAAI,CAACE,cAAc,CAACC,MAAM,CAAC;MAC7B;IACF,CAAC,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,kBAAkB"}
|
|
1
|
+
{"version":3,"file":"ResourceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","ResourceCollection","BaseCollection","getInitialChildModelLinks","initialChildModelLinks","collection","forEach","item","push","setChildModels","models","_default","exports","default"],"sources":["../../../src/models/base/ResourceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"./BaseCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * The ResourceCollection makes it possible to add child models to a collection of models\n * These child models are fetched using the ModularUI util\n */\nclass ResourceCollection<T: IModelWithChildModels> extends BaseCollection<T> {\n /**\n * Retrieve all child model links and flatten it into an array with single entries, removing all undefined items\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const initialChildModelLinks = [];\n\n this.collection.forEach((item: T) => {\n // $FlowFixMe[method-unbinding]\n if (typeof item?.getInitialChildModelLinks === \"function\") {\n initialChildModelLinks.push(...item.getInitialChildModelLinks());\n }\n });\n\n return initialChildModelLinks;\n }\n\n /**\n * Pass through models for setchildmodels to items of this collection\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.collection.forEach((item) => {\n // $FlowFixMe[prop-missing]\n if (typeof item[\"setChildModels\"] === \"function\") {\n item.setChildModels(models);\n }\n });\n }\n}\n\nexport default ResourceCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAAmCC,uBAAc,CAAI;EAC3E;AACF;AACA;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,sBAAsB,GAAG,EAAE;IAEjC,IAAI,CAACC,UAAU,CAACC,OAAO,CAAEC,IAAO,IAAK;MACnC;MACA,IAAI,OAAOA,IAAI,EAAEJ,yBAAyB,KAAK,UAAU,EAAE;QACzDC,sBAAsB,CAACI,IAAI,CAAC,GAAGD,IAAI,CAACJ,yBAAyB,CAAC,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;IAEF,OAAOC,sBAAsB;EAC/B;;EAEA;AACF;AACA;EACEK,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACL,UAAU,CAACC,OAAO,CAAEC,IAAI,IAAK;MAChC;MACA,IAAI,OAAOA,IAAI,CAAC,gBAAgB,CAAC,KAAK,UAAU,EAAE;QAChDA,IAAI,CAACE,cAAc,CAACC,MAAM,CAAC;MAC7B;IACF,CAAC,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_BaseModel","_LinkCollection","_exceptions","ResourceModel","BaseModel","constructor","modularuiResponse","arguments","length","undefined","ModularUIResponse","data","contributions","_defineProperty2","default","_key","key","_locale","locale","_childModels","_lastServerUpdate","Date","now","modelName","IllegalStateException","isApplicableModel","IllegalArgumentException","Error","lastServerUpdate","type","resourcetype","getContribution","label","links","_links","LinkCollection","Array","isArray","self","downloadLink","getLinksByGroup","first","selflink","getLinkByKey","selfhref","href","getInitialChildModelLinks","childModels","addChildModels","models","_context","flattenModels","_concat","call","setChildModels","dehydrate","_context2","_map","childModel","_default","exports"],"sources":["../../../src/models/base/ResourceModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport BaseModel from \"./BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport {\n IllegalArgumentException,\n IllegalStateException,\n} from \"../../exceptions\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\n\n/**\n * Base model, this the foundation for models that represent modular ui services, e.g. application, tab, caseview, etc\n */\nclass ResourceModel extends BaseModel implements IModelWithChildModels {\n _key: string;\n _locale: string;\n _childModels: Array<ModularUIModel>;\n _links: LinkCollection;\n _lastServerUpdate: number;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(modularuiResponse.data, modularuiResponse.contributions);\n\n this._key = modularuiResponse.key;\n this._locale = modularuiResponse.locale;\n\n this._childModels = [];\n\n this._lastServerUpdate = Date.now();\n }\n\n /**\n * Property to render name of a model, is original name after transpilation\n */\n static get modelName(): string {\n throw new IllegalStateException(`No modelName set on the resource model`);\n }\n\n /**\n * Returns true when the model is supported based on configuration found in contributions\n *\n * @abstract\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n if (!(data instanceof ModularUIResponse)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a ModularUIResponse\",\n );\n }\n\n throw new Error(\"No isApplicableModel condition set on resourcemodel\");\n }\n\n /**\n */\n get lastServerUpdate(): number {\n return this._lastServerUpdate;\n }\n\n /**\n */\n set lastServerUpdate(lastServerUpdate: number) {\n this._lastServerUpdate = lastServerUpdate;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get type of model\n *\n * @abstract\n */\n get type(): string {\n throw new IllegalStateException(\n `No type set on the resource model with key ${this.key}`,\n );\n }\n\n /**\n * Retrieve type of resource\n */\n get resourcetype(): string {\n return this.getContribution(\"resourcetype\", \"unknown\");\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n {\n self: {\n resourcetype: this.resourcetype,\n },\n ...this.contributions._links,\n },\n );\n }\n return this._links;\n }\n\n /**\n */\n set links(links: LinkCollection) {\n this._links = links;\n }\n\n /**\n *\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n if (downloadLink) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new IllegalStateException(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n * Add links to expand on initialization of this model\n *\n * @abstract\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return [];\n }\n\n /**\n * Retrieve links of expanded child models\n */\n get childModels(): Array<ModularUIModel> {\n return this._childModels;\n }\n\n /**\n * Add child models to this model\n */\n addChildModels(models: Array<ModularUIModel>): this {\n const flattenModels = [].concat(...models);\n\n this._childModels = flattenModels;\n\n this.setChildModels(flattenModels);\n\n return this;\n }\n\n /**\n * Template to set expanded child models\n * Use this hook to separate the retrieved child models into the correct models.\n *\n * @abstract\n * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>\n */\n setChildModels(models: Array<ModularUIModel>): void {\n if (!models) {\n throw new IllegalArgumentException(\"No models send to setChildModels\");\n }\n }\n\n /**\n */\n dehydrate(): Object {\n return {\n ...super.dehydrate(),\n key: this._key,\n locale: this._locale,\n // $FlowFixMe[missing-type-arg]\n childModels: this._childModels.map<ModularUIModel>(\n (childModel: ModularUIModel) => childModel.dehydrate(),\n ),\n };\n }\n}\n\nexport default ResourceModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AASA;AACA;AACA;AACA,MAAMI,aAAa,SAASC,kBAAS,CAAkC;EAOrE;AACF;AACA;EACEC,WAAWA,CAAA,EAAiE;IAAA,IAAhEC,iBAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAIG,0BAAiB,CAAC,CAAC;IACxE,KAAK,CAACJ,iBAAiB,CAACK,IAAI,EAAEL,iBAAiB,CAACM,aAAa,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,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E,IAAIE,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAI,CAACF,QAAQ,CAACG,IAAI;EAC3B;;EAEA;AACF;AACA;AACA;AACA;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAA0B;IACvC,OAAO,IAAI,CAAC5B,YAAY;EAC1B;;EAEA;AACF;AACA;EACE6B,cAAcA,CAACC,MAA6B,EAAQ;IAAA,IAAAC,QAAA;IAClD,MAAMC,aAAa,GAAG,IAAAC,OAAA,CAAAtC,OAAA,EAAAoC,QAAA,KAAE,EAAAG,IAAA,CAAAH,QAAA,EAAQ,GAAGD,MAAM,CAAC;IAE1C,IAAI,CAAC9B,YAAY,GAAGgC,aAAa;IAEjC,IAAI,CAACG,cAAc,CAACH,aAAa,CAAC;IAElC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,cAAcA,CAACL,MAA6B,EAAQ;IAClD,IAAI,CAACA,MAAM,EAAE;MACX,MAAM,IAAIvB,oCAAwB,CAAC,kCAAkC,CAAC;IACxE;EACF;;EAEA;AACF;EACE6B,SAASA,CAAA,EAAW;IAAA,IAAAC,SAAA;IAClB,OAAO;MACL,GAAG,KAAK,CAACD,SAAS,CAAC,CAAC;MACpBvC,GAAG,EAAE,IAAI,CAACD,IAAI;MACdG,MAAM,EAAE,IAAI,CAACD,OAAO;MACpB;MACA8B,WAAW,EAAE,IAAAU,IAAA,CAAA3C,OAAA,EAAA0C,SAAA,OAAI,CAACrC,YAAY,EAAAkC,IAAA,CAAAG,SAAA,EAC3BE,UAA0B,IAAKA,UAAU,CAACH,SAAS,CAAC,CACvD;IACF,CAAC;EACH;AACF;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEcX,aAAa"}
|
|
1
|
+
{"version":3,"file":"ResourceModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_BaseModel","_LinkCollection","_exceptions","ResourceModel","BaseModel","constructor","modularuiResponse","arguments","length","undefined","ModularUIResponse","data","contributions","_defineProperty2","default","_key","key","_locale","locale","_childModels","_lastServerUpdate","Date","now","modelName","IllegalStateException","isApplicableModel","IllegalArgumentException","Error","lastServerUpdate","type","resourcetype","getContribution","label","links","_links","LinkCollection","Array","isArray","self","downloadLink","getLinksByGroup","first","selflink","getLinkByKey","selfhref","href","getInitialChildModelLinks","childModels","addChildModels","models","_context","flattenModels","_concat","call","setChildModels","dehydrate","_context2","_map","childModel","_default","exports"],"sources":["../../../src/models/base/ResourceModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport BaseModel from \"./BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport {\n IllegalArgumentException,\n IllegalStateException,\n} from \"../../exceptions\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\n\n/**\n * Base model, this the foundation for models that represent modular ui services, e.g. application, tab, caseview, etc\n */\nclass ResourceModel extends BaseModel implements IModelWithChildModels {\n _key: string;\n _locale: string;\n _childModels: Array<ModularUIModel>;\n _links: LinkCollection;\n _lastServerUpdate: number;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(modularuiResponse.data, modularuiResponse.contributions);\n\n this._key = modularuiResponse.key;\n this._locale = modularuiResponse.locale;\n\n this._childModels = [];\n\n this._lastServerUpdate = Date.now();\n }\n\n /**\n * Property to render name of a model, is original name after transpilation\n */\n static get modelName(): string {\n throw new IllegalStateException(`No modelName set on the resource model`);\n }\n\n /**\n * Returns true when the model is supported based on configuration found in contributions\n *\n * @abstract\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n if (!(data instanceof ModularUIResponse)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a ModularUIResponse\",\n );\n }\n\n throw new Error(\"No isApplicableModel condition set on resourcemodel\");\n }\n\n /**\n */\n get lastServerUpdate(): number {\n return this._lastServerUpdate;\n }\n\n /**\n */\n set lastServerUpdate(lastServerUpdate: number) {\n this._lastServerUpdate = lastServerUpdate;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get type of model\n *\n * @abstract\n */\n get type(): string {\n throw new IllegalStateException(\n `No type set on the resource model with key ${this.key}`,\n );\n }\n\n /**\n * Retrieve type of resource\n */\n get resourcetype(): string {\n return this.getContribution(\"resourcetype\", \"unknown\");\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n {\n self: {\n resourcetype: this.resourcetype,\n },\n ...this.contributions._links,\n },\n );\n }\n return this._links;\n }\n\n /**\n */\n set links(links: LinkCollection) {\n this._links = links;\n }\n\n /**\n *\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n if (downloadLink) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new IllegalStateException(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n * Add links to expand on initialization of this model\n *\n * @abstract\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return [];\n }\n\n /**\n * Retrieve links of expanded child models\n */\n get childModels(): Array<ModularUIModel> {\n return this._childModels;\n }\n\n /**\n * Add child models to this model\n */\n addChildModels(models: Array<ModularUIModel>): this {\n const flattenModels = [].concat(...models);\n\n this._childModels = flattenModels;\n\n this.setChildModels(flattenModels);\n\n return this;\n }\n\n /**\n * Template to set expanded child models\n * Use this hook to separate the retrieved child models into the correct models.\n *\n * @abstract\n * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>\n */\n setChildModels(models: Array<ModularUIModel>): void {\n if (!models) {\n throw new IllegalArgumentException(\"No models send to setChildModels\");\n }\n }\n\n /**\n */\n dehydrate(): Object {\n return {\n ...super.dehydrate(),\n key: this._key,\n locale: this._locale,\n // $FlowFixMe[missing-type-arg]\n childModels: this._childModels.map<ModularUIModel>(\n (childModel: ModularUIModel) => childModel.dehydrate(),\n ),\n };\n }\n}\n\nexport default ResourceModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AASA;AACA;AACA;AACA,MAAMI,aAAa,SAASC,kBAAS,CAAkC;EAOrE;AACF;AACA;EACEC,WAAWA,CAAA,EAAiE;IAAA,IAAhEC,iBAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAIG,0BAAiB,CAAC,CAAC;IACxE,KAAK,CAACJ,iBAAiB,CAACK,IAAI,EAAEL,iBAAiB,CAACM,aAAa,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAE/D,IAAI,CAACC,IAAI,GAAGT,iBAAiB,CAACU,GAAG;IACjC,IAAI,CAACC,OAAO,GAAGX,iBAAiB,CAACY,MAAM;IAEvC,IAAI,CAACC,YAAY,GAAG,EAAE;IAEtB,IAAI,CAACC,iBAAiB,GAAGC,IAAI,C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,EAAQ;IAAA,IAAAC,QAAA;IAClD,MAAMC,aAAa,GAAG,IAAAC,OAAA,CAAAtC,OAAA,EAAAoC,QAAA,KAAE,EAAAG,IAAA,CAAAH,QAAA,EAAQ,GAAGD,MAAM,CAAC;IAE1C,IAAI,CAAC9B,YAAY,GAAGgC,aAAa;IAEjC,IAAI,CAACG,cAAc,CAACH,aAAa,CAAC;IAElC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,cAAcA,CAACL,MAA6B,EAAQ;IAClD,IAAI,CAACA,MAAM,EAAE;MACX,MAAM,IAAIvB,oCAAwB,CAAC,kCAAkC,CAAC;IACxE;EACF;;EAEA;AACF;EACE6B,SAASA,CAAA,EAAW;IAAA,IAAAC,SAAA;IAClB,OAAO;MACL,GAAG,KAAK,CAACD,SAAS,CAAC,CAAC;MACpBvC,GAAG,EAAE,IAAI,CAACD,IAAI;MACdG,MAAM,EAAE,IAAI,CAACD,OAAO;MACpB;MACA8B,WAAW,EAAE,IAAAU,IAAA,CAAA3C,OAAA,EAAA0C,SAAA,OAAI,CAACrC,YAAY,EAAAkC,IAAA,CAAAG,SAAA,EAC3BE,UAA0B,IAAKA,UAAU,CAACH,SAAS,CAAC,CACvD;IACF,CAAC;EACH;AACF;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEcX,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseViewModel.js","names":["_DetailModel","_interopRequireDefault","require","_Href","_TaskGroupCollection","_TaskGroupModel","_LayoutHints","_IllegalStateException","CaseViewModel","DetailModel","constructor","caseviewData","_defineProperty2","default","createTaskGroupCollection","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroupModels","i","length","TaskGroupModel","push","taskGroupCollection","add","casename","attributeCollection","getAttributeByLayoutHint","TITLE","label","value","viewLabel","getContribution","hasIntroText","introtext","_content","text","message","Array","isArray","texts","selfhref","selfLink","getLinkByKey","IllegalStateException","Href","href","_context","allTaskgroupData","getData","allTaskgroupContributions","_map","_filter","call","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_find","create","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","exports"],"sources":["../../../src/models/caseview/CaseViewModel.js"],"sourcesContent":["// @flow\nimport DetailModel from \"../detail/DetailModel\";\nimport Href from \"../href/Href\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport IllegalStateException from \"../../exceptions/IllegalStateException\";\n\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model containing the details of one case.\n */\nexport default class CaseViewModel extends DetailModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(caseviewData: ModularUIResponse) {\n super(caseviewData);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"CaseView\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseViewModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseView\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n * Getting panel links\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n super.setChildModels(models);\n\n const taskGroupModels = [];\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroupModels.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroupModels);\n }\n\n /**\n * Getting the case name\n */\n get casename(): ?AttributeType {\n return this.attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Retrieve the case label, this can be configured with a case property with the layout hint 'title'\n */\n get label(): string {\n return this.casename ? this.casename.value : \"\";\n }\n\n /**\n * Retrieve the label that was configured on the caseview\n */\n get viewLabel(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the case view\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the self href\n */\n get selfhref(): Href {\n const selfLink = this.links.getLinkByKey(\"self\");\n\n if (selfLink === null) {\n throw new IllegalStateException(\"No self href available\");\n }\n\n return new Href(selfLink.href);\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupData = this.getData(\"taskgroups\", []);\n const allTaskgroupContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupData\n .filter((taskgroup) =>\n allTaskgroupContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n ),\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): bo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B,CAACF,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAItC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACuC,oBAAoB;EAClC;;EAEA;AACF;AACA;EACEE,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACzC,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,CAAC0C,QAAQ;EACtE;AACF;AAACC,OAAA,CAAA/D,OAAA,GAAAL,aAAA"}
|
|
1
|
+
{"version":3,"file":"CaseViewModel.js","names":["_DetailModel","_interopRequireDefault","require","_Href","_TaskGroupCollection","_TaskGroupModel","_LayoutHints","_IllegalStateException","CaseViewModel","DetailModel","constructor","caseviewData","_defineProperty2","default","createTaskGroupCollection","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroupModels","i","length","TaskGroupModel","push","taskGroupCollection","add","casename","attributeCollection","getAttributeByLayoutHint","TITLE","label","value","viewLabel","getContribution","hasIntroText","introtext","_content","text","message","Array","isArray","texts","selfhref","selfLink","getLinkByKey","IllegalStateException","Href","href","_context","allTaskgroupData","getData","allTaskgroupContributions","_map","_filter","call","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_find","create","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","exports"],"sources":["../../../src/models/caseview/CaseViewModel.js"],"sourcesContent":["// @flow\nimport DetailModel from \"../detail/DetailModel\";\nimport Href from \"../href/Href\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport IllegalStateException from \"../../exceptions/IllegalStateException\";\n\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model containing the details of one case.\n */\nexport default class CaseViewModel extends DetailModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(caseviewData: ModularUIResponse) {\n super(caseviewData);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"CaseView\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseViewModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseView\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n * Getting panel links\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n super.setChildModels(models);\n\n const taskGroupModels = [];\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroupModels.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroupModels);\n }\n\n /**\n * Getting the case name\n */\n get casename(): ?AttributeType {\n return this.attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Retrieve the case label, this can be configured with a case property with the layout hint 'title'\n */\n get label(): string {\n return this.casename ? this.casename.value : \"\";\n }\n\n /**\n * Retrieve the label that was configured on the caseview\n */\n get viewLabel(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the case view\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the self href\n */\n get selfhref(): Href {\n const selfLink = this.links.getLinkByKey(\"self\");\n\n if (selfLink === null) {\n throw new IllegalStateException(\"No self href available\");\n }\n\n return new Href(selfLink.href);\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupData = this.getData(\"taskgroups\", []);\n const allTaskgroupContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupData\n .filter((taskgroup) =>\n allTaskgroupContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n ),\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,oBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACe,MAAMM,aAAa,SAASC,oBAAW,CAAC;EAGrD;AACF;EACEC,WAAWA,CAACC,YAA+B,EAAE;IAC3C,KAAK,CAACA,YAAY,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAEpB,IAAI,CAACC,yBAAyB,CAAC,CAAC;EAClC;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,O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AK,OAAA,CAAAjD,OAAA,EAAA6C,gBAAgB,EAAAK,IAAA,CAAhBL,gBAAgB,EAChCM,SAAS,IAChBJ,yBAAyB,CAACK,IAAI,CAC3BC,qBAAqB,IACpBA,qBAAqB,CAACC,IAAI,KAAKH,SAAS,CAACG,IAC7C,CACF,CAAC,EAAAJ,IAAA,CAAAN,QAAA,EACKO,SAAS,IAAK;MAClB,MAAMI,sBAAsB,GAAG,IAAAC,KAAA,CAAAxD,OAAA,EAAA+C,yBAAyB,EAAAG,IAAA,CAAzBH,yBAAyB,EACrDM,qBAAqB,IACpBA,qBAAqB,CAACC,IAAI,KAAKH,SAAS,CAACG,IAC7C,CAAC;MAED,OAAOpC,uBAAc,CAACuC,MAAM,CAC1BN,SAAS,CAACG,IAAI,EACdH,SAAS,EACTI,sBACF,CAAC;IACH,CAAC,CAAC;EACN;;EAEA;AACF;AACA;EACE,IAAInC,mBAAmBA,CAACsC,UAAiC,EAAE;IACzD,IAAI,CAACC,oBAAoB,GAAG,IAAIC,4BAAmB,CAACF,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAItC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACuC,oBAAoB;EAClC;;EAEA;AACF;AACA;EACEE,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACzC,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,CAAC0C,QAAQ;EACtE;AACF;AAACC,OAAA,CAAA/D,OAAA,GAAAL,aAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SCENARIO","decodedConceptTypeHref","decodeURIComponent","Array","isArray","some","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n )\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"STEP\",\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n \"STEP\",\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"PERSONA\",\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAOA;AACA;AACA,MAAMG,qBAAqB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;EAAA;EAGrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOT,qBAAqB,CAACU,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EAAEC,IAAI,EACrC,UACF,CAAC;EACH;;EAEA;AACF;EACE,OAAOH,eAAeA,CACpBI,eAAwB,EACxBC,WAA4C,EACnC;IACT,IAAI,CAACD,eAAe,EAAE;MACpB,OAAO,KAAK;IACd;IAEA,MAAME,SAAS,GAAG,wCAAwC;IAE1D,MAAMC,mBAAmB,GAAG;MAC1BC,IAAI,EAAE,IAAAC,oBAAU,EAAC,qCAAqC,EAAE,CACrD,GAAEH,SAAU,eAAc,CAC5B,CAAC;MACFI,OAAO,EAAE,IAAAD,oBAAU,EAAC,wCAAwC,EAAE,CAC3D,GAAEH,SAAU,UAAS,CACvB,CAAC;MACFK,QAAQ,EAAE,IAAAF,oBAAU,EAAC,gCAAgC,EAAE,CACpD,GAAEH,SAAU,mBAAkB,CAChC;IACH,CAAC;IAED,MAAMM,sBAAsB,GAAGC,kBAAkB,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AAO,CAACwB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACZ,IAAI,CAACgB,gBAAgB,CAACrB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOiB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAEcL,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SCENARIO","decodedConceptTypeHref","decodeURIComponent","Array","isArray","some","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n )\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"STEP\",\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n \"STEP\",\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"PERSONA\",\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAOA;AACA;AACA,MAAMG,qBAAqB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;EAAA;EAGrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOT,qBAAqB,CAACU,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EAAEC,IA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C,MAAMA,MAAM,GAAG,EAAE;IAEjB,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEC,YAAY,IAAK;MAAA,IAAAC,SAAA;MAC3C,MAAMC,gBAAgB,GAAG,IAAAZ,KAAA,CAAA7C,OAAA,EAAAwD,SAAA,GAAAD,YAAY,CAACvB,mBAAmB,EAAAR,IAAA,CAAAgC,SAAA,EACtDtB,QAAQ,IACPA,QAAQ,CAACC,SAAS,KAAK,UAAU,IACjCxC,qBAAqB,CAACU,eAAe,CACnC6B,QAAQ,CAACE,OAAO,CAACC,eAAe,EAAEC,IAAI,EACtC,SACF,CACJ,CAAC;MAED,MAAMoB,kBAAkB,GACtBD,gBAAgB,IAChB,CAACJ,MAAM,CAAChC,IAAI,CAAEsC,KAAK,IAAKA,KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACrB,OAAO,CAACwB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACZ,IAAI,CAACgB,gBAAgB,CAACrB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOiB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAEcL,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ConceptRelationCollection","_SourceReferenceCollection","_ConceptTypeDetailModel","_Constants","ConceptDetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_relations","ConceptRelationCollection","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","conceptTypeModel","_find","call","model","ConceptTypeDetailModel","conceptType","key","getData","selfhref","href","selflink","setParameter","TIMEVERSION_FILTER_NAME","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_map","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filter","_includes","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","SourceReferenceCollection","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWith","availableLanguages","split","value","exports"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAYA;AACA;AACA;AACe,MAAMK,kBAAkB,SAASC,sBAAa,CAAC;EAK5D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IA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C7B,OAAO,IAAA6C,OAAA,CAAAlD,OAAA,MAAI,CAACG,IAAI,IAAU6B,kCAAuB,CAAC,EAAEkE,KAAK,IAAI,IAAI;EACnE;AACF;AAACC,OAAA,CAAAnG,OAAA,GAAAL,kBAAA"}
|
|
1
|
+
{"version":3,"file":"ConceptDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ConceptRelationCollection","_SourceReferenceCollection","_ConceptTypeDetailModel","_Constants","ConceptDetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_relations","ConceptRelationCollection","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","conceptTypeModel","_find","call","model","ConceptTypeDetailModel","conceptType","key","getData","selfhref","href","selflink","setParameter","TIMEVERSION_FILTER_NAME","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_map","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filter","_includes","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","SourceReferenceCollection","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWith","availableLanguages","split","value","exports"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAYA;AACA;AACA;AACe,MAAMK,kBAAkB,SAASC,sBAAa,CAAC;EAK5D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,UAAU,GAAG,IAAIC,kCAAyB,CAC7C,IAAI,CAACC,IAAI,CAACC,SAAS,EACnB,IAAI,CAACC,SACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,oBAAoB;EAC7B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACL,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACM,aAAa,CAACC,YAAY,IAC/BP,IAAI,CAACM,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,eAAe,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,aAAa,CAAC;IAC9D,MAAMC,wBAAwB,GAC5B,IAAI,CAACC,mBAAmB,CAACL,yBAAyB,CAAC,CAAC;IAEtD,IAAIC,eAAe,EAAE;MACnBA,eAAe,CAACK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IAAAtD,IAAA,CAAA1C,OAAA,EAAA6E,gBAAgB,EAAAvD,IAAA,CAAhBuD,gBAAgB,EACxCe,MAAM,IAAM,IAAGA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,EACvC,CAAC;;MAED;MACA,OAAO,IAAA/C,OAAA,CAAAlD,OAAA,EAAAuF,UAAA,OAAI,CAACpF,IAAI,CAACkF,gBAAgB,EAAA/D,IAAA,CAAAiE,UAAA,EAC9BE,eAAe,IACd,CAAC,IAAAtC,SAAA,CAAAnD,OAAA,EAAAgG,kBAAkB,EAAA1E,IAAA,CAAlB0E,kBAAkB,EACjBP,eAAe,CAACnF,IAAI,CAACoF,SAAS,CAC5BD,eAAe,CAACnF,IAAI,CAACyE,MAAM,GAAGK,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAI/E,SAASA,CAAA,EAAkB;IAC7B,OAAO,IAAA6C,OAAA,CAAAlD,OAAA,MAAI,CAACG,IAAI,IAAU6B,kCAAuB,CAAC,EAAEkE,KAAK,IAAI,IAAI;EACnE;AACF;AAACC,OAAA,CAAAnG,OAAA,GAAAL,kBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","attribute","searchtermfilter","itemCollection","exports"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) => new ConceptLinkModel(concept.concept, this.entryDate),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAOA;AACA;AACA;AACe,MAAMK,iBAAiB,SAASC,sBAAa,CAAC;EAI3D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,KAAAC,OAAA,CAAAH,OAAA,EAAC,IAAI,CAACI,IAAI,GAAS;MAC9DC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ACuB,cAAoD,EAAE;IAC9D,IAAI,CAACvC,SAAS,GAAGuC,cAAc;EACjC;AACF;AAACC,OAAA,CAAAhD,OAAA,GAAAN,iBAAA"}
|
|
1
|
+
{"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","attribute","searchtermfilter","itemCollection","exports"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) => new ConceptLinkModel(concept.concept, this.entryDate),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;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,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAIzB,SAASA,CAAA,EAAkB;IAC7B,MAAM0B,iBAAiB,GAAG,IAAI,CAACb,gBAAgB,CAACY,uBAAuB,CACrEE,kCACF,CAAC;IACD,IAAID,iBAAiB,IAAIA,iBAAiB,CAACE,SAAS,EAAE;MACpD,OAAOF,iBAAiB,CAACE,SAAS,CAACV,KAAK;IAC1C;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIW,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAIlB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAAChB,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIgB,KAAKA,CAACuB,cAAoD,EAAE;IAC9D,IAAI,CAACvC,SAAS,GAAGuC,cAAc;EACjC;AACF;AAACC,OAAA,CAAAhD,OAAA,GAAAN,iBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_LinkModel","_LinkCollection","_ConceptTypeDetailModel","_Constants","ConceptLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","_defineProperty2","default","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_find","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","ConceptTypeDetailModel","key","_id","label","getData","links","_links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","addParameter","TIMEVERSION_FILTER_NAME","concepttypeHref","taxonomyType","asLinkModel","link","LinkModel","create","exports"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { IModelWithChildModels, ModularUIModel } from \"../types\";\nimport type Href from \"../href/Href\";\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(data: Object, entryDate: ?ISO_DATE = null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n const link = LinkModel.create(this.key, this.selfhref.href, this.label);\n link.href = this.selfhref;\n\n return link;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAIA;AACA;AACA;AACe,MAAMK,gBAAgB,SAC3BC,kBAAS,CAEnB;EAKE;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAA+B;IAAA,IAA7BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IACnD,KAAK,CAACF,IAAI,EAAE,CAAC,CAAC,CAAC;IAAC,IAAAK,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEhB,IAAI,CAACC,UAAU,GAAGN,SAAS;EAC7B;;EAEA;AACF;EACEO,yBAAyBA,CAAA,EAAqB;IAC5C,IAAI,IAAI,CAACC,eAAe,EAAE;MACxB,IAA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,KAAK,CAAC;IACvEe,IAAI,CAAC5B,IAAI,GAAG,IAAI,CAACK,QAAQ;IAEzB,OAAOuB,IAAI;EACb;AACF;AAACG,OAAA,CAAAtC,OAAA,GAAAT,gBAAA"}
|
|
1
|
+
{"version":3,"file":"ConceptLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_LinkModel","_LinkCollection","_ConceptTypeDetailModel","_Constants","ConceptLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","_defineProperty2","default","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_find","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","ConceptTypeDetailModel","key","_id","label","getData","links","_links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","addParameter","TIMEVERSION_FILTER_NAME","concepttypeHref","taxonomyType","asLinkModel","link","LinkModel","create","exports"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { IModelWithChildModels, ModularUIModel } from \"../types\";\nimport type Href from \"../href/Href\";\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(data: Object, entryDate: ?ISO_DATE = null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n const link = LinkModel.create(this.key, this.selfhref.href, this.label);\n link.href = this.selfhref;\n\n return link;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAA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I,IAAI,CAACX,UAAU,KAAK,IAAI,EAAE;MAC5B,OAAO,IAAI,CAAC0B,QAAQ,CAACpB,IAAI,CAACuB,YAAY,CACpCC,kCAAuB,EACvB,IAAI,CAAC9B,UACP,CAAC;IACH;IAEA,OAAO,IAAI,CAAC0B,QAAQ,CAACpB,IAAI;EAC3B;;EAEA;AACF;EACE,IAAIJ,eAAeA,CAAA,EAAqB;IACtC,OAAO,IAAI,CAACmB,KAAK,CAACM,YAAY,CAAC,aAAa,CAAC;EAC/C;;EAEA;AACF;AACA;EACE,IAAII,eAAeA,CAAA,EAAgB;IACjC,OAAO,IAAI,CAAC7B,eAAe,EAAEI,IAAI,IAAI,IAAI;EAC3C;;EAEA;AACF;EACE,IAAI0B,YAAYA,CAAA,EAAW;IACzB,OAAO,SAAS;EAClB;;EAEA;AACF;EACEC,WAAWA,CAAA,EAAc;IACvB,MAAMC,IAAI,GAAGC,kBAAS,CAACC,MAAM,CAAC,IAAI,CAACnB,GAAG,EAAE,IAAI,CAACN,QAAQ,CAACL,IAAI,EAAE,IAAI,CAACa,KAAK,CAAC;IACvEe,IAAI,CAAC5B,IAAI,GAAG,IAAI,CAACK,QAAQ;IAEzB,OAAOuB,IAAI;EACb;AACF;AAACG,OAAA,CAAAtC,OAAA,GAAAT,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptRelationCollection.js","names":["_ResourceCollection","_interopRequireDefault","require","_ConceptRelationModel","ConceptRelationCollection","ResourceCollection","constructor","relations","arguments","length","undefined","entryDate","_defineProperty2","default","_entryDate","collection","Array","isArray","_map","call","relation","ConceptRelationModel","types","_context","_context2","_filter","pos","arr","_findIndex","item","key","label","byType","type","_context3","hasIncoming","incoming","hasOutgoing","outgoing","_context4","direction","_context5","exports"],"sources":["../../../src/models/concepts/ConceptRelationCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ConceptRelationModel from \"./ConceptRelationModel\";\n\n/**\n * concept relation collection\n */\nexport default class ConceptRelationCollection extends ResourceCollection<ConceptRelationModel> {\n _entryDate: ?ISO_DATE;\n\n /**\n */\n constructor(relations: Array<Object> = [], entryDate: ?ISO_DATE = null) {\n super();\n\n this._entryDate = entryDate;\n\n this.collection = Array.isArray(relations)\n ? relations.map((relation) =>\n relation instanceof ConceptRelationModel\n ? relation\n : new ConceptRelationModel(relation, entryDate),\n )\n : [new ConceptRelationModel(relations, entryDate)];\n }\n\n /**\n * Get unique list of relation types\n */\n get types(): Array<{ key: string, label: string }> {\n return this.collection\n .filter(\n (relation, pos, arr) =>\n arr.findIndex((item) => item.key === relation.key) === pos,\n )\n .map((relation) => ({\n key: relation.key,\n label: relation.label,\n }));\n }\n\n /**\n * Get relation by its type\n */\n byType(type: string): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.key === type),\n this._entryDate,\n );\n }\n\n /**\n */\n hasIncoming(): boolean {\n return this.incoming.length > 0;\n }\n\n /**\n */\n hasOutgoing(): boolean {\n return this.outgoing.length > 0;\n }\n\n /**\n */\n get incoming(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"incoming\"),\n this._entryDate,\n );\n }\n\n /**\n */\n get outgoing(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"outgoing\"),\n this._entryDate,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAME,yBAAyB,SAASC,2BAAkB,CAAuB;EAG9F;AACF;EACEC,WAAWA,CAAA,EAA6D;IAAA,IAA5DC,SAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IAAEG,SAAoB,GAAAH,SAAA,CAAAC,MAAA,QAAAD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,QAAQ,IAAKA,QAAQ,CAACU,GAAG,KAAKG,IAAI,CAAC,EAChD,IAAI,CAACnB,UACP,CAAC;EACH;;EAEA;AACF;EACEqB,WAAWA,CAAA,EAAY;IACrB,OAAO,IAAI,CAACC,QAAQ,CAAC3B,MAAM,GAAG,CAAC;EACjC;;EAEA;AACF;EACE4B,WAAWA,CAAA,EAAY;IACrB,OAAO,IAAI,CAACC,QAAQ,CAAC7B,MAAM,GAAG,CAAC;EACjC;;EAEA;AACF;EACE,IAAI2B,QAAQA,CAAA,EAA8B;IAAA,IAAAG,SAAA;IACxC,OAAO,IAAInC,yBAAyB,CAClC,IAAAqB,OAAA,CAAAZ,OAAA,EAAA0B,SAAA,OAAI,EAAApB,IAAA,CAAAoB,SAAA,EAASnB,QAAQ,IAAKA,QAAQ,CAACoB,SAAS,KAAK,UAAU,CAAC,EAC5D,IAAI,CAAC1B,UACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIwB,QAAQA,CAAA,EAA8B;IAAA,IAAAG,SAAA;IACxC,OAAO,IAAIrC,yBAAyB,CAClC,IAAAqB,OAAA,CAAAZ,OAAA,EAAA4B,SAAA,OAAI,EAAAtB,IAAA,CAAAsB,SAAA,EAASrB,QAAQ,IAAKA,QAAQ,CAACoB,SAAS,KAAK,UAAU,CAAC,EAC5D,IAAI,CAAC1B,UACP,CAAC;EACH;AACF;AAAC4B,OAAA,CAAA7B,OAAA,GAAAT,yBAAA"}
|
|
1
|
+
{"version":3,"file":"ConceptRelationCollection.js","names":["_ResourceCollection","_interopRequireDefault","require","_ConceptRelationModel","ConceptRelationCollection","ResourceCollection","constructor","relations","arguments","length","undefined","entryDate","_defineProperty2","default","_entryDate","collection","Array","isArray","_map","call","relation","ConceptRelationModel","types","_context","_context2","_filter","pos","arr","_findIndex","item","key","label","byType","type","_context3","hasIncoming","incoming","hasOutgoing","outgoing","_context4","direction","_context5","exports"],"sources":["../../../src/models/concepts/ConceptRelationCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ConceptRelationModel from \"./ConceptRelationModel\";\n\n/**\n * concept relation collection\n */\nexport default class ConceptRelationCollection extends ResourceCollection<ConceptRelationModel> {\n _entryDate: ?ISO_DATE;\n\n /**\n */\n constructor(relations: Array<Object> = [], entryDate: ?ISO_DATE = null) {\n super();\n\n this._entryDate = entryDate;\n\n this.collection = Array.isArray(relations)\n ? relations.map((relation) =>\n relation instanceof ConceptRelationModel\n ? relation\n : new ConceptRelationModel(relation, entryDate),\n )\n : [new ConceptRelationModel(relations, entryDate)];\n }\n\n /**\n * Get unique list of relation types\n */\n get types(): Array<{ key: string, label: string }> {\n return this.collection\n .filter(\n (relation, pos, arr) =>\n arr.findIndex((item) => item.key === relation.key) === pos,\n )\n .map((relation) => ({\n key: relation.key,\n label: relation.label,\n }));\n }\n\n /**\n * Get relation by its type\n */\n byType(type: string): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.key === type),\n this._entryDate,\n );\n }\n\n /**\n */\n hasIncoming(): boolean {\n return this.incoming.length > 0;\n }\n\n /**\n */\n hasOutgoing(): boolean {\n return this.outgoing.length > 0;\n }\n\n /**\n */\n get incoming(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"incoming\"),\n this._entryDate,\n );\n }\n\n /**\n */\n get outgoing(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"outgoing\"),\n this._entryDate,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAME,yBAAyB,SAASC,2BAAkB,CAAuB;EAG9F;AACF;EACEC,WAAWA,CAAA,EAA6D;IAAA,IAA5DC,SAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EA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