@beinformed/ui 1.63.2 → 1.63.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 +7 -0
- package/esm/constants/Settings.js +3 -14
- package/esm/constants/Settings.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +1 -2
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/hooks/useI18n.js +1 -6
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js +3 -4
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +10 -30
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModularUI.js +4 -5
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +7 -8
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/i18n/Locale.js +2 -5
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +2 -5
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js +9 -10
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/withMessage.js +1 -6
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +3 -6
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +1 -4
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +2 -2
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +4 -14
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +1 -2
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +1 -5
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +2 -2
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +1 -3
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +3 -9
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +2 -8
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +2 -2
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js +2 -2
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +1 -2
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +1 -2
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +1 -4
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +1 -6
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +1 -4
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +1 -2
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +2 -2
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/base/BaseCollection.js +1 -2
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +6 -9
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js +1 -2
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +2 -2
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +1 -2
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +1 -3
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +1 -4
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +1 -3
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +1 -4
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +7 -3
- package/esm/models/concepts/SourceReferenceModel.js.flow +6 -0
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +1 -3
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +2 -2
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +1 -2
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/error/ErrorModel.js +1 -3
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +1 -4
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/form/FormModel.js +3 -9
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +2 -4
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/href/Href.js +3 -6
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js +1 -2
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +3 -10
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js +6 -15
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/list/ListModel.js +2 -2
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCategoryCollection.js +1 -2
- package/esm/models/modelcatalog/ModelCategoryCollection.js.map +1 -1
- package/esm/models/parameter/Parameter.js +2 -4
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/resolveModel.js +1 -2
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +1 -2
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +2 -2
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +1 -2
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react/ErrorBoundary.js +2 -2
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +13 -16
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/utils.js +1 -3
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js +20 -23
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +9 -13
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +9 -10
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js +7 -8
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +11 -12
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js +11 -12
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +1 -3
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +7 -11
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +3 -10
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js +3 -4
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js +7 -16
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +11 -19
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +10 -16
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +15 -38
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js +7 -22
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/I18nReducer.js +5 -8
- package/esm/redux/_i18n/I18nReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js +19 -23
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js +4 -5
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js +14 -19
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUIUtils.js +1 -2
- package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +1 -2
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/RouterReducer.js +1 -3
- package/esm/redux/_router/RouterReducer.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +34 -37
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +1 -2
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/Preferences.js +8 -15
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +3 -6
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +4 -7
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +3 -6
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +4 -7
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +5 -8
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +4 -5
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js +5 -8
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +3 -6
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +3 -6
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +5 -6
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +3 -6
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/Tab.js +3 -6
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +1 -3
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js +1 -3
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js +1 -3
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/ModelCatalogReducer.js +1 -3
- package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js +1 -3
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js +1 -3
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js +1 -3
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js +1 -3
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/utils/browser/Cache.js +1 -5
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +45 -91
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/xhr.js +1 -2
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/repositoryResource.js +1 -3
- package/esm/utils/helpers/repositoryResource.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js +3 -4
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js +1 -2
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js +1 -4
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +2 -6
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/constants/Settings.js +3 -14
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +1 -2
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/hooks/useI18n.js +1 -6
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js +3 -4
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +10 -30
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModularUI.js +4 -5
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +7 -8
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/i18n/Locale.js +2 -5
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +2 -5
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +9 -10
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/withMessage.js +1 -6
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +3 -6
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +1 -4
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +2 -2
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +4 -14
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +1 -2
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +1 -5
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +2 -2
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +1 -3
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +3 -9
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -8
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +2 -2
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js +2 -2
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +1 -2
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +1 -2
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +1 -4
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +1 -6
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +1 -4
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +1 -2
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +2 -2
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/base/BaseCollection.js +1 -2
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +6 -9
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js +1 -2
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +2 -2
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +1 -2
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +1 -3
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +1 -4
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +1 -3
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +1 -4
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +7 -3
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +1 -3
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +2 -2
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +1 -2
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/error/ErrorModel.js +1 -3
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +1 -4
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/form/FormModel.js +3 -9
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +2 -4
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/href/Href.js +3 -6
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js +1 -2
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js +3 -10
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js +6 -15
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/list/ListModel.js +2 -2
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCategoryCollection.js +1 -2
- package/lib/models/modelcatalog/ModelCategoryCollection.js.map +1 -1
- package/lib/models/parameter/Parameter.js +2 -4
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/resolveModel.js +1 -2
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +1 -2
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +2 -2
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +1 -2
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react/ErrorBoundary.js +2 -2
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +13 -16
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/utils.js +1 -3
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js +20 -23
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +9 -13
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +9 -10
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +7 -8
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +11 -12
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +11 -12
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +1 -3
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +7 -11
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +3 -10
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js +3 -4
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js +7 -16
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +11 -19
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +10 -16
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +15 -38
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js +7 -22
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/I18nReducer.js +5 -8
- package/lib/redux/_i18n/I18nReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js +19 -23
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +4 -5
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js +14 -19
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js +1 -2
- package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +1 -2
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/RouterReducer.js +1 -3
- package/lib/redux/_router/RouterReducer.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +34 -37
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +1 -2
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/Preferences.js +8 -15
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +3 -6
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +4 -7
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +3 -6
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +4 -7
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +5 -8
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +4 -5
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +5 -8
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +3 -6
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +3 -6
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +5 -6
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +3 -6
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/Tab.js +3 -6
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +1 -3
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +1 -3
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +1 -3
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/ModelCatalogReducer.js +1 -3
- package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +1 -3
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +1 -3
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +1 -3
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/store/beforeRenderHooks.js +1 -3
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/utils/browser/Cache.js +1 -5
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +45 -91
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/xhr.js +1 -2
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/repositoryResource.js +1 -3
- package/lib/utils/helpers/repositoryResource.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js +3 -4
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/number/DecimalFormat.js +1 -2
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +1 -4
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +2 -6
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +22 -22
- package/src/models/concepts/SourceReferenceModel.js +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelCatalogReducer.js","names":["_Cache","_interopRequireDefault","require","initialState","entryDate","Date","toISOString","split","ModelCatalogReducer","state","
|
|
1
|
+
{"version":3,"file":"ModelCatalogReducer.js","names":["_Cache","_interopRequireDefault","require","initialState","entryDate","Date","toISOString","split","ModelCatalogReducer","state","action","type","Cache","addItem","payload","_default","exports","default"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst initialState: ModelCatalogState = {\n entryDate: new Date().toISOString().split(\"T\")[0],\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,MAAMC,YAA+B,GAAG;EACtCC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAGA,CACnEC,KAAK,GAAGN,YAAY,EACpBO,MAAM,KACH;EACH,IAAI,CAACA,MAAM,EAAE;IACX,OAAOD,KAAK;EACd;EAEA,QAAQC,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBC,cAAK,CAACC,OAAO,CAAC,uBAAuB,EAAEH,MAAM,CAACI,OAAO,CAAC;MACtD,OAAO;QACL,GAAGL,KAAK;QACRL,SAAS,EAAEM,MAAM,CAACI;MACpB,CAAC;IACH;MACE,OAAOL,KAAK;EAChB;AACF,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaT,mBAAmB","ignoreList":[]}
|
|
@@ -15,9 +15,7 @@ const initialState = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Form reducer
|
|
17
17
|
*/
|
|
18
|
-
const NotificationReducer =
|
|
19
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
20
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
18
|
+
const NotificationReducer = (state = initialState, action) => {
|
|
21
19
|
if (!action) {
|
|
22
20
|
return state;
|
|
23
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationReducer.js","names":["initialState","render","messageType","message","error","NotificationReducer","state","
|
|
1
|
+
{"version":3,"file":"NotificationReducer.js","names":["initialState","render","messageType","message","error","NotificationReducer","state","action","type","payload","_default","exports","default"],"sources":["../../../src/redux/reducers/NotificationReducer.js"],"sourcesContent":["// @flow\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, NotificationState } from \"../types\";\n\n// REDUCER\nconst initialState: NotificationState = {\n render: false,\n messageType: null,\n message: null,\n error: null,\n};\n\n/**\n * Form reducer\n */\nconst NotificationReducer: Reducer<NotificationState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"DISMISS_NOTIFICATION\":\n return {\n ...state,\n render: false,\n };\n\n case \"SHOW_NOTIFICATION\":\n return {\n ...state,\n render: true,\n messageType: action.payload.type,\n message: action.payload.message,\n error: action.payload.error,\n };\n\n default:\n return state;\n }\n};\n\nexport default NotificationReducer;\n"],"mappings":";;;;;;AAIA;AACA,MAAMA,YAA+B,GAAG;EACtCC,MAAM,EAAE,KAAK;EACbC,WAAW,EAAE,IAAI;EACjBC,OAAO,EAAE,IAAI;EACbC,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAGA,CACnEC,KAAK,GAAGN,YAAY,EACpBO,MAAM,KACH;EACH,IAAI,CAACA,MAAM,EAAE;IACX,OAAOD,KAAK;EACd;EAEA,QAAQC,MAAM,CAACC,IAAI;IACjB,KAAK,sBAAsB;MACzB,OAAO;QACL,GAAGF,KAAK;QACRL,MAAM,EAAE;MACV,CAAC;IAEH,KAAK,mBAAmB;MACtB,OAAO;QACL,GAAGK,KAAK;QACRL,MAAM,EAAE,IAAI;QACZC,WAAW,EAAEK,MAAM,CAACE,OAAO,CAACD,IAAI;QAChCL,OAAO,EAAEI,MAAM,CAACE,OAAO,CAACN,OAAO;QAC/BC,KAAK,EAAEG,MAAM,CAACE,OAAO,CAACL;MACxB,CAAC;IAEH;MACE,OAAOE,KAAK;EAChB;AACF,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaP,mBAAmB","ignoreList":[]}
|
|
@@ -9,9 +9,7 @@ const initialState = {};
|
|
|
9
9
|
/**
|
|
10
10
|
* Pref reducer
|
|
11
11
|
*/
|
|
12
|
-
const PreferencesReducer =
|
|
13
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
14
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
12
|
+
const PreferencesReducer = (state = initialState, action) => {
|
|
15
13
|
if (action?.type === "SET_PREFERENCE") {
|
|
16
14
|
return {
|
|
17
15
|
...state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesReducer.js","names":["initialState","PreferencesReducer","state","
|
|
1
|
+
{"version":3,"file":"PreferencesReducer.js","names":["initialState","PreferencesReducer","state","action","type","payload","_default","exports","default"],"sources":["../../../src/redux/reducers/PreferencesReducer.js"],"sourcesContent":["// @flow\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, PreferencesState } from \"../types\";\n\nconst initialState: $Shape<PreferencesState> = {};\n\n/**\n * Pref reducer\n */\nconst PreferencesReducer: Reducer<PreferencesState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (action?.type === \"SET_PREFERENCE\") {\n return {\n ...state,\n ...action.payload,\n };\n }\n\n if (action?.type === \"SET_PREFERENCES\") {\n return {\n ...state,\n ...action.payload,\n };\n }\n\n return state;\n};\n\nexport default PreferencesReducer;\n"],"mappings":";;;;;;AAIA,MAAMA,YAAsC,GAAG,CAAC,CAAC;;AAEjD;AACA;AACA;AACA,MAAMC,kBAA0D,GAAGA,CACjEC,KAAK,GAAGF,YAAY,EACpBG,MAAM,KACH;EACH,IAAIA,MAAM,EAAEC,IAAI,KAAK,gBAAgB,EAAE;IACrC,OAAO;MACL,GAAGF,KAAK;MACR,GAAGC,MAAM,CAACE;IACZ,CAAC;EACH;EAEA,IAAIF,MAAM,EAAEC,IAAI,KAAK,iBAAiB,EAAE;IACtC,OAAO;MACL,GAAGF,KAAK;MACR,GAAGC,MAAM,CAACE;IACZ,CAAC;EACH;EAEA,OAAOH,KAAK;AACd,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaP,kBAAkB","ignoreList":[]}
|
|
@@ -23,9 +23,7 @@ const finishProgress = state => {
|
|
|
23
23
|
/**
|
|
24
24
|
* Keep state for the progress indicator
|
|
25
25
|
*/
|
|
26
|
-
const progressIndicatorReducer =
|
|
27
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
28
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
26
|
+
const progressIndicatorReducer = (state = initialState, action) => {
|
|
29
27
|
if (!action) {
|
|
30
28
|
return state;
|
|
31
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressIndicatorReducer.js","names":["initialState","count","timestamp","percentComplete","finishProgress","state","isFinalFinish","Date","now","progressIndicatorReducer","
|
|
1
|
+
{"version":3,"file":"ProgressIndicatorReducer.js","names":["initialState","count","timestamp","percentComplete","finishProgress","state","isFinalFinish","Date","now","progressIndicatorReducer","action","type","payload","_default","exports","default"],"sources":["../../../src/redux/reducers/ProgressIndicatorReducer.js"],"sourcesContent":["// @flow\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ProgressIndicatorState } from \"../types\";\n\n// REDUCER\nconst initialState: ProgressIndicatorState = {\n count: 0,\n timestamp: 0,\n percentComplete: 0,\n};\n\nconst finishProgress = (state: ProgressIndicatorState) => {\n const isFinalFinish = state.count - 1 === 0;\n return {\n ...state,\n count: state.count <= 0 ? 0 : state.count - 1,\n timestamp: isFinalFinish ? Date.now() : state.timestamp,\n percentComplete: isFinalFinish ? 0 : state.percentComplete,\n };\n};\n\n/**\n * Keep state for the progress indicator\n */\nconst progressIndicatorReducer: Reducer<ProgressIndicatorState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_PROGRESS\":\n return {\n ...state,\n percentComplete: action.payload?.percentComplete,\n };\n\n case \"FINISH_PROGRESS\":\n return finishProgress(state);\n\n case \"START_PROGRESS\":\n return {\n ...state,\n count: state.count + 1,\n };\n\n case \"RESET_PROGRESS\":\n return {\n ...state,\n count: 0,\n };\n\n default:\n return state;\n }\n};\n\nexport default progressIndicatorReducer;\n"],"mappings":";;;;;;AAIA;AACA,MAAMA,YAAoC,GAAG;EAC3CC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,eAAe,EAAE;AACnB,CAAC;AAED,MAAMC,cAAc,GAAIC,KAA6B,IAAK;EACxD,MAAMC,aAAa,GAAGD,KAAK,CAACJ,KAAK,GAAG,CAAC,KAAK,CAAC;EAC3C,OAAO;IACL,GAAGI,KAAK;IACRJ,KAAK,EAAEI,KAAK,CAACJ,KAAK,IAAI,CAAC,GAAG,CAAC,GAAGI,KAAK,CAACJ,KAAK,GAAG,CAAC;IAC7CC,SAAS,EAAEI,aAAa,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGH,KAAK,CAACH,SAAS;IACvDC,eAAe,EAAEG,aAAa,GAAG,CAAC,GAAGD,KAAK,CAACF;EAC7C,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA,MAAMM,wBAAsE,GAAGA,CAC7EJ,KAAK,GAAGL,YAAY,EACpBU,MAAM,KACH;EACH,IAAI,CAACA,MAAM,EAAE;IACX,OAAOL,KAAK;EACd;EAEA,QAAQK,MAAM,CAACC,IAAI;IACjB,KAAK,iBAAiB;MACpB,OAAO;QACL,GAAGN,KAAK;QACRF,eAAe,EAAEO,MAAM,CAACE,OAAO,EAAET;MACnC,CAAC;IAEH,KAAK,iBAAiB;MACpB,OAAOC,cAAc,CAACC,KAAK,CAAC;IAE9B,KAAK,gBAAgB;MACnB,OAAO;QACL,GAAGA,KAAK;QACRJ,KAAK,EAAEI,KAAK,CAACJ,KAAK,GAAG;MACvB,CAAC;IAEH,KAAK,gBAAgB;MACnB,OAAO;QACL,GAAGI,KAAK;QACRJ,KAAK,EAAE;MACT,CAAC;IAEH;MACE,OAAOI,KAAK;EAChB;AACF,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaN,wBAAwB","ignoreList":[]}
|
|
@@ -11,9 +11,7 @@ exports.handleBeforeRenderHooks = void 0;
|
|
|
11
11
|
* for example server preferences, and the request is available to retrieve request information
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
const handleBeforeRenderHooks =
|
|
15
|
-
let beforeRenderHooks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
|
-
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
14
|
+
const handleBeforeRenderHooks = (beforeRenderHooks = [], props) => {
|
|
17
15
|
if (beforeRenderHooks.length > 0) {
|
|
18
16
|
for (const beforeRenderHook of beforeRenderHooks) {
|
|
19
17
|
beforeRenderHook(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beforeRenderHooks.js","names":["handleBeforeRenderHooks","beforeRenderHooks","
|
|
1
|
+
{"version":3,"file":"beforeRenderHooks.js","names":["handleBeforeRenderHooks","beforeRenderHooks","props","length","beforeRenderHook","exports"],"sources":["../../../src/redux/store/beforeRenderHooks.js"],"sourcesContent":["// @flow\nimport type { ReduxStore } from \"../types\";\n\nexport type BeforeRenderHookProps = {\n store: ReduxStore,\n request?: HttpServletRequestJava,\n};\nexport type BeforeRenderHook = (props: BeforeRenderHookProps) => void;\n\n/**\n * Process handlers that need to be run before the react application starts,\n * for example to start a third party service<br>\n * An object with the store is available to make it possible to read state available in the redux store,\n * for example server preferences, and the request is available to retrieve request information\n *\n */\nexport const handleBeforeRenderHooks = (\n beforeRenderHooks: Array<BeforeRenderHook> = [],\n props: BeforeRenderHookProps,\n) => {\n if (beforeRenderHooks.length > 0) {\n for (const beforeRenderHook of beforeRenderHooks) {\n beforeRenderHook(props);\n }\n }\n};\n"],"mappings":";;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,uBAAuB,GAAGA,CACrCC,iBAA0C,GAAG,EAAE,EAC/CC,KAA4B,KACzB;EACH,IAAID,iBAAiB,CAACE,MAAM,GAAG,CAAC,EAAE;IAChC,KAAK,MAAMC,gBAAgB,IAAIH,iBAAiB,EAAE;MAChDG,gBAAgB,CAACF,KAAK,CAAC;IACzB;EACF;AACF,CAAC;AAACG,OAAA,CAAAL,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -134,11 +134,7 @@ class Cache {
|
|
|
134
134
|
var _context2;
|
|
135
135
|
// receive sessionstorage from other tabs
|
|
136
136
|
const newData = e.newValue ? JSON.parse(e.newValue) : {};
|
|
137
|
-
(0, _filter.default)(_context2 = (0, _entries.default)(newData)).call(_context2,
|
|
138
|
-
let [key] = _ref;
|
|
139
|
-
return !this.hasItem(key) && !(0, _startsWith.default)(key).call(key, RESOURCE_CACHE_PREFIX);
|
|
140
|
-
}).forEach(_ref2 => {
|
|
141
|
-
let [key, value] = _ref2;
|
|
137
|
+
(0, _filter.default)(_context2 = (0, _entries.default)(newData)).call(_context2, ([key]) => !this.hasItem(key) && !(0, _startsWith.default)(key).call(key, RESOURCE_CACHE_PREFIX)).forEach(([key, value]) => {
|
|
142
138
|
this.addItem(key, value);
|
|
143
139
|
});
|
|
144
140
|
this.setItem("sessionStorageCopied", Date.now().toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.js","names":["RESOURCE_CACHE_PREFIX","Cache","constructor","_defineProperty2","default","sessionStorage","_cache","createResourceKey","requestArgs","resourceKey","url","params","locale","getItem","key","cache","cacheItem","JSON","parse","error","hasItem","addItem","value","stringValue","_stringify","setItem","removeItem","clear","pattern","_context","_filter","_keys","call","k","RegExp","test","forEach","loadOtherBrowserTabs","callback","window","addEventListener","e","sendSessionStorage","receiveSessionStorage","length","localStorage","Date","now","toString","_context2","newData","newValue","_entries","
|
|
1
|
+
{"version":3,"file":"Cache.js","names":["RESOURCE_CACHE_PREFIX","Cache","constructor","_defineProperty2","default","sessionStorage","_cache","createResourceKey","requestArgs","resourceKey","url","params","locale","getItem","key","cache","cacheItem","JSON","parse","error","hasItem","addItem","value","stringValue","_stringify","setItem","removeItem","clear","pattern","_context","_filter","_keys","call","k","RegExp","test","forEach","loadOtherBrowserTabs","callback","window","addEventListener","e","sendSessionStorage","receiveSessionStorage","length","localStorage","Date","now","toString","_context2","newData","newValue","_entries","_startsWith","_default","exports"],"sources":["../../../src/utils/browser/Cache.js"],"sourcesContent":["// @flow\nimport type { RequestOptions } from \"../fetch/types\";\n\nconst RESOURCE_CACHE_PREFIX = \"res:\";\n\n/**\n * Manage the browser cache\n */\nclass Cache {\n _cache: Storage;\n\n /**\n */\n constructor() {\n if (typeof sessionStorage !== \"undefined\") {\n this._cache = sessionStorage;\n }\n }\n\n /**\n * Create a key that can be used to cache resources, needs the request arguments and uses url, params and header of the request args\n * to create a key that is unique for time versions and locale\n */\n createResourceKey(requestArgs: RequestOptions): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return `${RESOURCE_CACHE_PREFIX}${resourceKey}`;\n }\n\n /**\n * Get a cached item by it's key\n */\n getItem(key: string): any {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (error) {\n return this._cache.getItem(key);\n }\n }\n\n /**\n * Check if the item with key exists in the browser cache\n */\n hasItem(key: string): boolean {\n return this.getItem(key) !== null;\n }\n\n /**\n * Add an item to the cache\n */\n addItem(key: string, value: string | Object) {\n const stringValue =\n typeof value === \"string\" ? value : JSON.stringify(value);\n\n this._cache.setItem(key, stringValue);\n }\n\n /**\n */\n setItem(key: string, value: string | Object) {\n this.addItem(key, value);\n }\n\n /**\n */\n removeItem(key: string) {\n this._cache.removeItem(key);\n }\n\n /**\n * Clear complete cache storage\n */\n clear(pattern: ?string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache.removeItem(k));\n } else {\n this._cache.clear();\n }\n }\n\n // Session storage is not available between different tabs in the same window,\n // this load method copies sessionStorage from other tabs into this tab using localStorage\n // see https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/\n /**\n */\n loadOtherBrowserTabs(callback: Function) {\n window.addEventListener(\"storage\", (e) => {\n this.sendSessionStorage(e);\n this.receiveSessionStorage(e, callback);\n });\n\n if (this._cache.length === 0) {\n // trigger retrieval of sessionstorage on other tabs\n localStorage.setItem(\"getSessionStorage\", Date.now().toString());\n }\n }\n\n /**\n */\n sendSessionStorage(e: StorageEvent) {\n if (e.key === \"getSessionStorage\") {\n localStorage.setItem(\"sessionStorage\", JSON.stringify(this._cache));\n localStorage.removeItem(\"sessionStorage\");\n }\n }\n\n /**\n */\n receiveSessionStorage(e: StorageEvent, callback: Function): any {\n if (e.key === \"sessionStorage\" && !this.getItem(\"sessionStorageCopied\")) {\n // receive sessionstorage from other tabs\n const newData = e.newValue ? JSON.parse(e.newValue) : {};\n Object.entries(newData)\n .filter(\n ([key]) =>\n !this.hasItem(key) && !key.startsWith(RESOURCE_CACHE_PREFIX),\n )\n .forEach(([key, value]) => {\n this.addItem(key, value);\n });\n\n this.setItem(\"sessionStorageCopied\", Date.now().toString());\n\n return callback();\n }\n\n return null;\n }\n}\n\nexport default (new Cache(): Cache);\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -36,8 +36,7 @@ var _Cookies = require("../browser/Cookies");
|
|
|
36
36
|
* @hideconstructor
|
|
37
37
|
*/
|
|
38
38
|
class BaseDateTimeUtil {
|
|
39
|
-
constructor(isoFormat) {
|
|
40
|
-
let doOffsets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
39
|
+
constructor(isoFormat, doOffsets = false) {
|
|
41
40
|
(0, _defineProperty2.default)(this, "_isoFormat", void 0);
|
|
42
41
|
(0, _defineProperty2.default)(this, "_doOffsets", void 0);
|
|
43
42
|
(0, _defineProperty2.default)(this, "_timeZone", typeof Intl === "undefined" ? "Etc/UTC" : Intl.DateTimeFormat().resolvedOptions().timeZone || "Etc/UTC");
|
|
@@ -115,8 +114,7 @@ class BaseDateTimeUtil {
|
|
|
115
114
|
|
|
116
115
|
/**
|
|
117
116
|
*/
|
|
118
|
-
toDate(date) {
|
|
119
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
117
|
+
toDate(date, inputFormat = this.getIsoFormat()) {
|
|
120
118
|
if (date instanceof Date) {
|
|
121
119
|
return date;
|
|
122
120
|
}
|
|
@@ -133,8 +131,7 @@ class BaseDateTimeUtil {
|
|
|
133
131
|
|
|
134
132
|
/**
|
|
135
133
|
*/
|
|
136
|
-
toFormat(date, targetFormat) {
|
|
137
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
134
|
+
toFormat(date, targetFormat, inputFormat = this.getIsoFormat()) {
|
|
138
135
|
const {
|
|
139
136
|
weekStartsOn
|
|
140
137
|
} = this.getOptions();
|
|
@@ -151,8 +148,7 @@ class BaseDateTimeUtil {
|
|
|
151
148
|
|
|
152
149
|
/**
|
|
153
150
|
*/
|
|
154
|
-
toISO(date) {
|
|
155
|
-
let sourceFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
151
|
+
toISO(date, sourceFormat = this.getIsoFormat()) {
|
|
156
152
|
return this.toFormat(date, this.getIsoFormat(), sourceFormat);
|
|
157
153
|
}
|
|
158
154
|
|
|
@@ -181,8 +177,7 @@ class BaseDateTimeUtil {
|
|
|
181
177
|
|
|
182
178
|
/**
|
|
183
179
|
*/
|
|
184
|
-
isValid(date) {
|
|
185
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
180
|
+
isValid(date, inputFormat = this.getIsoFormat()) {
|
|
186
181
|
if (!date) {
|
|
187
182
|
return false;
|
|
188
183
|
}
|
|
@@ -192,50 +187,43 @@ class BaseDateTimeUtil {
|
|
|
192
187
|
|
|
193
188
|
/**
|
|
194
189
|
*/
|
|
195
|
-
isAfter(inputDate, afterISODate) {
|
|
196
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
190
|
+
isAfter(inputDate, afterISODate, inputFormat = this.getIsoFormat()) {
|
|
197
191
|
return afterISODate != null && (0, _isAfter.isAfter)(this.toDate(inputDate, inputFormat), this.toDate(afterISODate));
|
|
198
192
|
}
|
|
199
193
|
|
|
200
194
|
/**
|
|
201
195
|
*/
|
|
202
|
-
isSameOrAfter(inputDate, afterISODate) {
|
|
203
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
196
|
+
isSameOrAfter(inputDate, afterISODate, inputFormat = this.getIsoFormat()) {
|
|
204
197
|
return afterISODate != null && (this.isAfter(inputDate, afterISODate, inputFormat) || this.isSame(inputDate, afterISODate, inputFormat));
|
|
205
198
|
}
|
|
206
199
|
|
|
207
200
|
/**
|
|
208
201
|
*/
|
|
209
|
-
isBefore(inputDate, beforeISODate) {
|
|
210
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
202
|
+
isBefore(inputDate, beforeISODate, inputFormat = this.getIsoFormat()) {
|
|
211
203
|
return beforeISODate != null && (0, _isBefore.isBefore)(this.toDate(inputDate, inputFormat), this.toDate(beforeISODate));
|
|
212
204
|
}
|
|
213
205
|
|
|
214
206
|
/**
|
|
215
207
|
*/
|
|
216
|
-
isSameOrBefore(inputDate, beforeISODate) {
|
|
217
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
208
|
+
isSameOrBefore(inputDate, beforeISODate, inputFormat = this.getIsoFormat()) {
|
|
218
209
|
return beforeISODate != null && (this.isBefore(inputDate, beforeISODate, inputFormat) || this.isSame(inputDate, beforeISODate, inputFormat));
|
|
219
210
|
}
|
|
220
211
|
|
|
221
212
|
/**
|
|
222
213
|
*/
|
|
223
|
-
isSame(inputDate, compareDate) {
|
|
224
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
214
|
+
isSame(inputDate, compareDate, inputFormat = this.getIsoFormat()) {
|
|
225
215
|
return compareDate != null && this.toDate(inputDate, inputFormat).getTime() === this.toDate(compareDate).getTime();
|
|
226
216
|
}
|
|
227
217
|
|
|
228
218
|
/**
|
|
229
219
|
*/
|
|
230
|
-
isSameDay(inputDate, compareDate) {
|
|
231
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
220
|
+
isSameDay(inputDate, compareDate, inputFormat = this.getIsoFormat()) {
|
|
232
221
|
return compareDate != null && (0, _isSameDay.isSameDay)(this.toDate(inputDate, inputFormat), this.toDate(compareDate, inputFormat));
|
|
233
222
|
}
|
|
234
223
|
|
|
235
224
|
/**
|
|
236
225
|
*/
|
|
237
|
-
isOther(inputDate, compareDate) {
|
|
238
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
226
|
+
isOther(inputDate, compareDate, inputFormat = this.getIsoFormat()) {
|
|
239
227
|
return !this.isSame(inputDate, compareDate, inputFormat);
|
|
240
228
|
}
|
|
241
229
|
|
|
@@ -252,8 +240,7 @@ class BaseDateTimeUtil {
|
|
|
252
240
|
* Checks if a given local date and time is ambiguous in the specified timezone.
|
|
253
241
|
* Ambiguity happens during the end of daylight saving time (DST) transitions.
|
|
254
242
|
*/
|
|
255
|
-
isAmbiguous(inputDate) {
|
|
256
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
243
|
+
isAmbiguous(inputDate, inputFormat = this.getIsoFormat()) {
|
|
257
244
|
if (inputDate == null || typeof Intl === "undefined") {
|
|
258
245
|
return false;
|
|
259
246
|
}
|
|
@@ -277,8 +264,7 @@ class BaseDateTimeUtil {
|
|
|
277
264
|
/**
|
|
278
265
|
* @private
|
|
279
266
|
*/
|
|
280
|
-
_calculate(date, calculationFn, property, value) {
|
|
281
|
-
let inputFormat = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.getIsoFormat();
|
|
267
|
+
_calculate(date, calculationFn, property, value, inputFormat = this.getIsoFormat()) {
|
|
282
268
|
const parsedDate = this.toDate(date, inputFormat);
|
|
283
269
|
return this.toISO(calculationFn(parsedDate, {
|
|
284
270
|
[property]: value
|
|
@@ -289,99 +275,85 @@ class BaseDateTimeUtil {
|
|
|
289
275
|
|
|
290
276
|
/**
|
|
291
277
|
*/
|
|
292
|
-
addSeconds(date, amount) {
|
|
293
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
278
|
+
addSeconds(date, amount, inputFormat = this.getIsoFormat()) {
|
|
294
279
|
return this._calculate(date, _add.add, "seconds", amount, inputFormat);
|
|
295
280
|
}
|
|
296
281
|
|
|
297
282
|
/**
|
|
298
283
|
*/
|
|
299
|
-
addMinutes(date, amount) {
|
|
300
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
284
|
+
addMinutes(date, amount, inputFormat = this.getIsoFormat()) {
|
|
301
285
|
return this._calculate(date, _add.add, "minutes", amount, inputFormat);
|
|
302
286
|
}
|
|
303
287
|
|
|
304
288
|
/**
|
|
305
289
|
*/
|
|
306
|
-
addHours(date, amount) {
|
|
307
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
290
|
+
addHours(date, amount, inputFormat = this.getIsoFormat()) {
|
|
308
291
|
return this._calculate(date, _add.add, "hours", amount, inputFormat);
|
|
309
292
|
}
|
|
310
293
|
|
|
311
294
|
/**
|
|
312
295
|
*/
|
|
313
|
-
addDays(date, amount) {
|
|
314
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
296
|
+
addDays(date, amount, inputFormat = this.getIsoFormat()) {
|
|
315
297
|
return this._calculate(date, _add.add, "days", amount, inputFormat);
|
|
316
298
|
}
|
|
317
299
|
|
|
318
300
|
/**
|
|
319
301
|
*/
|
|
320
|
-
addWeeks(date, amount) {
|
|
321
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
302
|
+
addWeeks(date, amount, inputFormat = this.getIsoFormat()) {
|
|
322
303
|
return this._calculate(date, _add.add, "weeks", amount, inputFormat);
|
|
323
304
|
}
|
|
324
305
|
|
|
325
306
|
/**
|
|
326
307
|
*/
|
|
327
|
-
addMonths(date, amount) {
|
|
328
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
308
|
+
addMonths(date, amount, inputFormat = this.getIsoFormat()) {
|
|
329
309
|
return this._calculate(date, _add.add, "months", amount, inputFormat);
|
|
330
310
|
}
|
|
331
311
|
|
|
332
312
|
/**
|
|
333
313
|
*/
|
|
334
|
-
addYears(date, amount) {
|
|
335
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
314
|
+
addYears(date, amount, inputFormat = this.getIsoFormat()) {
|
|
336
315
|
return this._calculate(date, _add.add, "years", amount, inputFormat);
|
|
337
316
|
}
|
|
338
317
|
|
|
339
318
|
/**
|
|
340
319
|
*/
|
|
341
|
-
subtractSeconds(date, amount) {
|
|
342
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
320
|
+
subtractSeconds(date, amount, inputFormat = this.getIsoFormat()) {
|
|
343
321
|
return this._calculate(date, _sub.sub, "seconds", amount, inputFormat);
|
|
344
322
|
}
|
|
345
323
|
|
|
346
324
|
/**
|
|
347
325
|
*/
|
|
348
|
-
subtractMinutes(date, amount) {
|
|
349
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
326
|
+
subtractMinutes(date, amount, inputFormat = this.getIsoFormat()) {
|
|
350
327
|
return this._calculate(date, _sub.sub, "minutes", amount, inputFormat);
|
|
351
328
|
}
|
|
352
329
|
|
|
353
330
|
/**
|
|
354
331
|
*/
|
|
355
|
-
subtractHours(date, amount) {
|
|
356
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
332
|
+
subtractHours(date, amount, inputFormat = this.getIsoFormat()) {
|
|
357
333
|
return this._calculate(date, _sub.sub, "hours", amount, inputFormat);
|
|
358
334
|
}
|
|
359
335
|
|
|
360
336
|
/**
|
|
361
337
|
*/
|
|
362
|
-
subtractDays(date, amount) {
|
|
363
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
338
|
+
subtractDays(date, amount, inputFormat = this.getIsoFormat()) {
|
|
364
339
|
return this._calculate(date, _sub.sub, "days", amount, inputFormat);
|
|
365
340
|
}
|
|
366
341
|
|
|
367
342
|
/**
|
|
368
343
|
*/
|
|
369
|
-
subtractWeeks(date, amount) {
|
|
370
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
344
|
+
subtractWeeks(date, amount, inputFormat = this.getIsoFormat()) {
|
|
371
345
|
return this._calculate(date, _sub.sub, "weeks", amount, inputFormat);
|
|
372
346
|
}
|
|
373
347
|
|
|
374
348
|
/**
|
|
375
349
|
*/
|
|
376
|
-
subtractMonths(date, amount) {
|
|
377
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
350
|
+
subtractMonths(date, amount, inputFormat = this.getIsoFormat()) {
|
|
378
351
|
return this._calculate(date, _sub.sub, "months", amount, inputFormat);
|
|
379
352
|
}
|
|
380
353
|
|
|
381
354
|
/**
|
|
382
355
|
*/
|
|
383
|
-
subtractYears(date, amount) {
|
|
384
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
356
|
+
subtractYears(date, amount, inputFormat = this.getIsoFormat()) {
|
|
385
357
|
return this._calculate(date, _sub.sub, "years", amount, inputFormat);
|
|
386
358
|
}
|
|
387
359
|
|
|
@@ -390,9 +362,7 @@ class BaseDateTimeUtil {
|
|
|
390
362
|
/**
|
|
391
363
|
* @private
|
|
392
364
|
*/
|
|
393
|
-
_get(date, method) {
|
|
394
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
395
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
365
|
+
_get(date, method, inputFormat = this.getIsoFormat(), options = {}) {
|
|
396
366
|
const parsedDate = this.toDate(date, inputFormat);
|
|
397
367
|
return this.toISO(method(parsedDate, {
|
|
398
368
|
in: this.getDateFnsContext(),
|
|
@@ -402,22 +372,19 @@ class BaseDateTimeUtil {
|
|
|
402
372
|
|
|
403
373
|
/**
|
|
404
374
|
*/
|
|
405
|
-
startOfMonth(date) {
|
|
406
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
375
|
+
startOfMonth(date, inputFormat = this.getIsoFormat()) {
|
|
407
376
|
return this._get(date, _startOfMonth.startOfMonth, inputFormat);
|
|
408
377
|
}
|
|
409
378
|
|
|
410
379
|
/**
|
|
411
380
|
*/
|
|
412
|
-
endOfMonth(date) {
|
|
413
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
381
|
+
endOfMonth(date, inputFormat = this.getIsoFormat()) {
|
|
414
382
|
return this._get(date, _endOfMonth.endOfMonth, inputFormat);
|
|
415
383
|
}
|
|
416
384
|
|
|
417
385
|
/**
|
|
418
386
|
*/
|
|
419
|
-
startOfWeek(date) {
|
|
420
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
387
|
+
startOfWeek(date, inputFormat = this.getIsoFormat()) {
|
|
421
388
|
const {
|
|
422
389
|
weekStartsOn
|
|
423
390
|
} = this.getOptions();
|
|
@@ -428,8 +395,7 @@ class BaseDateTimeUtil {
|
|
|
428
395
|
|
|
429
396
|
/**
|
|
430
397
|
*/
|
|
431
|
-
getHours(date) {
|
|
432
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
398
|
+
getHours(date, inputFormat = this.getIsoFormat()) {
|
|
433
399
|
const parsedDate = this.toDate(date, inputFormat);
|
|
434
400
|
return (0, _getHours.getHours)(parsedDate, {
|
|
435
401
|
in: this.getDateFnsContext()
|
|
@@ -438,8 +404,7 @@ class BaseDateTimeUtil {
|
|
|
438
404
|
|
|
439
405
|
/**
|
|
440
406
|
*/
|
|
441
|
-
getMinutes(date) {
|
|
442
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
407
|
+
getMinutes(date, inputFormat = this.getIsoFormat()) {
|
|
443
408
|
const parsedDate = this.toDate(date, inputFormat);
|
|
444
409
|
return (0, _getMinutes.getMinutes)(parsedDate, {
|
|
445
410
|
in: this.getDateFnsContext()
|
|
@@ -448,8 +413,7 @@ class BaseDateTimeUtil {
|
|
|
448
413
|
|
|
449
414
|
/**
|
|
450
415
|
*/
|
|
451
|
-
getWeek(date) {
|
|
452
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
416
|
+
getWeek(date, inputFormat = this.getIsoFormat()) {
|
|
453
417
|
const {
|
|
454
418
|
weekStartsOn,
|
|
455
419
|
firstWeekContainsDate
|
|
@@ -467,8 +431,7 @@ class BaseDateTimeUtil {
|
|
|
467
431
|
/**
|
|
468
432
|
* @private
|
|
469
433
|
*/
|
|
470
|
-
_set(date, property, value) {
|
|
471
|
-
let inputFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.getIsoFormat();
|
|
434
|
+
_set(date, property, value, inputFormat = this.getIsoFormat()) {
|
|
472
435
|
const parsedDate = this.toDate(date, inputFormat);
|
|
473
436
|
return this.toISO((0, _set.set)(parsedDate, {
|
|
474
437
|
[property]: value
|
|
@@ -481,57 +444,49 @@ class BaseDateTimeUtil {
|
|
|
481
444
|
|
|
482
445
|
/**
|
|
483
446
|
*/
|
|
484
|
-
setYear(date, year) {
|
|
485
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
447
|
+
setYear(date, year, inputFormat = this.getIsoFormat()) {
|
|
486
448
|
return this._set(date, "year", year, inputFormat);
|
|
487
449
|
}
|
|
488
450
|
|
|
489
451
|
/**
|
|
490
452
|
*/
|
|
491
|
-
setMonth(date, month) {
|
|
492
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
453
|
+
setMonth(date, month, inputFormat = this.getIsoFormat()) {
|
|
493
454
|
return this._set(date, "month", month, inputFormat);
|
|
494
455
|
}
|
|
495
456
|
|
|
496
457
|
/**
|
|
497
458
|
*/
|
|
498
|
-
setDay(date, day) {
|
|
499
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
459
|
+
setDay(date, day, inputFormat = this.getIsoFormat()) {
|
|
500
460
|
return this._set(date, "date", day, inputFormat);
|
|
501
461
|
}
|
|
502
462
|
|
|
503
463
|
/**
|
|
504
464
|
*/
|
|
505
|
-
setHour(date, hour) {
|
|
506
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
465
|
+
setHour(date, hour, inputFormat = this.getIsoFormat()) {
|
|
507
466
|
return this._set(date, "hours", hour, inputFormat);
|
|
508
467
|
}
|
|
509
468
|
|
|
510
469
|
/**
|
|
511
470
|
*/
|
|
512
|
-
setMinute(date, minute) {
|
|
513
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
471
|
+
setMinute(date, minute, inputFormat = this.getIsoFormat()) {
|
|
514
472
|
return this._set(date, "minutes", minute, inputFormat);
|
|
515
473
|
}
|
|
516
474
|
|
|
517
475
|
/**
|
|
518
476
|
*/
|
|
519
|
-
setSecond(date, second) {
|
|
520
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
477
|
+
setSecond(date, second, inputFormat = this.getIsoFormat()) {
|
|
521
478
|
return this._set(date, "seconds", second, inputFormat);
|
|
522
479
|
}
|
|
523
480
|
|
|
524
481
|
/**
|
|
525
482
|
*/
|
|
526
|
-
setMilliseconds(date, millisecond) {
|
|
527
|
-
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
483
|
+
setMilliseconds(date, millisecond, inputFormat = this.getIsoFormat()) {
|
|
528
484
|
return this._set(date, "milliseconds", millisecond, inputFormat);
|
|
529
485
|
}
|
|
530
486
|
|
|
531
487
|
/**
|
|
532
488
|
*/
|
|
533
|
-
setTime(date, hours, minutes, seconds, milliseconds) {
|
|
534
|
-
let inputFormat = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : this.getIsoFormat();
|
|
489
|
+
setTime(date, hours, minutes, seconds, milliseconds, inputFormat = this.getIsoFormat()) {
|
|
535
490
|
const parsedDate = this.toDate(date, inputFormat);
|
|
536
491
|
return this.toISO((0, _set.set)(parsedDate, {
|
|
537
492
|
hours,
|
|
@@ -570,8 +525,7 @@ class BaseDateTimeUtil {
|
|
|
570
525
|
|
|
571
526
|
/**
|
|
572
527
|
*/
|
|
573
|
-
getOffset(date) {
|
|
574
|
-
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
528
|
+
getOffset(date, inputFormat = this.getIsoFormat()) {
|
|
575
529
|
const parsedDate = this.toDate(date, inputFormat);
|
|
576
530
|
if ((0, _isValid.isValid)(parsedDate)) {
|
|
577
531
|
const dateOffset = this.toFormat(parsedDate, _constants.DATETIME_OFFSET_FORMAT);
|