@beinformed/ui 1.35.0 → 1.36.1
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 +15 -0
- package/esm/constants/LayoutHintConfig.js +9 -0
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +5 -0
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +1 -1
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +20 -5
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/constants/Constants.js +33 -66
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +10 -2
- package/lib/constants/LayoutHintConfig.js.flow +9 -0
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +24 -37
- package/lib/constants/LayoutHints.js.flow +5 -0
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +3 -6
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js +1 -2
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +1 -2
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +1 -2
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +1 -2
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +1 -2
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +1 -2
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +1 -2
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +1 -2
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +1 -2
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +1 -2
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +1 -2
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +1 -2
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +1 -2
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +1 -2
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +3 -4
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/i18n/Locale.js +1 -2
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +2 -4
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +1 -2
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js +2 -2
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/languages.js +1 -2
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js +1 -2
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js +1 -2
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/lib/i18n/withMessage.js +1 -2
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +1 -1
- package/lib/models/actions/ActionCollection.js.flow +3 -1
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/application/__tests__/Application.spec.js.flow +1 -1
- package/lib/models/attributes/AttributeCollection.js +1 -2
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +1 -2
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +1 -2
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +1 -2
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +1 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +1 -2
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +1 -2
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +1 -2
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +1 -2
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +1 -2
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +1 -2
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +1 -2
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +1 -2
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +1 -2
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +1 -2
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +1 -2
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +1 -2
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +1 -2
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +1 -2
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +1 -2
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +1 -2
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +1 -2
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +1 -2
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +1 -2
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +1 -2
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/error/ErrorModel.js +1 -2
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/form/FormModel.js +1 -2
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/href/Href.js +1 -2
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/index.js +2 -2
- package/lib/models/index.js.map +1 -1
- package/lib/models/links/LinkModel.js +1 -2
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/__tests__/normalizeLinkJSON.spec.js.flow +2 -1
- package/lib/models/links/normalizeLinkJSON.js +20 -7
- package/lib/models/links/normalizeLinkJSON.js.flow +20 -4
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +1 -2
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +1 -2
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/parameter/Parameter.js +1 -2
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/resolveModel.js +1 -2
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +1 -2
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +1 -2
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/taskgroup/__tests__/TaskGroupModel.spec.js.flow +17 -0
- package/lib/models/user/UserServicesModel.js +1 -2
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +1 -2
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/CaptchaRequest.js +1 -2
- package/lib/modularui/CaptchaRequest.js.map +1 -1
- package/lib/modularui/ModularUIError.js +1 -2
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +1 -2
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +1 -2
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/UploadRequest.js +1 -2
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/react/ErrorBoundary.js +1 -2
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +1 -2
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react-client/rehydrate.js +1 -2
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +1 -2
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +1 -2
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +1 -2
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +1 -2
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +1 -2
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +1 -2
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +2 -2
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +1 -2
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +1 -2
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +1 -2
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js +1 -2
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +1 -2
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/RouterConnectors.js +5 -10
- package/lib/redux/_router/RouterConnectors.js.map +1 -1
- package/lib/redux/connectors/Application.js +1 -2
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +1 -2
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +1 -2
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +1 -2
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +1 -2
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +1 -2
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +1 -2
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +1 -2
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +1 -2
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +1 -2
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +1 -2
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +1 -2
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +1 -2
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +1 -2
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Progress.js +1 -2
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +1 -2
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +1 -2
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +1 -2
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +1 -2
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +1 -2
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +1 -2
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +1 -2
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +1 -2
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +1 -2
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +1 -2
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +1 -2
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/store/configureStore.js +1 -2
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +1 -2
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +4 -8
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +1 -2
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +1 -2
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +1 -2
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js +1 -2
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +1 -2
- package/lib/utils/number/formatValue.js.map +1 -1
- package/package.json +11 -10
- package/src/constants/LayoutHintConfig.js +9 -0
- package/src/constants/LayoutHints.js +5 -0
- package/src/models/actions/ActionCollection.js +3 -1
- package/src/models/application/__tests__/Application.spec.js +1 -1
- package/src/models/application/__tests__/webappContributions.json +2 -1
- package/src/models/links/__tests__/normalizeLinkJSON.spec.js +2 -1
- package/src/models/links/normalizeLinkJSON.js +20 -4
- package/src/models/taskgroup/__tests__/TaskGroupModel.spec.js +17 -0
- package/src/models/taskgroup/__tests__/taskgroup.json +25 -0
- package/src/models/taskgroup/__tests__/taskgroupContributions.json +23 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependentAttribute.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_constants","_ChoiceAttributeModel","_BooleanAttributeModel","_exceptions","EQUALS","INCLUDES","NOT_EQUALS","NOT_INCLUDES","NOT_IS_EMPTY","IS_EMPTY","SHOW","HIDE","DependentAttribute","BaseLayoutHintRule","constructor","arguments","_defineProperty2","default","isApplicableForHint","hint","regex","RegExp","DEPENDENT_ATTRIBUTE","test","getRuleInstance","initHint","rule","OPERATORS","DEPENDENT_ATTRIBUTE_CONTROL","isEmpyNotIsEmptRegex","result","match","action","control","operator","options","ConfigurationException","_action","_control","_operator","_options","_context","_map","split","call","option","_trim","processEqualsOptions","controlAttribute","ChoiceAttributeModel","BooleanAttributeModel","every","_context2","_includes","selected","processIncludesOptions","some","_context3","handleOperator","length","getControlAttribute","attributes","attribute","getAttributeByLayoutHint","process","processLayoutHintRules","isHidden","hide","label","_default","exports"],"sources":["../../../../src/models/attributes/layouthint-rules/DependentAttribute.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport {\n DEPENDENT_ATTRIBUTE_CONTROL,\n DEPENDENT_ATTRIBUTE,\n} from \"../../../constants\";\n\nimport ChoiceAttributeModel from \"../ChoiceAttributeModel\";\nimport BooleanAttributeModel from \"../BooleanAttributeModel\";\n\nimport { ConfigurationException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\nconst EQUALS = \"equals\";\nconst INCLUDES = \"includes\";\nconst NOT_EQUALS = \"notEquals\";\nconst NOT_INCLUDES = \"notIncludes\";\nconst NOT_IS_EMPTY = \"notIsEmpty\";\nconst IS_EMPTY = \"isEmpty\";\n\nconst SHOW = \"show\";\nconst HIDE = \"hide\";\n\n/**\n * Depending attributes hint logic\n */\nclass DependentAttribute extends BaseLayoutHintRule {\n _action: string;\n _control: string;\n _operator: string;\n _options: Array<string>;\n\n /**\n */\n static checkHintApplicability: boolean = true;\n\n /**\n */\n static isApplicableForHint(hint: string): boolean {\n const regex = new RegExp(\n `^${DEPENDENT_ATTRIBUTE}\\\\s?(${SHOW}|${HIDE})`,\n \"i\",\n );\n\n return regex.test(hint);\n }\n\n /**\n * Used on initHint to create an instance of this rule\n */\n static getRuleInstance(): DependentAttribute {\n return new DependentAttribute();\n }\n\n /**\n */\n static initHint(hint: string): any {\n const rule = this.getRuleInstance();\n\n const OPERATORS = `${EQUALS}|${INCLUDES}|${NOT_EQUALS}|${NOT_INCLUDES}|${NOT_IS_EMPTY}|${IS_EMPTY}`;\n const regex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})\\\\s(.*)`,\n \"i\",\n );\n const isEmpyNotIsEmptRegex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})`,\n \"i\",\n );\n\n const result = hint.match(regex)\n ? hint.match(regex)\n : hint.match(isEmpyNotIsEmptRegex);\n\n if (result) {\n rule.action = result[1];\n rule.control = result[2];\n rule.operator = result[3];\n rule.options = !result[4] ? \"\" : result[4];\n } else {\n throw new ConfigurationException(\n `No dependent information found on layout hint: ${hint}`,\n );\n }\n\n return rule;\n }\n\n /**\n */\n get action(): string {\n return this._action;\n }\n\n /**\n */\n set action(action: string) {\n this._action = action;\n }\n\n /**\n */\n get control(): string {\n return this._control;\n }\n\n /**\n */\n set control(control: string) {\n this._control = control;\n }\n\n /**\n */\n get operator(): string {\n return this._operator;\n }\n\n /**\n */\n set operator(operator: string) {\n this._operator = operator;\n }\n\n /**\n */\n get options(): Array<string> {\n return this._options;\n }\n\n /**\n */\n set options(options: string): void {\n this._options = options.split(\"|\").map((option) => option.trim());\n }\n\n /**\n */\n processEqualsOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (\n controlAttribute instanceof ChoiceAttributeModel ||\n controlAttribute instanceof BooleanAttributeModel\n ) {\n return this.options.every((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with equals operator must be a choice, string or number attribute\",\n );\n }\n\n /**\n */\n processIncludesOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (controlAttribute instanceof ChoiceAttributeModel) {\n return this.options.some((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with includes operator must be a choice attribute\",\n );\n }\n\n /**\n */\n handleOperator(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n switch (this.operator) {\n case EQUALS:\n return this.processEqualsOptions(controlAttribute);\n case INCLUDES:\n return this.processIncludesOptions(controlAttribute);\n case NOT_EQUALS:\n return !this.processEqualsOptions(controlAttribute);\n case NOT_INCLUDES:\n return !this.processIncludesOptions(controlAttribute);\n case NOT_IS_EMPTY:\n return controlAttribute?.selected.length !== 0;\n case IS_EMPTY:\n return controlAttribute?.selected.length === 0;\n default:\n throw new ConfigurationException(\n `Unsupported operator for dependent question: ${this.operator}`,\n );\n }\n }\n\n /**\n */\n getControlAttribute(\n attributes: AttributeCollection,\n ): ChoiceAttributeModel | BooleanAttributeModel | null {\n const attribute = attributes.getAttributeByLayoutHint(\n `${DEPENDENT_ATTRIBUTE_CONTROL}:${this.control}`,\n `${DEPENDENT_ATTRIBUTE_CONTROL}: ${this.control}`,\n );\n\n if (\n attribute instanceof ChoiceAttributeModel ||\n attribute instanceof BooleanAttributeModel\n ) {\n return attribute;\n }\n\n return null;\n }\n\n /**\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n const controlAttribute = this.getControlAttribute(attributes);\n if (!controlAttribute) {\n return;\n }\n\n controlAttribute.processLayoutHintRules(attributes);\n if (controlAttribute.isHidden) {\n attribute.hide();\n return;\n }\n\n const result = this.handleOperator(controlAttribute);\n if (this.action === SHOW) {\n attribute.isHidden = !result;\n } else if (this.action === HIDE) {\n attribute.isHidden = result;\n } else {\n throw new ConfigurationException(\n `Unsupported action ${this.action} for dependent question on attribute: ${attribute.label}`,\n );\n }\n }\n}\n\nexport default DependentAttribute;\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,sBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,MAAMK,MAAM,GAAG,QAAQ;AACvB,MAAMC,QAAQ,GAAG,UAAU;AAC3B,MAAMC,UAAU,GAAG,WAAW;AAC9B,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,YAAY,GAAG,YAAY;AACjC,MAAMC,QAAQ,GAAG,SAAS;AAE1B,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,IAAI,GAAG,MAAM;;AAEnB;AACA;AACA;AACA,MAAMC,kBAAkB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;EAAA;EAUlD;AACF;EACE,OAAOC,mBAAmBA,CAACC,IAAY,EAAW;IAChD,MAAMC,KAAK,GAAG,IAAIC,MAAM,CACrB,IAAGC,8BAAoB,QAAOZ,IAAK,IAAGC,IAAK,GAAE,EAC9C,GACF,CAAC;IAED,OAAOS,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,OAAQ,EAClD,CAAC;IAED,IACE6B,SAAS,YAAYb,6BAAoB,IACzCa,SAAS,YAAYZ,8BAAqB,EAC1C;MACA,OAAOY,SAAS;IAClB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,OAAOA,CAACF,SAAyB,EAAED,UAA+B,EAAQ;IACxE,MAAMb,gBAAgB,GAAG,IAAI,CAACY,mBAAmB,CAACC,UAAU,CAAC;IAC7D,IAAI,CAACb,gBAAgB,EAAE;MACrB;IACF;IAEAA,gBAAgB,CAACiB,sBAAsB,CAACJ,UAAU,CAAC;IACnD,IAAIb,gBAAgB,CAACkB,QAAQ,EAAE;MAC7BJ,SAAS,CAACK,IAAI,CAAC,CAAC;MAChB;IACF;IAEA,MAAMrC,MAAM,GAAG,IAAI,CAAC4B,cAAc,CAACV,gBAAgB,CAAC;IACpD,IAAI,IAAI,CAAChB,MAAM,KAAKtB,IAAI,EAAE;MACxBoD,SAAS,CAACI,QAAQ,GAAG,CAACpC,MAAM;IAC9B,CAAC,MAAM,IAAI,IAAI,CAACE,MAAM,KAAKrB,IAAI,EAAE;MAC/BmD,SAAS,CAACI,QAAQ,GAAGpC,MAAM;IAC7B,CAAC,MAAM;MACL,MAAM,IAAIM,kCAAsB,CAC7B,sBAAqB,IAAI,CAACJ,MAAO,yCAAwC8B,SAAS,CAACM,KAAM,EAC5F,CAAC;IACH;EACF;AACF;AAhNE;AACF;AADE,IAAApD,gBAAA,CAAAC,OAAA,EANIL,kBAAkB,4BAQmB,IAAI;AAAA,IAAAyD,QAAA,GAgNhCzD,kBAAkB;AAAA0D,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
|
|
1
|
+
{"version":3,"file":"DependentAttribute.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_constants","_ChoiceAttributeModel","_BooleanAttributeModel","_exceptions","EQUALS","INCLUDES","NOT_EQUALS","NOT_INCLUDES","NOT_IS_EMPTY","IS_EMPTY","SHOW","HIDE","DependentAttribute","BaseLayoutHintRule","constructor","arguments","_defineProperty2","default","isApplicableForHint","hint","regex","RegExp","DEPENDENT_ATTRIBUTE","test","getRuleInstance","initHint","rule","OPERATORS","DEPENDENT_ATTRIBUTE_CONTROL","isEmpyNotIsEmptRegex","result","match","action","control","operator","options","ConfigurationException","_action","_control","_operator","_options","_context","_map","split","call","option","_trim","processEqualsOptions","controlAttribute","ChoiceAttributeModel","BooleanAttributeModel","every","_context2","_includes","selected","processIncludesOptions","some","_context3","handleOperator","length","getControlAttribute","attributes","attribute","getAttributeByLayoutHint","process","processLayoutHintRules","isHidden","hide","label","_default","exports"],"sources":["../../../../src/models/attributes/layouthint-rules/DependentAttribute.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport {\n DEPENDENT_ATTRIBUTE_CONTROL,\n DEPENDENT_ATTRIBUTE,\n} from \"../../../constants\";\n\nimport ChoiceAttributeModel from \"../ChoiceAttributeModel\";\nimport BooleanAttributeModel from \"../BooleanAttributeModel\";\n\nimport { ConfigurationException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\nconst EQUALS = \"equals\";\nconst INCLUDES = \"includes\";\nconst NOT_EQUALS = \"notEquals\";\nconst NOT_INCLUDES = \"notIncludes\";\nconst NOT_IS_EMPTY = \"notIsEmpty\";\nconst IS_EMPTY = \"isEmpty\";\n\nconst SHOW = \"show\";\nconst HIDE = \"hide\";\n\n/**\n * Depending attributes hint logic\n */\nclass DependentAttribute extends BaseLayoutHintRule {\n _action: string;\n _control: string;\n _operator: string;\n _options: Array<string>;\n\n /**\n */\n static checkHintApplicability: boolean = true;\n\n /**\n */\n static isApplicableForHint(hint: string): boolean {\n const regex = new RegExp(\n `^${DEPENDENT_ATTRIBUTE}\\\\s?(${SHOW}|${HIDE})`,\n \"i\",\n );\n\n return regex.test(hint);\n }\n\n /**\n * Used on initHint to create an instance of this rule\n */\n static getRuleInstance(): DependentAttribute {\n return new DependentAttribute();\n }\n\n /**\n */\n static initHint(hint: string): any {\n const rule = this.getRuleInstance();\n\n const OPERATORS = `${EQUALS}|${INCLUDES}|${NOT_EQUALS}|${NOT_INCLUDES}|${NOT_IS_EMPTY}|${IS_EMPTY}`;\n const regex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})\\\\s(.*)`,\n \"i\",\n );\n const isEmpyNotIsEmptRegex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})`,\n \"i\",\n );\n\n const result = hint.match(regex)\n ? hint.match(regex)\n : hint.match(isEmpyNotIsEmptRegex);\n\n if (result) {\n rule.action = result[1];\n rule.control = result[2];\n rule.operator = result[3];\n rule.options = !result[4] ? \"\" : result[4];\n } else {\n throw new ConfigurationException(\n `No dependent information found on layout hint: ${hint}`,\n );\n }\n\n return rule;\n }\n\n /**\n */\n get action(): string {\n return this._action;\n }\n\n /**\n */\n set action(action: string) {\n this._action = action;\n }\n\n /**\n */\n get control(): string {\n return this._control;\n }\n\n /**\n */\n set control(control: string) {\n this._control = control;\n }\n\n /**\n */\n get operator(): string {\n return this._operator;\n }\n\n /**\n */\n set operator(operator: string) {\n this._operator = operator;\n }\n\n /**\n */\n get options(): Array<string> {\n return this._options;\n }\n\n /**\n */\n set options(options: string): void {\n this._options = options.split(\"|\").map((option) => option.trim());\n }\n\n /**\n */\n processEqualsOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (\n controlAttribute instanceof ChoiceAttributeModel ||\n controlAttribute instanceof BooleanAttributeModel\n ) {\n return this.options.every((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with equals operator must be a choice, string or number attribute\",\n );\n }\n\n /**\n */\n processIncludesOptions(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n if (controlAttribute instanceof ChoiceAttributeModel) {\n return this.options.some((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with includes operator must be a choice attribute\",\n );\n }\n\n /**\n */\n handleOperator(\n controlAttribute: ChoiceAttributeModel | BooleanAttributeModel,\n ): boolean {\n switch (this.operator) {\n case EQUALS:\n return this.processEqualsOptions(controlAttribute);\n case INCLUDES:\n return this.processIncludesOptions(controlAttribute);\n case NOT_EQUALS:\n return !this.processEqualsOptions(controlAttribute);\n case NOT_INCLUDES:\n return !this.processIncludesOptions(controlAttribute);\n case NOT_IS_EMPTY:\n return controlAttribute?.selected.length !== 0;\n case IS_EMPTY:\n return controlAttribute?.selected.length === 0;\n default:\n throw new ConfigurationException(\n `Unsupported operator for dependent question: ${this.operator}`,\n );\n }\n }\n\n /**\n */\n getControlAttribute(\n attributes: AttributeCollection,\n ): ChoiceAttributeModel | BooleanAttributeModel | null {\n const attribute = attributes.getAttributeByLayoutHint(\n `${DEPENDENT_ATTRIBUTE_CONTROL}:${this.control}`,\n `${DEPENDENT_ATTRIBUTE_CONTROL}: ${this.control}`,\n );\n\n if (\n attribute instanceof ChoiceAttributeModel ||\n attribute instanceof BooleanAttributeModel\n ) {\n return attribute;\n }\n\n return null;\n }\n\n /**\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n const controlAttribute = this.getControlAttribute(attributes);\n if (!controlAttribute) {\n return;\n }\n\n controlAttribute.processLayoutHintRules(attributes);\n if (controlAttribute.isHidden) {\n attribute.hide();\n return;\n }\n\n const result = this.handleOperator(controlAttribute);\n if (this.action === SHOW) {\n attribute.isHidden = !result;\n } else if (this.action === HIDE) {\n attribute.isHidden = result;\n } else {\n throw new ConfigurationException(\n `Unsupported action ${this.action} for dependent question on attribute: ${attribute.label}`,\n );\n }\n }\n}\n\nexport default DependentA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B,sBAAsB,CAACJ,UAAU,CAAC;IACnD,IAAIb,gBAAgB,CAACkB,QAAQ,EAAE;MAC7BJ,SAAS,CAACK,IAAI,CAAC,CAAC;MAChB;IACF;IAEA,MAAMrC,MAAM,GAAG,IAAI,CAAC4B,cAAc,CAACV,gBAAgB,CAAC;IACpD,IAAI,IAAI,CAAChB,MAAM,KAAKtB,IAAI,EAAE;MACxBoD,SAAS,CAACI,QAAQ,GAAG,CAACpC,MAAM;IAC9B,CAAC,MAAM,IAAI,IAAI,CAACE,MAAM,KAAKrB,IAAI,EAAE;MAC/BmD,SAAS,CAACI,QAAQ,GAAGpC,MAAM;IAC7B,CAAC,MAAM;MACL,MAAM,IAAIM,kCAAsB,CAC7B,sBAAqB,IAAI,CAACJ,MAAO,yCAAwC8B,SAAS,CAACM,KAAM,EAC5F,CAAC;IACH;EACF;AACF;AAhNE;AACF;AADE,IAAApD,gBAAA,CAAAC,OAAA,EANIL,kBAAkB,4BAQmB,IAAI;AAAA,IAAAyD,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAgNhCL,kBAAkB"}
|
|
@@ -84,6 +84,5 @@ class LayoutHintRuleCollection extends _BaseCollection.default {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
var _default = LayoutHintRuleCollection;
|
|
88
|
-
exports.default = _default;
|
|
87
|
+
var _default = exports.default = LayoutHintRuleCollection;
|
|
89
88
|
//# sourceMappingURL=LayoutHintRuleCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintRuleCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_BaseLayoutHintRule","_DependentAttribute","_RemainingTotalUploadSize","_exceptions","layoutHintRules","DependentAttribute","RemainingTotalUploadSize","addLayoutHintRule","rule","push","exports","updateLayoutHintRules","updater","newRules","Array","isArray","IllegalReturnException","LayoutHintRuleCollection","BaseCollection","allRules","setLayoutHintRules","attribute","rules","forEach","isApplicableForAttribute","checkHintApplicability","layouthint","hint","isApplicableForHint","add","initHint","initAttribute","process","attributes","all","_default","default"],"sources":["../../../../src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../../base/BaseCollection\";\n\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport DependentAttribute from \"./DependentAttribute\";\nimport RemainingTotalUploadSize from \"./RemainingTotalUploadSize\";\n\nimport { IllegalReturnException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * Array of available layout hint rules\n * @private\n */\nlet layoutHintRules: Array<Class<BaseLayoutHintRule>> = [\n DependentAttribute,\n RemainingTotalUploadSize,\n];\n\n/**\n * Add custom layout hint rules\n */\nexport const addLayoutHintRule = (rule: Class<BaseLayoutHintRule>) => {\n layoutHintRules.push(rule);\n};\n\ntype LayoutHintRulesUpdater = (\n rules: Array<Class<BaseLayoutHintRule>>,\n) => Array<Class<BaseLayoutHintRule>>;\n\n/**\n * Update existing array of layout hint rules, use this to update or remove standard rules\n *\n * @example\n * // remove RemainingTotalUploadSize rule\n * updateLayoutHintRules((rules) => {\n * return rules.filter(rule => rule !== RemainingTotalUploadSize));\n * });\n */\nexport const updateLayoutHintRules = (updater: LayoutHintRulesUpdater) => {\n const newRules = updater(layoutHintRules);\n if (Array.isArray(newRules)) {\n layoutHintRules = newRules;\n } else {\n throw new IllegalReturnException(\n \"Result of updater of updateLayoutHintRules is not an array\",\n );\n }\n};\n\n/**\n * Collection of layout hint rules\n */\nclass LayoutHintRuleCollection extends BaseCollection<ILayoutHintRule> {\n /**\n * Retrieve all rules available in the collection\n */\n get allRules(): Array<Class<BaseLayoutHintRule>> {\n return layoutHintRules;\n }\n\n /**\n * Set layout hint rules on the applicable attributes\n */\n static setLayoutHintRules<T: AttributeType>(attribute: T): T {\n const rules = new LayoutHintRuleCollection();\n\n layoutHintRules.forEach((rule) => {\n if (rule.isApplicableForAttribute(attribute)) {\n if (rule.checkHintApplicability) {\n attribute.layouthint.forEach((hint) => {\n if (rule.isApplicableForHint(hint)) {\n rules.add(rule.initHint(hint));\n }\n });\n } else {\n rules.add(rule.initAttribute(attribute));\n }\n }\n });\n\n attribute.layoutHintRules = rules;\n\n return attribute;\n }\n\n /**\n * Process layout hint rules in the collection\n */\n process(attribute: AttributeModel, attributes: AttributeCollection) {\n this.all.forEach((rule) => {\n rule.process(attribute, attributes);\n });\n }\n}\n\nexport default LayoutHintRuleCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,yBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAMA;AACA;AACA;AACA;AACA,IAAIK,eAAiD,GAAG,CACtDC,2BAAkB,EAClBC,iCAAwB,CACzB;;AAED;AACA;AACA;AACO,MAAMC,iBAAiB,GAAIC,IAA+B,IAAK;EACpEJ,eAAe,CAACK,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAMF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAIC,OAA+B,IAAK;EACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACR,eAAe,CAAC;EACzC,IAAIU,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3BT,eAAe,GAAGS,QAAQ;EAC5B,CAAC,MAAM;IACL,MAAM,IAAIG,kCAAsB,CAC9B,4DACF,CAAC;EACH;AACF,CAAC;;AAED;AACA;AACA;AAFAN,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGA,MAAMM,wBAAwB,SAASC,uBAAc,CAAkB;EACrE;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAqC;IAC/C,OAAOf,eAAe;EACxB;;EAEA;AACF;AACA;EACE,OAAOgB,kBAAkBA,CAAmBC,SAAY,EAAK;IAC3D,MAAMC,KAAK,GAAG,IAAIL,wBAAwB,CAAC,CAAC;IAE5Cb,eAAe,CAACmB,OAAO,CAAEf,IAAI,IAAK;MAChC,IAAIA,IAAI,CAACgB,wBAAwB,CAACH,SAAS,CAAC,EAAE;QAC5C,IAAIb,IAAI,CAACiB,sBAAsB,EAAE;UAC/BJ,SAAS,CAACK,UAAU,CAACH,OAAO,CAAEI,IAAI,IAAK;YACrC,IAAInB,IAAI,CAACoB,mBAAmB,CAACD,IAAI,CAAC,EAAE;cAClCL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACsB,QAAQ,CAACH,IAAI,CAAC,CAAC;YAChC;UACF,CAAC,CAAC;QACJ,CAAC,MAAM;UACLL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACuB,aAAa,CAACV,SAAS,CAAC,CAAC;QAC1C;MACF;IACF,CAAC,CAAC;IAEFA,SAAS,CAACjB,eAAe,GAAGkB,KAAK;IAEjC,OAAOD,SAAS;EAClB;;EAEA;AACF;AACA;EACEW,OAAOA,CAACX,SAAyB,EAAEY,UAA+B,EAAE;IAClE,IAAI,CAACC,GAAG,CAACX,OAAO,CAAEf,IAAI,IAAK;MACzBA,IAAI,CAACwB,OAAO,CAACX,SAAS,EAAEY,UAAU,CAAC;IACrC,CAAC,CAAC;EACJ;AACF;AAAC,IAAAE,QAAA,
|
|
1
|
+
{"version":3,"file":"LayoutHintRuleCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_BaseLayoutHintRule","_DependentAttribute","_RemainingTotalUploadSize","_exceptions","layoutHintRules","DependentAttribute","RemainingTotalUploadSize","addLayoutHintRule","rule","push","exports","updateLayoutHintRules","updater","newRules","Array","isArray","IllegalReturnException","LayoutHintRuleCollection","BaseCollection","allRules","setLayoutHintRules","attribute","rules","forEach","isApplicableForAttribute","checkHintApplicability","layouthint","hint","isApplicableForHint","add","initHint","initAttribute","process","attributes","all","_default","default"],"sources":["../../../../src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../../base/BaseCollection\";\n\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport DependentAttribute from \"./DependentAttribute\";\nimport RemainingTotalUploadSize from \"./RemainingTotalUploadSize\";\n\nimport { IllegalReturnException } from \"../../../exceptions\";\n\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * Array of available layout hint rules\n * @private\n */\nlet layoutHintRules: Array<Class<BaseLayoutHintRule>> = [\n DependentAttribute,\n RemainingTotalUploadSize,\n];\n\n/**\n * Add custom layout hint rules\n */\nexport const addLayoutHintRule = (rule: Class<BaseLayoutHintRule>) => {\n layoutHintRules.push(rule);\n};\n\ntype LayoutHintRulesUpdater = (\n rules: Array<Class<BaseLayoutHintRule>>,\n) => Array<Class<BaseLayoutHintRule>>;\n\n/**\n * Update existing array of layout hint rules, use this to update or remove standard rules\n *\n * @example\n * // remove RemainingTotalUploadSize rule\n * updateLayoutHintRules((rules) => {\n * return rules.filter(rule => rule !== RemainingTotalUploadSize));\n * });\n */\nexport const updateLayoutHintRules = (updater: LayoutHintRulesUpdater) => {\n const newRules = updater(layoutHintRules);\n if (Array.isArray(newRules)) {\n layoutHintRules = newRules;\n } else {\n throw new IllegalReturnException(\n \"Result of updater of updateLayoutHintRules is not an array\",\n );\n }\n};\n\n/**\n * Collection of layout hint rules\n */\nclass LayoutHintRuleCollection extends BaseCollection<ILayoutHintRule> {\n /**\n * Retrieve all rules available in the collection\n */\n get allRules(): Array<Class<BaseLayoutHintRule>> {\n return layoutHintRules;\n }\n\n /**\n * Set layout hint rules on the applicable attributes\n */\n static setLayoutHintRules<T: AttributeType>(attribute: T): T {\n const rules = new LayoutHintRuleCollection();\n\n layoutHintRules.forEach((rule) => {\n if (rule.isApplicableForAttribute(attribute)) {\n if (rule.checkHintApplicability) {\n attribute.layouthint.forEach((hint) => {\n if (rule.isApplicableForHint(hint)) {\n rules.add(rule.initHint(hint));\n }\n });\n } else {\n rules.add(rule.initAttribute(attribute));\n }\n }\n });\n\n attribute.layoutHintRules = rules;\n\n return attribute;\n }\n\n /**\n * Process layout hint rules in the collection\n */\n process(attribute: AttributeModel, attributes: AttributeCollection) {\n this.all.forEach((rule) => {\n rule.process(attribute, attributes);\n });\n }\n}\n\nexport default LayoutHintRuleCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,yBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAMA;AACA;AACA;AACA;AACA,IAAIK,eAAiD,GAAG,CACtDC,2BAAkB,EAClBC,iCAAwB,CACzB;;AAED;AACA;AACA;AACO,MAAMC,iBAAiB,GAAIC,IAA+B,IAAK;EACpEJ,eAAe,CAACK,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAMF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAIC,OAA+B,IAAK;EACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACR,eAAe,CAAC;EACzC,IAAIU,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3BT,eAAe,GAAGS,QAAQ;EAC5B,CAAC,MAAM;IACL,MAAM,IAAIG,kCAAsB,CAC9B,4DACF,CAAC;EACH;AACF,CAAC;;AAED;AACA;AACA;AAFAN,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGA,MAAMM,wBAAwB,SAASC,uBAAc,CAAkB;EACrE;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAqC;IAC/C,OAAOf,eAAe;EACxB;;EAEA;AACF;AACA;EACE,OAAOgB,kBAAkBA,CAAmBC,SAAY,EAAK;IAC3D,MAAMC,KAAK,GAAG,IAAIL,wBAAwB,CAAC,CAAC;IAE5Cb,eAAe,CAACmB,OAAO,CAAEf,IAAI,IAAK;MAChC,IAAIA,IAAI,CAACgB,wBAAwB,CAACH,SAAS,CAAC,EAAE;QAC5C,IAAIb,IAAI,CAACiB,sBAAsB,EAAE;UAC/BJ,SAAS,CAACK,UAAU,CAACH,OAAO,CAAEI,IAAI,IAAK;YACrC,IAAInB,IAAI,CAACoB,mBAAmB,CAACD,IAAI,CAAC,EAAE;cAClCL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACsB,QAAQ,CAACH,IAAI,CAAC,CAAC;YAChC;UACF,CAAC,CAAC;QACJ,CAAC,MAAM;UACLL,KAAK,CAACO,GAAG,CAACrB,IAAI,CAACuB,aAAa,CAACV,SAAS,CAAC,CAAC;QAC1C;MACF;IACF,CAAC,CAAC;IAEFA,SAAS,CAACjB,eAAe,GAAGkB,KAAK;IAEjC,OAAOD,SAAS;EAClB;;EAEA;AACF;AACA;EACEW,OAAOA,CAACX,SAAyB,EAAEY,UAA+B,EAAE;IAClE,IAAI,CAACC,GAAG,CAACX,OAAO,CAAEf,IAAI,IAAK;MACzBA,IAAI,CAACwB,OAAO,CAACX,SAAS,EAAEY,UAAU,CAAC;IACrC,CAAC,CAAC;EACJ;AACF;AAAC,IAAAE,QAAA,GAAAzB,OAAA,CAAA0B,OAAA,GAEcnB,wBAAwB"}
|
|
@@ -47,6 +47,5 @@ class RemainingTotalUploadSize extends _BaseLayoutHintRule.default {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
var _default = RemainingTotalUploadSize;
|
|
51
|
-
exports.default = _default;
|
|
50
|
+
var _default = exports.default = RemainingTotalUploadSize;
|
|
52
51
|
//# sourceMappingURL=RemainingTotalUploadSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemainingTotalUploadSize.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_UploadAttributeModel","_constants","RemainingTotalUploadSize","BaseLayoutHintRule","isApplicableForAttribute","attribute","UploadAttributeModel","initAttribute","processUploadInformation","attributes","uploadInformationAttributes","getAttributesByLayoutHint","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","length","firstHasInitialTotalFileSize","layouthint","has","initialTotalFileSize","value","maxTotalFileSize","process","_default","exports","default"],"sources":["../../../../src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport UploadAttributeModel from \"../UploadAttributeModel\";\n\nimport { INITIAL_TOTAL_FILESIZE, MAX_TOTAL_FILESIZE } from \"../../../constants\";\n\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * This pattern enables showing the upload file size remaining when uploading resources<br>\n * The rule depends on other attributes with the INITIAL_TOTAL_FILESIZE and MAX_TOTAL_FILESIZE layout hints\n */\nclass RemainingTotalUploadSize extends BaseLayoutHintRule {\n /**\n */\n static isApplicableForAttribute(attribute: AttributeType): boolean {\n return attribute instanceof UploadAttributeModel;\n }\n\n /**\n */\n static initAttribute(): ILayoutHintRule {\n return new RemainingTotalUploadSize();\n }\n\n /**\n */\n processUploadInformation(\n attribute: UploadAttributeModel,\n attributes: AttributeCollection,\n ) {\n const uploadInformationAttributes = attributes.getAttributesByLayoutHint(\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n );\n\n if (uploadInformationAttributes.length === 2) {\n const firstHasInitialTotalFileSize =\n uploadInformationAttributes[0].layouthint.has(INITIAL_TOTAL_FILESIZE);\n\n const initialTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[0].value\n : uploadInformationAttributes[1].value;\n\n const maxTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[1].value\n : uploadInformationAttributes[0].value;\n\n attribute.initialTotalFileSize = initialTotalFileSize;\n attribute.maxTotalFileSize = maxTotalFileSize;\n }\n }\n\n /**\n * Sets tresholds for initial and maximum upload file size\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n if (attribute instanceof UploadAttributeModel) {\n this.processUploadInformation(attribute, attributes);\n }\n }\n}\n\nexport default RemainingTotalUploadSize;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA,MAAMG,wBAAwB,SAASC,2BAAkB,CAAC;EACxD;AACF;EACE,OAAOC,wBAAwBA,CAACC,SAAwB,EAAW;IACjE,OAAOA,SAAS,YAAYC,6BAAoB;EAClD;;EAEA;AACF;EACE,OAAOC,aAAaA,CAAA,EAAoB;IACtC,OAAO,IAAIL,wBAAwB,CAAC,CAAC;EACvC;;EAEA;AACF;EACEM,wBAAwBA,CACtBH,SAA+B,EAC/BI,UAA+B,EAC/B;IACA,MAAMC,2BAA2B,GAAGD,UAAU,CAACE,yBAAyB,CACtEC,iCAAsB,EACtBC,6BACF,CAAC;IAED,IAAIH,2BAA2B,CAACI,MAAM,KAAK,CAAC,EAAE;MAC5C,MAAMC,4BAA4B,GAChCL,2BAA2B,CAAC,CAAC,CAAC,CAACM,UAAU,CAACC,GAAG,CAACL,iCAAsB,CAAC;MAEvE,MAAMM,oBAAoB,GAAGH,4BAA4B,GACrDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExC,MAAMC,gBAAgB,GAAGL,4BAA4B,GACjDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExCd,SAAS,CAACa,oBAAoB,GAAGA,oBAAoB;MACrDb,SAAS,CAACe,gBAAgB,GAAGA,gBAAgB;IAC/C;EACF;;EAEA;AACF;AACA;EACEC,OAAOA,CAAChB,SAAyB,EAAEI,UAA+B,EAAQ;IACxE,IAAIJ,SAAS,YAAYC,6BAAoB,EAAE;MAC7C,IAAI,CAACE,wBAAwB,CAACH,SAAS,EAAEI,UAAU,CAAC;IACtD;EACF;AACF;AAAC,IAAAa,QAAA,
|
|
1
|
+
{"version":3,"file":"RemainingTotalUploadSize.js","names":["_BaseLayoutHintRule","_interopRequireDefault","require","_UploadAttributeModel","_constants","RemainingTotalUploadSize","BaseLayoutHintRule","isApplicableForAttribute","attribute","UploadAttributeModel","initAttribute","processUploadInformation","attributes","uploadInformationAttributes","getAttributesByLayoutHint","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","length","firstHasInitialTotalFileSize","layouthint","has","initialTotalFileSize","value","maxTotalFileSize","process","_default","exports","default"],"sources":["../../../../src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js"],"sourcesContent":["// @flow\nimport BaseLayoutHintRule from \"./BaseLayoutHintRule\";\n\nimport UploadAttributeModel from \"../UploadAttributeModel\";\n\nimport { INITIAL_TOTAL_FILESIZE, MAX_TOTAL_FILESIZE } from \"../../../constants\";\n\nimport type { AttributeType, ILayoutHintRule } from \"../../types\";\nimport type AttributeCollection from \"../AttributeCollection\";\nimport type AttributeModel from \"../AttributeModel\";\n\n/**\n * This pattern enables showing the upload file size remaining when uploading resources<br>\n * The rule depends on other attributes with the INITIAL_TOTAL_FILESIZE and MAX_TOTAL_FILESIZE layout hints\n */\nclass RemainingTotalUploadSize extends BaseLayoutHintRule {\n /**\n */\n static isApplicableForAttribute(attribute: AttributeType): boolean {\n return attribute instanceof UploadAttributeModel;\n }\n\n /**\n */\n static initAttribute(): ILayoutHintRule {\n return new RemainingTotalUploadSize();\n }\n\n /**\n */\n processUploadInformation(\n attribute: UploadAttributeModel,\n attributes: AttributeCollection,\n ) {\n const uploadInformationAttributes = attributes.getAttributesByLayoutHint(\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n );\n\n if (uploadInformationAttributes.length === 2) {\n const firstHasInitialTotalFileSize =\n uploadInformationAttributes[0].layouthint.has(INITIAL_TOTAL_FILESIZE);\n\n const initialTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[0].value\n : uploadInformationAttributes[1].value;\n\n const maxTotalFileSize = firstHasInitialTotalFileSize\n ? uploadInformationAttributes[1].value\n : uploadInformationAttributes[0].value;\n\n attribute.initialTotalFileSize = initialTotalFileSize;\n attribute.maxTotalFileSize = maxTotalFileSize;\n }\n }\n\n /**\n * Sets tresholds for initial and maximum upload file size\n */\n process(attribute: AttributeModel, attributes: AttributeCollection): void {\n if (attribute instanceof UploadAttributeModel) {\n this.processUploadInformation(attribute, attributes);\n }\n }\n}\n\nexport default RemainingTotalUploadSize;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA,MAAMG,wBAAwB,SAASC,2BAAkB,CAAC;EACxD;AACF;EACE,OAAOC,wBAAwBA,CAACC,SAAwB,EAAW;IACjE,OAAOA,SAAS,YAAYC,6BAAoB;EAClD;;EAEA;AACF;EACE,OAAOC,aAAaA,CAAA,EAAoB;IACtC,OAAO,IAAIL,wBAAwB,CAAC,CAAC;EACvC;;EAEA;AACF;EACEM,wBAAwBA,CACtBH,SAA+B,EAC/BI,UAA+B,EAC/B;IACA,MAAMC,2BAA2B,GAAGD,UAAU,CAACE,yBAAyB,CACtEC,iCAAsB,EACtBC,6BACF,CAAC;IAED,IAAIH,2BAA2B,CAACI,MAAM,KAAK,CAAC,EAAE;MAC5C,MAAMC,4BAA4B,GAChCL,2BAA2B,CAAC,CAAC,CAAC,CAACM,UAAU,CAACC,GAAG,CAACL,iCAAsB,CAAC;MAEvE,MAAMM,oBAAoB,GAAGH,4BAA4B,GACrDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExC,MAAMC,gBAAgB,GAAGL,4BAA4B,GACjDL,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK,GACpCT,2BAA2B,CAAC,CAAC,CAAC,CAACS,KAAK;MAExCd,SAAS,CAACa,oBAAoB,GAAGA,oBAAoB;MACrDb,SAAS,CAACe,gBAAgB,GAAGA,gBAAgB;IAC/C;EACF;;EAEA;AACF;AACA;EACEC,OAAOA,CAAChB,SAAyB,EAAEI,UAA+B,EAAQ;IACxE,IAAIJ,SAAS,YAAYC,6BAAoB,EAAE;MAC7C,IAAI,CAACE,wBAAwB,CAACH,SAAS,EAAEI,UAAU,CAAC;IACtD;EACF;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCollection.js","names":["_full","require","BaseCollection","constructor","initCollection","arguments","length","undefined","_defineProperty2","default","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","_context","_context2","_slice","call","hasItems","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","_context3","_find","filter","_context4","_filter","some","every","map","_context5","_map","forEach","sort","compareFn","_context6","_sort","sorted","_context7","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseCollection.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\n/**\n * Base class for collections of models\n */\nclass BaseCollection<T> {\n _collection: Array<T>;\n\n /**\n * Construct base collection\n */\n constructor(initCollection: Array<T> = []) {\n this.collection = initCollection;\n }\n\n /**\n * Retrieve current collection\n */\n get collection(): Array<T> {\n return this._collection;\n }\n\n /**\n * Replace current collection with a new collection\n */\n set collection(collection: Array<T>) {\n this._collection = collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | Array<T> | T): BaseCollection<T> {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n // $FlowExpectedError[incompatible-type]\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n\n return this;\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n get hasItems(): boolean {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n get isEmpty(): boolean {\n return !this.hasItems;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all(): Array<T> {\n return this.collection;\n }\n\n /**\n * Get the size of this collection\n */\n get size(): number {\n return this.length;\n }\n\n /**\n * Get the size of this collection\n */\n get length(): number {\n return this.collection.length;\n }\n\n /**\n * Return first link in collection\n */\n get first(): T | null {\n return this.collection[0] ?? null;\n }\n\n /**\n */\n get last(): T | null {\n return this.collection[this.collection.length - 1] ?? null;\n }\n\n /**\n */\n get(index: number): T | null {\n return this.collection[index] ?? null;\n }\n\n /**\n * Find item\n */\n find(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): T | null {\n return this.collection.find(callbackfn, thisArg) ?? null;\n }\n\n /**\n * Filter items\n */\n filter(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): Array<T> {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.some(callbackfn, thisArg);\n }\n\n /**\n */\n every(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.every(callbackfn, thisArg);\n }\n\n /**\n */\n map<U>(\n callbackfn: (value: T, index: number, array: Array<T>) => U,\n thisArg?: T,\n ): Array<U> {\n return this.collection.map<U, ?T>(callbackfn, thisArg);\n }\n\n /**\n */\n forEach(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n /**\n */\n sort(compareFn?: (a: T, b: T) => number): Array<T> {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted(): Array<T> {\n return this.collection.sort();\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): this {\n return klona(this);\n }\n}\n\nexport default BaseCollection;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,cAAc,CAAI;EAGtB;AACF;AACA;EACEC,WAAWA,CAAA,EAAgC;IAAA,IAA/BC,cAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IACvC,IAAI,CAACC,UAAU,GAAGN,cAAc;EAClC;;EAEA;AACF;AACA;EACE,IAAIM,UAAUA,CAAA,EAAa;IACzB,OAAO,IAAI,CAACC,WAAW;EACzB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAACA,UAAoB,EAAE;IACnC,IAAI,CAACC,WAAW,GAAGD,UAAU;EAC/B;;EAEA;AACF;AACA;EACEE,GAAGA,CAACC,KAAuC,EAAqB;IAC9D,IAAIA,KAAK,YAAYX,cAAc,EAAE;MACnC,IAAI,CAACQ,UAAU,GAAG,CAAC,GAAG,IAAI,CAACA,UAAU,EAAE,GAAGG,KAA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U,EAAAY,IAAA,CAAAmB,SAAA,EAAYV,UAAU,EAAEC,OAAO,CAAC;EACxD;;EAEA;AACF;EACEW,OAAOA,CACLZ,UAA6D,EAC7DC,OAAa,EACb;IACA,IAAI,CAACtB,UAAU,CAACiC,OAAO,CAACZ,UAAU,EAAEC,OAAO,CAAC;EAC9C;;EAEA;AACF;EACEY,IAAIA,CAACC,SAAkC,EAAY;IAAA,IAAAC,SAAA;IACjD,OAAO,IAAAC,KAAA,CAAAtC,OAAA,EAAAqC,SAAA,OAAI,CAACpC,UAAU,EAAAY,IAAA,CAAAwB,SAAA,EAAMD,SAAS,CAAC;EACxC;;EAEA;AACF;AACA;EACE,IAAIG,MAAMA,CAAA,EAAa;IAAA,IAAAC,SAAA;IACrB,OAAO,IAAAF,KAAA,CAAAtC,OAAA,EAAAwC,SAAA,OAAI,CAACvC,UAAU,EAAAY,IAAA,CAAA2B,SAAM,CAAC;EAC/B;;EAEA;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"file":"BaseCollection.js","names":["_full","require","BaseCollection","constructor","initCollection","arguments","length","undefined","_defineProperty2","default","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","_context","_context2","_slice","call","hasItems","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","_context3","_find","filter","_context4","_filter","some","every","map","_context5","_map","forEach","sort","compareFn","_context6","_sort","sorted","_context7","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseCollection.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\n/**\n * Base class for collections of models\n */\nclass BaseCollection<T> {\n _collection: Array<T>;\n\n /**\n * Construct base collection\n */\n constructor(initCollection: Array<T> = []) {\n this.collection = initCollection;\n }\n\n /**\n * Retrieve current collection\n */\n get collection(): Array<T> {\n return this._collection;\n }\n\n /**\n * Replace current collection with a new collection\n */\n set collection(collection: Array<T>) {\n this._collection = collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | Array<T> | T): BaseCollection<T> {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n // $FlowExpectedError[incompatible-type]\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n\n return this;\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n get hasItems(): boolean {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n get isEmpty(): boolean {\n return !this.hasItems;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all(): Array<T> {\n return this.collection;\n }\n\n /**\n * Get the size of this collection\n */\n get size(): number {\n return this.length;\n }\n\n /**\n * Get the size of this collection\n */\n get length(): number {\n return this.collection.length;\n }\n\n /**\n * Return first link in collection\n */\n get first(): T | null {\n return this.collection[0] ?? null;\n }\n\n /**\n */\n get last(): T | null {\n return this.collection[this.collection.length - 1] ?? null;\n }\n\n /**\n */\n get(index: number): T | null {\n return this.collection[index] ?? null;\n }\n\n /**\n * Find item\n */\n find(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): T | null {\n return this.collection.find(callbackfn, thisArg) ?? null;\n }\n\n /**\n * Filter items\n */\n filter(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): Array<T> {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.some(callbackfn, thisArg);\n }\n\n /**\n */\n every(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ): boolean {\n return this.collection.every(callbackfn, thisArg);\n }\n\n /**\n */\n map<U>(\n callbackfn: (value: T, index: number, array: Array<T>) => U,\n thisArg?: T,\n ): Array<U> {\n return this.collection.map<U, ?T>(callbackfn, thisArg);\n }\n\n /**\n */\n forEach(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n /**\n */\n sort(compareFn?: (a: T, b: T) => number): Array<T> {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted(): Array<T> {\n return this.collection.sort();\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): this {\n return klona(this);\n }\n}\n\nexport default BaseCollection;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,cAAc,CAAI;EAGtB;AACF;AACA;EACEC,WAAWA,CAAA,EAAgC;IAAA,IAA/BC,cAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IACvC,IAAI,CAACC,UAAU,GAAGN,cAAc;EAClC;;EAEA;AACF;AACA;EACE,IAAIM,UAAUA,CAAA,EAAa;IACzB,OAAO,IAAI,CAACC,WAAW;EACzB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAACA,UAAoB,EAAE;IACnC,IAAI,CAACC,WAAW,GAAGD,UAAU;EAC/B;;EAEA;AACF;AACA;EACEE,GAAGA,CAACC,KAAuC,EAAqB;IAC9D,IAAIA,KAAK,YAAYX,cAAc,EAAE;MACnC,IAAI,CAACQ,UAAU,GAAG,CAAC,GAAG,IAAI,CAACA,UAAU,EAAE,GAAGG,KAAK,CAACC,GAAG,CAAC;IACtD,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;MAC/B;MACA,IAAI,CA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EAC7DC,OAAa,EACb;IACA,IAAI,CAACtB,UAAU,CAACiC,OAAO,CAACZ,UAAU,EAAEC,OAAO,CAAC;EAC9C;;EAEA;AACF;EACEY,IAAIA,CAACC,SAAkC,EAAY;IAAA,IAAAC,SAAA;IACjD,OAAO,IAAAC,KAAA,CAAAtC,OAAA,EAAAqC,SAAA,OAAI,CAACpC,UAAU,EAAAY,IAAA,CAAAwB,SAAA,EAAMD,SAAS,CAAC;EACxC;;EAEA;AACF;AACA;EACE,IAAIG,MAAMA,CAAA,EAAa;IAAA,IAAAC,SAAA;IACrB,OAAO,IAAAF,KAAA,CAAAtC,OAAA,EAAAwC,SAAA,OAAI,CAACvC,UAAU,EAAAY,IAAA,CAAA2B,SAAM,CAAC;EAC/B;;EAEA;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEcP,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseModel.js","names":["_full","require","_LayoutHintCollection","_interopRequireDefault","BaseModel","constructor","data","contributions","_defineProperty2","default","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","arguments","length","undefined","layouthint","hasData","_keys","connectKey","key","_connectKey","dehydrate","rehydrate","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseModel.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nexport type BaseDehydrateData = {\n +data: Object,\n +contributions: Object,\n connectKey: string,\n ...\n};\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nclass BaseModel {\n _data: Object;\n _contributions: Object;\n _layouthint: LayoutHintCollection;\n _connectKey: string;\n\n /**\n * constructor\n */\n constructor(data: Object, contributions: Object) {\n this._data = data;\n this._contributions = contributions;\n this._layouthint = new LayoutHintCollection(\n this.getContribution(\"layouthint\", []),\n );\n }\n\n /**\n * Retrieve data\n */\n get data(): Object {\n return this._data || {};\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n getData(propName: string, defaultValue: any = null): any {\n return this.data[propName] ?? defaultValue;\n }\n\n /**\n * Retrieve contributions\n */\n get contributions(): Object {\n return this._contributions || {};\n }\n\n /**\n * Retrieve property from the contributions of the model, mostly used internal\n */\n getContribution(propName: string, defaultValue: any = null): any {\n return this.contributions[propName] ?? defaultValue;\n }\n\n /**\n * Getting the layouthint\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n * Set the layouthint\n */\n set layouthint(layouthint: Array<string>) {\n this._layouthint = new LayoutHintCollection(layouthint);\n }\n\n /**\n * Indicates if the model has data\n */\n get hasData(): boolean {\n return Object.keys(this.data).length > 0;\n }\n\n /**\n * Set the unique key for this model\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n * Get the unique key of this model\n */\n get connectKey(): string {\n return this._connectKey;\n }\n\n /**\n * Dehydrate internal data, returns the information that is needed to recreate the model\n */\n dehydrate(): BaseDehydrateData {\n return {\n data: this._data,\n contributions: this._contributions,\n connectKey: this._connectKey,\n };\n }\n\n /**\n * Recreate the model with the given data\n */\n rehydrate(data: BaseDehydrateData) {\n this._connectKey = data.connectKey;\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): any {\n return klona(this);\n }\n}\n\nexport default BaseModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,CAAC;EAMd;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,g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AACH,IAAI,CAAC,CAACa,MAAM,GAAG,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAUA,CAACC,GAAW,EAAE;IAC1B,IAAI,CAACC,WAAW,GAAGD,GAAG;EACxB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACE,WAAW;EACzB;;EAEA;AACF;AACA;EACEC,SAASA,CAAA,EAAsB;IAC7B,OAAO;MACLrB,IAAI,EAAE,IAAI,CAACI,KAAK;MAChBH,aAAa,EAAE,IAAI,CAACI,cAAc;MAClCa,UAAU,EAAE,IAAI,CAACE;IACnB,CAAC;EACH;;EAEA;AACF;AACA;EACEE,SAASA,CAACtB,IAAuB,EAAE;IACjC,IAAI,CAACoB,WAAW,GAAGpB,IAAI,CAACkB,UAAU;EACpC;;EAEA;AACF;AACA;EACEK,KAAKA,CAAA,EAAQ;IACX,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"file":"BaseModel.js","names":["_full","require","_LayoutHintCollection","_interopRequireDefault","BaseModel","constructor","data","contributions","_defineProperty2","default","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","arguments","length","undefined","layouthint","hasData","_keys","connectKey","key","_connectKey","dehydrate","rehydrate","clone","klona","_default","exports"],"sources":["../../../src/models/base/BaseModel.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nexport type BaseDehydrateData = {\n +data: Object,\n +contributions: Object,\n connectKey: string,\n ...\n};\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nclass BaseModel {\n _data: Object;\n _contributions: Object;\n _layouthint: LayoutHintCollection;\n _connectKey: string;\n\n /**\n * constructor\n */\n constructor(data: Object, contributions: Object) {\n this._data = data;\n this._contributions = contributions;\n this._layouthint = new LayoutHintCollection(\n this.getContribution(\"layouthint\", []),\n );\n }\n\n /**\n * Retrieve data\n */\n get data(): Object {\n return this._data || {};\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n getData(propName: string, defaultValue: any = null): any {\n return this.data[propName] ?? defaultValue;\n }\n\n /**\n * Retrieve contributions\n */\n get contributions(): Object {\n return this._contributions || {};\n }\n\n /**\n * Retrieve property from the contributions of the model, mostly used internal\n */\n getContribution(propName: string, defaultValue: any = null): any {\n return this.contributions[propName] ?? defaultValue;\n }\n\n /**\n * Getting the layouthint\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n * Set the layouthint\n */\n set layouthint(layouthint: Array<string>) {\n this._layouthint = new LayoutHintCollection(layouthint);\n }\n\n /**\n * Indicates if the model has data\n */\n get hasData(): boolean {\n return Object.keys(this.data).length > 0;\n }\n\n /**\n * Set the unique key for this model\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n * Get the unique key of this model\n */\n get connectKey(): string {\n return this._connectKey;\n }\n\n /**\n * Dehydrate internal data, returns the information that is needed to recreate the model\n */\n dehydrate(): BaseDehydrateData {\n return {\n data: this._data,\n contributions: this._contributions,\n connectKey: this._connectKey,\n };\n }\n\n /**\n * Recreate the model with the given data\n */\n rehydrate(data: BaseDehydrateData) {\n this._connectKey = data.connectKey;\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): any {\n return klona(this);\n }\n}\n\nexport default BaseModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,CAAC;EAMd;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OA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,CAACa,MAAM,GAAG,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAUA,CAACC,GAAW,EAAE;IAC1B,IAAI,CAACC,WAAW,GAAGD,GAAG;EACxB;;EAEA;AACF;AACA;EACE,IAAID,UAAUA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACE,WAAW;EACzB;;EAEA;AACF;AACA;EACEC,SAASA,CAAA,EAAsB;IAC7B,OAAO;MACLrB,IAAI,EAAE,IAAI,CAACI,KAAK;MAChBH,aAAa,EAAE,IAAI,CAACI,cAAc;MAClCa,UAAU,EAAE,IAAI,CAACE;IACnB,CAAC;EACH;;EAEA;AACF;AACA;EACEE,SAASA,CAACtB,IAAuB,EAAE;IACjC,IAAI,CAACoB,WAAW,GAAGpB,IAAI,CAACkB,UAAU;EACpC;;EAEA;AACF;AACA;EACEK,KAAKA,CAAA,EAAQ;IACX,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcL,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","ResourceCollection","BaseCollection","getInitialChildModelLinks","initialChildModelLinks","collection","forEach","item","push","setChildModels","models","_default","exports","default"],"sources":["../../../src/models/base/ResourceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"./BaseCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * The ResourceCollection makes it possible to add child models to a collection of models\n * These child models are fetched using the ModularUI util\n */\nclass ResourceCollection<T: IModelWithChildModels> extends BaseCollection<T> {\n /**\n * Retrieve all child model links and flatten it into an array with single entries, removing all undefined items\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const initialChildModelLinks = [];\n\n this.collection.forEach((item: T) => {\n // $FlowFixMe[method-unbinding]\n if (typeof item?.getInitialChildModelLinks === \"function\") {\n initialChildModelLinks.push(...item.getInitialChildModelLinks());\n }\n });\n\n return initialChildModelLinks;\n }\n\n /**\n * Pass through models for setchildmodels to items of this collection\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.collection.forEach((item) => {\n // $FlowFixMe[prop-missing]\n if (typeof item[\"setChildModels\"] === \"function\") {\n item.setChildModels(models);\n }\n });\n }\n}\n\nexport default ResourceCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAAmCC,uBAAc,CAAI;EAC3E;AACF;AACA;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,sBAAsB,GAAG,EAAE;IAEjC,IAAI,CAACC,UAAU,CAACC,OAAO,CAAEC,IAAO,IAAK;MACnC;MACA,IAAI,OAAOA,IAAI,EAAEJ,yBAAyB,KAAK,UAAU,EAAE;QACzDC,sBAAsB,CAACI,IAAI,CAAC,GAAGD,IAAI,CAACJ,yBAAyB,CAAC,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;IAEF,OAAOC,sBAAsB;EAC/B;;EAEA;AACF;AACA;EACEK,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACL,UAAU,CAACC,OAAO,CAAEC,IAAI,IAAK;MAChC;MACA,IAAI,OAAOA,IAAI,CAAC,gBAAgB,CAAC,KAAK,UAAU,EAAE;QAChDA,IAAI,CAACE,cAAc,CAACC,MAAM,CAAC;MAC7B;IACF,CAAC,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"file":"ResourceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","ResourceCollection","BaseCollection","getInitialChildModelLinks","initialChildModelLinks","collection","forEach","item","push","setChildModels","models","_default","exports","default"],"sources":["../../../src/models/base/ResourceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"./BaseCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * The ResourceCollection makes it possible to add child models to a collection of models\n * These child models are fetched using the ModularUI util\n */\nclass ResourceCollection<T: IModelWithChildModels> extends BaseCollection<T> {\n /**\n * Retrieve all child model links and flatten it into an array with single entries, removing all undefined items\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const initialChildModelLinks = [];\n\n this.collection.forEach((item: T) => {\n // $FlowFixMe[method-unbinding]\n if (typeof item?.getInitialChildModelLinks === \"function\") {\n initialChildModelLinks.push(...item.getInitialChildModelLinks());\n }\n });\n\n return initialChildModelLinks;\n }\n\n /**\n * Pass through models for setchildmodels to items of this collection\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.collection.forEach((item) => {\n // $FlowFixMe[prop-missing]\n if (typeof item[\"setChildModels\"] === \"function\") {\n item.setChildModels(models);\n }\n });\n }\n}\n\nexport default ResourceCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAAmCC,uBAAc,CAAI;EAC3E;AACF;AACA;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,sBAAsB,GAAG,EAAE;IAEjC,IAAI,CAACC,UAAU,CAACC,OAAO,CAAEC,IAAO,IAAK;MACnC;MACA,IAAI,OAAOA,IAAI,EAAEJ,yBAAyB,KAAK,UAAU,EAAE;QACzDC,sBAAsB,CAACI,IAAI,CAAC,GAAGD,IAAI,CAACJ,yBAAyB,CAAC,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;IAEF,OAAOC,sBAAsB;EAC/B;;EAEA;AACF;AACA;EACEK,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACL,UAAU,CAACC,OAAO,CAAEC,IAAI,IAAK;MAChC;MACA,IAAI,OAAOA,IAAI,CAAC,gBAAgB,CAAC,KAAK,UAAU,EAAE;QAChDA,IAAI,CAACE,cAAc,CAACC,MAAM,CAAC;MAC7B;IACF,CAAC,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_BaseModel","_LinkCollection","_exceptions","ResourceModel","BaseModel","constructor","modularuiResponse","arguments","length","undefined","ModularUIResponse","data","contributions","_defineProperty2","default","_key","key","_locale","locale","_childModels","_lastServerUpdate","Date","now","modelName","IllegalStateException","isApplicableModel","IllegalArgumentException","Error","lastServerUpdate","type","resourcetype","getContribution","label","links","_links","LinkCollection","Array","isArray","self","selflink","getLinkByKey","selfhref","href","getInitialChildModelLinks","childModels","addChildModels","models","_context","flattenModels","_concat","call","setChildModels","dehydrate","_context2","_map","childModel","_default","exports"],"sources":["../../../src/models/base/ResourceModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport BaseModel from \"./BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport {\n IllegalArgumentException,\n IllegalStateException,\n} from \"../../exceptions\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\n\n/**\n * Base model, this the foundation for models that represent modular ui services, e.g. application, tab, caseview, etc\n */\nclass ResourceModel extends BaseModel implements IModelWithChildModels {\n _key: string;\n _locale: string;\n _childModels: Array<ModularUIModel>;\n _links: LinkCollection;\n _lastServerUpdate: number;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(modularuiResponse.data, modularuiResponse.contributions);\n\n this._key = modularuiResponse.key;\n this._locale = modularuiResponse.locale;\n\n this._childModels = [];\n\n this._lastServerUpdate = Date.now();\n }\n\n /**\n * Property to render name of a model, is original name after transpilation\n */\n static get modelName(): string {\n throw new IllegalStateException(`No modelName set on the resource model`);\n }\n\n /**\n * Returns true when the model is supported based on configuration found in contributions\n *\n * @abstract\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n if (!(data instanceof ModularUIResponse)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a ModularUIResponse\",\n );\n }\n\n throw new Error(\"No isApplicableModel condition set on resourcemodel\");\n }\n\n /**\n */\n get lastServerUpdate(): number {\n return this._lastServerUpdate;\n }\n\n /**\n */\n set lastServerUpdate(lastServerUpdate: number) {\n this._lastServerUpdate = lastServerUpdate;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get type of model\n *\n * @abstract\n */\n get type(): string {\n throw new IllegalStateException(\n `No type set on the resource model with key ${this.key}`,\n );\n }\n\n /**\n * Retrieve type of resource\n */\n get resourcetype(): string {\n return this.getContribution(\"resourcetype\", \"unknown\");\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n {\n self: {\n resourcetype: this.resourcetype,\n },\n ...this.contributions._links,\n },\n );\n }\n return this._links;\n }\n\n /**\n */\n set links(links: LinkCollection) {\n this._links = links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new IllegalStateException(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n * Add links to expand on initialization of this model\n *\n * @abstract\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return [];\n }\n\n /**\n * Retrieve links of expanded child models\n */\n get childModels(): Array<ModularUIModel> {\n return this._childModels;\n }\n\n /**\n * Add child models to this model\n */\n addChildModels(models: Array<ModularUIModel>): this {\n const flattenModels = [].concat(...models);\n\n this._childModels = flattenModels;\n\n this.setChildModels(flattenModels);\n\n return this;\n }\n\n /**\n * Template to set expanded child models\n * Use this hook to separate the retrieved child models into the correct models.\n *\n * @abstract\n * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>\n */\n setChildModels(models: Array<ModularUIModel>): void {\n if (!models) {\n throw new IllegalArgumentException(\"No models send to setChildModels\");\n }\n }\n\n /**\n */\n dehydrate(): Object {\n return {\n ...super.dehydrate(),\n key: this._key,\n locale: this._locale,\n // $FlowFixMe[missing-type-arg]\n childModels: this._childModels.map<ModularUIModel>(\n (childModel: ModularUIModel) => childModel.dehydrate(),\n ),\n };\n }\n}\n\nexport default ResourceModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AASA;AACA;AACA;AACA,MAAMI,aAAa,SAASC,kBAAS,CAAkC;EAOrE;AACF;AACA;EACEC,WAAWA,CAAA,EAAiE;IAAA,IAAhEC,iBAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAIG,0BAAiB,CAAC,CAAC;IACxE,KAAK,CAACJ,iBAAiB,CAACK,IAAI,EAAEL,iBAAiB,CAACM,aAAa,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAE/D,IAAI,CAACC,IAAI,GAAGT,iBAAiB,CAACU,GAAG;IACjC,IAAI,CAACC,OAAO,GAAGX,iBAAiB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AH,QAAA,EAAQ,GAAGD,MAAM,CAAC;IAE1C,IAAI,CAAC3B,YAAY,GAAG6B,aAAa;IAEjC,IAAI,CAACG,cAAc,CAACH,aAAa,CAAC;IAElC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,cAAcA,CAACL,MAA6B,EAAQ;IAClD,IAAI,CAACA,MAAM,EAAE;MACX,MAAM,IAAIpB,oCAAwB,CAAC,kCAAkC,CAAC;IACxE;EACF;;EAEA;AACF;EACE0B,SAASA,CAAA,EAAW;IAAA,IAAAC,SAAA;IAClB,OAAO;MACL,GAAG,KAAK,CAACD,SAAS,CAAC,CAAC;MACpBpC,GAAG,EAAE,IAAI,CAACD,IAAI;MACdG,MAAM,EAAE,IAAI,CAACD,OAAO;MACpB;MACA2B,WAAW,EAAE,IAAAU,IAAA,CAAAxC,OAAA,EAAAuC,SAAA,OAAI,CAAClC,YAAY,EAAA+B,IAAA,CAAAG,SAAA,EAC3BE,UAA0B,IAAKA,UAAU,CAACH,SAAS,CAAC,CACvD;IACF,CAAC;EACH;AACF;AAAC,IAAAI,QAAA,
|
|
1
|
+
{"version":3,"file":"ResourceModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_BaseModel","_LinkCollection","_exceptions","ResourceModel","BaseModel","constructor","modularuiResponse","arguments","length","undefined","ModularUIResponse","data","contributions","_defineProperty2","default","_key","key","_locale","locale","_childModels","_lastServerUpdate","Date","now","modelName","IllegalStateException","isApplicableModel","IllegalArgumentException","Error","lastServerUpdate","type","resourcetype","getContribution","label","links","_links","LinkCollection","Array","isArray","self","selflink","getLinkByKey","selfhref","href","getInitialChildModelLinks","childModels","addChildModels","models","_context","flattenModels","_concat","call","setChildModels","dehydrate","_context2","_map","childModel","_default","exports"],"sources":["../../../src/models/base/ResourceModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport BaseModel from \"./BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport {\n IllegalArgumentException,\n IllegalStateException,\n} from \"../../exceptions\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\n\n/**\n * Base model, this the foundation for models that represent modular ui services, e.g. application, tab, caseview, etc\n */\nclass ResourceModel extends BaseModel implements IModelWithChildModels {\n _key: string;\n _locale: string;\n _childModels: Array<ModularUIModel>;\n _links: LinkCollection;\n _lastServerUpdate: number;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(modularuiResponse.data, modularuiResponse.contributions);\n\n this._key = modularuiResponse.key;\n this._locale = modularuiResponse.locale;\n\n this._childModels = [];\n\n this._lastServerUpdate = Date.now();\n }\n\n /**\n * Property to render name of a model, is original name after transpilation\n */\n static get modelName(): string {\n throw new IllegalStateException(`No modelName set on the resource model`);\n }\n\n /**\n * Returns true when the model is supported based on configuration found in contributions\n *\n * @abstract\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n if (!(data instanceof ModularUIResponse)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a ModularUIResponse\",\n );\n }\n\n throw new Error(\"No isApplicableModel condition set on resourcemodel\");\n }\n\n /**\n */\n get lastServerUpdate(): number {\n return this._lastServerUpdate;\n }\n\n /**\n */\n set lastServerUpdate(lastServerUpdate: number) {\n this._lastServerUpdate = lastServerUpdate;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get type of model\n *\n * @abstract\n */\n get type(): string {\n throw new IllegalStateException(\n `No type set on the resource model with key ${this.key}`,\n );\n }\n\n /**\n * Retrieve type of resource\n */\n get resourcetype(): string {\n return this.getContribution(\"resourcetype\", \"unknown\");\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n {\n self: {\n resourcetype: this.resourcetype,\n },\n ...this.contributions._links,\n },\n );\n }\n return this._links;\n }\n\n /**\n */\n set links(links: LinkCollection) {\n this._links = links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new IllegalStateException(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n * Add links to expand on initialization of this model\n *\n * @abstract\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return [];\n }\n\n /**\n * Retrieve links of expanded child models\n */\n get childModels(): Array<ModularUIModel> {\n return this._childModels;\n }\n\n /**\n * Add child models to this model\n */\n addChildModels(models: Array<ModularUIModel>): this {\n const flattenModels = [].concat(...models);\n\n this._childModels = flattenModels;\n\n this.setChildModels(flattenModels);\n\n return this;\n }\n\n /**\n * Template to set expanded child models\n * Use this hook to separate the retrieved child models into the correct models.\n *\n * @abstract\n * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>\n */\n setChildModels(models: Array<ModularUIModel>): void {\n if (!models) {\n throw new IllegalArgumentException(\"No models send to setChildModels\");\n }\n }\n\n /**\n */\n dehydrate(): Object {\n return {\n ...super.dehydrate(),\n key: this._key,\n locale: this._locale,\n // $FlowFixMe[missing-type-arg]\n childModels: this._childModels.map<ModularUIModel>(\n (childModel: ModularUIModel) => childModel.dehydrate(),\n ),\n };\n }\n}\n\nexport default ResourceModel;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,O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AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcX,aAAa"}
|
|
@@ -111,6 +111,5 @@ class BusinessScenarioModel extends _ConceptDetailModel.default {
|
|
|
111
111
|
return actors;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
var _default = BusinessScenarioModel;
|
|
115
|
-
exports.default = _default;
|
|
114
|
+
var _default = exports.default = BusinessScenarioModel;
|
|
116
115
|
//# sourceMappingURL=BusinessScenarioModel.js.map
|
|
@@ -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,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOT,qBAAqB,CAACU,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EA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AACK,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);\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,Y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KAAK,CAAC;MAC3B;IACF;IAEA,IAAI,CAACG,aAAa,GAAGA,aAAa;EACpC;;EAEA;AACF;EACE,IAAIA,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,GAAAC,OAAA,CAAA5D,OAAA,GAEcL,qBAAqB"}
|
|
@@ -97,6 +97,5 @@ class ConceptTypeDetailModel extends _ResourceModel.default {
|
|
|
97
97
|
return this.getData("sectionReferenceTypes", []);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
var _default = ConceptTypeDetailModel;
|
|
101
|
-
exports.default = _default;
|
|
100
|
+
var _default = exports.default = ConceptTypeDetailModel;
|
|
102
101
|
//# 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,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,GAAAC,OAAA,CAAAC,OAAA,GAEctB,sBAAsB"}
|
|
@@ -62,6 +62,5 @@ class SourceReferenceModel {
|
|
|
62
62
|
return (0, _createHash.createHashFromHref)(this.selfhref);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
var _default = SourceReferenceModel;
|
|
66
|
-
exports.default = _default;
|
|
65
|
+
var _default = exports.default = SourceReferenceModel;
|
|
67
66
|
//# 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,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA,MAAMI,oBAAoB,CAAC;EAIzB;AACF;EACEC,WAAWA,CAACC,eAAuB,EAA+B;IAAA,IAA7BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAC9D,IAAI,CAACC,gBAAgB,GAAGP,eAAe;IACvC,IAAI,CAACQ,UAAU,GAAGP,SAAS;EAC7B;;EAEA;AACF;EACE,IAAIQ,IAAIA,CAAA,EAAqB;IAC3B,MAAMC,OAAO,GAAG,IAAI,CAACH,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,OAAO,CAC3D,GAAE,IAAI,CAACP,gBAAgB,CAACI,MAAM,CAACI,OAAO,CAACF,IAAK,GAAE,EAC/C,EACF,CAAC;IAED,OAAO,IAAIG,yBAAgB,CACzB;MACE,GAAG,IAAI,CAACT,gBAAgB;MACxBG;IACF,CAAC,EACD,IAAI,CAACF,UACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIS,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAIC,aAAI,CAAC,IAAI,CAACX,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,CAAC;EACzD;;EAEA;AACF;EACE,IAAIM,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACZ,gBAAgB,CAACY,IAAI;EACnC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACb,gBAAgB,CAACa,KAAK;EACpC;;EAEA;AACF;EACE,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACd,gBAAgB,CAACc,WAAW;EAC1C;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAAC,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,eAAuB,EAA+B;IAAA,IAA7BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAC9D,IAAI,CAACC,gBAAgB,GAAGP,eAAe;IACvC,IAAI,CAACQ,UAAU,GAAGP,SAAS;EAC7B;;EAEA;AACF;EACE,IAAIQ,IAAIA,CAAA,EAAqB;IAC3B,MAAMC,OAAO,GAAG,IAAI,CAACH,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,OAAO,CAC3D,GAAE,IAAI,CAACP,gBAAgB,CAACI,MAAM,CAACI,OAAO,CAACF,IAAK,GAAE,EAC/C,EACF,CAAC;IAED,OAAO,IAAIG,yBAAgB,CACzB;MACE,GAAG,IAAI,CAACT,gBAAgB;MACxBG;IACF,CAAC,EACD,IAAI,CAACF,UACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIS,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAIC,aAAI,CAAC,IAAI,CAACX,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,CAAC;EACzD;;EAEA;AACF;EACE,IAAIM,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACZ,gBAAgB,CAACY,IAAI;EACnC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACb,gBAAgB,CAACa,KAAK;EACpC;;EAEA;AACF;EACE,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACd,gBAAgB,CAACc,WAAW;EAC1C;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAAC,8BAAkB,EAAC,IAAI,CAACN,QAAQ,CAAC;EAC1C;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAEcR,oBAAoB"}
|
|
@@ -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;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,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AGN,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,QAAQ;EAC3B;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAc;IACxB,IAAI,CAAC,IAAI,CAACC,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAG,IAAIC,kBAAS,CAAC,IAAI,CAACR,IAAI,CAACS,MAAM,EAAEC,IAAI,CAAC;IACxD;IACA,OAAO,IAAI,CAACH,SAAS;EACvB;;EAEA;AACF;EACE,IAAII,QA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igurationElements;
|
|
143
|
-
exports.default = _default;
|
|
142
|
+
var _default = exports.default = ContentConfigurationElements;
|
|
144
143
|
//# 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,s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AM,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,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,CA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J,4BAA4B"}
|
|
@@ -45,6 +45,5 @@ class ContentConfigurationEndResults {
|
|
|
45
45
|
}) || null;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
var _default = ContentConfigurationEndResults;
|
|
49
|
-
exports.default = _default;
|
|
48
|
+
var _default = exports.default = ContentConfigurationEndResults;
|
|
50
49
|
//# 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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