@beinformed/ui 1.31.0 → 1.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js +8 -2
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +8 -0
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/modularui/CaptchaRequest.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/UploadRequest.js.map +1 -1
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/client.js +1 -0
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/I18nActions.js.map +1 -1
- package/esm/redux/_i18n/I18nReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/RouterActions.js.map +1 -1
- package/esm/redux/_router/RouterConnectors.js.map +1 -1
- package/esm/redux/_router/RouterReducer.js.map +1 -1
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/__tests__/mergeLayoutHintConfigurations.spec.js.flow +4 -4
- package/lib/builder/mergeLayoutHintConfigurations.js.flow +3 -3
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/LayoutHints.js.flow +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js.flow +2 -2
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/FetchException.js.flow +2 -2
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/NetworkException.js.flow +1 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js.flow +1 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +9 -9
- package/lib/hooks/__tests__/useAuthentication.spec.js.flow +2 -2
- package/lib/hooks/__tests__/useForm.spec.js.flow +2 -2
- package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +7 -7
- package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +2 -2
- package/lib/hooks/__tests__/usePreference.spec.js.flow +1 -1
- package/lib/hooks/useAllFormsOnModel.js.flow +2 -2
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js.flow +2 -2
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js.flow +1 -1
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js.flow +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js.flow +4 -4
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js.flow +3 -3
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js.flow +2 -2
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.flow +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModularUI.js.flow +1 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js.flow +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.flow +1 -1
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js.flow +1 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js.flow +2 -2
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +8 -2
- package/lib/hooks/usePreference.js.flow +17 -7
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/i18n/Locale.js.flow +4 -4
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js.flow +8 -8
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js.flow +2 -2
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/__tests__/Locale.spec.js.flow +3 -3
- package/lib/i18n/__tests__/Locales.spec.js.flow +15 -13
- package/lib/i18n/withMessage.js.flow +4 -4
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/actions/ActionCollection.js.flow +4 -4
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js.flow +4 -4
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/actions/__tests__/ActionCollection.spec.js.flow +3 -3
- package/lib/models/actions/__tests__/ActionModel.spec.js.flow +1 -1
- package/lib/models/application/ApplicationModel.js.flow +3 -3
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.flow +7 -7
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js.flow +9 -9
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.flow +9 -9
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.flow +24 -24
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js.flow +1 -1
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js.flow +4 -4
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +7 -7
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +15 -15
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +8 -0
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +19 -11
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +10 -10
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.flow +7 -7
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +6 -6
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js.flow +9 -9
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js.flow +8 -8
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js.flow +3 -3
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js.flow +5 -5
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeCollection.spec.js.flow +11 -11
- package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +7 -7
- package/lib/models/attributes/__tests__/AttributeModel.spec.js.flow +5 -5
- package/lib/models/attributes/__tests__/AttributeSetModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/BooleanAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/ChoiceAttributeModel.spec.js.flow +8 -8
- package/lib/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js.flow +8 -8
- package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/DateAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/DatetimeAttributeModel.spec.js.flow +11 -11
- package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +3 -3
- package/lib/models/attributes/__tests__/MemoAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/MoneyAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/NumberAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/PasswordAttributeModel.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/StringAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/TimeAttributeModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/TimestampModel.spec.js.flow +2 -2
- package/lib/models/attributes/__tests__/UploadAttributeModel.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/_createAttribute.spec.js.flow +6 -6
- package/lib/models/attributes/__tests__/createAttributeComposite.spec.js.flow +3 -3
- package/lib/models/attributes/__tests__/createAttributeDynamicSchema.spec.js.flow +3 -3
- package/lib/models/attributes/_createAttribute.js.flow +5 -5
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.flow +5 -5
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.flow +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.flow +6 -6
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.flow +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.flow +6 -6
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.flow +2 -2
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.flow +2 -2
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js.flow +1 -1
- package/lib/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js.flow +6 -6
- package/lib/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js.flow +5 -5
- package/lib/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js.flow +6 -6
- package/lib/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js.flow +3 -3
- package/lib/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js.flow +2 -2
- package/lib/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js.flow +1 -1
- package/lib/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js.flow +4 -4
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +4 -4
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +15 -15
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.flow +2 -2
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.flow +2 -2
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js.flow +22 -22
- package/lib/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js.flow +4 -4
- package/lib/models/base/BaseCollection.js.flow +6 -6
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js.flow +1 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js.flow +5 -5
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/base/__tests__/ResourceCollection.spec.js.flow +1 -1
- package/lib/models/caseview/CaseViewModel.js.flow +4 -4
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +3 -3
- package/lib/models/concepts/BusinessScenarioModel.js.flow +9 -9
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.flow +17 -17
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.flow +2 -2
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js.flow +6 -4
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js.flow +5 -5
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js.flow +2 -2
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js.flow +2 -2
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +1 -1
- package/lib/models/content/ContentIndexModel.js.flow +3 -3
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js.flow +11 -9
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js.flow +2 -2
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.flow +4 -4
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/SectionModel.js.flow +4 -4
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js.flow +2 -2
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/content/__tests__/ContentModel.spec.js.flow +16 -16
- package/lib/models/contentconfiguration/ContentConfiguration.js.flow +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.flow +5 -5
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.flow +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.flow +2 -2
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +12 -12
- package/lib/models/detail/DetailModel.js.flow +5 -5
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js.flow +4 -4
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js.flow +1 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/__tests__/ErrorModel.spec.js.flow +1 -1
- package/lib/models/filters/AssignmentFilterModel.js.flow +3 -3
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js.flow +3 -3
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.flow +5 -5
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/__tests__/AssignmentFilterModel.spec.js.flow +4 -4
- package/lib/models/filters/__tests__/FilterCollection.spec.js.flow +11 -11
- package/lib/models/filters/__tests__/FilterModel.spec.js.flow +1 -1
- package/lib/models/filters/__tests__/RangeFilterModel.spec.js.flow +1 -1
- package/lib/models/form/FormModel.js.flow +39 -39
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js.flow +16 -16
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/form/__tests__/FormModel.instrument.spec.js.flow +7 -7
- package/lib/models/form/__tests__/FormModel.repeating.spec.js.flow +2 -2
- package/lib/models/form/__tests__/FormModel.selfhref.spec.js.flow +1 -1
- package/lib/models/form/__tests__/FormModel.spec.js.flow +6 -6
- package/lib/models/form/__tests__/FormResultData.spec.js.flow +1 -1
- package/lib/models/form/__tests__/FormWithContent.spec.js.flow +3 -3
- package/lib/models/grouping/GroupingModel.js.flow +7 -7
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/grouping/__tests__/GroupingModel.spec.js.flow +2 -2
- package/lib/models/href/Href.js.flow +6 -6
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/__tests__/Href.spec.js.flow +18 -16
- package/lib/models/layouthint/LayoutHintCollection.js.flow +3 -3
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js.flow +4 -4
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js.flow +3 -3
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/__tests__/LinkModel.spec.js.flow +4 -4
- package/lib/models/links/normalizeLinkJSON.js.flow +6 -6
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js.flow +7 -7
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js.flow +2 -2
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js.flow +2 -2
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js.flow +6 -6
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +4 -4
- package/lib/models/list/__tests__/ListItemCollection.spec.js.flow +1 -1
- package/lib/models/list/__tests__/ListModel.spec.js.flow +3 -3
- package/lib/models/list/__tests__/ListResultDetail.spec.js.flow +3 -3
- package/lib/models/lookup/LookupOptionCollection.js.flow +1 -1
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js.flow +4 -4
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/lookup/__tests__/LookupOptionsModel.spec.js.flow +3 -3
- package/lib/models/modelcatalog/ModelCatalogModel.js.flow +2 -2
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js.flow +1 -1
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/paging/__tests__/PagingModel.spec.js.flow +2 -2
- package/lib/models/panels/GroupingPanelModel.js.flow +5 -5
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +8 -8
- package/lib/models/parameter/__tests__/Parameter.spec.js.flow +5 -5
- package/lib/models/process/ProcessStatusSettingsModel.js.flow +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/process/__tests__/ProcessStatusSettingsModel.spec.js.flow +1 -1
- package/lib/models/resolveModel.js.flow +4 -4
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js.flow +4 -4
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/sorting/__tests__/SortingModel.spec.js.flow +3 -3
- package/lib/models/tab/TabModel.js.flow +3 -3
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/tab/__tests__/TabModel.spec.js.flow +5 -5
- package/lib/models/taskgroup/TaskGroupModel.js.flow +2 -2
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserProfileModel.js.flow +1 -1
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/__tests__/UserModel.spec.js.flow +2 -2
- package/lib/models/user/__tests__/UserProfileModel.spec.js.flow +2 -2
- package/lib/models/user/__tests__/UserServicesModel.spec.js.flow +1 -1
- package/lib/modularui/CaptchaRequest.js.flow +1 -1
- package/lib/modularui/CaptchaRequest.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.flow +26 -26
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/UploadRequest.js.flow +6 -6
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/modularui/__tests__/ModularUIError.spec.js.flow +1 -1
- package/lib/modularui/__tests__/ModularUIRequest.spec.js.flow +9 -9
- package/lib/react/utils.js.flow +1 -1
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/client.js +1 -0
- package/lib/react-client/client.js.flow +11 -10
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js.flow +2 -2
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/rehydrate.js.flow +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/__tests__/serverUtil.spec.js.flow +2 -2
- package/lib/react-server/createSSRComplete.js.flow +3 -3
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js.flow +4 -4
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js.flow +1 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js.flow +2 -2
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverUtil.js.flow +8 -8
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/__tests__/createTheme.spec.js.flow +4 -4
- package/lib/react-theme/createTheme.js.flow +1 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/utils/__tests__/background.spec.js.flow +2 -2
- package/lib/react-theme/utils/__tests__/contrast.spec.js.flow +1 -1
- package/lib/react-theme/utils/__tests__/corners.spec.js.flow +3 -3
- package/lib/react-theme/utils/__tests__/spacers.spec.js.flow +1 -1
- package/lib/react-theme/utils/__tests__/themeProps.spec.js.flow +9 -9
- package/lib/react-theme/utils/colors.js.flow +3 -3
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js.flow +6 -6
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js.flow +2 -2
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js.flow +2 -2
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js.flow +8 -8
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/I18nActions.js.flow +1 -1
- package/lib/redux/_i18n/I18nActions.js.map +1 -1
- package/lib/redux/_i18n/I18nReducer.js.flow +2 -2
- package/lib/redux/_i18n/I18nReducer.js.map +1 -1
- package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +2 -2
- package/lib/redux/_modularui/ModularUIActions.js.flow +8 -8
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js.flow +4 -4
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js.flow +6 -6
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js.flow +5 -5
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js.flow +11 -11
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js.flow +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_modularui/__tests__/reducer.spec.js.flow +13 -13
- package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +3 -3
- package/lib/redux/_modularui/types.js.flow +4 -4
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.flow +3 -3
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/RouterActions.js.flow +3 -3
- package/lib/redux/_router/RouterActions.js.map +1 -1
- package/lib/redux/_router/RouterConnectors.js.flow +5 -5
- package/lib/redux/_router/RouterConnectors.js.map +1 -1
- package/lib/redux/_router/RouterReducer.js.flow +1 -1
- package/lib/redux/_router/RouterReducer.js.map +1 -1
- package/lib/redux/_router/__tests__/reducer.spec.js.flow +2 -2
- package/lib/redux/actions/Application.js.flow +1 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js.flow +1 -1
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js.flow +3 -3
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js.flow +2 -2
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +3 -3
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js.flow +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js.flow +3 -3
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Notification.js.flow +4 -4
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js.flow +11 -11
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js.flow +1 -1
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js.flow +3 -3
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/__tests__/Authorization.spec.js.flow +2 -2
- package/lib/redux/actions/__tests__/Error-server.spec.js.flow +13 -13
- package/lib/redux/actions/__tests__/Error.spec.js.flow +6 -6
- package/lib/redux/actions/__tests__/Notification.spec.js.flow +1 -1
- package/lib/redux/actions/__tests__/Preferences.spec.js.flow +2 -2
- package/lib/redux/connectors/Application.js.flow +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js.flow +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js.flow +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.flow +2 -2
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js.flow +5 -5
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.flow +6 -6
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js.flow +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js.flow +1 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js.flow +1 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js.flow +2 -2
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.flow +3 -3
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js.flow +1 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.flow +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js.flow +2 -2
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js.flow +1 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js.flow +1 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js.flow +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js.flow +1 -1
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js.flow +1 -1
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.flow +1 -1
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js.flow +1 -1
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js.flow +1 -1
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.flow +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/__tests__/AuthReducer.spec.js.flow +10 -10
- package/lib/redux/reducers/__tests__/ErrorReducer.spec.js.flow +1 -1
- package/lib/redux/reducers/__tests__/ModalsReducer.spec.js.flow +3 -3
- package/lib/redux/reducers/__tests__/NotificationReducer.spec.js.flow +3 -3
- package/lib/redux/reducers/__tests__/PreferencesReducer.spec.js.flow +2 -2
- package/lib/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js.flow +8 -8
- package/lib/redux/store/beforeRenderHooks.js.flow +1 -1
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js.flow +3 -3
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cookies.js.flow +1 -1
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/browser/__tests__/Cookies.spec.js.flow +1 -1
- package/lib/utils/datetime/DateTimeUtil.js.flow +15 -15
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/datetime/__tests__/DateTime.spec.js.flow +84 -81
- package/lib/utils/fetch/__tests__/xhr.spec.js.flow +2 -2
- package/lib/utils/fetch/universalFetch.js.flow +1 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.flow +6 -6
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/__tests__/sanitizeHTML.spec.js.flow +8 -8
- package/lib/utils/helpers/sanitizeHtml.js.flow +3 -3
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js.flow +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js.flow +2 -2
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/__tests__/formatValue.spec.js.flow +1 -1
- package/lib/utils/number/formatValue.js.flow +2 -2
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.flow +7 -7
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +20 -20
- package/src/builder/__tests__/mergeLayoutHintConfigurations.spec.js +4 -4
- package/src/builder/mergeLayoutHintConfigurations.js +3 -3
- package/src/constants/LayoutHints.js +1 -1
- package/src/constants/Settings.js +2 -2
- package/src/exceptions/FetchException.js +2 -2
- package/src/exceptions/NetworkException.js +1 -1
- package/src/exceptions/UnauthorizedException.js +1 -1
- package/src/hooks/__tests__/UseModularUIModel.spec.js +9 -9
- package/src/hooks/__tests__/useAuthentication.spec.js +2 -2
- package/src/hooks/__tests__/useForm.spec.js +2 -2
- package/src/hooks/__tests__/useModelCatalog.spec.js +7 -7
- package/src/hooks/__tests__/useModularUIBasic.spec.js +2 -2
- package/src/hooks/__tests__/usePreference.spec.js +1 -1
- package/src/hooks/useAllFormsOnModel.js +2 -2
- package/src/hooks/useAuthentication.js +2 -2
- package/src/hooks/useContent.js +1 -1
- package/src/hooks/useDeepCompareEffect.js +1 -1
- package/src/hooks/useForm.js +4 -4
- package/src/hooks/useI18n.js +3 -3
- package/src/hooks/useModal.js +2 -2
- package/src/hooks/useModelCatalog.js +1 -1
- package/src/hooks/useModularUI.js +1 -1
- package/src/hooks/useModularUIBasic.js +1 -1
- package/src/hooks/useModularUIModel.js +1 -1
- package/src/hooks/useModularUIRequest.js +1 -1
- package/src/hooks/useNotification.js +2 -2
- package/src/hooks/usePreference.js +17 -7
- package/src/i18n/Locale.js +4 -4
- package/src/i18n/Locales.js +8 -8
- package/src/i18n/Message.js +2 -2
- package/src/i18n/__tests__/Locale.spec.js +3 -3
- package/src/i18n/__tests__/Locales.spec.js +15 -13
- package/src/i18n/withMessage.js +4 -4
- package/src/models/actions/ActionCollection.js +4 -4
- package/src/models/actions/ActionModel.js +4 -4
- package/src/models/actions/__tests__/ActionCollection.spec.js +3 -3
- package/src/models/actions/__tests__/ActionModel.spec.js +1 -1
- package/src/models/application/ApplicationModel.js +3 -3
- package/src/models/attributes/AttributeCollection.js +7 -7
- package/src/models/attributes/AttributeContent.js +9 -9
- package/src/models/attributes/AttributeDataHelper.js +9 -9
- package/src/models/attributes/AttributeModel.js +24 -24
- package/src/models/attributes/AttributeSetModel.js +1 -1
- package/src/models/attributes/BooleanAttributeModel.js +4 -4
- package/src/models/attributes/ChoiceAttributeModel.js +7 -7
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +15 -15
- package/src/models/attributes/ChoiceAttributeOptionModel.js +19 -11
- package/src/models/attributes/CompositeAttributeChildCollection.js +10 -10
- package/src/models/attributes/CompositeAttributeModel.js +7 -7
- package/src/models/attributes/DatetimeAttributeModel.js +6 -6
- package/src/models/attributes/NumberAttributeModel.js +9 -9
- package/src/models/attributes/PasswordAttributeModel.js +8 -8
- package/src/models/attributes/StringAttributeModel.js +3 -3
- package/src/models/attributes/UploadAttributeModel.js +5 -5
- package/src/models/attributes/__tests__/AttributeCollection.spec.js +11 -11
- package/src/models/attributes/__tests__/AttributeContent.spec.js +7 -7
- package/src/models/attributes/__tests__/AttributeModel.spec.js +5 -5
- package/src/models/attributes/__tests__/AttributeSetModel.spec.js +2 -2
- package/src/models/attributes/__tests__/BooleanAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/ChoiceAttributeModel.spec.js +8 -8
- package/src/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js +8 -8
- package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
- package/src/models/attributes/__tests__/DateAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/DatetimeAttributeModel.spec.js +11 -11
- package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +3 -3
- package/src/models/attributes/__tests__/MemoAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/MoneyAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/NumberAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/PasswordAttributeModel.spec.js +1 -1
- package/src/models/attributes/__tests__/StringAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/TimeAttributeModel.spec.js +2 -2
- package/src/models/attributes/__tests__/TimestampModel.spec.js +2 -2
- package/src/models/attributes/__tests__/UploadAttributeModel.spec.js +4 -4
- package/src/models/attributes/__tests__/_createAttribute.spec.js +6 -6
- package/src/models/attributes/__tests__/createAttributeComposite.spec.js +3 -3
- package/src/models/attributes/__tests__/createAttributeDynamicSchema.spec.js +3 -3
- package/src/models/attributes/_createAttribute.js +5 -5
- package/src/models/attributes/input-constraints/ConstraintCollection.js +5 -5
- package/src/models/attributes/input-constraints/ConstraintModel.js +1 -1
- package/src/models/attributes/input-constraints/DateBoundaryConstraint.js +6 -6
- package/src/models/attributes/input-constraints/MandatoryConstraint.js +1 -1
- package/src/models/attributes/input-constraints/NumberBoundaryConstraint.js +6 -6
- package/src/models/attributes/input-constraints/NumberFormatConstraint.js +2 -2
- package/src/models/attributes/input-constraints/NumberGroupingConstraint.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js +1 -1
- package/src/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js +6 -6
- package/src/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js +5 -5
- package/src/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js +6 -6
- package/src/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js +3 -3
- package/src/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js +2 -2
- package/src/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js +1 -1
- package/src/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js +4 -4
- package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +4 -4
- package/src/models/attributes/layouthint-rules/DependentAttribute.js +15 -15
- package/src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +2 -2
- package/src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +2 -2
- package/src/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js +22 -22
- package/src/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js +1 -1
- package/src/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js +4 -4
- package/src/models/base/BaseCollection.js +6 -6
- package/src/models/base/BaseModel.js +1 -1
- package/src/models/base/ResourceModel.js +5 -5
- package/src/models/base/__tests__/ResourceCollection.spec.js +1 -1
- package/src/models/caseview/CaseViewModel.js +4 -4
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +3 -3
- package/src/models/concepts/BusinessScenarioModel.js +9 -9
- package/src/models/concepts/ConceptDetailModel.js +17 -17
- package/src/models/concepts/ConceptIndexModel.js +2 -2
- package/src/models/concepts/ConceptLinkModel.js +6 -4
- package/src/models/concepts/ConceptRelationCollection.js +5 -5
- package/src/models/concepts/SourceReferenceCollection.js +2 -2
- package/src/models/concepts/SourceReferenceModel.js +2 -2
- package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +1 -1
- package/src/models/content/ContentIndexModel.js +3 -3
- package/src/models/content/ContentLinkModel.js +11 -9
- package/src/models/content/ContentModel.js +2 -2
- package/src/models/content/ContentTOCModel.js +4 -4
- package/src/models/content/SectionModel.js +4 -4
- package/src/models/content/SubSectionModel.js +2 -2
- package/src/models/content/__tests__/ContentModel.spec.js +16 -16
- package/src/models/contentconfiguration/ContentConfiguration.js +1 -1
- package/src/models/contentconfiguration/ContentConfigurationElements.js +5 -5
- package/src/models/contentconfiguration/ContentConfigurationEndResults.js +1 -1
- package/src/models/contentconfiguration/ContentConfigurationQuestions.js +2 -2
- package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +12 -12
- package/src/models/detail/DetailModel.js +5 -5
- package/src/models/error/ErrorCollection.js +4 -4
- package/src/models/error/ErrorModel.js +1 -1
- package/src/models/error/__tests__/ErrorModel.spec.js +1 -1
- package/src/models/filters/AssignmentFilterModel.js +3 -3
- package/src/models/filters/BaseFilterModel.js +3 -3
- package/src/models/filters/FilterCollection.js +5 -5
- package/src/models/filters/__tests__/AssignmentFilterModel.spec.js +4 -4
- package/src/models/filters/__tests__/FilterCollection.spec.js +11 -11
- package/src/models/filters/__tests__/FilterModel.spec.js +1 -1
- package/src/models/filters/__tests__/RangeFilterModel.spec.js +1 -1
- package/src/models/form/FormModel.js +39 -39
- package/src/models/form/FormObjectModel.js +16 -16
- package/src/models/form/__tests__/FormModel.instrument.spec.js +7 -7
- package/src/models/form/__tests__/FormModel.repeating.spec.js +2 -2
- package/src/models/form/__tests__/FormModel.selfhref.spec.js +1 -1
- package/src/models/form/__tests__/FormModel.spec.js +6 -6
- package/src/models/form/__tests__/FormResultData.spec.js +1 -1
- package/src/models/form/__tests__/FormWithContent.spec.js +3 -3
- package/src/models/grouping/GroupingModel.js +7 -7
- package/src/models/grouping/__tests__/GroupingModel.spec.js +2 -2
- package/src/models/href/Href.js +6 -6
- package/src/models/href/__tests__/Href.spec.js +18 -16
- package/src/models/layouthint/LayoutHintCollection.js +3 -3
- package/src/models/links/LinkCollection.js +4 -4
- package/src/models/links/LinkModel.js +3 -3
- package/src/models/links/__tests__/LinkModel.spec.js +4 -4
- package/src/models/links/normalizeLinkJSON.js +6 -6
- package/src/models/list/ListDetailModel.js +7 -7
- package/src/models/list/ListItemCollection.js +2 -2
- package/src/models/list/ListItemModel.js +2 -2
- package/src/models/list/ListModel.js +6 -6
- package/src/models/list/__tests__/ListDetailModel.spec.js +4 -4
- package/src/models/list/__tests__/ListItemCollection.spec.js +1 -1
- package/src/models/list/__tests__/ListModel.spec.js +3 -3
- package/src/models/list/__tests__/ListResultDetail.spec.js +3 -3
- package/src/models/lookup/LookupOptionCollection.js +1 -1
- package/src/models/lookup/LookupOptionsModel.js +4 -4
- package/src/models/lookup/__tests__/LookupOptionsModel.spec.js +3 -3
- package/src/models/modelcatalog/ModelCatalogModel.js +2 -2
- package/src/models/paging/PagingModel.js +1 -1
- package/src/models/paging/__tests__/PagingModel.spec.js +2 -2
- package/src/models/panels/GroupingPanelModel.js +5 -5
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +8 -8
- package/src/models/parameter/__tests__/Parameter.spec.js +5 -5
- package/src/models/process/ProcessStatusSettingsModel.js +1 -1
- package/src/models/process/__tests__/ProcessStatusSettingsModel.spec.js +1 -1
- package/src/models/resolveModel.js +4 -4
- package/src/models/sorting/SortingModel.js +4 -4
- package/src/models/sorting/__tests__/SortingModel.spec.js +3 -3
- package/src/models/tab/TabModel.js +3 -3
- package/src/models/tab/__tests__/TabModel.spec.js +5 -5
- package/src/models/taskgroup/TaskGroupModel.js +2 -2
- package/src/models/types.js +1 -1
- package/src/models/user/UserProfileModel.js +1 -1
- package/src/models/user/__tests__/UserModel.spec.js +2 -2
- package/src/models/user/__tests__/UserProfileModel.spec.js +2 -2
- package/src/models/user/__tests__/UserServicesModel.spec.js +1 -1
- package/src/modularui/CaptchaRequest.js +1 -1
- package/src/modularui/ModularUIRequest.js +26 -26
- package/src/modularui/UploadRequest.js +6 -6
- package/src/modularui/__tests__/ModularUIError.spec.js +1 -1
- package/src/modularui/__tests__/ModularUIRequest.spec.js +9 -9
- package/src/react/utils.js +1 -1
- package/src/react-client/client.js +11 -10
- package/src/react-client/contextPath.js +2 -2
- package/src/react-client/rehydrate.js +1 -1
- package/src/react-server/__tests__/serverUtil.spec.js +2 -2
- package/src/react-server/createSSRComplete.js +3 -3
- package/src/react-server/renderSSRComplete.js +4 -4
- package/src/react-server/renderSSRMinimal.js +1 -1
- package/src/react-server/requestInformation.js +2 -2
- package/src/react-server/serverUtil.js +8 -8
- package/src/react-theme/__tests__/createTheme.spec.js +4 -4
- package/src/react-theme/createTheme.js +1 -1
- package/src/react-theme/utils/__tests__/background.spec.js +2 -2
- package/src/react-theme/utils/__tests__/contrast.spec.js +1 -1
- package/src/react-theme/utils/__tests__/corners.spec.js +3 -3
- package/src/react-theme/utils/__tests__/spacers.spec.js +1 -1
- package/src/react-theme/utils/__tests__/themeProps.spec.js +9 -9
- package/src/react-theme/utils/colors.js +3 -3
- package/src/react-theme/utils/contrast.js +6 -6
- package/src/react-theme/utils/corners.js +2 -2
- package/src/react-theme/utils/spacers.js +2 -2
- package/src/react-theme/utils/themeProps.js +8 -8
- package/src/redux/_i18n/I18nActions.js +1 -1
- package/src/redux/_i18n/I18nReducer.js +2 -2
- package/src/redux/_i18n/__tests__/reducer.spec.js +2 -2
- package/src/redux/_modularui/ModularUIActions.js +8 -8
- package/src/redux/_modularui/ModularUIConnector.js +4 -4
- package/src/redux/_modularui/ModularUIMiddleware.js +6 -6
- package/src/redux/_modularui/ModularUIReducer.js +5 -5
- package/src/redux/_modularui/ModularUISelectors.js +11 -11
- package/src/redux/_modularui/ModularUIUtils.js +1 -1
- package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
- package/src/redux/_modularui/__tests__/reducer.spec.js +13 -13
- package/src/redux/_modularui/__tests__/selectors.spec.js +3 -3
- package/src/redux/_modularui/types.js +4 -4
- package/src/redux/_modularui/withModularUI.js +3 -3
- package/src/redux/_router/RouterActions.js +3 -3
- package/src/redux/_router/RouterConnectors.js +5 -5
- package/src/redux/_router/RouterReducer.js +1 -1
- package/src/redux/_router/__tests__/reducer.spec.js +2 -2
- package/src/redux/actions/Application.js +1 -1
- package/src/redux/actions/Authorization.js +1 -1
- package/src/redux/actions/Error.js +3 -3
- package/src/redux/actions/FormAttributeSet.js +2 -2
- package/src/redux/actions/FormAttributeSetRepeatable.js +3 -3
- package/src/redux/actions/FormAutosave.js +1 -1
- package/src/redux/actions/FormAutosubmit.js +1 -1
- package/src/redux/actions/FormValidations.js +3 -3
- package/src/redux/actions/Notification.js +4 -4
- package/src/redux/actions/Preferences.js +11 -11
- package/src/redux/actions/ProgressIndicator.js +1 -1
- package/src/redux/actions/SignIn.js +3 -3
- package/src/redux/actions/__tests__/Authorization.spec.js +2 -2
- package/src/redux/actions/__tests__/Error-server.spec.js +13 -13
- package/src/redux/actions/__tests__/Error.spec.js +6 -6
- package/src/redux/actions/__tests__/Notification.spec.js +1 -1
- package/src/redux/actions/__tests__/Preferences.spec.js +2 -2
- package/src/redux/connectors/Application.js +1 -1
- package/src/redux/connectors/Breadcrumb.js +1 -1
- package/src/redux/connectors/CaseView.js +1 -1
- package/src/redux/connectors/ConceptDetail.js +1 -1
- package/src/redux/connectors/ContentBrowser.js +1 -1
- package/src/redux/connectors/ContentDetail.js +1 -1
- package/src/redux/connectors/ContentDetailSection.js +2 -2
- package/src/redux/connectors/Form.js +5 -5
- package/src/redux/connectors/FormAttributeSet.js +6 -6
- package/src/redux/connectors/ListDetail.js +1 -1
- package/src/redux/connectors/Modal.js +1 -1
- package/src/redux/connectors/ModelCatalog.js +1 -1
- package/src/redux/connectors/Notification.js +1 -1
- package/src/redux/connectors/PanelRenderer.js +2 -2
- package/src/redux/connectors/Preferences.js +3 -3
- package/src/redux/connectors/Progress.js +1 -1
- package/src/redux/connectors/ProgressIndicator.js +1 -1
- package/src/redux/connectors/QuickSearch.js +2 -2
- package/src/redux/connectors/SignIn.js +1 -1
- package/src/redux/connectors/SignOut.js +1 -1
- package/src/redux/connectors/Tab.js +1 -1
- package/src/redux/reducers/AuthReducer.js +1 -1
- package/src/redux/reducers/ErrorReducer.js +1 -1
- package/src/redux/reducers/ModalsReducer.js +1 -1
- package/src/redux/reducers/NotificationReducer.js +1 -1
- package/src/redux/reducers/PreferencesReducer.js +1 -1
- package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
- package/src/redux/reducers/__tests__/AuthReducer.spec.js +10 -10
- package/src/redux/reducers/__tests__/ErrorReducer.spec.js +1 -1
- package/src/redux/reducers/__tests__/ModalsReducer.spec.js +3 -3
- package/src/redux/reducers/__tests__/NotificationReducer.spec.js +3 -3
- package/src/redux/reducers/__tests__/PreferencesReducer.spec.js +2 -2
- package/src/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js +8 -8
- package/src/redux/store/beforeRenderHooks.js +1 -1
- package/src/redux/store/configureStore.js +3 -3
- package/src/utils/browser/Cookies.js +1 -1
- package/src/utils/browser/__tests__/Cookies.spec.js +1 -1
- package/src/utils/datetime/DateTimeUtil.js +15 -15
- package/src/utils/datetime/__tests__/DateTime.spec.js +84 -81
- package/src/utils/fetch/__tests__/xhr.spec.js +2 -2
- package/src/utils/fetch/universalFetch.js +1 -1
- package/src/utils/fetch/xhr.js +6 -6
- package/src/utils/helpers/__tests__/sanitizeHTML.spec.js +8 -8
- package/src/utils/helpers/sanitizeHtml.js +3 -3
- package/src/utils/helpers/text.js +1 -1
- package/src/utils/number/DecimalFormat.js +2 -2
- package/src/utils/number/__tests__/formatValue.spec.js +1 -1
- package/src/utils/number/formatValue.js +2 -2
- package/src/utils/number/parseNumbers.js +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","layouthint","TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA;AACe,MAAMM,WAAW,SAASC,sBAAa,CAAC;EAKrD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACX,IAAAG,SAAA,CAAAZ,OAAA,EAAAS,YAAY,EAAAI,IAAA,CAAZJ,YAAY,EAAU,aAAa,CAAC,IACnC,IAAAK,SAAA,CAAAd,OAAA,EAAAQ,QAAA,IAAC,QAAQ,EAAE,qB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AiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAAC1C,IAAI,CAAC2C,OAAO,EACjB,IAAI,CAACxC,aAAa,CAACwC,OACrB,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACH,iBAAiB;EAC/B;;EAEA;AACF;EACE,IAAIG,gBAAgBA,CAACA,gBAAkC,EAAE;IACvD,IAAI,CAACH,iBAAiB,GAAGG,gBAAgB;EAC3C;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAY;IACpB,OAAO,IAAI,CAAC1C,aAAa,CAACC,YAAY,KAAK,UAAU;EACvD;;EAEA;AACF;AACA;EACE,IAAI0C,cAAcA,CAAA,EAAmB;IACnC,OAAO,IAAI,CAACrC,oBAAoB,CAACsC,wBAAwB,CAAChB,kBAAK,CAAC;EAClE;;EAEA;AACF;AACA;EACEiB,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAY7D,WAAW,EAAE;MAChC,MAAM8D,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAAC1B,mBAAmB,GAAGyB,KAAK,CAACxC,oBAAoB;MAC5DyC,WAAW,CAACX,kBAAkB,GAAGU,KAAK,CAACT,mBAAmB;MAC1DU,WAAW,CAACN,gBAAgB,GAAGK,KAAK,CAACR,iBAAiB;MAEtD,OAAOS,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAA7D,OAAA,GAAAL,WAAA"}
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","layouthint","TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden,\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA;AACe,MAAMM,WAAW,SAASC,sBAAa,CAAC;EAKrD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;I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,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAA7D,OAAA,GAAAL,WAAA"}
|
|
@@ -45,7 +45,7 @@ export default class ErrorCollection extends BaseCollection<ErrorModel> {
|
|
|
45
45
|
id: string,
|
|
46
46
|
defaultMessage?: string,
|
|
47
47
|
parameters?: MessageParameters,
|
|
48
|
-
layouthint?: LayoutHintCollection
|
|
48
|
+
layouthint?: LayoutHintCollection,
|
|
49
49
|
) {
|
|
50
50
|
const itemIdx = this.findById(id);
|
|
51
51
|
|
|
@@ -70,7 +70,7 @@ export default class ErrorCollection extends BaseCollection<ErrorModel> {
|
|
|
70
70
|
id: string,
|
|
71
71
|
defaultMessage?: string,
|
|
72
72
|
parameters?: MessageParameters,
|
|
73
|
-
layouthint?: LayoutHintCollection
|
|
73
|
+
layouthint?: LayoutHintCollection,
|
|
74
74
|
) {
|
|
75
75
|
if (parameters) {
|
|
76
76
|
this.addError(id, defaultMessage, parameters, layouthint);
|
|
@@ -111,8 +111,8 @@ export default class ErrorCollection extends BaseCollection<ErrorModel> {
|
|
|
111
111
|
constraint.id,
|
|
112
112
|
constraint.defaultMessage,
|
|
113
113
|
constraint.parameters,
|
|
114
|
-
true
|
|
115
|
-
)
|
|
114
|
+
true,
|
|
115
|
+
),
|
|
116
116
|
),
|
|
117
117
|
];
|
|
118
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ErrorModel","_LayoutHintCollection","ErrorCollection","BaseCollection","constructor","type","errorCollection","_defineProperty2","default","_type","collection","serverErrors","_context","_filter","call","error","isClientConstraint","findById","id","_context2","_findIndex","item","addError","defaultMessage","parameters","layouthint","itemIdx","removeByIndex","add","ErrorModel","removeError","addServerError","undefined","removeServerError","removeServerErrors","forEach","addErrors","errors","addConstraints","constraints","_map","constraint","hasMandatoryError","some","isMandatoryConstraint","exports"],"sources":["../../../src/models/error/ErrorCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ErrorModel from \"./ErrorModel\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type { IConstraintModel } from \"../types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Form Objects\n */\nexport default class ErrorCollection extends BaseCollection<ErrorModel> {\n _type: string;\n\n /**\n * constructor\n */\n constructor(type: string, errorCollection?: ErrorCollection) {\n super();\n\n this._type = type;\n this.collection = [];\n\n if (errorCollection) {\n this.collection = [...errorCollection.collection];\n }\n }\n\n /**\n */\n get serverErrors(): Array<ErrorModel> {\n return this.collection.filter((error) => !error.isClientConstraint);\n }\n\n /**\n */\n findById(id: string): number {\n return this.collection.findIndex((item) => item.id === id);\n }\n\n /**\n * Add an error to the collection\n */\n addError(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n layouthint?: LayoutHintCollection
|
|
1
|
+
{"version":3,"file":"ErrorCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ErrorModel","_LayoutHintCollection","ErrorCollection","BaseCollection","constructor","type","errorCollection","_defineProperty2","default","_type","collection","serverErrors","_context","_filter","call","error","isClientConstraint","findById","id","_context2","_findIndex","item","addError","defaultMessage","parameters","layouthint","itemIdx","removeByIndex","add","ErrorModel","removeError","addServerError","undefined","removeServerError","removeServerErrors","forEach","addErrors","errors","addConstraints","constraints","_map","constraint","hasMandatoryError","some","isMandatoryConstraint","exports"],"sources":["../../../src/models/error/ErrorCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ErrorModel from \"./ErrorModel\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type { IConstraintModel } from \"../types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Form Objects\n */\nexport default class ErrorCollection extends BaseCollection<ErrorModel> {\n _type: string;\n\n /**\n * constructor\n */\n constructor(type: string, errorCollection?: ErrorCollection) {\n super();\n\n this._type = type;\n this.collection = [];\n\n if (errorCollection) {\n this.collection = [...errorCollection.collection];\n }\n }\n\n /**\n */\n get serverErrors(): Array<ErrorModel> {\n return this.collection.filter((error) => !error.isClientConstraint);\n }\n\n /**\n */\n findById(id: string): number {\n return this.collection.findIndex((item) => item.id === id);\n }\n\n /**\n * Add an error to the collection\n */\n addError(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n layouthint?: LayoutHintCollection,\n ) {\n const itemIdx = this.findById(id);\n\n if (itemIdx > -1) {\n this.removeByIndex(itemIdx);\n }\n\n this.add(new ErrorModel(id, defaultMessage, parameters, false, layouthint));\n }\n\n /**\n */\n removeError(id: string) {\n const itemIdx = this.findById(id);\n this.removeByIndex(itemIdx);\n }\n\n /**\n * Add a server error to the collection\n */\n addServerError(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n layouthint?: LayoutHintCollection,\n ) {\n if (parameters) {\n this.addError(id, defaultMessage, parameters, layouthint);\n } else {\n this.addError(id, defaultMessage, undefined, layouthint);\n }\n }\n\n /**\n */\n removeServerError(id: string) {\n this.removeError(id);\n }\n\n /**\n */\n removeServerErrors() {\n this.serverErrors.forEach((error) => {\n this.removeError(error.id);\n });\n }\n\n /**\n */\n addErrors(errors: Array<ErrorModel>) {\n this.collection = [...this.collection, ...errors];\n }\n\n /**\n * Add constraints to error collection\n */\n addConstraints(constraints: Array<IConstraintModel>) {\n this.collection = [\n ...this.collection,\n ...constraints.map(\n (constraint) =>\n new ErrorModel(\n constraint.id,\n constraint.defaultMessage,\n constraint.parameters,\n true,\n ),\n ),\n ];\n }\n\n /**\n * Indicates if a mandatory constraint is available and if it is in error.\n * Rationale: When a mandatory constraint is in error other constraint probably don't mather because there is no value to check\n */\n hasMandatoryError(): boolean {\n return this.collection.some((error) => error.isMandatoryConstraint);\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,eAAA,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BkB,UAAU,CAACjB,UAAU,EACrB,IACF,CACJ,CAAC,CACF;EACH;;EAEA;AACF;AACA;AACA;EACEkB,iBAAiBA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAAChC,UAAU,CAACiC,IAAI,CAAE5B,KAAK,IAAKA,KAAK,CAAC6B,qBAAqB,CAAC;EACrE;AACF;AAACC,OAAA,CAAArC,OAAA,GAAAN,eAAA"}
|
|
@@ -20,7 +20,7 @@ class ErrorModel {
|
|
|
20
20
|
defaultMessage: ?string,
|
|
21
21
|
parameters: ?MessageParameters,
|
|
22
22
|
isClientConstraint: boolean = false,
|
|
23
|
-
layouthint: LayoutHintCollection = new LayoutHintCollection()
|
|
23
|
+
layouthint: LayoutHintCollection = new LayoutHintCollection(),
|
|
24
24
|
) {
|
|
25
25
|
this._id = id;
|
|
26
26
|
this._parameters = parameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorModel.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ErrorModel","constructor","id","defaultMessage","parameters","isClientConstraint","arguments","length","undefined","layouthint","LayoutHintCollection","_defineProperty2","default","_id","_parameters","_defaultMessage","_isClientConstraint","_layouthint","Array","isArray","isMandatoryConstraint","getMessage","_default","exports"],"sources":["../../../src/models/error/ErrorModel.js"],"sourcesContent":["// @flow\nimport type { MessageObject, MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Wrapper around an error message / object\n */\nclass ErrorModel {\n _id: string;\n _defaultMessage: ?string;\n _parameters: ?MessageParameters;\n _isClientConstraint: boolean;\n _layouthint: LayoutHintCollection;\n\n /**\n * Contruct\n */\n constructor(\n id: string,\n defaultMessage: ?string,\n parameters: ?MessageParameters,\n isClientConstraint: boolean = false,\n layouthint: LayoutHintCollection = new LayoutHintCollection()
|
|
1
|
+
{"version":3,"file":"ErrorModel.js","names":["_LayoutHintCollection","_interopRequireDefault","require","ErrorModel","constructor","id","defaultMessage","parameters","isClientConstraint","arguments","length","undefined","layouthint","LayoutHintCollection","_defineProperty2","default","_id","_parameters","_defaultMessage","_isClientConstraint","_layouthint","Array","isArray","isMandatoryConstraint","getMessage","_default","exports"],"sources":["../../../src/models/error/ErrorModel.js"],"sourcesContent":["// @flow\nimport type { MessageObject, MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n * Wrapper around an error message / object\n */\nclass ErrorModel {\n _id: string;\n _defaultMessage: ?string;\n _parameters: ?MessageParameters;\n _isClientConstraint: boolean;\n _layouthint: LayoutHintCollection;\n\n /**\n * Contruct\n */\n constructor(\n id: string,\n defaultMessage: ?string,\n parameters: ?MessageParameters,\n isClientConstraint: boolean = false,\n layouthint: LayoutHintCollection = new LayoutHintCollection(),\n ) {\n this._id = id;\n this._parameters = parameters;\n this._defaultMessage = defaultMessage;\n this._isClientConstraint = isClientConstraint;\n this._layouthint = Array.isArray(layouthint)\n ? new LayoutHintCollection(layouthint)\n : layouthint;\n }\n\n /**\n * Get id of error\n */\n get id(): string {\n return this._id;\n }\n\n /**\n */\n get defaultMessage(): ?string {\n return this._defaultMessage;\n }\n\n /**\n */\n get parameters(): ?MessageParameters {\n return this._parameters;\n }\n\n /**\n */\n get isClientConstraint(): boolean {\n return this._isClientConstraint || false;\n }\n\n /**\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n */\n get isMandatoryConstraint(): boolean {\n return this.id === \"Constraint.Mandatory\";\n }\n\n /**\n * Returns a message object from the error\n */\n getMessage(): MessageObject {\n return {\n id: this.id,\n defaultMessage: this.defaultMessage ?? \"\",\n parameters: this.parameters ?? {},\n };\n }\n}\n\nexport default ErrorModel;\n"],"mappings":";;;;;;;;AAEA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,UAAU,CAAC;EAOf;AACF;AACA;EACEC,WAAWA,CACTC,EAAU,EACVC,cAAuB,EACvB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mB,UAAUA,CAAA,EAAkB;IAC1B,OAAO;MACLnB,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,cAAc,EAAE,IAAI,CAACA,cAAc,IAAI,EAAE;MACzCC,UAAU,EAAE,IAAI,CAACA,UAAU,IAAI,CAAC;IAClC,CAAC;EACH;AACF;AAAC,IAAAkB,QAAA,GAEctB,UAAU;AAAAuB,OAAA,CAAAX,OAAA,GAAAU,QAAA"}
|
|
@@ -55,7 +55,7 @@ export default class AssignmentFilterModel extends BaseFilterModel {
|
|
|
55
55
|
|
|
56
56
|
if (typeof assignmentTypeData === "undefined") {
|
|
57
57
|
throw new IllegalStateException(
|
|
58
|
-
`Missing assignment type data for ${key}
|
|
58
|
+
`Missing assignment type data for ${key}`,
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -75,7 +75,7 @@ export default class AssignmentFilterModel extends BaseFilterModel {
|
|
|
75
75
|
"choice",
|
|
76
76
|
assignmentTypeData.name || assignmentTypeData.param,
|
|
77
77
|
assignmentTypeData,
|
|
78
|
-
assignmentTypeContributions
|
|
78
|
+
assignmentTypeContributions,
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -101,7 +101,7 @@ export default class AssignmentFilterModel extends BaseFilterModel {
|
|
|
101
101
|
"choice",
|
|
102
102
|
userData.name || userData.param,
|
|
103
103
|
userData,
|
|
104
|
-
userContributions
|
|
104
|
+
userContributions,
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignmentFilterModel.js","names":["_BaseFilterModel","_interopRequireDefault","require","_exceptions","AssignmentFilterModel","BaseFilterModel","constructor","data","contributions","_defineProperty2","default","_assignmenttype","createAssignmentTypeModel","_user","createUserModel","key","name","listkey","_listKey","contextid","getContribution","assignmentTypeData","IllegalStateException","dynamicschema","assignmentTypeContributions","enumerated","optionMode","_links","createAttribute","param","userData","userContributions","assignmenttype","user","params","value","reset","update","attribute","isActive","initvalue","isValid","exports"],"sources":["../../../src/models/filters/AssignmentFilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\n\nimport type { AttributeType } from \"../types\";\nimport { IllegalStateException } from \"../../exceptions\";\n/**\n * Assignment filter consists of two filters: assignment type and user filter\n */\nexport default class AssignmentFilterModel extends BaseFilterModel {\n _listKey: string;\n _assignmenttype: ?AttributeType;\n _user: ?AttributeType;\n\n /**\n * Construct an assignment filter\n */\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._assignmenttype = this.createAssignmentTypeModel();\n this._user = this.createUserModel();\n }\n\n /**\n */\n get key(): ?string {\n return this.data.name;\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey(): string {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key: string) {\n this._listKey = key;\n }\n\n /**\n */\n get contextid(): string {\n return this.getContribution(\"contextid\", \"\");\n }\n /**\n * Creates an assignmenttype model when assignmenttype json is present\n */\n createAssignmentTypeModel(): ?AttributeType {\n const key = `${this.contextid}ASSIGNMENTTYPE`;\n const assignmentTypeData = this.data[key];\n\n if (typeof assignmentTypeData === \"undefined\") {\n throw new IllegalStateException(\n `Missing assignment type data for ${key}
|
|
1
|
+
{"version":3,"file":"AssignmentFilterModel.js","names":["_BaseFilterModel","_interopRequireDefault","require","_exceptions","AssignmentFilterModel","BaseFilterModel","constructor","data","contributions","_defineProperty2","default","_assignmenttype","createAssignmentTypeModel","_user","createUserModel","key","name","listkey","_listKey","contextid","getContribution","assignmentTypeData","IllegalStateException","dynamicschema","assignmentTypeContributions","enumerated","optionMode","_links","createAttribute","param","userData","userContributions","assignmenttype","user","params","value","reset","update","attribute","isActive","initvalue","isValid","exports"],"sources":["../../../src/models/filters/AssignmentFilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\n\nimport type { AttributeType } from \"../types\";\nimport { IllegalStateException } from \"../../exceptions\";\n/**\n * Assignment filter consists of two filters: assignment type and user filter\n */\nexport default class AssignmentFilterModel extends BaseFilterModel {\n _listKey: string;\n _assignmenttype: ?AttributeType;\n _user: ?AttributeType;\n\n /**\n * Construct an assignment filter\n */\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._assignmenttype = this.createAssignmentTypeModel();\n this._user = this.createUserModel();\n }\n\n /**\n */\n get key(): ?string {\n return this.data.name;\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey(): string {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key: string) {\n this._listKey = key;\n }\n\n /**\n */\n get contextid(): string {\n return this.getContribution(\"contextid\", \"\");\n }\n /**\n * Creates an assignmenttype model when assignmenttype json is present\n */\n createAssignmentTypeModel(): ?AttributeType {\n const key = `${this.contextid}ASSIGNMENTTYPE`;\n const assignmentTypeData = this.data[key];\n\n if (typeof assignmentTypeData === \"undefined\") {\n throw new IllegalStateException(\n `Missing assignment type data for ${key}`,\n );\n }\n\n if (this.data.dynamicschema && this.data.dynamicschema[key]) {\n assignmentTypeData.dynamicschema = {\n [key]: this.data.dynamicschema[key],\n };\n }\n\n const assignmentTypeContributions = {\n ...this.contributions[key],\n enumerated: true,\n optionMode: assignmentTypeData._links ? \"lookup\" : \"static\",\n };\n\n return this.createAttribute(\n \"choice\",\n assignmentTypeData.name || assignmentTypeData.param,\n assignmentTypeData,\n assignmentTypeContributions,\n );\n }\n\n /**\n * Creates an assignmenttype model when userkey json is present\n */\n createUserModel(): ?AttributeType {\n const key = `${this.contextid}USERKEY`;\n const userData = this.data[key];\n\n if (this.data.dynamicschema && this.data.dynamicschema[key]) {\n userData.dynamicschema = {\n [key]: this.data.dynamicschema[key],\n };\n }\n\n const userContributions = {\n ...this.contributions[key],\n optionMode: userData._links ? \"lookup\" : \"static\",\n };\n\n return this.createAttribute(\n \"choice\",\n userData.name || userData.param,\n userData,\n userContributions,\n );\n }\n\n /**\n * The assignment filter consists of two part. This method return the assignment type attribute\n */\n get assignmenttype(): ?AttributeType {\n return this._assignmenttype;\n }\n\n /**\n * The assignment filter consists of two part. This method return the user identifier attribute\n */\n get user(): ?AttributeType {\n return this._user;\n }\n\n /**\n * Getting the parameters of this filter\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (this.assignmenttype && this.user) {\n return [\n {\n name: this.assignmenttype.name,\n value: this.assignmenttype.value,\n },\n {\n name: this.user.name,\n value: this.user.value,\n },\n ];\n }\n\n return [];\n }\n\n /**\n * Reset the values within the filter\n */\n reset(): AssignmentFilterModel {\n if (this.assignmenttype) {\n this.assignmenttype.reset();\n }\n if (this.user) {\n this.user.reset();\n }\n\n return this;\n }\n\n /**\n * Update this filter\n */\n update(attribute: AttributeType, value: string) {\n if (this.user != null && this.user.key === attribute.key) {\n this.user.update(value);\n } else if (\n this.assignmenttype != null &&\n this.assignmenttype.key === attribute.key\n ) {\n this.assignmenttype.update(value);\n }\n }\n\n /**\n * Inidiates if filter is active\n */\n isActive(): boolean {\n return (\n (this.assignmenttype != null && this.assignmenttype.initvalue !== null) ||\n (this.user != null && this.user.initvalue !== null)\n );\n }\n\n /**\n * Inidiates if filter is valid\n */\n get isValid(): boolean {\n return (\n this.assignmenttype != null &&\n this.assignmenttype.isValid &&\n this.user != null &&\n this.user.isValid\n );\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AACA;AACA;AACA;AACe,MAAME,qBAAqB,SAASC,wBAAe,CAAC;EAKjE;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAC/C,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAE3B,IAAI,CAACC,eAAe,GAAG,IAAI,CAACC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default class BaseFilterModel extends BaseModel {
|
|
|
23
23
|
this.type,
|
|
24
24
|
this.param,
|
|
25
25
|
this.data,
|
|
26
|
-
this.contributions
|
|
26
|
+
this.contributions,
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
if (this.contributions.listKey) {
|
|
@@ -47,7 +47,7 @@ export default class BaseFilterModel extends BaseModel {
|
|
|
47
47
|
type: string,
|
|
48
48
|
param: string,
|
|
49
49
|
data: Object,
|
|
50
|
-
contributions: Object
|
|
50
|
+
contributions: Object,
|
|
51
51
|
): AttributeType | null {
|
|
52
52
|
if (type === "assignment") {
|
|
53
53
|
return null;
|
|
@@ -125,7 +125,7 @@ export default class BaseFilterModel extends BaseModel {
|
|
|
125
125
|
get attribute(): AttributeType {
|
|
126
126
|
if (!this._attribute) {
|
|
127
127
|
throw new IllegalStateException(
|
|
128
|
-
`Missing filter attribute on filter model: ${this.label}
|
|
128
|
+
`Missing filter attribute on filter model: ${this.label}`,
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
return this._attribute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseFilterModel.js","names":["_BaseModel","_interopRequireDefault","require","_createAttribute","_Constants","_exceptions","BaseFilterModel","BaseModel","constructor","data","contributions","_defineProperty2","default","_attribute","createAttribute","type","param","listKey","listkey","replace","context","_context","contextLabel","label","_listKey","key","getContribution","name","PARAMETER_SEPARATOR","attribute","IllegalStateException","params","value","reset","update","isQuickSearch","quicksearch","isActive","initvalue","isValid","readonlyvalue","exports"],"sources":["../../../src/models/filters/BaseFilterModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport createAttribute from \"../attributes/_createAttribute\";\nimport { PARAMETER_SEPARATOR } from \"../../constants/Constants\";\n\nimport type { AttributeType, FilterType } from \"../types\";\nimport { IllegalStateException } from \"../../exceptions\";\n\n/**\n * Base class for filters\n */\nexport default class BaseFilterModel extends BaseModel {\n _attribute: AttributeType | null = null;\n _context: Object;\n _listKey: string;\n\n /**\n */\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._attribute = this.createAttribute(\n this.type,\n this.param,\n this.data,\n this.contributions
|
|
1
|
+
{"version":3,"file":"BaseFilterModel.js","names":["_BaseModel","_interopRequireDefault","require","_createAttribute","_Constants","_exceptions","BaseFilterModel","BaseModel","constructor","data","contributions","_defineProperty2","default","_attribute","createAttribute","type","param","listKey","listkey","replace","context","_context","contextLabel","label","_listKey","key","getContribution","name","PARAMETER_SEPARATOR","attribute","IllegalStateException","params","value","reset","update","isQuickSearch","quicksearch","isActive","initvalue","isValid","readonlyvalue","exports"],"sources":["../../../src/models/filters/BaseFilterModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport createAttribute from \"../attributes/_createAttribute\";\nimport { PARAMETER_SEPARATOR } from \"../../constants/Constants\";\n\nimport type { AttributeType, FilterType } from \"../types\";\nimport { IllegalStateException } from \"../../exceptions\";\n\n/**\n * Base class for filters\n */\nexport default class BaseFilterModel extends BaseModel {\n _attribute: AttributeType | null = null;\n _context: Object;\n _listKey: string;\n\n /**\n */\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._attribute = this.createAttribute(\n this.type,\n this.param,\n this.data,\n this.contributions,\n );\n\n if (this.contributions.listKey) {\n this.listkey = this.contributions.listKey;\n }\n }\n\n /**\n * Get the type of a filter.\n */\n get type(): string {\n return this.contributions.type\n ? this.contributions.type.replace(\"filter\", \"\")\n : \"string\";\n }\n\n /**\n * Create attribute through the attribute factory. Create type based on filter key without the filter suffix\n */\n createAttribute(\n type: string,\n param: string,\n data: Object,\n contributions: Object,\n ): AttributeType | null {\n if (type === \"assignment\") {\n return null;\n }\n\n return createAttribute(param, data, {\n ...contributions,\n type: type,\n });\n }\n\n /**\n * Getting context data\n */\n get context(): Object {\n return this._context;\n }\n\n /**\n * Set context of filter\n */\n set context(context: Object) {\n this._context = context;\n }\n\n /**\n * Getting the context label\n */\n get contextLabel(): string {\n return this.context?.label ?? \"\";\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey(): string {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key: string) {\n this._listKey = key;\n }\n\n /**\n * Getting the label of the filter\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the name of the filter\n */\n get name(): string {\n if (this.listkey) {\n return this.listkey + PARAMETER_SEPARATOR + this.param;\n }\n\n return this.param;\n }\n\n /**\n * Getting the param name of the filter\n */\n get param(): string {\n return this.data.param ?? this.data.name;\n }\n\n /**\n * Get attribute of filter\n */\n get attribute(): AttributeType {\n if (!this._attribute) {\n throw new IllegalStateException(\n `Missing filter attribute on filter model: ${this.label}`,\n );\n }\n return this._attribute;\n }\n\n /**\n * Retrieve the parameters with it's value for this filter\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.attribute?.value,\n },\n ];\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n reset(): FilterType {\n if (this.attribute) {\n this.attribute.reset();\n }\n\n return this;\n }\n\n /**\n * Update this filter with input name and value\n */\n update(attribute: AttributeType, value: string) {\n if (this.attribute) {\n this.attribute.update(value);\n }\n }\n\n /**\n * Inidicates if filter is a quick search filter\n */\n isQuickSearch(): boolean {\n return this.contributions.quicksearch === true;\n }\n\n /**\n * Inidiates if filter is active\n */\n isActive(): boolean {\n return this.attribute !== null && this.attribute.initvalue !== null;\n }\n\n /**\n * Inidiates if filter is valid\n */\n get isValid(): boolean {\n return this.attribute !== null && this.attribute.isValid;\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (this.attribute) {\n return this.attribute.readonlyvalue;\n }\n return \"\";\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGA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;MAClB,IAAI,CAACA,SAAS,CAACI,KAAK,CAAC,CAAC;IACxB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEC,MAAMA,CAACL,SAAwB,EAAEG,KAAa,EAAE;IAC9C,IAAI,IAAI,CAACH,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAACK,MAAM,CAACF,KAAK,CAAC;IAC9B;EACF;;EAEA;AACF;AACA;EACEG,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACzB,aAAa,CAAC0B,WAAW,KAAK,IAAI;EAChD;;EAEA;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACR,SAAS,KAAK,IAAI,IAAI,IAAI,CAACA,SAAS,CAACS,SAAS,KAAK,IAAI;EACrE;;EAEA;AACF;AACA;EACE,IAAIC,OAAOA,CAAA,EAAY;IACrB,OAAO,IAAI,CAACV,SAAS,KAAK,IAAI,IAAI,IAAI,CAACA,SAAS,CAACU,OAAO;EAC1D;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,IAAI,IAAI,CAACX,SAAS,EAAE;MAClB,OAAO,IAAI,CAACA,SAAS,CAACW,aAAa;IACrC;IACA,OAAO,EAAE;EACX;AACF;AAACC,OAAA,CAAA7B,OAAA,GAAAN,eAAA"}
|
|
@@ -33,7 +33,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
|
|
|
33
33
|
...filterData,
|
|
34
34
|
dynamicschema: contributions.dynamicschema,
|
|
35
35
|
},
|
|
36
|
-
filterContributionByKey
|
|
36
|
+
filterContributionByKey,
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
if (contributions.listkey) {
|
|
@@ -42,7 +42,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
|
|
|
42
42
|
|
|
43
43
|
if (contributions.contexts && filterContributionByKey.contextid) {
|
|
44
44
|
const filterContext = contributions.contexts.find(
|
|
45
|
-
(context) => context.id === filterContributionByKey.contextid
|
|
45
|
+
(context) => context.id === filterContributionByKey.contextid,
|
|
46
46
|
);
|
|
47
47
|
if (filterContext) {
|
|
48
48
|
filter.context = filterContext;
|
|
@@ -59,7 +59,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
|
|
|
59
59
|
createFilter(
|
|
60
60
|
filterKey: string,
|
|
61
61
|
data: Object,
|
|
62
|
-
contributions: Object
|
|
62
|
+
contributions: Object,
|
|
63
63
|
): FilterType {
|
|
64
64
|
const type = contributions.type || "stringfilter";
|
|
65
65
|
if (type === "choicefilter" && filterKey === "index") {
|
|
@@ -93,7 +93,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
|
|
|
93
93
|
*/
|
|
94
94
|
checkRangeFilterByAttributeKey(
|
|
95
95
|
filter: RangeFilterModel,
|
|
96
|
-
key: string
|
|
96
|
+
key: string,
|
|
97
97
|
): boolean {
|
|
98
98
|
const rangeAttribute = filter.attribute;
|
|
99
99
|
|
|
@@ -113,7 +113,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
|
|
|
113
113
|
*/
|
|
114
114
|
checkAssignmentFilterByAttributeKey(
|
|
115
115
|
filter: AssignmentFilterModel,
|
|
116
|
-
key: string
|
|
116
|
+
key: string,
|
|
117
117
|
): boolean {
|
|
118
118
|
return (
|
|
119
119
|
filter.key === key ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_RangeFilterModel","_AssignmentFilterModel","_FilterModel","_ConceptIndexFilterModel","_CompositeAttributeModel","FilterCollection","BaseCollection","constructor","data","arguments","length","undefined","contributions","Array","isArray","_filter","default","_context","_context2","collection","_map","call","filterContribution","_keys","filterKey","filterData","filterContributionByKey","filter","createFilter","dynamicschema","listkey","contexts","contextid","_context3","filterContext","_find","context","id","type","ConceptIndexFilterModel","_includes","RangeFilterModel","AssignmentFilterModel","FilterModel","reset","_context4","checkRangeFilterByAttributeKey","key","rangeAttribute","attribute","CompositeAttributeModel","start","end","checkAssignmentFilterByAttributeKey","user","assignmenttype","getFilterByAttributeKey","_context5","update","value","_context6","filterToUpdate","parentKey","Error","newFilter","clone","name","isValid","every","hasActiveFilters","some","isActive","exports"],"sources":["../../../src/models/filters/FilterCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\n\nimport RangeFilterModel from \"../filters/RangeFilterModel\";\nimport AssignmentFilterModel from \"../filters/AssignmentFilterModel\";\nimport FilterModel from \"../filters/FilterModel\";\nimport ConceptIndexFilterModel from \"../filters/ConceptIndexFilterModel\";\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\n\nimport type { AttributeType, FilterType } from \"../types\";\n\n/**\n * Contains a collection of filters\n */\nexport default class FilterCollection extends BaseCollection<FilterType> {\n /**\n * Construct a collection of filters\n */\n constructor(data: Object = {}, contributions: Object = {}) {\n super();\n\n if (data && contributions && Array.isArray(contributions.filter)) {\n this.collection = contributions.filter\n .filter((filterContribution) => Object.keys(filterContribution)[0])\n .map((filterContribution) => {\n const [filterKey] = Object.keys(filterContribution);\n const filterData = data[filterKey];\n const filterContributionByKey = filterContribution[filterKey];\n\n const filter = this.createFilter(\n filterKey,\n {\n ...filterData,\n dynamicschema: contributions.dynamicschema,\n },\n filterContributionByKey\n );\n\n if (contributions.listkey) {\n filter.listkey = contributions.listkey;\n }\n\n if (contributions.contexts && filterContributionByKey.contextid) {\n const filterContext = contributions.contexts.find(\n (context) => context.id === filterContributionByKey.contextid\n );\n if (filterContext) {\n filter.context = filterContext;\n }\n }\n\n return filter;\n });\n }\n }\n\n /**\n */\n createFilter(\n filterKey: string,\n data: Object,\n contributions: Object\n ): FilterType {\n const type = contributions.type || \"stringfilter\";\n if (type === \"choicefilter\" && filterKey === \"index\") {\n return new ConceptIndexFilterModel(data, contributions);\n }\n\n if (type.includes(\"rangefilter\")) {\n return new RangeFilterModel(data, contributions);\n }\n\n if (type === \"assignmentfilter\") {\n return new AssignmentFilterModel(data, contributions);\n }\n\n return new FilterModel(data, contributions);\n }\n\n /**\n * Call the reset function on all filters\n *\n * @see {FilterType#reset()}\n */\n reset(): FilterCollection {\n this.collection = this.collection.map((filter) => filter.reset());\n\n return this;\n }\n\n /**\n * Checks if range attribute key equals key\n */\n checkRangeFilterByAttributeKey(\n filter: RangeFilterModel,\n key: string\n ): boolean {\n const rangeAttribute = filter.attribute;\n\n if (rangeAttribute instanceof CompositeAttributeModel) {\n return (\n rangeAttribute.key === key ||\n (rangeAttribute.start && rangeAttribute.start.key === key) ||\n (rangeAttribute.end && rangeAttribute.end.key === key)\n );\n }\n\n return false;\n }\n\n /**\n * Check if assignment filter attribute matches key\n */\n checkAssignmentFilterByAttributeKey(\n filter: AssignmentFilterModel,\n key: string\n ): boolean {\n return (\n filter.key === key ||\n filter.user?.key === key ||\n filter.assignmenttype?.key === key\n );\n }\n\n /**\n * Getting the filter by name\n */\n getFilterByAttributeKey(key: string): FilterType | null {\n return (\n this.find((filter) => {\n if (filter instanceof RangeFilterModel) {\n return this.checkRangeFilterByAttributeKey(filter, key);\n }\n\n if (filter instanceof AssignmentFilterModel) {\n return this.checkAssignmentFilterByAttributeKey(filter, key);\n }\n\n return filter.attribute?.key === key;\n }) || null\n );\n }\n\n /**\n * Update Filter by input name and value\n */\n update(attribute: AttributeType, value: string): void {\n const filterToUpdate = attribute.parentKey\n ? this.getFilterByAttributeKey(attribute.parentKey)\n : this.getFilterByAttributeKey(attribute.key);\n\n if (!filterToUpdate) {\n throw new Error(`Can not find filter by attribute key: ${attribute.key}`);\n }\n\n const newFilter = filterToUpdate.clone();\n newFilter.update(attribute, value);\n\n this.collection = this.collection.map((filter) => {\n if (filter.name === newFilter.name) {\n return newFilter;\n }\n\n return filter;\n });\n }\n\n /**\n * Retrieve if all filters are valid\n */\n get isValid(): boolean {\n return this.collection.every((filter) => filter.isValid);\n }\n\n /**\n * Indicates if an active filter is present in the collection\n */\n hasActiveFilters(): boolean {\n return this.collection.some((filter) => filter.isActive());\n }\n}\n"],"mappings":";;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M,IAAKA,MAAM,CAAC4C,QAAQ,CAAC,CAAC,CAAC;EAC5D;AACF;AAACC,OAAA,CAAAxD,OAAA,GAAAX,gBAAA"}
|
|
1
|
+
{"version":3,"file":"FilterCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_RangeFilterModel","_AssignmentFilterModel","_FilterModel","_ConceptIndexFilterModel","_CompositeAttributeModel","FilterCollection","BaseCollection","constructor","data","arguments","length","undefined","contributions","Array","isArray","_filter","default","_context","_context2","collection","_map","call","filterContribution","_keys","filterKey","filterData","filterContributionByKey","filter","createFilter","dynamicschema","listkey","contexts","contextid","_context3","filterContext","_find","context","id","type","ConceptIndexFilterModel","_includes","RangeFilterModel","AssignmentFilterModel","FilterModel","reset","_context4","checkRangeFilterByAttributeKey","key","rangeAttribute","attribute","CompositeAttributeModel","start","end","checkAssignmentFilterByAttributeKey","user","assignmenttype","getFilterByAttributeKey","_context5","update","value","_context6","filterToUpdate","parentKey","Error","newFilter","clone","name","isValid","every","hasActiveFilters","some","isActive","exports"],"sources":["../../../src/models/filters/FilterCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\n\nimport RangeFilterModel from \"../filters/RangeFilterModel\";\nimport AssignmentFilterModel from \"../filters/AssignmentFilterModel\";\nimport FilterModel from \"../filters/FilterModel\";\nimport ConceptIndexFilterModel from \"../filters/ConceptIndexFilterModel\";\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\n\nimport type { AttributeType, FilterType } from \"../types\";\n\n/**\n * Contains a collection of filters\n */\nexport default class FilterCollection extends BaseCollection<FilterType> {\n /**\n * Construct a collection of filters\n */\n constructor(data: Object = {}, contributions: Object = {}) {\n super();\n\n if (data && contributions && Array.isArray(contributions.filter)) {\n this.collection = contributions.filter\n .filter((filterContribution) => Object.keys(filterContribution)[0])\n .map((filterContribution) => {\n const [filterKey] = Object.keys(filterContribution);\n const filterData = data[filterKey];\n const filterContributionByKey = filterContribution[filterKey];\n\n const filter = this.createFilter(\n filterKey,\n {\n ...filterData,\n dynamicschema: contributions.dynamicschema,\n },\n filterContributionByKey,\n );\n\n if (contributions.listkey) {\n filter.listkey = contributions.listkey;\n }\n\n if (contributions.contexts && filterContributionByKey.contextid) {\n const filterContext = contributions.contexts.find(\n (context) => context.id === filterContributionByKey.contextid,\n );\n if (filterContext) {\n filter.context = filterContext;\n }\n }\n\n return filter;\n });\n }\n }\n\n /**\n */\n createFilter(\n filterKey: string,\n data: Object,\n contributions: Object,\n ): FilterType {\n const type = contributions.type || \"stringfilter\";\n if (type === \"choicefilter\" && filterKey === \"index\") {\n return new ConceptIndexFilterModel(data, contributions);\n }\n\n if (type.includes(\"rangefilter\")) {\n return new RangeFilterModel(data, contributions);\n }\n\n if (type === \"assignmentfilter\") {\n return new AssignmentFilterModel(data, contributions);\n }\n\n return new FilterModel(data, contributions);\n }\n\n /**\n * Call the reset function on all filters\n *\n * @see {FilterType#reset()}\n */\n reset(): FilterCollection {\n this.collection = this.collection.map((filter) => filter.reset());\n\n return this;\n }\n\n /**\n * Checks if range attribute key equals key\n */\n checkRangeFilterByAttributeKey(\n filter: RangeFilterModel,\n key: string,\n ): boolean {\n const rangeAttribute = filter.attribute;\n\n if (rangeAttribute instanceof CompositeAttributeModel) {\n return (\n rangeAttribute.key === key ||\n (rangeAttribute.start && rangeAttribute.start.key === key) ||\n (rangeAttribute.end && rangeAttribute.end.key === key)\n );\n }\n\n return false;\n }\n\n /**\n * Check if assignment filter attribute matches key\n */\n checkAssignmentFilterByAttributeKey(\n filter: AssignmentFilterModel,\n key: string,\n ): boolean {\n return (\n filter.key === key ||\n filter.user?.key === key ||\n filter.assignmenttype?.key === key\n );\n }\n\n /**\n * Getting the filter by name\n */\n getFilterByAttributeKey(key: string): FilterType | null {\n return (\n this.find((filter) => {\n if (filter instanceof RangeFilterModel) {\n return this.checkRangeFilterByAttributeKey(filter, key);\n }\n\n if (filter instanceof AssignmentFilterModel) {\n return this.checkAssignmentFilterByAttributeKey(filter, key);\n }\n\n return filter.attribute?.key === key;\n }) || null\n );\n }\n\n /**\n * Update Filter by input name and value\n */\n update(attribute: AttributeType, value: string): void {\n const filterToUpdate = attribute.parentKey\n ? this.getFilterByAttributeKey(attribute.parentKey)\n : this.getFilterByAttributeKey(attribute.key);\n\n if (!filterToUpdate) {\n throw new Error(`Can not find filter by attribute key: ${attribute.key}`);\n }\n\n const newFilter = filterToUpdate.clone();\n newFilter.update(attribute, value);\n\n this.collection = this.collection.map((filter) => {\n if (filter.name === newFilter.name) {\n return newFilter;\n }\n\n return filter;\n });\n }\n\n /**\n * Retrieve if all filters are valid\n */\n get isValid(): boolean {\n return this.collection.every((filter) => filter.isValid);\n }\n\n /**\n * Indicates if an active filter is present in the collection\n */\n hasActiveFilters(): boolean {\n return this.collection.some((filter) => filter.isActive());\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,wBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,wBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMM,gBAAgB,SAASC,uBAAc,CAAa;EACvE;AACF;AACA;EACEC,WAAWA,CAAA,EAAgD;IAAA,IAA/CC,IAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,IAAEG,aAAqB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACvD,KAAK,CAAC,CAAC;IAEP,IAAID,IAAI,IAAII,aAAa,IAAIC,KAAK,CAACC,OAAO,KAAAC,OAAA,CAAAC,OAAA,EAACJ,aA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AAI,CAACxC,UAAU,GAAG,IAAAC,IAAA,CAAAJ,OAAA,EAAA4C,SAAA,OAAI,CAACzC,UAAU,EAAAE,IAAA,CAAAuC,SAAA,EAAMjC,MAAM,IAAK;MAChD,IAAIA,MAAM,CAACuC,IAAI,KAAKF,SAAS,CAACE,IAAI,EAAE;QAClC,OAAOF,SAAS;MAClB;MAEA,OAAOrC,MAAM;IACf,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACE,IAAIwC,OAAOA,CAAA,EAAY;IACrB,OAAO,IAAI,CAAChD,UAAU,CAACiD,KAAK,CAAEzC,MAAM,IAAKA,MAAM,CAACwC,OAAO,CAAC;EAC1D;;EAEA;AACF;AACA;EACEE,gBAAgBA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAAClD,UAAU,CAACmD,IAAI,CAAE3C,MAAM,IAAKA,MAAM,CAAC4C,QAAQ,CAAC,CAAC,CAAC;EAC5D;AACF;AAACC,OAAA,CAAAxD,OAAA,GAAAX,gBAAA"}
|
|
@@ -64,14 +64,14 @@ describe("assignmentFilterModel", () => {
|
|
|
64
64
|
it("should be able to create an AssignmentFilterModel", () => {
|
|
65
65
|
const assignmentFilter = new AssignmentFilterModel(
|
|
66
66
|
filterData,
|
|
67
|
-
filterContributions
|
|
67
|
+
filterContributions,
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
expect(assignmentFilter).toBeInstanceOf(AssignmentFilterModel);
|
|
71
71
|
expect(assignmentFilter.user).toBeInstanceOf(ChoiceAttributeModel);
|
|
72
72
|
expect(assignmentFilter.user.type === "lookup").toBeTruthy();
|
|
73
73
|
expect(assignmentFilter.assignmenttype).toBeInstanceOf(
|
|
74
|
-
ChoiceAttributeModel
|
|
74
|
+
ChoiceAttributeModel,
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
expect(assignmentFilter.assignmenttype.options.size).toBe(1);
|
|
@@ -124,7 +124,7 @@ describe("assignmentFilterModel", () => {
|
|
|
124
124
|
],
|
|
125
125
|
},
|
|
126
126
|
contextid: "C1_1_",
|
|
127
|
-
}
|
|
127
|
+
},
|
|
128
128
|
);
|
|
129
129
|
|
|
130
130
|
expect(assignmentFilter).toBeInstanceOf(AssignmentFilterModel);
|
|
@@ -132,7 +132,7 @@ describe("assignmentFilterModel", () => {
|
|
|
132
132
|
expect(assignmentFilter.user.type === "lookup").toBeTruthy();
|
|
133
133
|
expect(assignmentFilter.user.options.size).toBe(1);
|
|
134
134
|
expect(assignmentFilter.assignmenttype).toBeInstanceOf(
|
|
135
|
-
ChoiceAttributeModel
|
|
135
|
+
ChoiceAttributeModel,
|
|
136
136
|
);
|
|
137
137
|
|
|
138
138
|
expect(assignmentFilter.assignmenttype.options.size).toBe(2);
|
|
@@ -28,39 +28,39 @@ describe("models", () => {
|
|
|
28
28
|
expect(collection.getFilterByAttributeKey("ASSIGNMENT")).toBeDefined();
|
|
29
29
|
|
|
30
30
|
expect(collection.getFilterByAttributeKey("STRING").type).toBe(
|
|
31
|
-
"string"
|
|
31
|
+
"string",
|
|
32
32
|
);
|
|
33
33
|
expect(collection.getFilterByAttributeKey("CHECKBOX").type).toBe(
|
|
34
|
-
"choice"
|
|
34
|
+
"choice",
|
|
35
35
|
);
|
|
36
36
|
expect(collection.getFilterByAttributeKey("RADIO").type).toBe("choice");
|
|
37
37
|
expect(collection.getFilterByAttributeKey("DATERANGE").type).toBe(
|
|
38
|
-
"daterange"
|
|
38
|
+
"daterange",
|
|
39
39
|
);
|
|
40
40
|
expect(collection.getFilterByAttributeKey("NUMBERRANGE").type).toBe(
|
|
41
|
-
"numberrange"
|
|
41
|
+
"numberrange",
|
|
42
42
|
);
|
|
43
43
|
expect(collection.getFilterByAttributeKey("USERKEY").type).toBe(
|
|
44
|
-
"assignment"
|
|
44
|
+
"assignment",
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
expect(collection.getFilterByAttributeKey("STRING").label).toBe(
|
|
48
|
-
"Stringfilter"
|
|
48
|
+
"Stringfilter",
|
|
49
49
|
);
|
|
50
50
|
expect(collection.getFilterByAttributeKey("CHECKBOX").label).toBe(
|
|
51
|
-
"Checkboxfilter"
|
|
51
|
+
"Checkboxfilter",
|
|
52
52
|
);
|
|
53
53
|
expect(collection.getFilterByAttributeKey("RADIO").label).toBe(
|
|
54
|
-
"Radiofilter"
|
|
54
|
+
"Radiofilter",
|
|
55
55
|
);
|
|
56
56
|
expect(collection.getFilterByAttributeKey("DATERANGE").label).toBe(
|
|
57
|
-
"Date range"
|
|
57
|
+
"Date range",
|
|
58
58
|
);
|
|
59
59
|
expect(collection.getFilterByAttributeKey("NUMBERRANGE").label).toBe(
|
|
60
|
-
"Number range"
|
|
60
|
+
"Number range",
|
|
61
61
|
);
|
|
62
62
|
expect(collection.getFilterByAttributeKey("USERKEY").label).toBe(
|
|
63
|
-
"Assignments"
|
|
63
|
+
"Assignments",
|
|
64
64
|
);
|
|
65
65
|
});
|
|
66
66
|
});
|