@beinformed/ui 1.34.2 → 1.35.0
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 +12 -0
- package/esm/models/filters/StringFilterModel.js +3 -2
- package/esm/models/filters/StringFilterModel.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +4 -0
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/lib/constants/Constants.js +66 -33
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +2 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +36 -18
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +6 -3
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js +2 -1
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +2 -1
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +2 -1
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +2 -1
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +2 -1
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +2 -1
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +2 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +2 -1
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +2 -1
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +2 -1
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +2 -1
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +2 -1
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +2 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +2 -1
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +2 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/i18n/Locale.js +2 -1
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +4 -2
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +2 -1
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/languages.js +2 -1
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js +2 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js +2 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/lib/i18n/withMessage.js +2 -1
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +2 -1
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +2 -1
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +2 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +2 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +2 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +2 -1
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +2 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +2 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +2 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +2 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +2 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +2 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +2 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +2 -1
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +2 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +2 -1
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +2 -1
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +2 -1
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +2 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +2 -1
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +2 -1
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +2 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +2 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +2 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +2 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/error/ErrorModel.js +2 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/filters/StringFilterModel.js +2 -2
- package/lib/models/filters/StringFilterModel.js.flow +2 -2
- package/lib/models/filters/StringFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +2 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/href/Href.js +2 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/links/LinkModel.js +2 -1
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +2 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +2 -1
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +2 -1
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/parameter/Parameter.js +2 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/resolveModel.js +2 -1
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +2 -1
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +2 -1
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +2 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +2 -1
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/CaptchaRequest.js +2 -1
- package/lib/modularui/CaptchaRequest.js.map +1 -1
- package/lib/modularui/ModularUIError.js +2 -1
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +2 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +2 -1
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/UploadRequest.js +2 -1
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/react/ErrorBoundary.js +2 -1
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +2 -1
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react-client/rehydrate.js +2 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +2 -1
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +2 -1
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +2 -1
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +2 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +6 -1
- package/lib/react-server/serverNoSSR.js.flow +5 -0
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +2 -1
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +2 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +2 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +2 -1
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js +2 -1
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +2 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/RouterConnectors.js +10 -5
- package/lib/redux/_router/RouterConnectors.js.map +1 -1
- package/lib/redux/connectors/Application.js +2 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +2 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +2 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +2 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +2 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +2 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +2 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +2 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +2 -1
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +2 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +2 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +2 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +2 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +2 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Progress.js +2 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +2 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +2 -1
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +2 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +2 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +2 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +2 -1
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +2 -1
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +2 -1
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +2 -1
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +2 -1
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +2 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/store/configureStore.js +2 -1
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +2 -1
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +8 -4
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +2 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +2 -1
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +2 -1
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js +2 -1
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +2 -1
- package/lib/utils/number/formatValue.js.map +1 -1
- package/package.json +1 -1
- package/src/models/filters/StringFilterModel.js +2 -2
- package/src/react-server/serverNoSSR.js +5 -0
|
@@ -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","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 return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n conceptTypeHref.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,IAA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aAAaA,CAACN,MAAiC,EAAE;IACnD,IAAI,CAACS,cAAc,GAAGT,MAAM;EAC9B;;EAEA;AACF;EACE,IAAIM,aAAaA,CAAA,EAA8B;IAC7C,OAAO,IAAI,CAACG,cAAc;EAC5B;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4B;IACpC,MAAMA,MAAM,GAAG,EAAE;IAEjB,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEC,YAAY,IAAK;MAAA,IAAAC,SAAA;MAC3C,MAAMC,gBAAgB,GAAG,IAAAZ,KAAA,CAAA3C,OAAA,EAAAsD,SAAA,GAAAD,YAAY,CAACvB,mBAAmB,EAAAR,IAAA,CAAAgC,SAAA,EACtDtB,QAAQ,IACPA,QAAQ,CAACC,SAAS,KAAK,UAAU,IACjCtC,qBAAqB,CAACU,eAAe,CACnC2B,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,
|
|
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","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 return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n conceptTypeHref.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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F,OAAOiB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAEchE,qBAAqB;AAAAiE,OAAA,CAAA5D,OAAA,GAAA2D,QAAA"}
|
|
@@ -97,5 +97,6 @@ class ConceptTypeDetailModel extends _ResourceModel.default {
|
|
|
97
97
|
return this.getData("sectionReferenceTypes", []);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
var _default =
|
|
100
|
+
var _default = ConceptTypeDetailModel;
|
|
101
|
+
exports.default = _default;
|
|
101
102
|
//# sourceMappingURL=ConceptTypeDetailModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptTypeDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","ConceptTypeDetailModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","key","_id","label","getData","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes","_default","exports","default"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACA,MAAMC,sBAAsB,SAASC,sBAAa,CAAC;EACjD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,wBAAwB;EACjC;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;EACE,IAAIC,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACH,IAAI,CAACI,GAAG;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACD,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;EACjC;;EAEA;AACF;AACA;EACE,IAAIE,SAASA,CAAA,EAAW;IACtB,OAAO,IAAI,CAACF,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIG,eAAeA,CAAA,EAAW;IAC5B,OAAO,IAAI,CAACH,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;EAChD;;EAEA;AACF;AACA;EACE,IAAII,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACJ,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAUA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAACX,IAAI,CAACW,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIC,aAAaA,CAAA,EAAkB;IACjC,OAAO,IAAI,CAACN,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIO,iBAAiBA,CAAA,EAAkB;IACrC,OAAO,IAAI,CAACP,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;EAC9C;;EAEA;AACF;AACA;EACE,IAAIQ,qBAAqBA,CAAA,EAAkB;IACzC,OAAO,IAAI,CAACR,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC;EAClD;AACF;AAAC,IAAAS,QAAA,
|
|
1
|
+
{"version":3,"file":"ConceptTypeDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","ConceptTypeDetailModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","key","_id","label","getData","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes","_default","exports","default"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACA,MAAMC,sBAAsB,SAASC,sBAAa,CAAC;EACjD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,wBAAwB;EACjC;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;EACE,IA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
|
|
62
62
|
return (0, _createHash.createHashFromHref)(this.selfhref);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
var _default =
|
|
65
|
+
var _default = SourceReferenceModel;
|
|
66
|
+
exports.default = _default;
|
|
66
67
|
//# sourceMappingURL=SourceReferenceModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceReferenceModel.js","names":["_createHash","require","_ContentLinkModel","_interopRequireDefault","_Href","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","_defineProperty2","default","_sourceReference","_entryDate","link","section","_links","self","href","replace","content","ContentLinkModel","selfhref","Href","type","label","sourceLabel","referenceHash","createHashFromHref","_default","exports"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n\n /**\n */\n constructor(sourceReference: Object, entryDate: ?ISO_DATE = null) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section = this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(this._sourceReference._links.self.href);\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,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AC,8BAAkB,EAAC,IAAI,CAACN,QAAQ,CAAC;EAC1C;AACF;AAAC,IAAAO,QAAA,
|
|
1
|
+
{"version":3,"file":"SourceReferenceModel.js","names":["_createHash","require","_ContentLinkModel","_interopRequireDefault","_Href","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","_defineProperty2","default","_sourceReference","_entryDate","link","section","_links","self","href","replace","content","ContentLinkModel","selfhref","Href","type","label","sourceLabel","referenceHash","createHashFromHref","_default","exports"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n\n /**\n */\n constructor(sourceReference: Object, entryDate: ?ISO_DATE = null) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section = this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(this._sourceReference._links.self.href);\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA,MAAMI,oBAAoB,CAAC;EAIzB;AACF;EACEC,WAAWA,CAACC,eAAu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A"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionModel.js","names":["_BaseModel","_interopRequireDefault","require","_ContentLinkModel","_SubSectionModel","_createHash","_LinkModel","_utils","SectionModel","BaseModel","constructor","data","entryDate","_defineProperty2","default","_entryDate","referred","selflink","_selflink","LinkModel","_links","self","selfhref","href","type","sourceLabel","id","_id","key","label","getData","number","body","retrieveText","childSectionLinks","_context","childSections","_map","call","childSection","ContentLinkModel","section","selfContentLink","_childSections","_context2","_context3","_filter","sections","subSections","_context4","subSection","SubSectionModel","referenceHash","createHashFromHref","getReferredSections","push","referredChilds","_default","exports"],"sources":["../../../src/models/content/SectionModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport LinkModel from \"../links/LinkModel\";\n\nimport type Href from \"../href/Href\";\nimport { retrieveText } from \"../../utils\";\n\n/**\n */\nclass SectionModel extends BaseModel {\n _entryDate: ISO_DATE | null;\n _selflink: ?LinkModel;\n _childSections: Array<SectionModel>;\n\n constructor(data: Object, entryDate: ISO_DATE | null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get selflink(): LinkModel {\n if (!this._selflink) {\n this._selflink = new LinkModel(this.data._links?.self);\n }\n return this._selflink;\n }\n\n /**\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n */\n get entryDate(): ISO_DATE | null {\n return this._entryDate;\n }\n\n /**\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this.data.sourceLabel;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n */\n get key(): string {\n return this.id;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return retrieveText(this.data.body);\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.data.childSections\n ? this.data.childSections.map(\n (childSection) =>\n new ContentLinkModel(\n {\n section: childSection.id || childSection._id,\n _id: childSection.id || childSection._id,\n label: childSection.label,\n sourceLabel: childSection.sourceLabel,\n _links: childSection._links,\n },\n this.entryDate,\n ),\n )\n : [];\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(\n {\n section: this.id,\n _id: this.id,\n label: this.data.label,\n sourceLabel: this.data.sourceLabel,\n _links: this.data._links,\n },\n this.entryDate,\n );\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n if (!this._childSections && this.data.childSections) {\n this._childSections = this.data.childSections\n .filter((childSection) => \"body\" in childSection)\n .map((childSection) => new SectionModel(childSection, this.entryDate));\n }\n return this._childSections || [];\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this._childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) => new SubSectionModel(subSection),\n )\n : [];\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n */\n getReferredSections(): Array<SubSectionModel | SectionModel> {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n for (const childSection of this.childSections) {\n if (childSection.referred) {\n sections.push(childSection);\n }\n\n const referredChilds = childSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n\nexport default SectionModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAC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AQ,CAAC;EAC1C;;EAEA;AACF;EACEgC,mBAAmBA,CAAA,EAA0C;IAC3D,MAAMP,QAAQ,GAAG,EAAE;IAEnB,KAAK,MAAMG,UAAU,IAAI,IAAI,CAACF,WAAW,EAAE;MACzC,IAAIE,UAAU,CAAClC,QAAQ,EAAE;QACvB+B,QAAQ,CAACQ,IAAI,CAACL,UAAU,CAAC;MAC3B;MAEA,MAAMM,cAAc,GAAGN,UAAU,CAACI,mBAAmB,CAAC,CAAC;MACvDP,QAAQ,CAACQ,IAAI,CAAC,GAAGC,cAAc,CAAC;IAClC;IAEA,KAAK,MAAMjB,YAAY,IAAI,IAAI,CAACH,aAAa,EAAE;MAC7C,IAAIG,YAAY,CAACvB,QAAQ,EAAE;QACzB+B,QAAQ,CAACQ,IAAI,CAAChB,YAAY,CAAC;MAC7B;MAEA,MAAMiB,cAAc,GAAGjB,YAAY,CAACe,mBAAmB,CAAC,CAAC;MACzDP,QAAQ,CAACQ,IAAI,CAAC,GAAGC,cAAc,CAAC;IAClC;IAEA,OAAOT,QAAQ;EACjB;AACF;AAAC,IAAAU,QAAA,
|
|
1
|
+
{"version":3,"file":"SectionModel.js","names":["_BaseModel","_interopRequireDefault","require","_ContentLinkModel","_SubSectionModel","_createHash","_LinkModel","_utils","SectionModel","BaseModel","constructor","data","entryDate","_defineProperty2","default","_entryDate","referred","selflink","_selflink","LinkModel","_links","self","selfhref","href","type","sourceLabel","id","_id","key","label","getData","number","body","retrieveText","childSectionLinks","_context","childSections","_map","call","childSection","ContentLinkModel","section","selfContentLink","_childSections","_context2","_context3","_filter","sections","subSections","_context4","subSection","SubSectionModel","referenceHash","createHashFromHref","getReferredSections","push","referredChilds","_default","exports"],"sources":["../../../src/models/content/SectionModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport LinkModel from \"../links/LinkModel\";\n\nimport type Href from \"../href/Href\";\nimport { retrieveText } from \"../../utils\";\n\n/**\n */\nclass SectionModel extends BaseModel {\n _entryDate: ISO_DATE | null;\n _selflink: ?LinkModel;\n _childSections: Array<SectionModel>;\n\n constructor(data: Object, entryDate: ISO_DATE | null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get selflink(): LinkModel {\n if (!this._selflink) {\n this._selflink = new LinkModel(this.data._links?.self);\n }\n return this._selflink;\n }\n\n /**\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n */\n get entryDate(): ISO_DATE | null {\n return this._entryDate;\n }\n\n /**\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this.data.sourceLabel;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n */\n get key(): string {\n return this.id;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return retrieveText(this.data.body);\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.data.childSections\n ? this.data.childSections.map(\n (childSection) =>\n new ContentLinkModel(\n {\n section: childSection.id || childSection._id,\n _id: childSection.id || childSection._id,\n label: childSection.label,\n sourceLabel: childSection.sourceLabel,\n _links: childSection._links,\n },\n this.entryDate,\n ),\n )\n : [];\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(\n {\n section: this.id,\n _id: this.id,\n label: this.data.label,\n sourceLabel: this.data.sourceLabel,\n _links: this.data._links,\n },\n this.entryDate,\n );\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n if (!this._childSections && this.data.childSections) {\n this._childSections = this.data.childSections\n .filter((childSection) => \"body\" in childSection)\n .map((childSection) => new SectionModel(childSection, this.entryDate));\n }\n return this._childSections || [];\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this._childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) => new SubSectionModel(subSection),\n )\n : [];\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n */\n getReferredSections(): Array<SubSectionModel | SectionModel> {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n for (const childSection of this.childSections) {\n if (childSection.referred) {\n sections.push(childSection);\n }\n\n const referredChilds = childSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n\nexport default SectionModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAL,sBAAA,CAAAC,OAAA;AAGA,IAAAK,MAAA,GAAAL,OAAA;AAEA;AACA;AACA,MAAMM,YAAY,SAASC,kBAAS,CAAC;EAKnCC,WAAWA,CAACC,IAAY,EAAEC,SAA0B,EAAE;IACpD,KAAK,CAACD,IAAI,EAAE,CAAC,CAAC,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEhB,IAAI,CAACC,UAAU,GAAGH,SAAS;EAC7B;;EAEA;AACF;EACE,IAAII,QAAQA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACL,IAAI,CAACK,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AAC;MACzDP,QAAQ,CAACQ,IAAI,CAAC,GAAGC,cAAc,CAAC;IAClC;IAEA,OAAOT,QAAQ;EACjB;AACF;AAAC,IAAAU,QAAA,GAEcjD,YAAY;AAAAkD,OAAA,CAAA5C,OAAA,GAAA2C,QAAA"}
|
|
@@ -139,5 +139,6 @@ class ContentConfigurationElements {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
var _default =
|
|
142
|
+
var _default = ContentConfigurationElements;
|
|
143
|
+
exports.default = _default;
|
|
143
144
|
//# sourceMappingURL=ContentConfigurationElements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentConfigurationElements.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ContentConfigurationElements","constructor","elementConfiguration","_defineProperty2","default","_hasConfiguration","_elementConfiguration","includeLayoutHints","hints","_context","contentIncludeLayoutHint","_filter","call","elementConfig","key","_keys","config","layouthint","some","hint","_includes","excludeLayoutHints","_context2","contentExcludeLayoutHint","_context3","_map","type","label","types","labelTypes","propertyTypes","sectionReferenceTypes","textFragmentTypes","LayoutHintCollection","icon","hasConfig","hasContent","configElement","hasLayoutHint","has","byTypes","_context4","arguments","length","undefined","labelConfig","_context5","getAllSectionReferenceTypes","_context6","sectionReferences","item","forEach","push","getContentElementConfigBySectionReferenceType","_context7","_context8","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationElements.js"],"sourcesContent":["// @flow\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Get element configuration of instrument questions\n */\nclass ContentConfigurationElements {\n _hasConfiguration: boolean;\n _elementConfiguration: Array<Object>;\n\n /**\n */\n constructor(elementConfiguration: ?Array<Object>) {\n this._hasConfiguration = elementConfiguration != null;\n this._elementConfiguration =\n elementConfiguration == null ? [] : elementConfiguration;\n }\n\n /**\n */\n includeLayoutHints(hints: Array<string>): ContentConfigurationElements {\n const contentIncludeLayoutHint = this._elementConfiguration.filter(\n (elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config || !config.layouthint) {\n return false;\n }\n\n return config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentIncludeLayoutHint);\n }\n\n /**\n */\n excludeLayoutHints(hints: Array<string>): ContentConfigurationElements {\n const contentExcludeLayoutHint = this._elementConfiguration.filter(\n (elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config) {\n return false;\n } else if (!config.layouthint) {\n return true;\n }\n\n return !config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentExcludeLayoutHint);\n }\n\n /**\n */\n get config(): Array<Object> {\n return this._elementConfiguration.map((elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config) {\n return {};\n }\n\n return {\n type: key,\n label: config.label,\n types:\n config.labelTypes ||\n config.propertyTypes ||\n config.sectionReferenceTypes ||\n config.textFragmentTypes,\n layouthint: new LayoutHintCollection(config.layouthint),\n icon: config.icon || \"\",\n };\n });\n }\n\n /**\n */\n hasConfig(): boolean {\n return this._hasConfiguration;\n }\n\n /**\n */\n hasContent(): boolean {\n return this.config.some(\n (configElement) => configElement.type === \"contentElement\",\n );\n }\n\n /**\n * Retrieve if the configuration has an element that has a specific layouthint,\n * makes it easy to indicate that the content needs to be presented in a certain way.\n */\n hasLayoutHint(hint: string): boolean {\n return this.config.some((configElement) =>\n configElement.layouthint.has(hint),\n );\n }\n\n /**\n * Returns config elements by given types\n */\n byTypes(types: Array<string> = []): Array<Object> {\n if (!types || types.length === 0) {\n return this.config;\n }\n\n return this.config.filter((config) => types.includes(config.type));\n }\n\n /**\n * Get label config elements\n */\n get labelConfig(): Array<Object> {\n return this.config.filter((config) => config.type === \"labelElement\");\n }\n\n /**\n * Get all section reference types\n */\n getAllSectionReferenceTypes(): Array<any> {\n const sectionReferences = [];\n\n this.config\n .filter((item) => item.type === \"contentElement\")\n .forEach((item) => {\n sectionReferences.push(...item.types);\n });\n\n return sectionReferences;\n }\n\n /**\n * Retrieve all content element configuration by content type\n */\n getContentElementConfigBySectionReferenceType(type: string): Array<Object> {\n return this.config.filter(\n (config) =>\n config.type === \"contentElement\" && config.types.includes(type),\n );\n }\n}\n\nexport default ContentConfigurationElements;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,4BAA4B,CAAC;EAIjC;AACF;EACEC,WAAWA,CAACC,oBAAoC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAChD,IAAI,CAACC,iBAAiB,GAAGH,oBAAoB,IAAI,IAAI;IACrD,IAAI,CAACI,qBAAqB,GACxBJ,oBAAoB,IAAI,IAAI,GAAG,EAAE,GAAGA,oBAAoB;EAC5D;;EAEA;AACF;EACEK,kBAAkBA,CAACC,KAAoB,EAAgC;IAAA,IAAAC,QAAA;IACrE,MAAMC,wBAAwB,GAAG,IAAAC,OAAA,CAAAP,OAAA,EAAAK,QAAA,OAAI,CAACH,qBAAqB,EAAAM,IAAA,CAAAH,QAAA,EACxDI,aAAa,IAAK;MACjB,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAX,OAAA,EAAYS,aAAa,CAAC;MACxC,MAAMG,MAAM,GAAGH,aAAa,CAACC,GAAG,CAAC;MAEjC,IAAI,CAACE,MAAM,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;QACjC,OAAO,KAAK;MACd;MAEA,OAAOD,MAAM,CAACC,UAAU,CAACC,IAAI,CAAEC,IAAI,IAAK,IAAAC,SAAA,CAAAhB,OAAA,EAAAI,KAAK,EAAAI,IAAA,CAALJ,KAAK,EAAUW,IAAI,CAAC,CAAC;IAC/D,CACF,CAAC;IAED,OAAO,IAAInB,4BAA4B,CAACU,wBAAwB,CAAC;EACnE;;EAEA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,MAAM,EAAAJ,IAAA,CAAAkC,SAAA,EAAS9B,MAAM,IAAKA,MAAM,CAACU,IAAI,KAAK,cAAc,CAAC;EACvE;;EAEA;AACF;AACA;EACEqB,2BAA2BA,CAAA,EAAe;IAAA,IAAAC,SAAA;IACxC,MAAMC,iBAAiB,GAAG,EAAE;IAE5B,IAAAtC,OAAA,CAAAP,OAAA,EAAA4C,SAAA,OAAI,CAAChC,MAAM,EAAAJ,IAAA,CAAAoC,SAAA,EACAE,IAAI,IAAKA,IAAI,CAACxB,IAAI,KAAK,gBAAgB,CAAC,CAChDyB,OAAO,CAAED,IAAI,IAAK;MACjBD,iBAAiB,CAACG,IAAI,CAAC,GAAGF,IAAI,CAACtB,KAAK,CAAC;IACvC,CAAC,CAAC;IAEJ,OAAOqB,iBAAiB;EAC1B;;EAEA;AACF;AACA;EACEI,6CAA6CA,CAAC3B,IAAY,EAAiB;IAAA,IAAA4B,SAAA;IACzE,OAAO,IAAA3C,OAAA,CAAAP,OAAA,EAAAkD,SAAA,OAAI,CAACtC,MAAM,EAAAJ,IAAA,CAAA0C,SAAA,EACftC,MAAM;MAAA,IAAAuC,SAAA;MAAA,OACLvC,MAAM,CAACU,IAAI,KAAK,gBAAgB,IAAI,IAAAN,SAAA,CAAAhB,OAAA,EAAAmD,SAAA,GAAAvC,MAAM,CAACY,KAAK,EAAAhB,IAAA,CAAA2C,SAAA,EAAU7B,IAAI,CAAC;IAAA,CACnE,CAAC;EACH;AACF;AAAC,IAAA8B,QAAA,
|
|
1
|
+
{"version":3,"file":"ContentConfigurationElements.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ContentConfigurationElements","constructor","elementConfiguration","_defineProperty2","default","_hasConfiguration","_elementConfiguration","includeLayoutHints","hints","_context","contentIncludeLayoutHint","_filter","call","elementConfig","key","_keys","config","layouthint","some","hint","_includes","excludeLayoutHints","_context2","contentExcludeLayoutHint","_context3","_map","type","label","types","labelTypes","propertyTypes","sectionReferenceTypes","textFragmentTypes","LayoutHintCollection","icon","hasConfig","hasContent","configElement","hasLayoutHint","has","byTypes","_context4","arguments","length","undefined","labelConfig","_context5","getAllSectionReferenceTypes","_context6","sectionReferences","item","forEach","push","getContentElementConfigBySectionReferenceType","_context7","_context8","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationElements.js"],"sourcesContent":["// @flow\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Get element configuration of instrument questions\n */\nclass ContentConfigurationElements {\n _hasConfiguration: boolean;\n _elementConfiguration: Array<Object>;\n\n /**\n */\n constructor(elementConfiguration: ?Array<Object>) {\n this._hasConfiguration = elementConfiguration != null;\n this._elementConfiguration =\n elementConfiguration == null ? [] : elementConfiguration;\n }\n\n /**\n */\n includeLayoutHints(hints: Array<string>): ContentConfigurationElements {\n const contentIncludeLayoutHint = this._elementConfiguration.filter(\n (elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config || !config.layouthint) {\n return false;\n }\n\n return config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentIncludeLayoutHint);\n }\n\n /**\n */\n excludeLayoutHints(hints: Array<string>): ContentConfigurationElements {\n const contentExcludeLayoutHint = this._elementConfiguration.filter(\n (elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config) {\n return false;\n } else if (!config.layouthint) {\n return true;\n }\n\n return !config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentExcludeLayoutHint);\n }\n\n /**\n */\n get config(): Array<Object> {\n return this._elementConfiguration.map((elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n if (!config) {\n return {};\n }\n\n return {\n type: key,\n label: config.label,\n types:\n config.labelTypes ||\n config.propertyTypes ||\n config.sectionReferenceTypes ||\n config.textFragmentTypes,\n layouthint: new LayoutHintCollection(config.layouthint),\n icon: config.icon || \"\",\n };\n });\n }\n\n /**\n */\n hasConfig(): boolean {\n return this._hasConfiguration;\n }\n\n /**\n */\n hasContent(): boolean {\n return this.config.some(\n (configElement) => configElement.type === \"contentElement\",\n );\n }\n\n /**\n * Retrieve if the configuration has an element that has a specific layouthint,\n * makes it easy to indicate that the content needs to be presented in a certain way.\n */\n hasLayoutHint(hint: string): boolean {\n return this.config.some((configElement) =>\n configElement.layouthint.has(hint),\n );\n }\n\n /**\n * Returns config elements by given types\n */\n byTypes(types: Array<string> = []): Array<Object> {\n if (!types || types.length === 0) {\n return this.config;\n }\n\n return this.config.filter((config) => types.includes(config.type));\n }\n\n /**\n * Get label config elements\n */\n get labelConfig(): Array<Object> {\n return this.config.filter((config) => config.type === \"labelElement\");\n }\n\n /**\n * Get all section reference types\n */\n getAllSectionReferenceTypes(): Array<any> {\n const sectionReferences = [];\n\n this.config\n .filter((item) => item.type === \"contentElement\")\n .forEach((item) => {\n sectionReferences.push(...item.types);\n });\n\n return sectionReferences;\n }\n\n /**\n * Retrieve all content element configuration by content type\n */\n getContentElementConfigBySectionReferenceType(type: string): Array<Object> {\n return this.config.filter(\n (config) =>\n config.type === \"contentElement\" && config.types.includes(type),\n );\n }\n}\n\nexport default ContentConfigurationElements;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,4BAA4B,CAAC;EAIjC;AACF;EACEC,WAAWA,CAACC,oBAAoC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAChD,IAAI,CAACC,iBAAiB,GAAGH,oBAAoB,IAAI,IAAI;IACrD,IAAI,CAACI,qBAAqB,GACxBJ,oBAAoB,IAAI,IAAI,GAAG,EAAE,GAAGA,oBAAoB;EAC5D;;EAEA;AACF;EACEK,kBAAkBA,CAACC,KAAoB,EAAgC;IAAA,IAAAC,QAAA;IACrE,MAAMC,wBAAwB,GAAG,IAAAC,OAAA,CAAAP,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IAAAuC,SAAA;MAAA,OACLvC,MAAM,CAACU,IAAI,KAAK,gBAAgB,IAAI,IAAAN,SAAA,CAAAhB,OAAA,EAAAmD,SAAA,GAAAvC,MAAM,CAACY,KAAK,EAAAhB,IAAA,CAAA2C,SAAA,EAAU7B,IAAI,CAAC;IAAA,CACnE,CAAC;EACH;AACF;AAAC,IAAA8B,QAAA,GAEcxD,4BAA4B;AAAAyD,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
|
|
@@ -45,5 +45,6 @@ class ContentConfigurationEndResults {
|
|
|
45
45
|
}) || null;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
var _default =
|
|
48
|
+
var _default = ContentConfigurationEndResults;
|
|
49
|
+
exports.default = _default;
|
|
49
50
|
//# sourceMappingURL=ContentConfigurationEndResults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentConfigurationEndResults.js","names":["_ContentConfigurationResults","_interopRequireDefault","require","ContentConfigurationEndResults","constructor","configuration","_defineProperty2","default","_configuration","config","_context","_context2","_map","_filter","call","configElement","key","_keys","ContentConfigurationResults","getContentConfigurationElementsForAttribute","attributeKey","_context3","_find","item","_context4","_includes","attributes","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationEndResults.js"],"sourcesContent":["// @flow\nimport ContentConfigurationResults from \"./ContentConfigurationResults\";\n\n/**\n */\nclass ContentConfigurationEndResults {\n _configuration: Array<Object>;\n\n /**\n */\n constructor(configuration: Array<Object>) {\n this._configuration = configuration || [];\n }\n\n /**\n */\n get config(): Array<ContentConfigurationResults> {\n return this._configuration\n .filter((configElement) => {\n const [key] = Object.keys(configElement);\n\n return (\n key === \"decisionResult\" ||\n key === \"classificationResult\" ||\n key === \"calculatorResult\"\n );\n })\n .map((configElement) => {\n const [key] = Object.keys(configElement);\n return new ContentConfigurationResults(configElement[key]);\n });\n }\n\n /**\n */\n getContentConfigurationElementsForAttribute(\n attributeKey: string,\n ): ContentConfigurationResults | null {\n return (\n this.config.find((item) => item.attributes.includes(attributeKey)) || null\n );\n }\n}\n\nexport default ContentConfigurationEndResults;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,4BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,8BAA8B,CAAC;EAGnC;AACF;EACEC,WAAWA,CAACC,aAA4B,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACxC,IAAI,CAACC,cAAc,GAAGH,aAAa,IAAI,EAAE;EAC3C;;EAEA;AACF;EACE,IAAII,MAAMA,CAAA,EAAuC;IAAA,IAAAC,QAAA,EAAAC,SAAA;IAC/C,OAAO,IAAAC,IAAA,CAAAL,OAAA,EAAAG,QAAA,OAAAG,OAAA,CAAAN,OAAA,EAAAI,SAAA,OAAI,CAACH,cAAc,EAAAM,IAAA,CAAAH,SAAA,EACfI,aAAa,IAAK;MACzB,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAV,OAAA,EAAYQ,aAAa,CAAC;MAExC,OACEC,GAAG,KAAK,gBAAgB,IACxBA,GAAG,KAAK,sBAAsB,IAC9BA,GAAG,KAAK,kBAAkB;IAE9B,CAAC,CAAC,EAAAF,IAAA,CAAAJ,QAAA,EACIK,aAAa,IAAK;MACtB,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAV,OAAA,EAAYQ,aAAa,CAAC;MACxC,OAAO,IAAIG,oCAA2B,CAACH,aAAa,CAACC,GAAG,CAAC,CAAC;IAC5D,CAAC,CAAC;EACN;;EAEA;AACF;EACEG,2CAA2CA,CACzCC,YAAoB,EACgB;IAAA,IAAAC,SAAA;IACpC,OACE,IAAAC,KAAA,CAAAf,OAAA,EAAAc,SAAA,OAAI,CAACZ,MAAM,EAAAK,IAAA,CAAAO,SAAA,EAAOE,IAAI;MAAA,IAAAC,SAAA;MAAA,OAAK,IAAAC,SAAA,CAAAlB,OAAA,EAAAiB,SAAA,GAAAD,IAAI,CAACG,UAAU,EAAAZ,IAAA,CAAAU,SAAA,EAAUJ,YAAY,CAAC;IAAA,EAAC,IAAI,IAAI;EAE9E;AACF;AAAC,IAAAO,QAAA,
|
|
1
|
+
{"version":3,"file":"ContentConfigurationEndResults.js","names":["_ContentConfigurationResults","_interopRequireDefault","require","ContentConfigurationEndResults","constructor","configuration","_defineProperty2","default","_configuration","config","_context","_context2","_map","_filter","call","configElement","key","_keys","ContentConfigurationResults","getContentConfigurationElementsForAttribute","attributeKey","_context3","_find","item","_context4","_includes","attributes","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationEndResults.js"],"sourcesContent":["// @flow\nimport ContentConfigurationResults from \"./ContentConfigurationResults\";\n\n/**\n */\nclass ContentConfigurationEndResults {\n _configuration: Array<Object>;\n\n /**\n */\n constructor(configuration: Array<Object>) {\n this._configuration = configuration || [];\n }\n\n /**\n */\n get config(): Array<ContentConfigurationResults> {\n return this._configuration\n .filter((configElement) => {\n const [key] = Object.keys(configElement);\n\n return (\n key === \"decisionResult\" ||\n key === \"classificationResult\" ||\n key === \"calculatorResult\"\n );\n })\n .map((configElement) => {\n const [key] = Object.keys(configElement);\n return new ContentConfigurationResults(configElement[key]);\n });\n }\n\n /**\n */\n getContentConfigurationElementsForAttribute(\n attributeKey: string,\n ): ContentConfigurationResults | null {\n return (\n this.config.find((item) => item.attributes.includes(attributeKey)) || null\n );\n }\n}\n\nexport default ContentConfigurationEndResults;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,4BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,8BAA8B,CAAC;EAGnC;AACF;EACEC,WAAWA,CAACC,aAA4B,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACxC,IAAI,CAACC,cAAc,GAAGH,aAAa,IAAI,EAAE;EAC3C;;EAEA;AACF;EACE,IAAII,MAAMA,CAAA,EAAuC;IAAA,IAAAC,QAAA,EAAAC,SAAA;IAC/C,OAAO,IAAAC,IAAA,CAAAL,OAAA,EAAAG,QAAA,OAAAG,OAAA,CAAAN,OAAA,EAAAI,SAAA,OAAI,CAACH,cAAc,EAAAM,IAAA,CAAAH,SAAA,EACfI,aAAa,IAAK;MACzB,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAV,OAAA,EAAYQ,aAAa,CAAC;MAExC,OACEC,GAAG,KAAK,gBAAgB,IACxBA,GAAG,KAAK,sBAAsB,IAC9BA,GAAG,KAAK,kBAAkB;IAE9B,CAAC,CAAC,EAAAF,IAAA,CAAAJ,QAAA,EACIK,aAAa,IAAK;MACtB,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAV,OAAA,EAAYQ,aAAa,CAAC;MACxC,OAAO,IAAIG,oCAA2B,CAACH,aAAa,CAACC,GAAG,CAAC,CAAC;IAC5D,CAAC,CAAC;EACN;;EAEA;AACF;EACEG,2CAA2CA,CACzCC,YAAoB,EACgB;IAAA,IAAAC,SAAA;IACpC,OACE,IAAAC,KAAA,CAAAf,OAAA,EAAAc,SAAA,OAAI,CAACZ,MAAM,EAAAK,IAAA,CAAAO,SAAA,EAAOE,IAAI;MAAA,IAAAC,SAAA;MAAA,OAAK,IAAAC,SAAA,CAAAlB,OAAA,EAAAiB,SAAA,GAAAD,IAAI,CAACG,UAAU,EAAAZ,IAAA,CAAAU,SAAA,EAAUJ,YAAY,CAAC;IAAA,EAAC,IAAI,IAAI;EAE9E;AACF;AAAC,IAAAO,QAAA,GAEcxB,8BAA8B;AAAAyB,OAAA,CAAArB,OAAA,GAAAoB,QAAA"}
|
|
@@ -50,5 +50,6 @@ class ContentConfigurationQuestions {
|
|
|
50
50
|
return new _ContentConfigurationElements.default(this._configuration.givenAnswerElements);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var _default =
|
|
53
|
+
var _default = ContentConfigurationQuestions;
|
|
54
|
+
exports.default = _default;
|
|
54
55
|
//# sourceMappingURL=ContentConfigurationQuestions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentConfigurationQuestions.js","names":["_ContentConfigurationElements","_interopRequireDefault","require","ContentConfigurationQuestions","constructor","configuration","_defineProperty2","default","_configuration","hasConfig","question","options","answers","ContentConfigurationElements","questionElements","optionElements","givenAnswerElements","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationQuestions.js"],"sourcesContent":["// @flow\nimport ContentConfigurationElements from \"./ContentConfigurationElements\";\n\n/**\n */\nclass ContentConfigurationQuestions {\n _configuration: Object;\n\n /**\n */\n constructor(configuration: Object) {\n this._configuration = configuration || null;\n }\n\n /**\n */\n hasConfig(): boolean {\n return (\n this.question.hasConfig() ||\n this.options.hasConfig() ||\n this.answers.hasConfig()\n );\n }\n\n /**\n */\n get question(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(\n this._configuration.questionElements,\n );\n }\n\n /**\n */\n get options(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(this._configuration.optionElements);\n }\n\n /**\n */\n get answers(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(\n this._configuration.givenAnswerElements,\n );\n }\n}\n\nexport default ContentConfigurationQuestions;\n"],"mappings":";;;;;;;;AACA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,6BAA6B,CAAC;EAGlC;AACF;EACEC,WAAWA,CAACC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACjC,IAAI,CAACC,cAAc,GAAGH,aAAa,IAAI,IAAI;EAC7C;;EAEA;AACF;EACEI,SAASA,CAAA,EAAY;IACnB,OACE,IAAI,CAACC,QAAQ,CAACD,SAAS,CAAC,CAAC,IACzB,IAAI,CAACE,OAAO,CAACF,SAAS,CAAC,CAAC,IACxB,IAAI,CAACG,OAAO,CAACH,SAAS,CAAC,CAAC;EAE5B;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAiC;IAC3C,IAAI,IAAI,CAACF,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CACrC,IAAI,CAACL,cAAc,CAACM,gBACtB,CAAC;EACH;;EAEA;AACF;EACE,IAAIH,OAAOA,CAAA,EAAiC;IAC1C,IAAI,IAAI,CAACH,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CAAC,IAAI,CAACL,cAAc,CAACO,cAAc,CAAC;EAC7E;;EAEA;AACF;EACE,IAAIH,OAAOA,CAAA,EAAiC;IAC1C,IAAI,IAAI,CAACJ,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CACrC,IAAI,CAACL,cAAc,CAACQ,mBACtB,CAAC;EACH;AACF;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"file":"ContentConfigurationQuestions.js","names":["_ContentConfigurationElements","_interopRequireDefault","require","ContentConfigurationQuestions","constructor","configuration","_defineProperty2","default","_configuration","hasConfig","question","options","answers","ContentConfigurationElements","questionElements","optionElements","givenAnswerElements","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationQuestions.js"],"sourcesContent":["// @flow\nimport ContentConfigurationElements from \"./ContentConfigurationElements\";\n\n/**\n */\nclass ContentConfigurationQuestions {\n _configuration: Object;\n\n /**\n */\n constructor(configuration: Object) {\n this._configuration = configuration || null;\n }\n\n /**\n */\n hasConfig(): boolean {\n return (\n this.question.hasConfig() ||\n this.options.hasConfig() ||\n this.answers.hasConfig()\n );\n }\n\n /**\n */\n get question(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(\n this._configuration.questionElements,\n );\n }\n\n /**\n */\n get options(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(this._configuration.optionElements);\n }\n\n /**\n */\n get answers(): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n return new ContentConfigurationElements(\n this._configuration.givenAnswerElements,\n );\n }\n}\n\nexport default ContentConfigurationQuestions;\n"],"mappings":";;;;;;;;AACA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,6BAA6B,CAAC;EAGlC;AACF;EACEC,WAAWA,CAACC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACjC,IAAI,CAACC,cAAc,GAAGH,aAAa,IAAI,IAAI;EAC7C;;EAEA;AACF;EACEI,SAASA,CAAA,EAAY;IACnB,OACE,IAAI,CAACC,QAAQ,CAACD,SAAS,CAAC,CAAC,IACzB,IAAI,CAACE,OAAO,CAACF,SAAS,CAAC,CAAC,IACxB,IAAI,CAACG,OAAO,CAACH,SAAS,CAAC,CAAC;EAE5B;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAiC;IAC3C,IAAI,IAAI,CAACF,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CACrC,IAAI,CAACL,cAAc,CAACM,gBACtB,CAAC;EACH;;EAEA;AACF;EACE,IAAIH,OAAOA,CAAA,EAAiC;IAC1C,IAAI,IAAI,CAACH,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CAAC,IAAI,CAACL,cAAc,CAACO,cAAc,CAAC;EAC7E;;EAEA;AACF;EACE,IAAIH,OAAOA,CAAA,EAAiC;IAC1C,IAAI,IAAI,CAACJ,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIK,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,OAAO,IAAIA,qCAA4B,CACrC,IAAI,CAACL,cAAc,CAACQ,mBACtB,CAAC;EACH;AACF;AAAC,IAAAC,QAAA,GAEcd,6BAA6B;AAAAe,OAAA,CAAAX,OAAA,GAAAU,QAAA"}
|
|
@@ -99,5 +99,6 @@ class ContentConfigurationResults {
|
|
|
99
99
|
return this._layouthint;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
var _default =
|
|
102
|
+
var _default = ContentConfigurationResults;
|
|
103
|
+
exports.default = _default;
|
|
103
104
|
//# sourceMappingURL=ContentConfigurationResults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentConfigurationResults.js","names":["_ContentConfigurationElements","_interopRequireDefault","require","_LayoutHintCollection","_utils","ContentConfigurationResults","constructor","configuration","_defineProperty2","default","_configuration","_layouthint","LayoutHintCollection","layouthint","label","description","isPlainObject","message","attributes","_context","_context2","_map","_filter","all","call","hint","_includes","substring","length","getFormConfigElement","elementKey","ContentConfigurationElements","configElement","calculatedResultElements","positiveResultElements","negativeResultElements","resultElements","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationResults.js"],"sourcesContent":["// @flow\nimport ContentConfigurationElements from \"./ContentConfigurationElements\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\nimport { isPlainObject } from \"../../utils\";\n\n/**\n */\nclass ContentConfigurationResults {\n _configuration: Object;\n _layouthint: LayoutHintCollection;\n\n /**\n */\n constructor(configuration: Object) {\n this._configuration = configuration || null;\n\n this._layouthint = new LayoutHintCollection(configuration?.layouthint);\n }\n\n /**\n */\n get label(): string | null {\n if (this._configuration === null) {\n return null;\n }\n\n return this._configuration.label;\n }\n\n /**\n */\n get description(): string | null {\n if (this._configuration === null) {\n return null;\n }\n\n const description = this._configuration.description;\n if (isPlainObject(description) && \"message\" in description) {\n return description.message;\n }\n\n return description;\n }\n\n /**\n */\n get attributes(): Array<string> {\n if (this._configuration === null) {\n return [];\n }\n\n // An issue with mapped attributes is giving us the wrong attribute keys in the attributes property\n // as a temporary fix a layouthint with the correct mapped attribute key can be set in the configuration of the end results\n return [\n ...this._configuration.attributes,\n ...this.layouthint.all\n .filter((hint) => hint.includes(\"attribute:\"))\n .map((hint) => hint.substring(\"attribute:\".length)),\n ];\n }\n\n /**\n */\n getFormConfigElement(elementKey: string): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n const configElement = this._configuration[elementKey];\n\n return new ContentConfigurationElements(configElement);\n }\n\n /**\n */\n get calculatedResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"calculatedResultElements\");\n }\n\n /**\n */\n get positiveResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"positiveResultElements\");\n }\n\n /**\n */\n get negativeResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"negativeResultElements\");\n }\n\n /**\n */\n get resultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"resultElements\");\n }\n\n /**\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n}\n\nexport default ContentConfigurationResults;\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA,MAAMG,2BAA2B,CAAC;EAIhC;AACF;EACEC,WAAWA,CAACC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACjC,IAAI,CAACC,cAAc,GAAGH,aAAa,IAAI,IAAI;IAE3C,IAAI,CAACI,WAAW,GAAG,IAAIC,6BAAoB,CAACL,aAAa,EAAEM,UAAU,CAAC;EAC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,aAAa,GAAG,IAAI,CAACtB,cAAc,CAACoB,UAAU,CAAC;IAErD,OAAO,IAAIC,qCAA4B,CAACC,aAAa,CAAC;EACxD;;EAEA;AACF;EACE,IAAIC,wBAAwBA,CAAA,EAAiC;IAC3D,OAAO,IAAI,CAACJ,oBAAoB,CAAC,0BAA0B,CAAC;EAC9D;;EAEA;AACF;EACE,IAAIK,sBAAsBA,CAAA,EAAiC;IACzD,OAAO,IAAI,CAACL,oBAAoB,CAAC,wBAAwB,CAAC;EAC5D;;EAEA;AACF;EACE,IAAIM,sBAAsBA,CAAA,EAAiC;IACzD,OAAO,IAAI,CAACN,oBAAoB,CAAC,wBAAwB,CAAC;EAC5D;;EAEA;AACF;EACE,IAAIO,cAAcA,CAAA,EAAiC;IACjD,OAAO,IAAI,CAACP,oBAAoB,CAAC,gBAAgB,CAAC;EACpD;;EAEA;AACF;EACE,IAAIhB,UAAUA,CAAA,EAAyB;IACrC,OAAO,IAAI,CAACF,WAAW;EACzB;AACF;AAAC,IAAA0B,QAAA,
|
|
1
|
+
{"version":3,"file":"ContentConfigurationResults.js","names":["_ContentConfigurationElements","_interopRequireDefault","require","_LayoutHintCollection","_utils","ContentConfigurationResults","constructor","configuration","_defineProperty2","default","_configuration","_layouthint","LayoutHintCollection","layouthint","label","description","isPlainObject","message","attributes","_context","_context2","_map","_filter","all","call","hint","_includes","substring","length","getFormConfigElement","elementKey","ContentConfigurationElements","configElement","calculatedResultElements","positiveResultElements","negativeResultElements","resultElements","_default","exports"],"sources":["../../../src/models/contentconfiguration/ContentConfigurationResults.js"],"sourcesContent":["// @flow\nimport ContentConfigurationElements from \"./ContentConfigurationElements\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\nimport { isPlainObject } from \"../../utils\";\n\n/**\n */\nclass ContentConfigurationResults {\n _configuration: Object;\n _layouthint: LayoutHintCollection;\n\n /**\n */\n constructor(configuration: Object) {\n this._configuration = configuration || null;\n\n this._layouthint = new LayoutHintCollection(configuration?.layouthint);\n }\n\n /**\n */\n get label(): string | null {\n if (this._configuration === null) {\n return null;\n }\n\n return this._configuration.label;\n }\n\n /**\n */\n get description(): string | null {\n if (this._configuration === null) {\n return null;\n }\n\n const description = this._configuration.description;\n if (isPlainObject(description) && \"message\" in description) {\n return description.message;\n }\n\n return description;\n }\n\n /**\n */\n get attributes(): Array<string> {\n if (this._configuration === null) {\n return [];\n }\n\n // An issue with mapped attributes is giving us the wrong attribute keys in the attributes property\n // as a temporary fix a layouthint with the correct mapped attribute key can be set in the configuration of the end results\n return [\n ...this._configuration.attributes,\n ...this.layouthint.all\n .filter((hint) => hint.includes(\"attribute:\"))\n .map((hint) => hint.substring(\"attribute:\".length)),\n ];\n }\n\n /**\n */\n getFormConfigElement(elementKey: string): ContentConfigurationElements {\n if (this._configuration === null) {\n return new ContentConfigurationElements([]);\n }\n\n const configElement = this._configuration[elementKey];\n\n return new ContentConfigurationElements(configElement);\n }\n\n /**\n */\n get calculatedResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"calculatedResultElements\");\n }\n\n /**\n */\n get positiveResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"positiveResultElements\");\n }\n\n /**\n */\n get negativeResultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"negativeResultElements\");\n }\n\n /**\n */\n get resultElements(): ContentConfigurationElements {\n return this.getFormConfigElement(\"resultElements\");\n }\n\n /**\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n}\n\nexport default ContentConfigurationResults;\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA,MAAMG,2BAA2B,CAAC;EAIhC;AACF;EACEC,WAAWA,CAACC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;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UAAkB,EAAgC;IACrE,IAAI,IAAI,CAACpB,cAAc,KAAK,IAAI,EAAE;MAChC,OAAO,IAAIqB,qCAA4B,CAAC,EAAE,CAAC;IAC7C;IAEA,MAAMC,aAAa,GAAG,IAAI,CAACtB,cAAc,CAACoB,UAAU,CAAC;IAErD,OAAO,IAAIC,qCAA4B,CAACC,aAAa,CAAC;EACxD;;EAEA;AACF;EACE,IAAIC,wBAAwBA,CAAA,EAAiC;IAC3D,OAAO,IAAI,CAACJ,oBAAoB,CAAC,0BAA0B,CAAC;EAC9D;;EAEA;AACF;EACE,IAAIK,sBAAsBA,CAAA,EAAiC;IACzD,OAAO,IAAI,CAACL,oBAAoB,CAAC,wBAAwB,CAAC;EAC5D;;EAEA;AACF;EACE,IAAIM,sBAAsBA,CAAA,EAAiC;IACzD,OAAO,IAAI,CAACN,oBAAoB,CAAC,wBAAwB,CAAC;EAC5D;;EAEA;AACF;EACE,IAAIO,cAAcA,CAAA,EAAiC;IACjD,OAAO,IAAI,CAACP,oBAAoB,CAAC,gBAAgB,CAAC;EACpD;;EAEA;AACF;EACE,IAAIhB,UAAUA,CAAA,EAAyB;IACrC,OAAO,IAAI,CAACF,WAAW;EACzB;AACF;AAAC,IAAA0B,QAAA,GAEchC,2BAA2B;AAAAiC,OAAA,CAAA7B,OAAA,GAAA4B,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorModel.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ErrorModel","constructor","id","defaultMessage","parameters","isClientConstraint","arguments","length","undefined","layouthint","LayoutHintCollection","_defineProperty2","default","_id","_parameters","_defaultMessage","_isClientConstraint","_layouthint","Array","isArray","isMandatoryConstraint","getMessage","_default","exports"],"sources":["../../../src/models/error/ErrorModel.js"],"sourcesContent":["// @flow\nimport type { MessageObject, MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Wrapper around an error message / object\n */\nclass ErrorModel {\n _id: string;\n _defaultMessage: ?string;\n _parameters: ?MessageParameters;\n _isClientConstraint: boolean;\n _layouthint: LayoutHintCollection;\n\n /**\n * Contruct\n */\n constructor(\n id: string,\n defaultMessage: ?string,\n parameters: ?MessageParameters,\n isClientConstraint: boolean = false,\n layouthint: LayoutHintCollection = new LayoutHintCollection(),\n ) {\n this._id = id;\n this._parameters = parameters;\n this._defaultMessage = defaultMessage;\n this._isClientConstraint = isClientConstraint;\n this._layouthint = Array.isArray(layouthint)\n ? new LayoutHintCollection(layouthint)\n : layouthint;\n }\n\n /**\n * Get id of error\n */\n get id(): string {\n return this._id;\n }\n\n /**\n */\n get defaultMessage(): ?string {\n return this._defaultMessage;\n }\n\n /**\n */\n get parameters(): ?MessageParameters {\n return this._parameters;\n }\n\n /**\n */\n get isClientConstraint(): boolean {\n return this._isClientConstraint || false;\n }\n\n /**\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n */\n get isMandatoryConstraint(): boolean {\n return this.id === \"Constraint.Mandatory\";\n }\n\n /**\n * Returns a message object from the error\n */\n getMessage(): MessageObject {\n return {\n id: this.id,\n defaultMessage: this.defaultMessage ?? \"\",\n parameters: this.parameters ?? {},\n };\n }\n}\n\nexport default ErrorModel;\n"],"mappings":";;;;;;;;AAEA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,UAAU,CAAC;EAOf;AACF;AACA;EACEC,WAAWA,CACTC,EAAU,EACVC,cAAuB,EACvBC,UAA8B,EAG9B;IAAA,IAFAC,kBAA2B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;IAAA,IACnCG,UAAgC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAII,6BAAoB,CAAC,CAAC;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAE7D,IAAI,CAACC,GAAG,GAAGX,EAAE;IACb,IAAI,CAACY,WAAW,GAAGV,UAAU;IAC7B,IAAI,CAACW,eAAe,GAAGZ,cAAc;IACrC,IAAI,CAACa,mBAAmB,GAAGX,kBAAkB;IAC7C,IAAI,CAACY,WAAW,GAAGC,KAAK,CAACC,OAAO,CAACV,UAAU,CAAC,GACxC,IAAIC,6BAAoB,CAACD,UAAU,CAAC,GACpCA,UAAU;EAChB;;EAEA;AACF;AACA;EACE,IAAIP,EAAEA,CAAA,EAAW;IACf,OAAO,IAAI,CAACW,GAAG;EACjB;;EAEA;AACF;EACE,IAAIV,cAAcA,CAAA,EAAY;IAC5B,OAAO,IAAI,CAACY,eAAe;EAC7B;;EAEA;AACF;EACE,IAAIX,UAAUA,CAAA,EAAuB;IACnC,OAAO,IAAI,CAACU,WAAW;EACzB;;EAEA;AACF;EACE,IAAIT,kBAAkBA,CAAA,EAAY;IAChC,OAAO,IAAI,CAACW,mBAAmB,IAAI,KAAK;EAC1C;;EAEA;AACF;EACE,IAAIP,UAAUA,CAAA,EAAyB;IACrC,OAAO,IAAI,CAACQ,WAAW;EACzB;;EAEA;AACF;EACE,IAAIG,qBAAqBA,CAAA,EAAY;IACnC,OAAO,IAAI,CAAClB,EAAE,KAAK,sBAAsB;EAC3C;;EAEA;AACF;AACA;EACEmB,UAAUA,CAAA,EAAkB;IAC1B,OAAO;MACLnB,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,cAAc,EAAE,IAAI,CAACA,cAAc,IAAI,EAAE;MACzCC,UAAU,EAAE,IAAI,CAACA,UAAU,IAAI,CAAC;IAClC,CAAC;EACH;AACF;AAAC,IAAAkB,QAAA,
|
|
1
|
+
{"version":3,"file":"ErrorModel.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ErrorModel","constructor","id","defaultMessage","parameters","isClientConstraint","arguments","length","undefined","layouthint","LayoutHintCollection","_defineProperty2","default","_id","_parameters","_defaultMessage","_isClientConstraint","_layouthint","Array","isArray","isMandatoryConstraint","getMessage","_default","exports"],"sources":["../../../src/models/error/ErrorModel.js"],"sourcesContent":["// @flow\nimport type { MessageObject, MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Wrapper around an error message / object\n */\nclass ErrorModel {\n _id: string;\n _defaultMessage: ?string;\n _parameters: ?MessageParameters;\n _isClientConstraint: boolean;\n _layouthint: LayoutHintCollection;\n\n /**\n * Contruct\n */\n constructor(\n id: string,\n defaultMessage: ?string,\n parameters: ?MessageParameters,\n isClientConstraint: boolean = false,\n layouthint: LayoutHintCollection = new LayoutHintCollection(),\n ) {\n this._id = id;\n this._parameters = parameters;\n this._defaultMessage = defaultMessage;\n this._isClientConstraint = isClientConstraint;\n this._layouthint = Array.isArray(layouthint)\n ? new LayoutHintCollection(layouthint)\n : layouthint;\n }\n\n /**\n * Get id of error\n */\n get id(): string {\n return this._id;\n }\n\n /**\n */\n get defaultMessage(): ?string {\n return this._defaultMessage;\n }\n\n /**\n */\n get parameters(): ?MessageParameters {\n return this._parameters;\n }\n\n /**\n */\n get isClientConstraint(): boolean {\n return this._isClientConstraint || false;\n }\n\n /**\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n */\n get isMandatoryConstraint(): boolean {\n return this.id === \"Constraint.Mandatory\";\n }\n\n /**\n * Returns a message object from the error\n */\n getMessage(): MessageObject {\n return {\n id: this.id,\n defaultMessage: this.defaultMessage ?? \"\",\n parameters: this.parameters ?? {},\n };\n }\n}\n\nexport default ErrorModel;\n"],"mappings":";;;;;;;;AAEA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,UAAU,CAAC;EAOf;AACF;AACA;EACEC,WAAWA,CACTC,EAAU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EAEA;AACF;AACA;EACEmB,UAAUA,CAAA,EAAkB;IAC1B,OAAO;MACLnB,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,cAAc,EAAE,IAAI,CAACA,cAAc,IAAI,EAAE;MACzCC,UAAU,EAAE,IAAI,CAACA,UAAU,IAAI,CAAC;IAClC,CAAC;EACH;AACF;AAAC,IAAAkB,QAAA,GAEctB,UAAU;AAAAuB,OAAA,CAAAX,OAAA,GAAAU,QAAA"}
|
|
@@ -8,11 +8,11 @@ exports.default = void 0;
|
|
|
8
8
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
9
9
|
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
11
|
-
var
|
|
11
|
+
var _FilterModel = _interopRequireDefault(require("./FilterModel"));
|
|
12
12
|
/**
|
|
13
13
|
* StringFilterModel can handle string filters with multiple setting
|
|
14
14
|
*/
|
|
15
|
-
class StringFilterModel extends
|
|
15
|
+
class StringFilterModel extends _FilterModel.default {
|
|
16
16
|
/**
|
|
17
17
|
*/
|
|
18
18
|
constructor(data, contributions) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import BaseFilterModel from "./BaseFilterModel";
|
|
3
2
|
|
|
4
3
|
import type { AttributeType, FilterType } from "../types";
|
|
4
|
+
import FilterModel from "./FilterModel";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* StringFilterModel can handle string filters with multiple setting
|
|
8
8
|
*/
|
|
9
|
-
export default class StringFilterModel extends
|
|
9
|
+
export default class StringFilterModel extends FilterModel {
|
|
10
10
|
_isValid: boolean = true;
|
|
11
11
|
_value: string | null;
|
|
12
12
|
_inputvalue: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringFilterModel.js","names":["
|
|
1
|
+
{"version":3,"file":"StringFilterModel.js","names":["_FilterModel","_interopRequireDefault","require","StringFilterModel","FilterModel","constructor","data","contributions","_defineProperty2","default","update","attribute","value","_inputvalue","_value","params","param","name","removeFormat","inputvalue","reset","isValid","_isValid","toString","shouldHandleFormat","_context","_context2","values","isMultiple","_map","split","call","val","_trim","outputValues","formattedValue","formatValue","push","validate","join","operator","getContribution","isBSN","layouthint","has","isIBAN","isZipcode","replace","exports"],"sources":["../../../src/models/filters/StringFilterModel.js"],"sourcesContent":["// @flow\n\nimport type { AttributeType, FilterType } from \"../types\";\nimport FilterModel from \"./FilterModel\";\n\n/**\n * StringFilterModel can handle string filters with multiple setting\n */\nexport default class StringFilterModel extends FilterModel {\n _isValid: boolean = true;\n _value: string | null;\n _inputvalue: string;\n\n /**\n */\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this.update(this.attribute, data.value ?? \"\");\n\n // when formatted value set this to initial input value\n this._inputvalue = this._value ?? \"\";\n }\n\n /**\n * Retrieve the parameters with its value for this filter\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.removeFormat(this.value),\n },\n ];\n }\n\n /**\n * Getting the value of the filter\n */\n get value(): string | null {\n return this._value;\n }\n\n /**\n */\n get inputvalue(): string {\n return this._inputvalue;\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n reset(): FilterType {\n this._inputvalue = \"\";\n this._value = null;\n\n return this;\n }\n\n /**\n */\n get isValid(): boolean {\n return this._isValid;\n }\n\n /**\n * Update this filter with input name and value\n */\n update(attribute: AttributeType, value: string) {\n this._isValid = true;\n this._inputvalue = typeof value !== \"string\" ? value.toString() : value;\n\n if (this.shouldHandleFormat()) {\n const values = this.isMultiple\n ? this._inputvalue.split(\",\").map((val) => val.trim())\n : [this._inputvalue.trim()];\n\n const outputValues = [];\n for (const val of values) {\n const formattedValue = this.formatValue(val);\n if (formattedValue !== \"\") {\n outputValues.push(formattedValue);\n\n if (!this.attribute.validate(formattedValue)) {\n this._isValid = false;\n }\n }\n }\n\n this._value = outputValues.join(\",\");\n } else {\n this._value = value;\n }\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n */\n formatValue(value: string): string {\n if (this.shouldHandleFormat()) {\n return this.attribute.formatValue(value);\n }\n return value;\n }\n\n /**\n */\n isBSN(): boolean {\n return this.layouthint.has(\"bsn\");\n }\n\n /**\n */\n isIBAN(): boolean {\n return this.layouthint.has(\"iban\");\n }\n\n /**\n */\n isZipcode(): boolean {\n return this.layouthint.has(\"zipcode\");\n }\n\n /**\n */\n removeFormat(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (this.shouldHandleFormat()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n /**\n */\n shouldHandleFormat(): boolean {\n return (\n (this.operator === \"exactly\" || this.operator === \"isNot\") &&\n (this.isIBAN() || this.isZipcode() || this.isBSN())\n );\n }\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAMC,iBAAiB,SAASC,oBAAW,CAAC;EAKzD;AACF;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAC/C,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA,oBAPT,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAStB,IAAI,CAACC,MAAM,CAAC,IAAI,CAACC,SAAS,EAAEL,IAAI,CAACM,KAAK,IAAI,EAAE,CAAC;;IAE7C;IACA,IAAI,CAACC,WAAW,GAAG,IAAI,CAACC,MAAM,IAAI,EAAE;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAA4C;IACpD,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;MACf,OA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