@beinformed/ui 1.25.0 → 1.25.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/hooks/useAuthentication.js +1 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +0 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js +1 -1
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +4 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useRouter.js +1 -1
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +5 -2
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.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/base/ResourceModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.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/links/LinkModel.js +3 -1
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +1 -1
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react-client/client.js +1 -1
- package/esm/react-client/client.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 +4 -2
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/serverUtil.js +18 -9
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +1 -1
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +8 -3
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +3 -1
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +3 -1
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +9 -3
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/redux/_i18n/{actions.js → I18nActions.js} +1 -1
- package/esm/redux/_i18n/I18nActions.js.map +1 -0
- package/esm/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
- package/esm/redux/_i18n/I18nReducer.js.map +1 -0
- package/esm/redux/_i18n/index.js +2 -2
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -0
- package/esm/redux/_modularui/{connector.js → ModularUIConnector.js} +5 -5
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -0
- package/esm/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +2 -2
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -0
- package/esm/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -0
- package/esm/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -0
- package/esm/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
- package/esm/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
- package/esm/redux/_modularui/index.js +6 -6
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/{actions.js → RouterActions.js} +1 -1
- package/esm/redux/_router/RouterActions.js.map +1 -0
- package/esm/redux/_router/{connectors.js → RouterConnectors.js} +2 -2
- package/esm/redux/_router/RouterConnectors.js.map +1 -0
- package/esm/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
- package/esm/redux/_router/RouterMiddleware.js.map +1 -0
- package/esm/redux/_router/{reducer.js → RouterReducer.js} +1 -1
- package/esm/redux/_router/RouterReducer.js.map +1 -0
- package/esm/redux/_router/index.js +4 -4
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/actions/Application.js +2 -2
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +3 -3
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +1 -1
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +2 -2
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +1 -1
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +1 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +1 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +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 +1 -1
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/SignIn.js +1 -1
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js +1 -1
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/connectors/Application.js +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js +1 -1
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +1 -1
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +1 -1
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +1 -1
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +1 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +2 -2
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +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 +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js +3 -3
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/store/configureStore.js +4 -4
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +3 -2
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/objects.js +4 -3
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.flow +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Settings.js.flow +1 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/hooks/useAuthentication.js +3 -3
- package/lib/hooks/useAuthentication.js.flow +1 -1
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.flow +2 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +2 -2
- package/lib/hooks/useModels.js.flow +1 -1
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +3 -3
- package/lib/hooks/useModularUI.js.flow +4 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +4 -1
- package/lib/hooks/useModularUIBasic.js.flow +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useRouter.js +6 -6
- package/lib/hooks/useRouter.js.flow +7 -1
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.flow +8 -6
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.flow +18 -16
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +5 -2
- package/lib/models/attributes/NumberAttributeModel.js.flow +7 -3
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js.flow +1 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/base/ResourceModel.js.flow +1 -1
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.flow +4 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.flow +1 -1
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/form/FormModel.js.flow +2 -2
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/links/LinkModel.js +3 -1
- package/lib/models/links/LinkModel.js.flow +4 -2
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js.flow +1 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListModel.js.flow +1 -1
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +1 -1
- package/lib/models/parameter/Parameter.js.flow +1 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/types.js.flow +6 -6
- package/lib/models/types.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.flow +6 -6
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react-client/client.js +2 -2
- package/lib/react-client/client.js.flow +8 -8
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/rehydrate.js.flow +2 -2
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js.flow +3 -3
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +4 -2
- package/lib/react-server/renderSSRComplete.js.flow +2 -2
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/serverUtil.js +19 -10
- package/lib/react-server/serverUtil.js.flow +20 -11
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +1 -1
- package/lib/react-theme/ThemeProvider.js.flow +1 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/__tests__/ThemeProvider.spec.js.flow +2 -0
- package/lib/react-theme/__tests__/createTheme.spec.js.flow +3 -0
- package/lib/react-theme/createTheme.js +8 -3
- package/lib/react-theme/createTheme.js.flow +7 -5
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +3 -1
- package/lib/react-theme/utils/contrast.js.flow +1 -1
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +3 -1
- package/lib/react-theme/utils/corners.js.flow +1 -1
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +9 -3
- package/lib/react-theme/utils/spacers.js.flow +3 -3
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/redux/_i18n/{actions.js → I18nActions.js} +1 -1
- package/lib/redux/_i18n/{actions.js.flow → I18nActions.js.flow} +0 -0
- package/lib/redux/_i18n/I18nActions.js.map +1 -0
- package/lib/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
- package/{src/redux/_i18n/reducer.js → lib/redux/_i18n/I18nReducer.js.flow} +5 -2
- package/lib/redux/_i18n/I18nReducer.js.map +1 -0
- package/lib/redux/_i18n/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +1 -1
- package/lib/redux/_i18n/index.js +8 -8
- package/lib/redux/_i18n/index.js.flow +2 -2
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/lib/redux/_modularui/{actions.js.flow → ModularUIActions.js.flow} +1 -1
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -0
- package/lib/redux/_modularui/{connector.js → ModularUIConnector.js} +11 -11
- package/{src/redux/_modularui/connector.js → lib/redux/_modularui/ModularUIConnector.js.flow} +8 -4
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -0
- package/lib/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +4 -4
- package/lib/redux/_modularui/{middleware.js.flow → ModularUIMiddleware.js.flow} +20 -5
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -0
- package/lib/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
- package/lib/redux/_modularui/{reducer.js.flow → ModularUIReducer.js.flow} +14 -8
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -0
- package/lib/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
- package/lib/redux/_modularui/{selectors.js.flow → ModularUISelectors.js.flow} +3 -2
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -0
- package/lib/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
- package/lib/redux/_modularui/{modularuiUtils.js.flow → ModularUIUtils.js.flow} +0 -0
- package/lib/redux/_modularui/{modularuiUtils.js.map → 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 +6 -4
- package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +1 -1
- package/lib/redux/_modularui/index.js +22 -22
- package/lib/redux/_modularui/index.js.flow +6 -6
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +10 -4
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +2 -2
- package/lib/redux/_modularui/withModularUI.js.flow +1 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/{actions.js → RouterActions.js} +1 -1
- package/lib/redux/_router/{actions.js.flow → RouterActions.js.flow} +0 -0
- package/lib/redux/_router/RouterActions.js.map +1 -0
- package/lib/redux/_router/{connectors.js → RouterConnectors.js} +7 -7
- package/lib/redux/_router/{connectors.js.flow → RouterConnectors.js.flow} +1 -1
- package/lib/redux/_router/RouterConnectors.js.map +1 -0
- package/lib/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
- package/lib/redux/_router/{middleware.js.flow → RouterMiddleware.js.flow} +0 -0
- package/lib/redux/_router/RouterMiddleware.js.map +1 -0
- package/lib/redux/_router/{reducer.js → RouterReducer.js} +1 -1
- package/lib/redux/_router/{reducer.js.flow → RouterReducer.js.flow} +0 -0
- package/lib/redux/_router/RouterReducer.js.map +1 -0
- package/lib/redux/_router/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_router/__tests__/middleware.spec.js.flow +2 -2
- package/lib/redux/_router/__tests__/reducer.spec.js.flow +1 -1
- package/lib/redux/_router/index.js +16 -16
- package/lib/redux/_router/index.js.flow +4 -4
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/actions/Application.js +5 -5
- package/lib/redux/actions/Application.js.flow +5 -2
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +6 -6
- package/lib/redux/actions/Authorization.js.flow +3 -3
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +2 -2
- package/lib/redux/actions/Error.js.flow +2 -2
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +5 -5
- package/lib/redux/actions/Form.js.flow +2 -2
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +2 -2
- package/lib/redux/actions/FormAttributeSet.js.flow +1 -1
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +4 -4
- package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +2 -2
- package/lib/redux/actions/FormAutosave.js.flow +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +2 -2
- package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +2 -2
- package/lib/redux/actions/FormValidations.js.flow +5 -3
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Notification.js.flow +1 -1
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +1 -1
- package/lib/redux/actions/Preferences.js.flow +3 -3
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/SignIn.js +2 -2
- package/lib/redux/actions/SignIn.js.flow +1 -1
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +2 -2
- package/lib/redux/actions/SignOut.js.flow +1 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/connectors/Application.js +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 +2 -2
- package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +2 -2
- package/lib/redux/connectors/CaseView.js.flow +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +2 -2
- package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +2 -2
- package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +2 -2
- package/lib/redux/connectors/ContentDetail.js.flow +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +2 -2
- package/lib/redux/connectors/ContentDetailSection.js.flow +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +2 -2
- package/lib/redux/connectors/Form.js.flow +1 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +2 -2
- package/lib/redux/connectors/ListDetail.js.flow +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +2 -2
- package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +2 -2
- package/lib/redux/connectors/PanelRenderer.js.flow +1 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.flow +5 -2
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +4 -4
- package/lib/redux/connectors/QuickSearch.js.flow +2 -2
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +2 -2
- 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 +2 -2
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +2 -2
- package/lib/redux/connectors/Tab.js.flow +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.flow +2 -2
- package/lib/redux/reducers/ModalsReducer.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/createReducer.js +6 -6
- package/lib/redux/reducers/createReducer.js.flow +3 -3
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/store/configureStore.js +5 -5
- package/lib/redux/store/configureStore.js.flow +4 -4
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +5 -3
- package/lib/utils/fetch/universalFetch.js.flow +8 -6
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.flow +21 -21
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/objects.js.flow +5 -3
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.flow +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.flow +8 -2
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +8 -8
- package/src/builder/mergeLayoutHintConfigurations.js +1 -1
- package/src/constants/Settings.js +1 -1
- package/src/hooks/useAuthentication.js +1 -1
- package/src/hooks/useModelCatalog.js +2 -1
- package/src/hooks/useModels.js +1 -1
- package/src/hooks/useModularUI.js +4 -1
- package/src/hooks/useModularUIBasic.js +1 -1
- package/src/hooks/useRouter.js +7 -1
- package/src/models/attributes/AttributeCollection.js +8 -6
- package/src/models/attributes/AttributeModel.js +18 -16
- package/src/models/attributes/CompositeAttributeChildCollection.js +1 -1
- package/src/models/attributes/NumberAttributeModel.js +7 -3
- package/src/models/attributes/_createAttribute.js +1 -1
- package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +1 -1
- package/src/models/attributes/layouthint-rules/DependentAttribute.js +1 -1
- package/src/models/base/ResourceModel.js +1 -1
- package/src/models/content/ContentTOCModel.js +4 -1
- package/src/models/filters/FilterCollection.js +1 -1
- package/src/models/form/FormModel.js +2 -2
- package/src/models/links/LinkModel.js +4 -2
- package/src/models/links/normalizeLinkJSON.js +1 -1
- package/src/models/list/ListModel.js +1 -1
- package/src/models/parameter/Parameter.js +1 -1
- package/src/models/types.js +6 -6
- package/src/modularui/ModularUIRequest.js +6 -6
- package/src/react-client/client.js +8 -8
- package/src/react-client/rehydrate.js +2 -2
- package/src/react-server/createSSRComplete.js +3 -3
- package/src/react-server/renderSSRComplete.js +2 -2
- package/src/react-server/serverUtil.js +20 -11
- package/src/react-theme/ThemeProvider.js +1 -1
- package/src/react-theme/__tests__/ThemeProvider.spec.js +2 -0
- package/src/react-theme/__tests__/createTheme.spec.js +3 -0
- package/src/react-theme/createTheme.js +7 -5
- package/src/react-theme/utils/contrast.js +1 -1
- package/src/react-theme/utils/corners.js +1 -1
- package/src/react-theme/utils/spacers.js +3 -3
- package/src/redux/_i18n/{actions.js → I18nActions.js} +0 -0
- package/{lib/redux/_i18n/reducer.js.flow → src/redux/_i18n/I18nReducer.js} +5 -2
- package/src/redux/_i18n/__tests__/actions.spec.js +1 -1
- package/src/redux/_i18n/__tests__/reducer.spec.js +1 -1
- package/src/redux/_i18n/index.js +2 -2
- package/src/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/{lib/redux/_modularui/connector.js.flow → src/redux/_modularui/ModularUIConnector.js} +8 -4
- package/src/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +20 -5
- package/src/redux/_modularui/{reducer.js → ModularUIReducer.js} +14 -8
- package/src/redux/_modularui/{selectors.js → ModularUISelectors.js} +3 -2
- package/src/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +0 -0
- package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
- package/src/redux/_modularui/__tests__/reducer.spec.js +6 -4
- package/src/redux/_modularui/__tests__/selectors.spec.js +1 -1
- package/src/redux/_modularui/index.js +6 -6
- package/src/redux/_modularui/types.js +10 -4
- package/src/redux/_modularui/withModularUI.js +1 -1
- package/src/redux/_router/{actions.js → RouterActions.js} +0 -0
- package/src/redux/_router/{connectors.js → RouterConnectors.js} +1 -1
- package/src/redux/_router/{middleware.js → RouterMiddleware.js} +0 -0
- package/src/redux/_router/{reducer.js → RouterReducer.js} +0 -0
- package/src/redux/_router/__tests__/actions.spec.js +1 -1
- package/src/redux/_router/__tests__/middleware.spec.js +2 -2
- package/src/redux/_router/__tests__/reducer.spec.js +1 -1
- package/src/redux/_router/index.js +4 -4
- package/src/redux/actions/Application.js +5 -2
- package/src/redux/actions/Authorization.js +3 -3
- package/src/redux/actions/Error.js +2 -2
- package/src/redux/actions/Form.js +2 -2
- package/src/redux/actions/FormAttributeSet.js +1 -1
- package/src/redux/actions/FormAttributeSetRepeatable.js +1 -1
- package/src/redux/actions/FormAutosave.js +1 -1
- package/src/redux/actions/FormAutosubmit.js +1 -1
- package/src/redux/actions/FormValidations.js +5 -3
- package/src/redux/actions/Notification.js +1 -1
- package/src/redux/actions/Preferences.js +3 -3
- package/src/redux/actions/SignIn.js +1 -1
- package/src/redux/actions/SignOut.js +1 -1
- 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 +1 -1
- package/src/redux/connectors/Form.js +1 -1
- package/src/redux/connectors/ListDetail.js +1 -1
- package/src/redux/connectors/ModelCatalog.js +1 -1
- package/src/redux/connectors/PanelRenderer.js +1 -1
- package/src/redux/connectors/Preferences.js +5 -2
- package/src/redux/connectors/QuickSearch.js +2 -2
- package/src/redux/connectors/SignIn.js +1 -1
- package/src/redux/connectors/SignOut.js +2 -2
- package/src/redux/connectors/Tab.js +1 -1
- package/src/redux/reducers/ModalsReducer.js +2 -2
- package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
- package/src/redux/reducers/createReducer.js +3 -3
- package/src/redux/store/configureStore.js +4 -4
- package/src/utils/fetch/universalFetch.js +8 -6
- package/src/utils/fetch/xhr.js +21 -21
- package/src/utils/helpers/objects.js +5 -3
- package/src/utils/helpers/sanitizeHtml.js +1 -1
- package/src/utils/number/parseNumbers.js +8 -2
- package/types/models/concepts/ConceptDetailModel.d.ts +3 -3
- package/types/models/concepts/ConceptRelationModel.d.ts +2 -1
- package/types/models/types.d.ts +17 -3
- package/types/redux/_modularui/types.d.ts +3 -1
- package/types/utils/fetch/universalFetch.d.ts +3 -3
- package/types/utils/helpers/objects.d.ts +10 -2
- package/esm/redux/_i18n/actions.js.map +0 -1
- package/esm/redux/_i18n/reducer.js.map +0 -1
- package/esm/redux/_modularui/actions.js.map +0 -1
- package/esm/redux/_modularui/connector.js.map +0 -1
- package/esm/redux/_modularui/middleware.js.map +0 -1
- package/esm/redux/_modularui/reducer.js.map +0 -1
- package/esm/redux/_modularui/selectors.js.map +0 -1
- package/esm/redux/_router/actions.js.map +0 -1
- package/esm/redux/_router/connectors.js.map +0 -1
- package/esm/redux/_router/middleware.js.map +0 -1
- package/esm/redux/_router/reducer.js.map +0 -1
- package/lib/redux/_i18n/actions.js.map +0 -1
- package/lib/redux/_i18n/reducer.js.map +0 -1
- package/lib/redux/_modularui/actions.js.map +0 -1
- package/lib/redux/_modularui/connector.js.map +0 -1
- package/lib/redux/_modularui/middleware.js.map +0 -1
- package/lib/redux/_modularui/reducer.js.map +0 -1
- package/lib/redux/_modularui/selectors.js.map +0 -1
- package/lib/redux/_router/actions.js.map +0 -1
- package/lib/redux/_router/connectors.js.map +0 -1
- package/lib/redux/_router/middleware.js.map +0 -1
- package/lib/redux/_router/reducer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelCatalog.js","names":["useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","useConceptIndex","href","ConceptIndexModel","getHref","context","dynamic","location","replace","search","useConceptDetail","concept","useLocation","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel =>\n useModularUIBasic(\"conceptindex\", href, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n\nconst getHref = (context, dynamic, location) => {\n let href = dynamic;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search) {\n href = `${href}${location.search}`;\n }\n\n return href;\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = getHref(\"concepts\", concept, location);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel =>\n useModularUIBasic(\"contentindex\", href, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = getHref(\"content\", content, location);\n return useModularUIBasic(\"contenttoc\", href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (contentSection: string): ?ContentModel => {\n const href = getHref(\"content\", contentSection);\n return useModularUIBasic(\"content\", href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (contentType: string): ?ContentTypeModel => {\n const href = getHref(\"contenttypes\", contentType);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","useConceptIndex","href","ConceptIndexModel","getHref","context","dynamic","location","replace","search","useConceptDetail","concept","useLocation","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel =>\n useModularUIBasic(\"conceptindex\", href, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n\nconst getHref = (context: string, dynamic: string, location?: Location) => {\n let href = dynamic;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search) {\n href = `${href}${location.search}`;\n }\n\n return href;\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = getHref(\"concepts\", concept, location);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel =>\n useModularUIBasic(\"contentindex\", href, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = getHref(\"content\", content, location);\n return useModularUIBasic(\"contenttoc\", href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (contentSection: string): ?ContentModel => {\n const href = getHref(\"content\", contentSection);\n return useModularUIBasic(\"content\", href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (contentType: string): ?ContentTypeModel => {\n const href = getHref(\"contenttypes\", contentType);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACO,MAAMA,eAAe,GAAG,MAC7B,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC;AACf,CAAC,CAAC;;AAEJ;AACA;AADA;AAEO,MAAMC,eAAe,GAAIC,IAAY,IAC1C,IAAAL,oCAAiB,EAAC,cAAc,EAAEK,IAAI,EAAE;EACtCJ,cAAc,EAAE,CAAC,cAAc,CAAC;EAChC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AE;IAC3CJ,cAAc,EAAE,CAAC,YAAY,CAAC;IAC9BC,WAAW,EAAEkB;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AADA;AAEO,MAAMC,UAAU,GAAIC,cAAsB,IAAoB;EACnE,MAAMjB,IAAI,GAAGE,OAAO,CAAC,SAAS,EAAEe,cAAc,CAAC;EAC/C,OAAO,IAAAtB,oCAAiB,EAAC,SAAS,EAAEK,IAAI,EAAE;IACxCJ,cAAc,EAAE,CAAC,SAAS,CAAC;IAC3BC,WAAW,EAAEqB;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AADA;AAEO,MAAMC,cAAc,GAAIC,WAAmB,IAAwB;EACxE,MAAMpB,IAAI,GAAGE,OAAO,CAAC,cAAc,EAAEkB,WAAW,CAAC;EACjD,OAAO,IAAAzB,oCAAiB,EAAC,cAAc,EAAEK,IAAI,EAAE;IAC7CJ,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/BC,WAAW,EAAEwB;EACf,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
package/lib/hooks/useModels.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useModels = void 0;
|
|
7
7
|
var _reactRedux = require("react-redux");
|
|
8
|
-
var
|
|
8
|
+
var _ModularUIActions = require("../redux/_modularui/ModularUIActions");
|
|
9
9
|
/**
|
|
10
10
|
* Hook that contains the reload property that can be used to reload a model
|
|
11
11
|
*/
|
|
@@ -13,7 +13,7 @@ const useModels = () => {
|
|
|
13
13
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
14
14
|
return {
|
|
15
15
|
reload: (model, options) => {
|
|
16
|
-
dispatch((0,
|
|
16
|
+
dispatch((0, _ModularUIActions.reloadModel)(model, options));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModels.js","names":["useModels","dispatch","useDispatch","reload","model","options","reloadModel"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/
|
|
1
|
+
{"version":3,"file":"useModels.js","names":["useModels","dispatch","useDispatch","reload","model","options","reloadModel"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/ModularUIActions\";\n\nimport type { ModularUIModel } from \"../models/types\";\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: any) => void,\n};\n\n/**\n * Hook that contains the reload property that can be used to reload a model\n */\nexport const useModels: UseModels = () => {\n const dispatch = useDispatch();\n return {\n reload: (model: ModularUIModel, options?: Object) => {\n dispatch(reloadModel(model, options));\n },\n };\n};\n"],"mappings":";;;;;;AACA;AAEA;AAQA;AACA;AACA;AACO,MAAMA,SAAoB,GAAG,MAAM;EACxC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAC9B,OAAO;IACLC,MAAM,EAAE,CAACC,KAAqB,EAAEC,OAAgB,KAAK;MACnDJ,QAAQ,CAAC,IAAAK,6BAAW,EAACF,KAAK,EAAEC,OAAO,CAAC,CAAC;IACvC;EACF,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -8,7 +8,7 @@ exports.useModularUI = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactRedux = require("react-redux");
|
|
10
10
|
var _constants = require("../constants");
|
|
11
|
-
var
|
|
11
|
+
var _ModularUIActions = require("../redux/_modularui/ModularUIActions");
|
|
12
12
|
var _useDeepCompareEffect = _interopRequireDefault(require("./useDeepCompareEffect"));
|
|
13
13
|
var _useI18n = require("./useI18n");
|
|
14
14
|
/**
|
|
@@ -37,7 +37,7 @@ const useModularUI = function (modelKey, url) {
|
|
|
37
37
|
// prevent reloads when previous option had the isReload, but the new options not
|
|
38
38
|
const isOldReload = prevHref.current === href && prevOptions.current.isReload && !options.isReload;
|
|
39
39
|
if (!isOldReload) {
|
|
40
|
-
dispatch((0,
|
|
40
|
+
dispatch((0, _ModularUIActions.loadModularUI)(key, href, options));
|
|
41
41
|
}
|
|
42
42
|
prevOptions.current = options;
|
|
43
43
|
prevHref.current = href;
|
|
@@ -48,7 +48,7 @@ const useModularUI = function (modelKey, url) {
|
|
|
48
48
|
(0, _react.useEffect)(() => {
|
|
49
49
|
return () => {
|
|
50
50
|
if (removeOnUnmount) {
|
|
51
|
-
dispatch((0,
|
|
51
|
+
dispatch((0, _ModularUIActions.removeModelByKey)(key));
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}, [dispatch, key, removeOnUnmount]);
|
|
@@ -3,7 +3,10 @@ import { useEffect, useRef } from "react";
|
|
|
3
3
|
import { useDispatch, useSelector } from "react-redux";
|
|
4
4
|
|
|
5
5
|
import { HTTP_METHODS } from "../constants";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
loadModularUI,
|
|
8
|
+
removeModelByKey,
|
|
9
|
+
} from "../redux/_modularui/ModularUIActions";
|
|
7
10
|
|
|
8
11
|
import useDeepCompareEffect from "./useDeepCompareEffect";
|
|
9
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUI.js","names":["useKeyForHook","modelKey","url","locale","useLocale","split","useModularUI","options","method","HTTP_METHODS","GET","removeOnUnmount","dispatch","useDispatch","href","toString","key","prevOptions","useRef","prevHref","useDeepCompareEffect","isOldReload","current","isReload","loadModularUI","useEffect","removeModelByKey","useSelector","state","modularui"],"sources":["../../src/hooks/useModularUI.js"],"sourcesContent":["// @flow\nimport { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { HTTP_METHODS } from \"../constants\";\nimport {
|
|
1
|
+
{"version":3,"file":"useModularUI.js","names":["useKeyForHook","modelKey","url","locale","useLocale","split","useModularUI","options","method","HTTP_METHODS","GET","removeOnUnmount","dispatch","useDispatch","href","toString","key","prevOptions","useRef","prevHref","useDeepCompareEffect","isOldReload","current","isReload","loadModularUI","useEffect","removeModelByKey","useSelector","state","modularui"],"sources":["../../src/hooks/useModularUI.js"],"sourcesContent":["// @flow\nimport { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { HTTP_METHODS } from \"../constants\";\nimport {\n loadModularUI,\n removeModelByKey,\n} from \"../redux/_modularui/ModularUIActions\";\n\nimport useDeepCompareEffect from \"./useDeepCompareEffect\";\n\nimport { useLocale } from \"./useI18n\";\n\nimport type Href from \"../models/href/Href\";\nimport type { RequestBaseOptions } from \"../utils\";\n\n/**\n */\nconst useKeyForHook = (modelKey: string, url: string) => {\n const locale = useLocale();\n return `${modelKey}(${url.split(\"?\")[0]})(${locale})`;\n};\n\n/**\n * Use redux action and selector to retrieve the correct modular ui service model\n */\nexport const useModularUI = (\n modelKey: string,\n url: string | Href,\n options: RequestBaseOptions = {\n method: HTTP_METHODS.GET,\n removeOnUnmount: false,\n }\n): any => {\n const dispatch = useDispatch();\n const href = url.toString();\n const key = useKeyForHook(modelKey, href);\n\n const prevOptions = useRef(options);\n const prevHref = useRef(href);\n\n // dispatch loadModularUI\n useDeepCompareEffect(() => {\n // prevent reloads when previous option had the isReload, but the new options not\n const isOldReload =\n prevHref.current === href &&\n prevOptions.current.isReload &&\n !options.isReload;\n\n if (!isOldReload) {\n dispatch(loadModularUI(key, href, options));\n }\n\n prevOptions.current = options;\n prevHref.current = href;\n }, [key, href, options]);\n\n const { removeOnUnmount = false } = options;\n useEffect(() => {\n return () => {\n if (removeOnUnmount) {\n dispatch(removeModelByKey(key));\n }\n };\n }, [dispatch, key, removeOnUnmount]);\n\n // retrieve current model from modularui reducer\n return useSelector((state) => {\n return state.modularui[key];\n });\n};\n"],"mappings":";;;;;;;AACA;AACA;AAEA;AACA;AAKA;AAEA;AAKA;AACA;AACA,MAAMA,aAAa,GAAG,CAACC,QAAgB,EAAEC,GAAW,KAAK;EACvD,MAAMC,MA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,GAAG,CAAC,CAAC;MACjC;IACF,CAAC;EACH,CAAC,EAAE,CAACJ,QAAQ,EAAEI,GAAG,EAAEL,eAAe,CAAC,CAAC;;EAEpC;EACA,OAAO,IAAAgB,uBAAW,EAAEC,KAAK,IAAK;IAC5B,OAAOA,KAAK,CAACC,SAAS,CAACb,GAAG,CAAC;EAC7B,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -21,7 +21,10 @@ const useModularUIBasic = function (key, href) {
|
|
|
21
21
|
if (!href) {
|
|
22
22
|
throw new _exceptions.IllegalArgumentException("Missing href");
|
|
23
23
|
}
|
|
24
|
-
const useModularUIOptions = {
|
|
24
|
+
const useModularUIOptions = {
|
|
25
|
+
targetModel: undefined,
|
|
26
|
+
isReload: false
|
|
27
|
+
};
|
|
25
28
|
if (options.targetModel) {
|
|
26
29
|
useModularUIOptions.targetModel = options.targetModel;
|
|
27
30
|
}
|
|
@@ -27,7 +27,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
|
|
|
27
27
|
throw new IllegalArgumentException("Missing href");
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const useModularUIOptions = {};
|
|
30
|
+
const useModularUIOptions = { targetModel: undefined, isReload: false };
|
|
31
31
|
if (options.targetModel) {
|
|
32
32
|
useModularUIOptions.targetModel = options.targetModel;
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIBasic.js","names":["useModularUIBasic","key","href","options","expectedModels","targetModel","undefined","location","useLocation","IllegalArgumentException","useModularUIOptions","state","reload","pathname","toString","
|
|
1
|
+
{"version":3,"file":"useModularUIBasic.js","names":["useModularUIBasic","key","href","options","expectedModels","targetModel","undefined","location","useLocation","IllegalArgumentException","useModularUIOptions","isReload","state","reload","pathname","toString","modularUI","useModularUI","model","length","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useModularUI } from \"./useModularUI\";\n\nimport { useLocation } from \"./useRouter\";\n\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\ntype UseModularUIBasicOptions<T> = {\n expectedModels: Array<string>,\n targetModel?: Class<T>,\n};\n\n/**\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n }\n): ?T => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = { targetModel: undefined, isReload: false };\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n }\n\n // reload when the modular service starts with the current location\n if (location.state?.reload && location.pathname.startsWith(href.toString())) {\n useModularUIOptions.isReload = true;\n }\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n\n if (modularUI?.model) {\n const { model } = modularUI;\n if (options.expectedModels.length > 0) {\n const isCorrectModel = options.expectedModels.some((expectedModel) => {\n return model.type === expectedModel;\n });\n\n if (!isCorrectModel) {\n console.error(modularUI, \"is not of instance\", options.expectedModels);\n throw new IllegalStateException(\"Resolved model has incorrect type\");\n }\n }\n\n return model;\n }\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AAEA;AASA;AACA;AACO,MAAMA,iBAAiB,GAAG,UAC/BC,GAAW,EACXC,IAAmB,EAKZ;EAAA;EAAA,IAJPC,OAAoC,uEAAG;IACrCC,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEC;EACf,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,sBAAW,GAAE;EAC9B,IAAI,CAACN,IAAI,EAAE;IACT,MAAM,IAAIO,oCAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMC,mBAAmB,GAAG;IAAEL,WAAW,EAAEC,SAAS;IAAEK,QAAQ,EAAE;EAAM,CAAC;EACvE,IAAIR,OAAO,CAACE,WAAW,EAAE;IACvBK,mBAAmB,CAACL,WAAW,GAAGF,OAAO,CAACE,WAAW;EACvD;;EAEA;EACA,IAAIE,QAAQ,CAACK,KAAK,EAAEC,MAAM,IAAI,oCAAAN,QAAQ,CAACO,QAAQ,iBAAYZ,IAAI,CAACa,QAAQ,EAAE,CAAC,EAAE;IAC3EL,mBAAmB,CAACC,QAAQ,GAAG,IAAI;EACrC;EAEA,MAAMK,SAAS,GAAG,IAAAC,0BAAY,EAAChB,GAAG,EAAEC,IAAI,EAAEQ,mBAAmB,CAAC;EAE9D,IAAIM,SAAS,EAAEE,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGF,SAAS;IAC3B,IAAIb,OAAO,CAACC,cAAc,CAACe,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMC,cAAc,GAAGjB,OAAO,CAACC,cAAc,CAACiB,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOJ,KAAK,CAACK,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACT,SAAS,EAAE,oBAAoB,EAAEb,OAAO,CAACC,cAAc,CAAC;QACtE,MAAM,IAAIsB,iCAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOR,KAAK;EACd;AACF,CAAC;AAAC"}
|
package/lib/hooks/useRouter.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useQuerystring = exports.usePathname = exports.useNavigation = exports.useLocationKey = exports.useLocation = void 0;
|
|
7
7
|
var _reactRedux = require("react-redux");
|
|
8
|
-
var
|
|
8
|
+
var _RouterActions = require("../redux/_router/RouterActions");
|
|
9
9
|
/**
|
|
10
10
|
*/
|
|
11
11
|
const useLocation = () => (0, _reactRedux.useSelector)(state => state.router.location);
|
|
@@ -31,11 +31,11 @@ exports.usePathname = usePathname;
|
|
|
31
31
|
const useNavigation = () => {
|
|
32
32
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
33
33
|
return {
|
|
34
|
-
push: (location, state) => dispatch((0,
|
|
35
|
-
replace: (location, state) => dispatch((0,
|
|
36
|
-
go: delta => dispatch((0,
|
|
37
|
-
goBack: () => dispatch((0,
|
|
38
|
-
goForward: () => dispatch((0,
|
|
34
|
+
push: (location, state) => dispatch((0, _RouterActions.push)(location, state)),
|
|
35
|
+
replace: (location, state) => dispatch((0, _RouterActions.replace)(location, state)),
|
|
36
|
+
go: delta => dispatch((0, _RouterActions.go)(delta)),
|
|
37
|
+
goBack: () => dispatch((0, _RouterActions.goBack)()),
|
|
38
|
+
goForward: () => dispatch((0, _RouterActions.goForward)())
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
exports.useNavigation = useNavigation;
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
import { useDispatch, useSelector } from "react-redux";
|
|
3
3
|
import type { Location, LocationShape } from "react-router";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
push,
|
|
7
|
+
replace,
|
|
8
|
+
go,
|
|
9
|
+
goBack,
|
|
10
|
+
goForward,
|
|
11
|
+
} from "../redux/_router/RouterActions";
|
|
6
12
|
import type {
|
|
7
13
|
GoAction,
|
|
8
14
|
GoBackAction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","names":["useLocation","useSelector","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","useDispatch","push","replace","go","delta","goBack","goForward"],"sources":["../../src/hooks/useRouter.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport type { Location, LocationShape } from \"react-router\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"useRouter.js","names":["useLocation","useSelector","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","useDispatch","push","replace","go","delta","goBack","goForward"],"sources":["../../src/hooks/useRouter.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport type { Location, LocationShape } from \"react-router\";\n\nimport {\n push,\n replace,\n go,\n goBack,\n goForward,\n} from \"../redux/_router/RouterActions\";\nimport type {\n GoAction,\n GoBackAction,\n GoForwardAction,\n PushAction,\n ReplaceAction,\n} from \"../redux\";\n\ntype UseLocationHook = () => Location;\ntype UseLocationKeyHook = () => string;\ntype UseQuerystringHook = () => string;\ntype UsePathnameHook = () => string;\ntype UseNavigationHook = () => {\n push: (location: LocationShape | string, state?: { ... }) => PushAction,\n replace: (location: LocationShape | string, state?: { ... }) => ReplaceAction,\n go: (delta: number) => GoAction,\n goBack: () => GoBackAction,\n goForward: () => GoForwardAction,\n};\n\n/**\n */\nexport const useLocation: UseLocationHook = () =>\n useSelector((state) => state.router.location);\n\n/**\n */\nexport const useLocationKey: UseLocationKeyHook = () =>\n useLocation()?.key ?? \"\";\n\n/**\n */\nexport const useQuerystring: UseQuerystringHook = () => useLocation()?.search;\n\n/**\n */\nexport const usePathname: UsePathnameHook = () => useLocation()?.pathname;\n\n/**\n */\nexport const useNavigation: UseNavigationHook = () => {\n const dispatch = useDispatch();\n\n return {\n push: (location: LocationShape | string, state?: { ... }) =>\n dispatch(push(location, state)),\n replace: (location: LocationShape | string, state?: { ... }) =>\n dispatch(replace(location, state)),\n go: (delta: number) => dispatch(go(delta)),\n goBack: () => dispatch(goBack()),\n goForward: () => dispatch(goForward()),\n };\n};\n"],"mappings":";;;;;;AACA;AAGA;AA2BA;AACA;AACO,MAAMA,WAA4B,GAAG,MAC1C,IAAAC,uBAAW,EAAEC,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAChDL,WAAW,EAAE,EAAEM,GAAG,IAAI,EAAE;;AAE1B;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAAMP,WAAW,EAAE,EAAEQ,MAAM;;AAE7E;AACA;AADA;AAEO,MAAMC,WAA4B,GAAG,MAAMT,WAAW,EAAE,EAAEU,QAAQ;;AAEzE;AACA;AADA;AAEO,MAAMC,aAAgC,GAAG,MAAM;EACpD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAE9B,OAAO;IACLC,IAAI,EAAE,CAACV,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAC,IAAAE,mBAAI,EAACV,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCa,OAAO,EAAE,CAACX,QAAgC,EAAEF,KAAe,KACzDU,QAAQ,CAAC,IAAAG,sBAAO,EAACX,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACpCc,EAAE,EAAGC,KAAa,IAAKL,QAAQ,CAAC,IAAAI,iBAAE,EAACC,KAAK,CAAC,CAAC;IAC1CC,MAAM,EAAE,MAAMN,QAAQ,CAAC,IAAAM,qBAAM,GAAE,CAAC;IAChCC,SAAS,EAAE,MAAMP,QAAQ,CAAC,IAAAO,wBAAS,GAAE;EACvC,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -63,7 +63,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
*/
|
|
66
|
-
processLayoutHintRules() {
|
|
66
|
+
processLayoutHintRules(): void {
|
|
67
67
|
this.all.forEach((attribute) => {
|
|
68
68
|
attribute.processLayoutHintRules(this);
|
|
69
69
|
});
|
|
@@ -157,14 +157,14 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
|
|
|
157
157
|
/**
|
|
158
158
|
* Replace an attribute instance in the collection with a new attribute instance
|
|
159
159
|
*/
|
|
160
|
-
replace(oldAttribute: AttributeType, newAttribute: AttributeType) {
|
|
160
|
+
replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {
|
|
161
161
|
this.replaceByKey(oldAttribute.key, newAttribute);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* Replace an attribute by the key of the attribute
|
|
166
166
|
*/
|
|
167
|
-
replaceByKey(key: string, newAttribute: AttributeType) {
|
|
167
|
+
replaceByKey(key: string, newAttribute: AttributeType): void {
|
|
168
168
|
this.forEach((attribute, index) => {
|
|
169
169
|
if (attribute.key === key) {
|
|
170
170
|
this.collection[index] = newAttribute;
|
|
@@ -176,7 +176,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
|
|
|
176
176
|
* Set reference date by replacing an old attribute with a new attribute with a reference Date
|
|
177
177
|
* Date is a string in ISO format yyyy-MM-dd
|
|
178
178
|
*/
|
|
179
|
-
setReferenceDate(date: string) {
|
|
179
|
+
setReferenceDate(date: string): void {
|
|
180
180
|
this.forEach((attribute) => {
|
|
181
181
|
const newAttribute = attribute.clone();
|
|
182
182
|
|
|
@@ -194,7 +194,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
|
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
*/
|
|
197
|
-
addServerError(error: FormErrorAnchor) {
|
|
197
|
+
addServerError(error: FormErrorAnchor): void {
|
|
198
198
|
const elementid = error?.anchor?.elementid;
|
|
199
199
|
|
|
200
200
|
if (elementid) {
|
|
@@ -244,7 +244,9 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
|
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
246
|
*/
|
|
247
|
-
indicateContentConfiguration(
|
|
247
|
+
indicateContentConfiguration(
|
|
248
|
+
contentConfiguration: ContentConfiguration
|
|
249
|
+
): void {
|
|
248
250
|
if (contentConfiguration) {
|
|
249
251
|
this.all.forEach((attribute) => {
|
|
250
252
|
attribute.indicateContentConfiguration(contentConfiguration);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeCollection.js","names":["AttributeCollection","ResourceCollection","constructor","data","contributions","isReadonly","forEach","contribution","key","attribute","createAttribute","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","isHidden","questions","isResult","results","getAttributeByAttribute","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","hints","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","validationData","attributesFormData","isVisible","getEmptyFormData","attributeFormData"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor } from \"../types\";\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n isReadonly: boolean = false\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key]);\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules() {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType) {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType) {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string) {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor) {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(contentConfiguration: ContentConfiguration) {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData)\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n\nexport default AttributeCollection;\n"],"mappings":";;;;;;;;;;;;AACA;AAEA;AAEA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,SAASC,2BAAkB,CAAgB;EAClEC,WAAW,GAIT;IAAA,IAHAC,IAA4B,uEAAG,CAAC,CAAC;IAAA,IACjCC,aAA4B,uEAAG,EAAE;IAAA,IACjCC,UAAmB,uEAAG,KAAK;IAE3B,KAAK,EAAE;IAEP,IAAID,aAAa,EAAE;MACjBA,aAAa,CAACE,OAAO,CAAEC,YAAY,IAAK;QACtC,MAAM,CAACC,GAAG,CAAC,GAAG,mBAAYD,YAAY,CAAC;QAEvC,MAAME,SAAS,GAAG,IAAAC,wBAAe,EAACF,GAAG,EAAEL,IAAI,EAAEI,YAAY,CAACC,GAAG,CAAC,CAAC;QAE/D,IAAIC,SAAS,KAAK,IAAI,EAAE;UACtB;UACA,IAAIJ,UAAU,IAAI,CAAC,IAAAM,YAAG,EAACJ,YAAY,CAACC,GAAG,CAAC,EAAE,UAAU,CAAC,EAAE;YACrDC,SAAS,CAACG,QAAQ,GAAG,IAAI;UAC3B;UAEA,IAAI,CAACC,UAAU,CAACC,IAAI,CAACL,SAAS,CAAC;QACjC;MACF,CAAC,CAAC;MAEF,IAAI,CAACM,sBAAsB,EAAE;IAC/B;EACF;;EAEA;AACF;AACA;AACA;AACA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EAAE;QACvB,OAAO3D,SAAS,CAACuD,QAAQ;MAC3B;MAEA,OAAOvD,SAAS,CAAC4D,gBAAgB,EAAE;IACrC,CAAC,CAAC;IAEJ,IAAIlE,IAAI,GAAG,CAAC,CAAC;IACbgE,kBAAkB,CAAC7D,OAAO,CAAEgE,iBAAiB,IAAK;MAChD;MACA;MACAnE,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAGmE;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAOnE,IAAI;EACb;AACF;AAAC,eAEcH,mBAAmB;AAAA"}
|
|
1
|
+
{"version":3,"file":"AttributeCollection.js","names":["AttributeCollection","ResourceCollection","constructor","data","contributions","isReadonly","forEach","contribution","key","attribute","createAttribute","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","isHidden","questions","isResult","results","getAttributeByAttribute","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","hints","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","validationData","attributesFormData","isVisible","getEmptyFormData","attributeFormData"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor } from \"../types\";\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n isReadonly: boolean = false\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key]);\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules(): void {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType): void {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string): void {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor): void {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration\n ): void {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData)\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n\nexport default AttributeCollection;\n"],"mappings":";;;;;;;;;;;;AACA;AAEA;AAEA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,SAASC,2BAAkB,CAAgB;EAClEC,WAAW,GAIT;IAAA,IAHAC,IAA4B,uEAAG,CAAC,CAAC;IAAA,IACjCC,aAA4B,uEAAG,EAAE;IAAA,IACjCC,UAAmB,uEAAG,KAAK;IA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AAIA,oBAAoB,EAAE;MACxB,IAAI,CAAC9C,GAAG,CAACX,OAAO,CAAEG,SAAS,IAAK;QAC9BA,SAAS,CAACqD,4BAA4B,CAACC,oBAAoB,CAAC;MAC9D,CAAC,CAAC;IACJ;EACF;;EAEA;AACF;AACA;AACA;EACE,IAAIC,QAAQ,GAA6B;IACvC,OAAO,IAAI,CAACC,WAAW,CAAC,KAAK,CAAC;EAChC;;EAEA;AACF;EACEA,WAAW,GAA4D;IAAA;IAAA,IAA3DC,cAAuB,uEAAG,KAAK;IACzC,MAAMC,kBAAkB,GAAG,oEAAI,CAACnD,UAAU,mBAErCP,SAAS,IACRA,SAAS,CAACuD,QAAQ,KAAK,IAAI,IAC3B,CAACvD,SAAS,CAACG,QAAQ,KAClB,CAACsD,cAAc,IAAIzD,SAAS,CAACgD,wBAAwB,CAAC,CAC1D,kBACKhD,SAAS,IAAK;MAClB;MACA,IAAIA,SAAS,CAAC2D,SAAS,EAAE;QACvB,OAAO3D,SAAS,CAACuD,QAAQ;MAC3B;MAEA,OAAOvD,SAAS,CAAC4D,gBAAgB,EAAE;IACrC,CAAC,CAAC;IAEJ,IAAIlE,IAAI,GAAG,CAAC,CAAC;IACbgE,kBAAkB,CAAC7D,OAAO,CAAEgE,iBAAiB,IAAK;MAChD;MACA;MACAnE,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAGmE;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAOnE,IAAI;EACb;AACF;AAAC,eAEcH,mBAAmB;AAAA"}
|
|
@@ -144,7 +144,7 @@ export default class AttributeModel
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
*/
|
|
147
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
147
|
+
setChildModels(models: Array<ModularUIModel>): void {
|
|
148
148
|
const conceptHref = this.conceptLink?.href;
|
|
149
149
|
if (conceptHref) {
|
|
150
150
|
this.concept = models.find((model) =>
|
|
@@ -214,7 +214,9 @@ export default class AttributeModel
|
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
216
|
*/
|
|
217
|
-
indicateContentConfiguration(
|
|
217
|
+
indicateContentConfiguration(
|
|
218
|
+
contentConfiguration: ContentConfiguration
|
|
219
|
+
): void {
|
|
218
220
|
if (contentConfiguration) {
|
|
219
221
|
const hasQuestionConfig = contentConfiguration.questions?.hasConfig();
|
|
220
222
|
|
|
@@ -634,7 +636,7 @@ export default class AttributeModel
|
|
|
634
636
|
/**
|
|
635
637
|
* Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
|
|
636
638
|
*/
|
|
637
|
-
setUseClientsideValidation(enabled: boolean) {
|
|
639
|
+
setUseClientsideValidation(enabled: boolean): void {
|
|
638
640
|
this._useClientsideValidation = enabled;
|
|
639
641
|
}
|
|
640
642
|
|
|
@@ -701,14 +703,14 @@ export default class AttributeModel
|
|
|
701
703
|
/**
|
|
702
704
|
* Reset static error messages on attribute
|
|
703
705
|
*/
|
|
704
|
-
resetErrors() {
|
|
706
|
+
resetErrors(): void {
|
|
705
707
|
this._errorCollection = new ErrorCollection("attribute");
|
|
706
708
|
}
|
|
707
709
|
|
|
708
710
|
/**
|
|
709
711
|
* Registers an error that was received from a server response
|
|
710
712
|
*/
|
|
711
|
-
addServerError(error: FormErrorAnchor) {
|
|
713
|
+
addServerError(error: FormErrorAnchor): void {
|
|
712
714
|
this._errorCollection.addServerError(
|
|
713
715
|
error.id,
|
|
714
716
|
error.message,
|
|
@@ -719,7 +721,7 @@ export default class AttributeModel
|
|
|
719
721
|
|
|
720
722
|
/**
|
|
721
723
|
*/
|
|
722
|
-
removeServerError(id: string) {
|
|
724
|
+
removeServerError(id: string): void {
|
|
723
725
|
this._errorCollection.removeServerError(id);
|
|
724
726
|
}
|
|
725
727
|
|
|
@@ -738,13 +740,13 @@ export default class AttributeModel
|
|
|
738
740
|
/**
|
|
739
741
|
* Registers a missing error that was received from the server
|
|
740
742
|
*/
|
|
741
|
-
addMissingError() {
|
|
743
|
+
addMissingError(): void {
|
|
742
744
|
this._errorCollection.addServerError("Constraint.Missing");
|
|
743
745
|
}
|
|
744
746
|
|
|
745
747
|
/**
|
|
746
748
|
*/
|
|
747
|
-
removeMissingError() {
|
|
749
|
+
removeMissingError(): void {
|
|
748
750
|
this.removeServerError("Constraint.Missing");
|
|
749
751
|
}
|
|
750
752
|
|
|
@@ -771,7 +773,7 @@ export default class AttributeModel
|
|
|
771
773
|
return {};
|
|
772
774
|
}
|
|
773
775
|
|
|
774
|
-
const params = {};
|
|
776
|
+
const params: { [name: string]: string | number } = {};
|
|
775
777
|
|
|
776
778
|
Object.keys(parameters).forEach((paramKey: string) => {
|
|
777
779
|
const paramValue = parameters[paramKey];
|
|
@@ -793,7 +795,7 @@ export default class AttributeModel
|
|
|
793
795
|
|
|
794
796
|
/**
|
|
795
797
|
*/
|
|
796
|
-
updateValidations(errors: Array<Object>) {
|
|
798
|
+
updateValidations(errors: Array<Object>): void {
|
|
797
799
|
if (
|
|
798
800
|
errors.some((error) => error.id === "Constraint.Mandatory") ||
|
|
799
801
|
this.layouthint.has(MANDATORY)
|
|
@@ -831,7 +833,7 @@ export default class AttributeModel
|
|
|
831
833
|
/**
|
|
832
834
|
* Set last modification to current timestamp
|
|
833
835
|
*/
|
|
834
|
-
updateLastModification() {
|
|
836
|
+
updateLastModification(): void {
|
|
835
837
|
this._lastModification = Date.now();
|
|
836
838
|
}
|
|
837
839
|
|
|
@@ -847,7 +849,7 @@ export default class AttributeModel
|
|
|
847
849
|
*
|
|
848
850
|
* @abstract
|
|
849
851
|
*/
|
|
850
|
-
reset() {
|
|
852
|
+
reset(): void {
|
|
851
853
|
throw new UnsupportedOperationException(
|
|
852
854
|
`Reset method not implemented for ${this.type}`
|
|
853
855
|
);
|
|
@@ -857,7 +859,7 @@ export default class AttributeModel
|
|
|
857
859
|
* Merge old attribute with the attribute from the server.
|
|
858
860
|
* Readonly attributes always need to show the value from the server
|
|
859
861
|
*/
|
|
860
|
-
mergeAttribute(oldAttribute: AttributeType) {
|
|
862
|
+
mergeAttribute(oldAttribute: AttributeType): void {
|
|
861
863
|
this.concept = oldAttribute.concept;
|
|
862
864
|
|
|
863
865
|
if (
|
|
@@ -916,13 +918,13 @@ export default class AttributeModel
|
|
|
916
918
|
/**
|
|
917
919
|
* Explicitly toggle visibility of this attribute
|
|
918
920
|
*/
|
|
919
|
-
show() {
|
|
921
|
+
show(): void {
|
|
920
922
|
this.isHidden = false;
|
|
921
923
|
}
|
|
922
924
|
|
|
923
925
|
/**
|
|
924
926
|
*/
|
|
925
|
-
hide() {
|
|
927
|
+
hide(): void {
|
|
926
928
|
this.isHidden = true;
|
|
927
929
|
}
|
|
928
930
|
|
|
@@ -956,7 +958,7 @@ export default class AttributeModel
|
|
|
956
958
|
|
|
957
959
|
/**
|
|
958
960
|
*/
|
|
959
|
-
processLayoutHintRules(attributes: AttributeCollection) {
|
|
961
|
+
processLayoutHintRules(attributes: AttributeCollection): void {
|
|
960
962
|
if (this._layoutHintRules) {
|
|
961
963
|
this.layoutHintRules.process(this, attributes);
|
|
962
964
|
}
|