@beinformed/ui 1.63.2 → 1.63.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/esm/constants/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/Authenticate.js +4 -6
- package/esm/modularui/Authenticate.js.flow +6 -6
- package/esm/modularui/Authenticate.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/Authenticate.js +4 -6
- package/lib/modularui/Authenticate.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 +23 -23
- package/src/models/concepts/SourceReferenceModel.js +6 -0
- package/src/modularui/Authenticate.js +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.js","names":["_flattenDeep","_interopRequireDefault","require","_objects","_Settings","replacePlaceholders","inputTheme","_context","possibleKeys","_map","default","_keys","call","key","join","re","RegExp","_entries","forEach","
|
|
1
|
+
{"version":3,"file":"createTheme.js","names":["_flattenDeep","_interopRequireDefault","require","_objects","_Settings","replacePlaceholders","inputTheme","_context","possibleKeys","_map","default","_keys","call","key","join","re","RegExp","_entries","forEach","value","replace","match","capture","generateTheme","storedTheme","themeElements","storedSettings","settings","generatedTheme","element","isPlainObject","generatedSettings","createTheme","themeConfigs","customTheme","flattenDeep","setSettings","_default","exports"],"sources":["../../src/react-theme/createTheme.js"],"sourcesContent":["// @flow\nimport flattenDeep from \"lodash/flattenDeep\";\n\nimport { isPlainObject } from \"../utils/helpers/objects\";\n\nimport { setSettings } from \"../constants/Settings\";\n\nimport type { Theme } from \"./types\";\n\nconst replacePlaceholders = (inputTheme: Theme) => {\n const possibleKeys = Object.keys(inputTheme)\n .map((key) => `\\\\b${key}\\\\b`)\n .join(\"|\");\n\n const re = new RegExp(`\\\\$(${possibleKeys})`, \"g\");\n Object.entries(inputTheme).forEach(([key, value]) => {\n if (key !== \"settings\" && typeof value === \"string\") {\n inputTheme[key] = value.replace(\n re,\n // $FlowIssue[incompatible-call]\n (match, capture) => inputTheme[capture],\n );\n }\n });\n\n return inputTheme;\n};\n\nconst generateTheme = (storedTheme: Theme, ...themeElements: Array<Theme>) => {\n const storedSettings = storedTheme?.settings ?? {};\n\n let generatedTheme = { settings: {} };\n for (const element of themeElements) {\n if (typeof element === \"function\") {\n generatedTheme = element(replacePlaceholders(generatedTheme));\n } else if (isPlainObject(element)) {\n const generatedSettings = generatedTheme.settings;\n // $FlowFixMe[cannot-spread-indexer]\n generatedTheme = { ...generatedTheme, ...element, ...storedTheme };\n if (\"settings\" in element) {\n generatedTheme.settings = {\n ...generatedSettings,\n ...element.settings,\n ...storedSettings,\n };\n }\n }\n }\n\n // final - replace any assignments inside the theme\n return replacePlaceholders(generatedTheme);\n};\n\n/**\n * Create a theme from multiple theme configuration objects.\n * Properties are overwriten by iterating the configuration objects from left to right.\n *\n * The first argument represents a stored theme part, this is optional. The stored theme part will overwrite every part in the collection of theme parts.\n * Thus a stored configuration is leading as it can be configured by a modeller through the repository.\n *\n * Placeholders can be used, they are replaced before calling a function theme part or at the end of the theme creation.\n *\n * Both objects and function can be used, where a function receives the previous objects as input arguments.\n * For example using the method createTheme(ThemeObject, ThemeObject2, ThemeFunction, ThemeFunction2), will be handled as:\n *\n * ThemeFunction2(ThemeFunction1({ ...ThemeObject, ...ThemeObject2 }))\n *\n * @example\n * Example where the primary color of the default theme is overwritten with a primary color of the custom theme,\n * but the button bg still uses the yiq function of the default theme:\n *\n * const DefaultTheme = {\n * PRIMARY_COLOR: \"#0000ff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * BUTTON_COLOR: \"$PRIMARY_COLOR\"\n * }\n *\n * const createDefaultTheme = (input) => ({\n * ...input,\n * BUTTON_BG: getContrastYIQ(input.BUTTON_COLOR)\n * })\n *\n * const CustomTheme = {\n * PRIMARY_COLOR: \"#ff0000\"\n * }\n *\n * createTheme(null, DefaultTheme, CustomTheme, createDefaultTheme);\n *\n * // Result:\n * {\n * PRIMARY_COLOR: \"#ff0000\",\n * BUTTON_COLOR: \"#ff0000\",\n * BUTTON_BG: \"#fff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * }\n */\nconst createTheme = (\n storedTheme: Theme,\n ...themeConfigs: Array<Theme | Array<Theme> | void>\n):\n | any\n | {}\n | {\n INPUT_FOCUS_BORDER_COLOR?: string,\n LINK_HOVER_COLOR?: string,\n PAGING_HOVER_COLOR?: string,\n settings?: { [settingName: string]: string },\n } => {\n const customTheme = generateTheme(storedTheme, ...flattenDeep(themeConfigs));\n\n if (customTheme) {\n setSettings(customTheme.settings);\n }\n\n return customTheme;\n};\n\nexport default createTheme;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAIA,MAAMG,mBAAmB,GAAIC,UAAiB,IAAK;EAAA,IAAAC,QAAA;EACjD,MAAMC,YAAY,GAAG,IAAAC,IAAA,CAAAC,OAAA,EAAAH,QAAA,OAAAI,KAAA,CAAAD,OAAA,EAAYJ,UAAU,CAAC,EAAAM,IAAA,CAAAL,QAAA,EACpCM,GAAG,IAAK,MAAMA,GAAG,KAAK,CAAC,CAC5BC,IAAI,CAAC,GAAG,CAAC;EAEZ,MAAMC,EAAE,GAAG,IAAIC,MAAM,CAAC,OAAOR,YAAY,GAAG,EAAE,GAAG,CAAC;EAClD,IAAAS,QAAA,CAAAP,OAAA,EAAeJ,UAAU,CAAC,CAACY,OAAO,CAAC,CAAC,CAACL,GAAG,EAAEM,KAAK,CAAC,KAAK;IACnD,IAAIN,GAAG,KAAK,UAAU,IAAI,OAAOM,KAAK,KAAK,QAAQ,EAAE;MACnDb,UAAU,CAACO,GAAG,CAAC,GAAGM,KAAK,CAACC,OAAO,CAC7BL,EAAE;MACF;MACA,CAACM,KAAK,EAAEC,OAAO,KAAKhB,UAAU,CAACgB,OAAO,CACxC,CAAC;IACH;EACF,CAAC,CAAC;EAEF,OAAOhB,UAAU;AACnB,CAAC;AAED,MAAMiB,aAAa,GAAGA,CAACC,WAAkB,EAAE,GAAGC,aAA2B,KAAK;EAC5E,MAAMC,cAAc,GAAGF,WAAW,EAAEG,QAAQ,IAAI,CAAC,CAAC;EAElD,IAAIC,cAAc,GAAG;IAAED,QAAQ,EAAE,CAAC;EAAE,CAAC;EACrC,KAAK,MAAME,OAAO,IAAIJ,aAAa,EAAE;IACnC,IAAI,OAAOI,OAAO,KAAK,UAAU,EAAE;MACjCD,cAAc,GAAGC,OAAO,CAACxB,mBAAmB,CAACuB,cAAc,CAAC,CAAC;IAC/D,CAAC,MAAM,IAAI,IAAAE,sBAAa,EAACD,OAAO,CAAC,EAAE;MACjC,MAAME,iBAAiB,GAAGH,cAAc,CAACD,QAAQ;MACjD;MACAC,cAAc,GAAG;QAAE,GAAGA,cAAc;QAAE,GAAGC,OAAO;QAAE,GAAGL;MAAY,CAAC;MAClE,IAAI,UAAU,IAAIK,OAAO,EAAE;QACzBD,cAAc,CAACD,QAAQ,GAAG;UACxB,GAAGI,iBAAiB;UACpB,GAAGF,OAAO,CAACF,QAAQ;UACnB,GAAGD;QACL,CAAC;MACH;IACF;EACF;;EAEA;EACA,OAAOrB,mBAAmB,CAACuB,cAAc,CAAC;AAC5C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,WAAW,GAAGA,CAClBR,WAAkB,EAClB,GAAGS,YAAgD,KAS5C;EACP,MAAMC,WAAW,GAAGX,aAAa,CAACC,WAAW,EAAE,GAAG,IAAAW,oBAAW,EAACF,YAAY,CAAC,CAAC;EAE5E,IAAIC,WAAW,EAAE;IACf,IAAAE,qBAAW,EAACF,WAAW,CAACP,QAAQ,CAAC;EACnC;EAEA,OAAOO,WAAW;AACpB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEasB,WAAW","ignoreList":[]}
|
|
@@ -7,10 +7,9 @@ exports.renderBackground = void 0;
|
|
|
7
7
|
var _themeProps = require("./themeProps");
|
|
8
8
|
/**
|
|
9
9
|
*/
|
|
10
|
-
const renderBackground = (path, defaultValue) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
10
|
+
const renderBackground = (path, defaultValue) => ({
|
|
11
|
+
theme
|
|
12
|
+
}) => {
|
|
14
13
|
const value = (0, _themeProps.getThemeProp)(theme, path, defaultValue);
|
|
15
14
|
if (typeof value === "string") {
|
|
16
15
|
return `background: ${value}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","names":["_themeProps","require","renderBackground","path","defaultValue","
|
|
1
|
+
{"version":3,"file":"background.js","names":["_themeProps","require","renderBackground","path","defaultValue","theme","value","getThemeProp","exports"],"sources":["../../../src/react-theme/utils/background.js"],"sourcesContent":["// @flow\nimport { getThemeProp } from \"./themeProps\";\n\nimport type { ThemePropValue, UtilThemeProps } from \"../types\";\n\n/**\n */\nconst renderBackground =\n (path: string, defaultValue?: string): ((UtilThemeProps) => ThemePropValue) =>\n ({ theme }: UtilThemeProps) => {\n const value = getThemeProp(theme, path, defaultValue);\n\n if (typeof value === \"string\") {\n return `background: ${value}`;\n }\n\n return value;\n };\n\nexport { renderBackground };\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA,MAAMC,gBAAgB,GACpBA,CAACC,IAAY,EAAEC,YAAqB,KACpC,CAAC;EAAEC;AAAsB,CAAC,KAAK;EAC7B,MAAMC,KAAK,GAAG,IAAAC,wBAAY,EAACF,KAAK,EAAEF,IAAI,EAAEC,YAAY,CAAC;EAErD,IAAI,OAAOE,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,eAAeA,KAAK,EAAE;EAC/B;EAEA,OAAOA,KAAK;AACd,CAAC;AAACE,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -11,12 +11,9 @@ var _themeProps = require("./themeProps");
|
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
13
|
*/
|
|
14
|
-
const darkenColor = (amount, path, defaultValue) =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
18
|
-
return (0, _polished.darken)(amount, (0, _themeProps.getThemeProp)(theme, path, defaultValue));
|
|
19
|
-
};
|
|
14
|
+
const darkenColor = (amount, path, defaultValue) => ({
|
|
15
|
+
theme
|
|
16
|
+
}) => (0, _polished.darken)(amount, (0, _themeProps.getThemeProp)(theme, path, defaultValue));
|
|
20
17
|
|
|
21
18
|
/*
|
|
22
19
|
* Themed color x amount lightened
|
|
@@ -24,12 +21,9 @@ const darkenColor = (amount, path, defaultValue) => _ref => {
|
|
|
24
21
|
/**
|
|
25
22
|
*/
|
|
26
23
|
exports.darkenColor = darkenColor;
|
|
27
|
-
const lightenColor = (amount, path, defaultValue) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref2;
|
|
31
|
-
return (0, _polished.lighten)(amount, (0, _themeProps.getThemeProp)(theme, path, defaultValue));
|
|
32
|
-
};
|
|
24
|
+
const lightenColor = (amount, path, defaultValue) => ({
|
|
25
|
+
theme
|
|
26
|
+
}) => (0, _polished.lighten)(amount, (0, _themeProps.getThemeProp)(theme, path, defaultValue));
|
|
33
27
|
|
|
34
28
|
/*
|
|
35
29
|
* Make a color lighter or darker in the same color family
|
|
@@ -37,9 +31,6 @@ const lightenColor = (amount, path, defaultValue) => _ref2 => {
|
|
|
37
31
|
/**
|
|
38
32
|
*/
|
|
39
33
|
exports.lightenColor = lightenColor;
|
|
40
|
-
const changeHSL =
|
|
41
|
-
let hueAdjustment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
42
|
-
return (0, _polished.hsl)((0, _polished.parseToHsl)(color).hue + hueAdjustment, saturation, lightness);
|
|
43
|
-
};
|
|
34
|
+
const changeHSL = (color, saturation, lightness, hueAdjustment = 0) => (0, _polished.hsl)((0, _polished.parseToHsl)(color).hue + hueAdjustment, saturation, lightness);
|
|
44
35
|
exports.changeHSL = changeHSL;
|
|
45
36
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["_polished","require","_themeProps","darkenColor","amount","path","defaultValue","
|
|
1
|
+
{"version":3,"file":"colors.js","names":["_polished","require","_themeProps","darkenColor","amount","path","defaultValue","theme","darken","getThemeProp","exports","lightenColor","lighten","changeHSL","color","saturation","lightness","hueAdjustment","hsl","parseToHsl","hue"],"sources":["../../../src/react-theme/utils/colors.js"],"sourcesContent":["// @flow\nimport { darken, hsl, lighten, parseToHsl } from \"polished\";\nimport { getThemeProp } from \"./themeProps\";\n\nimport type { UtilThemeProps } from \"../types\";\n\n/*\n * Themed color x amount darkened\n */\n/**\n */\nconst darkenColor =\n (\n amount: number | string,\n path: string,\n defaultValue?: string,\n ): ((UtilThemeProps) => string) =>\n ({ theme }: UtilThemeProps) =>\n darken(amount, getThemeProp(theme, path, defaultValue));\n\n/*\n * Themed color x amount lightened\n */\n/**\n */\nconst lightenColor =\n (\n amount: number | string,\n path: string,\n defaultValue?: string,\n ): ((UtilThemeProps) => string) =>\n ({ theme }: UtilThemeProps) =>\n lighten(amount, getThemeProp(theme, path, defaultValue));\n\n/*\n * Make a color lighter or darker in the same color family\n */\n/**\n */\nconst changeHSL = (\n color: string,\n saturation?: number,\n lightness?: number,\n hueAdjustment: number = 0,\n): string => hsl(parseToHsl(color).hue + hueAdjustment, saturation, lightness);\n\nexport { darkenColor, lightenColor, changeHSL };\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA,MAAME,WAAW,GACfA,CACEC,MAAuB,EACvBC,IAAY,EACZC,YAAqB,KAEvB,CAAC;EAAEC;AAAsB,CAAC,KACxB,IAAAC,gBAAM,EAACJ,MAAM,EAAE,IAAAK,wBAAY,EAACF,KAAK,EAAEF,IAAI,EAAEC,YAAY,CAAC,CAAC;;AAE3D;AACA;AACA;AACA;AACA;AADAI,OAAA,CAAAP,WAAA,GAAAA,WAAA;AAEA,MAAMQ,YAAY,GAChBA,CACEP,MAAuB,EACvBC,IAAY,EACZC,YAAqB,KAEvB,CAAC;EAAEC;AAAsB,CAAC,KACxB,IAAAK,iBAAO,EAACR,MAAM,EAAE,IAAAK,wBAAY,EAACF,KAAK,EAAEF,IAAI,EAAEC,YAAY,CAAC,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AADAI,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEA,MAAME,SAAS,GAAGA,CAChBC,KAAa,EACbC,UAAmB,EACnBC,SAAkB,EAClBC,aAAqB,GAAG,CAAC,KACd,IAAAC,aAAG,EAAC,IAAAC,oBAAU,EAACL,KAAK,CAAC,CAACM,GAAG,GAAGH,aAAa,EAAEF,UAAU,EAAEC,SAAS,CAAC;AAACN,OAAA,CAAAG,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -35,10 +35,7 @@ const getYIQ = color => {
|
|
|
35
35
|
* the preferred color is returned
|
|
36
36
|
*/
|
|
37
37
|
exports.getYIQ = getYIQ;
|
|
38
|
-
const getContrastYIQ =
|
|
39
|
-
let dark = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#212529";
|
|
40
|
-
let light = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#fff";
|
|
41
|
-
let preferredColor = arguments.length > 3 ? arguments[3] : undefined;
|
|
38
|
+
const getContrastYIQ = (color, dark = "#212529", light = "#fff", preferredColor) => {
|
|
42
39
|
const yiqColor = getYIQ(color);
|
|
43
40
|
if (preferredColor && getColorContrast(color, preferredColor) >= 4.5) {
|
|
44
41
|
return preferredColor;
|
|
@@ -75,21 +72,16 @@ const getBackgroundColor = (theme, bgColorProperty, defaultValue) => {
|
|
|
75
72
|
* Retrieve the contrast color for the given background property,
|
|
76
73
|
* based on theme properties
|
|
77
74
|
*/
|
|
78
|
-
const renderContrastColor =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const preferredColor = (0, _themeProps.getThemeStringProp)(theme, preferredColorProperty);
|
|
89
|
-
const darkColor = (0, _themeProps.getThemeStringProp)(theme, standardDarkProperty, "#212529");
|
|
90
|
-
const lightColor = (0, _themeProps.getThemeStringProp)(theme, standardLightProperty, "#fff");
|
|
91
|
-
return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);
|
|
92
|
-
};
|
|
75
|
+
const renderContrastColor = (bgColorProperty, preferredColorProperty, standardDarkProperty = "YIQ_DARK_COLOR", standardLightProperty = "YIQ_LIGHT_COLOR") => ({
|
|
76
|
+
theme = {
|
|
77
|
+
settings: {}
|
|
78
|
+
}
|
|
79
|
+
}) => {
|
|
80
|
+
const bgColor = getBackgroundColor(theme, bgColorProperty, "#ffffff");
|
|
81
|
+
const preferredColor = (0, _themeProps.getThemeStringProp)(theme, preferredColorProperty);
|
|
82
|
+
const darkColor = (0, _themeProps.getThemeStringProp)(theme, standardDarkProperty, "#212529");
|
|
83
|
+
const lightColor = (0, _themeProps.getThemeStringProp)(theme, standardLightProperty, "#fff");
|
|
84
|
+
return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);
|
|
93
85
|
};
|
|
94
86
|
exports.renderContrastColor = renderContrastColor;
|
|
95
87
|
//# sourceMappingURL=contrast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrast.js","names":["_polished","require","_themeProps","_exceptions","getColorContrast","color1","color2","luminance1","getLuminance","luminance2","parseFloat","toFixed","exports","getYIQ","color","rgb","parseToRgb","red","green","blue","getContrastYIQ","dark","
|
|
1
|
+
{"version":3,"file":"contrast.js","names":["_polished","require","_themeProps","_exceptions","getColorContrast","color1","color2","luminance1","getLuminance","luminance2","parseFloat","toFixed","exports","getYIQ","color","rgb","parseToRgb","red","green","blue","getContrastYIQ","dark","light","preferredColor","yiqColor","darkColor","lightColor","getBackgroundColor","theme","bgColorProperty","defaultValue","bgColor","getProp","backgroundColor","ThemePropertyException","renderContrastColor","preferredColorProperty","standardDarkProperty","standardLightProperty","settings","getThemeStringProp"],"sources":["../../../src/react-theme/utils/contrast.js"],"sourcesContent":["// @flow\nimport { getLuminance, parseToRgb } from \"polished\";\n\nimport { getThemeStringProp, getProp } from \"./themeProps\";\n\nimport { ThemePropertyException } from \"../../exceptions\";\n\nimport type { Theme, UtilThemeProps } from \"../types\";\n\n/**\n * calculate the contrast ratio of two colors\n */\nconst getColorContrast = (color1: string, color2: string): number => {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return parseFloat(\n (luminance1 > luminance2\n ? (luminance1 + 0.05) / (luminance2 + 0.05)\n : (luminance2 + 0.05) / (luminance1 + 0.05)\n ).toFixed(2),\n );\n};\n\n/*\n * The YIQ equation converts the RGB color (0 to 255) into a YIQ color space.\n * YIQ is the standard formula for calculating the perceived brightness of a color,\n * and is recommended by the World Wide Web Consortium (W3C).\n */\n/**\n */\nconst getYIQ = (color: string): number => {\n const rgb = parseToRgb(color);\n\n return (rgb.red * 299 + rgb.green * 587 + rgb.blue * 114) / 1000;\n};\n\n/**\n * Get dark or light color, depending on the given color\n * When the contrast between the color and the light or dark color is too low,\n * the preferred color is returned\n */\nconst getContrastYIQ = (\n color: string,\n dark: string = \"#212529\",\n light: string = \"#fff\",\n preferredColor?: string,\n): string => {\n const yiqColor = getYIQ(color);\n\n if (preferredColor && getColorContrast(color, preferredColor) >= 4.5) {\n return preferredColor;\n }\n\n const darkColor = getYIQ(dark) < 127.5 ? dark : \"#212529\";\n const lightColor = getYIQ(light) > 127.5 ? light : \"#fff\";\n\n if (yiqColor > 127.5) {\n if (getColorContrast(color, darkColor) < 3) {\n return \"#212529\";\n }\n\n return darkColor;\n }\n\n if (getColorContrast(color, lightColor) < 3) {\n return \"#fff\";\n }\n return lightColor;\n};\n\n/**\n */\nconst getBackgroundColor = (\n theme: Theme,\n bgColorProperty: string,\n defaultValue: string,\n) => {\n let bgColor = getProp(theme, bgColorProperty, defaultValue);\n\n if (typeof bgColor === \"object\") {\n bgColor = bgColor?.backgroundColor ?? defaultValue;\n }\n\n if (typeof bgColor === \"string\") {\n return bgColor;\n }\n\n throw new ThemePropertyException(\n `${bgColorProperty} is not a string, but: ${typeof bgColor}`,\n );\n};\n\n/**\n * Retrieve the contrast color for the given background property,\n * based on theme properties\n */\nconst renderContrastColor =\n (\n bgColorProperty: string,\n preferredColorProperty?: string,\n standardDarkProperty: string = \"YIQ_DARK_COLOR\",\n standardLightProperty: string = \"YIQ_LIGHT_COLOR\",\n ): ((UtilThemeProps) => string) =>\n ({ theme = { settings: {} } }: UtilThemeProps) => {\n const bgColor = getBackgroundColor(theme, bgColorProperty, \"#ffffff\");\n const preferredColor = getThemeStringProp(theme, preferredColorProperty);\n const darkColor = getThemeStringProp(\n theme,\n standardDarkProperty,\n \"#212529\",\n );\n const lightColor = getThemeStringProp(theme, standardLightProperty, \"#fff\");\n\n return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);\n };\n\nexport { getColorContrast, getYIQ, getContrastYIQ, renderContrastColor };\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAIA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CAACC,MAAc,EAAEC,MAAc,KAAa;EACnE,MAAMC,UAAU,GAAG,IAAAC,sBAAY,EAACH,MAAM,CAAC;EACvC,MAAMI,UAAU,GAAG,IAAAD,sBAAY,EAACF,MAAM,CAAC;EACvC,OAAOI,UAAU,CACf,CAACH,UAAU,GAAGE,UAAU,GACpB,CAACF,UAAU,GAAG,IAAI,KAAKE,UAAU,GAAG,IAAI,CAAC,GACzC,CAACA,UAAU,GAAG,IAAI,KAAKF,UAAU,GAAG,IAAI,CAAC,EAC3CI,OAAO,CAAC,CAAC,CACb,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AADAC,OAAA,CAAAR,gBAAA,GAAAA,gBAAA;AAEA,MAAMS,MAAM,GAAIC,KAAa,IAAa;EACxC,MAAMC,GAAG,GAAG,IAAAC,oBAAU,EAACF,KAAK,CAAC;EAE7B,OAAO,CAACC,GAAG,CAACE,GAAG,GAAG,GAAG,GAAGF,GAAG,CAACG,KAAK,GAAG,GAAG,GAAGH,GAAG,CAACI,IAAI,GAAG,GAAG,IAAI,IAAI;AAClE,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAP,OAAA,CAAAC,MAAA,GAAAA,MAAA;AAKA,MAAMO,cAAc,GAAGA,CACrBN,KAAa,EACbO,IAAY,GAAG,SAAS,EACxBC,KAAa,GAAG,MAAM,EACtBC,cAAuB,KACZ;EACX,MAAMC,QAAQ,GAAGX,MAAM,CAACC,KAAK,CAAC;EAE9B,IAAIS,cAAc,IAAInB,gBAAgB,CAACU,KAAK,EAAES,cAAc,CAAC,IAAI,GAAG,EAAE;IACpE,OAAOA,cAAc;EACvB;EAEA,MAAME,SAAS,GAAGZ,MAAM,CAACQ,IAAI,CAAC,GAAG,KAAK,GAAGA,IAAI,GAAG,SAAS;EACzD,MAAMK,UAAU,GAAGb,MAAM,CAACS,KAAK,CAAC,GAAG,KAAK,GAAGA,KAAK,GAAG,MAAM;EAEzD,IAAIE,QAAQ,GAAG,KAAK,EAAE;IACpB,IAAIpB,gBAAgB,CAACU,KAAK,EAAEW,SAAS,CAAC,GAAG,CAAC,EAAE;MAC1C,OAAO,SAAS;IAClB;IAEA,OAAOA,SAAS;EAClB;EAEA,IAAIrB,gBAAgB,CAACU,KAAK,EAAEY,UAAU,CAAC,GAAG,CAAC,EAAE;IAC3C,OAAO,MAAM;EACf;EACA,OAAOA,UAAU;AACnB,CAAC;;AAED;AACA;AADAd,OAAA,CAAAQ,cAAA,GAAAA,cAAA;AAEA,MAAMO,kBAAkB,GAAGA,CACzBC,KAAY,EACZC,eAAuB,EACvBC,YAAoB,KACjB;EACH,IAAIC,OAAO,GAAG,IAAAC,mBAAO,EAACJ,KAAK,EAAEC,eAAe,EAAEC,YAAY,CAAC;EAE3D,IAAI,OAAOC,OAAO,KAAK,QAAQ,EAAE;IAC/BA,OAAO,GAAGA,OAAO,EAAEE,eAAe,IAAIH,YAAY;EACpD;EAEA,IAAI,OAAOC,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAM,IAAIG,kCAAsB,CAC9B,GAAGL,eAAe,0BAA0B,OAAOE,OAAO,EAC5D,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMI,mBAAmB,GACvBA,CACEN,eAAuB,EACvBO,sBAA+B,EAC/BC,oBAA4B,GAAG,gBAAgB,EAC/CC,qBAA6B,GAAG,iBAAiB,KAEnD,CAAC;EAAEV,KAAK,GAAG;IAAEW,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAAK;EAChD,MAAMR,OAAO,GAAGJ,kBAAkB,CAACC,KAAK,EAAEC,eAAe,EAAE,SAAS,CAAC;EACrE,MAAMN,cAAc,GAAG,IAAAiB,8BAAkB,EAACZ,KAAK,EAAEQ,sBAAsB,CAAC;EACxE,MAAMX,SAAS,GAAG,IAAAe,8BAAkB,EAClCZ,KAAK,EACLS,oBAAoB,EACpB,SACF,CAAC;EACD,MAAMX,UAAU,GAAG,IAAAc,8BAAkB,EAACZ,KAAK,EAAEU,qBAAqB,EAAE,MAAM,CAAC;EAE3E,OAAOlB,cAAc,CAACW,OAAO,EAAEN,SAAS,EAAEC,UAAU,EAAEH,cAAc,CAAC;AACvE,CAAC;AAACX,OAAA,CAAAuB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -13,22 +13,16 @@ const DEFAULT_CORNER_PROPERTY = "border-radius";
|
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
15
|
*/
|
|
16
|
-
const roundedCorners =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (theme.ROUNDED_CORNERS) {
|
|
27
|
-
const propertyName = property && property !== DEFAULT_CORNER_PROPERTY ? `border-${property}-radius` : DEFAULT_CORNER_PROPERTY;
|
|
28
|
-
return `${propertyName}: ${(0, _themeProps.getThemeStringProp)(theme, path, defaultValue)}`;
|
|
29
|
-
}
|
|
30
|
-
return "";
|
|
31
|
-
};
|
|
16
|
+
const roundedCorners = (property = DEFAULT_CORNER_PROPERTY, path = "BORDER_RADIUS", defaultValue = "0.25rem") => ({
|
|
17
|
+
theme = {
|
|
18
|
+
settings: {}
|
|
19
|
+
}
|
|
20
|
+
}) => {
|
|
21
|
+
if (theme.ROUNDED_CORNERS) {
|
|
22
|
+
const propertyName = property && property !== DEFAULT_CORNER_PROPERTY ? `border-${property}-radius` : DEFAULT_CORNER_PROPERTY;
|
|
23
|
+
return `${propertyName}: ${(0, _themeProps.getThemeStringProp)(theme, path, defaultValue)}`;
|
|
24
|
+
}
|
|
25
|
+
return "";
|
|
32
26
|
};
|
|
33
27
|
exports.roundedCorners = roundedCorners;
|
|
34
28
|
//# sourceMappingURL=corners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corners.js","names":["_themeProps","require","DEFAULT_CORNER_PROPERTY","roundedCorners","property","
|
|
1
|
+
{"version":3,"file":"corners.js","names":["_themeProps","require","DEFAULT_CORNER_PROPERTY","roundedCorners","property","path","defaultValue","theme","settings","ROUNDED_CORNERS","propertyName","getThemeStringProp","exports"],"sources":["../../../src/react-theme/utils/corners.js"],"sourcesContent":["// @flow\nimport { getThemeStringProp } from \"./themeProps\";\n\nimport type { UtilThemeProps } from \"../types\";\n\nconst DEFAULT_CORNER_PROPERTY = \"border-radius\";\n\n/*\n * Border radius based on the theme setting for rounded corners\n * When ROUNDED_CORNERS is not true in the theme, no rounded corners are returned\n */\n/**\n */\nconst roundedCorners =\n (\n property: string = DEFAULT_CORNER_PROPERTY,\n path: string = \"BORDER_RADIUS\",\n defaultValue: string = \"0.25rem\",\n ): ((UtilThemeProps) => string) =>\n ({ theme = { settings: {} } }: UtilThemeProps) => {\n if (theme.ROUNDED_CORNERS) {\n const propertyName =\n property && property !== DEFAULT_CORNER_PROPERTY\n ? `border-${property}-radius`\n : DEFAULT_CORNER_PROPERTY;\n\n return `${propertyName}: ${getThemeStringProp(\n theme,\n path,\n defaultValue,\n )}`;\n }\n\n return \"\";\n };\n\nexport { roundedCorners };\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAIA,MAAMC,uBAAuB,GAAG,eAAe;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAClBA,CACEC,QAAgB,GAAGF,uBAAuB,EAC1CG,IAAY,GAAG,eAAe,EAC9BC,YAAoB,GAAG,SAAS,KAElC,CAAC;EAAEC,KAAK,GAAG;IAAEC,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAAK;EAChD,IAAID,KAAK,CAACE,eAAe,EAAE;IACzB,MAAMC,YAAY,GAChBN,QAAQ,IAAIA,QAAQ,KAAKF,uBAAuB,GAC5C,UAAUE,QAAQ,SAAS,GAC3BF,uBAAuB;IAE7B,OAAO,GAAGQ,YAAY,KAAK,IAAAC,8BAAkB,EAC3CJ,KAAK,EACLF,IAAI,EACJC,YACF,CAAC,EAAE;EACL;EAEA,OAAO,EAAE;AACX,CAAC;AAACM,OAAA,CAAAT,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -12,10 +12,7 @@ var _IllegalArgumentException = _interopRequireDefault(require("../../exceptions
|
|
|
12
12
|
var _IllegalStateException = _interopRequireDefault(require("../../exceptions/IllegalStateException"));
|
|
13
13
|
/**
|
|
14
14
|
*/
|
|
15
|
-
const getSize =
|
|
16
|
-
let ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
17
|
-
let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "SPACER";
|
|
18
|
-
let unit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "rem";
|
|
15
|
+
const getSize = (theme, ratio = 1, path = "SPACER", unit = "rem") => {
|
|
19
16
|
if (typeof ratio === "string") {
|
|
20
17
|
return ratio;
|
|
21
18
|
}
|
|
@@ -34,17 +31,11 @@ const getSize = function (theme) {
|
|
|
34
31
|
*/
|
|
35
32
|
/**
|
|
36
33
|
*/
|
|
37
|
-
const spacer =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
settings: {}
|
|
43
|
-
}
|
|
44
|
-
} = _ref;
|
|
45
|
-
return getSize(theme, ratio);
|
|
46
|
-
};
|
|
47
|
-
};
|
|
34
|
+
const spacer = (ratio = 1) => ({
|
|
35
|
+
theme = {
|
|
36
|
+
settings: {}
|
|
37
|
+
}
|
|
38
|
+
}) => getSize(theme, ratio);
|
|
48
39
|
|
|
49
40
|
/*
|
|
50
41
|
* Render spacers based on the given ratio * theme SPACER
|
|
@@ -54,19 +45,11 @@ const spacer = function () {
|
|
|
54
45
|
/**
|
|
55
46
|
*/
|
|
56
47
|
exports.spacer = spacer;
|
|
57
|
-
const spacers =
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const spacers = (...ratios) => ({
|
|
49
|
+
theme = {
|
|
50
|
+
settings: {}
|
|
60
51
|
}
|
|
61
|
-
|
|
62
|
-
let {
|
|
63
|
-
theme = {
|
|
64
|
-
settings: {}
|
|
65
|
-
}
|
|
66
|
-
} = _ref2;
|
|
67
|
-
return (0, _map.default)(ratios).call(ratios, ratio => getSize(theme, ratio)).join(" ");
|
|
68
|
-
};
|
|
69
|
-
};
|
|
52
|
+
}) => (0, _map.default)(ratios).call(ratios, ratio => getSize(theme, ratio)).join(" ");
|
|
70
53
|
|
|
71
54
|
/*
|
|
72
55
|
* Render a gutter based on GUTTER property
|
|
@@ -74,16 +57,10 @@ const spacers = function () {
|
|
|
74
57
|
/**
|
|
75
58
|
*/
|
|
76
59
|
exports.spacers = spacers;
|
|
77
|
-
const gutter =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
settings: {}
|
|
83
|
-
}
|
|
84
|
-
} = _ref3;
|
|
85
|
-
return getSize(theme, ratio, "GRID_GUTTER", "px");
|
|
86
|
-
};
|
|
87
|
-
};
|
|
60
|
+
const gutter = (ratio = 1) => ({
|
|
61
|
+
theme = {
|
|
62
|
+
settings: {}
|
|
63
|
+
}
|
|
64
|
+
}) => getSize(theme, ratio, "GRID_GUTTER", "px");
|
|
88
65
|
exports.gutter = gutter;
|
|
89
66
|
//# sourceMappingURL=spacers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacers.js","names":["_big","_interopRequireDefault","require","_IllegalArgumentException","_IllegalStateException","getSize","theme","ratio","
|
|
1
|
+
{"version":3,"file":"spacers.js","names":["_big","_interopRequireDefault","require","_IllegalArgumentException","_IllegalStateException","getSize","theme","ratio","path","unit","size","Big","times","IllegalStateException","IllegalArgumentException","_stringify","default","spacer","settings","exports","spacers","ratios","_map","call","join","gutter"],"sources":["../../../src/react-theme/utils/spacers.js"],"sourcesContent":["// @flow\nimport Big from \"big.js\";\n\nimport type { Theme, UtilThemeProps } from \"../types\";\nimport IllegalArgumentException from \"../../exceptions/IllegalArgumentException\";\nimport IllegalStateException from \"../../exceptions/IllegalStateException\";\n\n/**\n */\nconst getSize = (\n theme: Theme,\n ratio: number | string = 1,\n path: string = \"SPACER\",\n unit: string = \"rem\",\n) => {\n if (typeof ratio === \"string\") {\n return ratio;\n }\n\n if (typeof ratio === \"number\") {\n if (typeof theme[path] === \"number\") {\n const size = Big(ratio).times(theme[path]);\n return `${size}${unit}`;\n }\n throw new IllegalStateException(`Size ${path} must be a number`);\n }\n\n throw new IllegalArgumentException(\n `Ratio ${JSON.stringify(ratio)} must be a string or number`,\n );\n};\n\n/*\n * Render spacers based on the given ratio * theme SPACER\n */\n/**\n */\nconst spacer =\n (ratio: number = 1): ((UtilThemeProps) => string) =>\n ({ theme = { settings: {} } }: UtilThemeProps) =>\n getSize(theme, ratio);\n\n/*\n * Render spacers based on the given ratio * theme SPACER\n * Ratio's can be given clockwise with shorthand,\n * spacers(0.5, 1) with a spacer of 0.8 will give \"0.4rem 1rem\";\n */\n/**\n */\nconst spacers =\n (...ratios: Array<number | \"auto\">): ((UtilThemeProps) => string) =>\n ({ theme = { settings: {} } }: UtilThemeProps) =>\n ratios.map((ratio) => getSize(theme, ratio)).join(\" \");\n\n/*\n * Render a gutter based on GUTTER property\n */\n/**\n */\nconst gutter =\n (ratio: number = 1): ((UtilThemeProps) => string) =>\n ({ theme = { settings: {} } }: UtilThemeProps) =>\n getSize(theme, ratio, \"GRID_GUTTER\", \"px\");\n\nexport { spacer, spacers, gutter };\n"],"mappings":";;;;;;;;;AACA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,yBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMG,OAAO,GAAGA,CACdC,KAAY,EACZC,KAAsB,GAAG,CAAC,EAC1BC,IAAY,GAAG,QAAQ,EACvBC,IAAY,GAAG,KAAK,KACjB;EACH,IAAI,OAAOF,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,IAAI,OAAOD,KAAK,CAACE,IAAI,CAAC,KAAK,QAAQ,EAAE;MACnC,MAAME,IAAI,GAAG,IAAAC,YAAG,EAACJ,KAAK,CAAC,CAACK,KAAK,CAACN,KAAK,CAACE,IAAI,CAAC,CAAC;MAC1C,OAAO,GAAGE,IAAI,GAAGD,IAAI,EAAE;IACzB;IACA,MAAM,IAAII,8BAAqB,CAAC,QAAQL,IAAI,mBAAmB,CAAC;EAClE;EAEA,MAAM,IAAIM,iCAAwB,CAChC,SAAS,IAAAC,UAAA,CAAAC,OAAA,EAAeT,KAAK,CAAC,6BAChC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMU,MAAM,GACVA,CAACV,KAAa,GAAG,CAAC,KAClB,CAAC;EAAED,KAAK,GAAG;IAAEY,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3Cb,OAAO,CAACC,KAAK,EAAEC,KAAK,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AADAY,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAEA,MAAMG,OAAO,GACXA,CAAC,GAAGC,MAA8B,KAClC,CAAC;EAAEf,KAAK,GAAG;IAAEY,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3C,IAAAI,IAAA,CAAAN,OAAA,EAAAK,MAAM,EAAAE,IAAA,CAANF,MAAM,EAAMd,KAAK,IAAKF,OAAO,CAACC,KAAK,EAAEC,KAAK,CAAC,CAAC,CAACiB,IAAI,CAAC,GAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AADAL,OAAA,CAAAC,OAAA,GAAAA,OAAA;AAEA,MAAMK,MAAM,GACVA,CAAClB,KAAa,GAAG,CAAC,KAClB,CAAC;EAAED,KAAK,GAAG;IAAEY,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3Cb,OAAO,CAACC,KAAK,EAAEC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC;AAACY,OAAA,CAAAM,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -8,20 +8,14 @@ var _objects = require("../../utils/helpers/objects");
|
|
|
8
8
|
var _exceptions = require("../../exceptions");
|
|
9
9
|
/**
|
|
10
10
|
*/
|
|
11
|
-
const getProp =
|
|
12
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
14
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
11
|
+
const getProp = (theme = {}, path = "", defaultValue = "") => {
|
|
15
12
|
return path === "" ? defaultValue : (0, _objects.get)(theme, path, defaultValue);
|
|
16
13
|
};
|
|
17
14
|
|
|
18
15
|
/**
|
|
19
16
|
*/
|
|
20
17
|
exports.getProp = getProp;
|
|
21
|
-
const getThemeProp =
|
|
22
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
24
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
18
|
+
const getThemeProp = (theme = {}, path = "", defaultValue = "") => {
|
|
25
19
|
const value = getProp(theme, path, defaultValue);
|
|
26
20
|
if (value != null && (typeof value === "string" || typeof value === "number" || typeof value === "object")) {
|
|
27
21
|
return value;
|
|
@@ -32,10 +26,7 @@ const getThemeProp = function () {
|
|
|
32
26
|
/**
|
|
33
27
|
*/
|
|
34
28
|
exports.getThemeProp = getThemeProp;
|
|
35
|
-
const getThemeStringProp =
|
|
36
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
38
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
29
|
+
const getThemeStringProp = (theme = {}, path = "", defaultValue = "") => {
|
|
39
30
|
const value = getProp(theme, path, defaultValue);
|
|
40
31
|
if (typeof value === "string") {
|
|
41
32
|
return value;
|
|
@@ -48,10 +39,7 @@ const getThemeStringProp = function () {
|
|
|
48
39
|
/**
|
|
49
40
|
*/
|
|
50
41
|
exports.getThemeStringProp = getThemeStringProp;
|
|
51
|
-
const getThemeNumberProp =
|
|
52
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
54
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
42
|
+
const getThemeNumberProp = (theme = {}, path = "", defaultValue = 0) => {
|
|
55
43
|
const value = getProp(theme, path, defaultValue);
|
|
56
44
|
if (typeof value === "number") {
|
|
57
45
|
return value;
|
|
@@ -65,11 +53,8 @@ const getThemeNumberProp = function () {
|
|
|
65
53
|
/**
|
|
66
54
|
*/
|
|
67
55
|
exports.getThemeNumberProp = getThemeNumberProp;
|
|
68
|
-
const themeProp = (path, defaultValue) =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} = _ref;
|
|
72
|
-
return getThemeProp(theme, path, defaultValue);
|
|
73
|
-
};
|
|
56
|
+
const themeProp = (path, defaultValue) => ({
|
|
57
|
+
theme
|
|
58
|
+
}) => getThemeProp(theme, path, defaultValue);
|
|
74
59
|
exports.themeProp = themeProp;
|
|
75
60
|
//# sourceMappingURL=themeProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeProps.js","names":["_objects","require","_exceptions","getProp","theme","
|
|
1
|
+
{"version":3,"file":"themeProps.js","names":["_objects","require","_exceptions","getProp","theme","path","defaultValue","get","exports","getThemeProp","value","ThemePropertyException","getThemeStringProp","toString","getThemeNumberProp","themeProp"],"sources":["../../../src/react-theme/utils/themeProps.js"],"sourcesContent":["// @flow\nimport { get } from \"../../utils/helpers/objects\";\n\nimport { ThemePropertyException } from \"../../exceptions\";\n\nimport type { Theme, ThemePropValue } from \"../types\";\n\n/**\n */\nexport const getProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: ThemePropValue = \"\",\n): ?ThemePropValue => {\n return path === \"\" ? defaultValue : get(theme, path, defaultValue);\n};\n\n/**\n */\nexport const getThemeProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: ThemePropValue = \"\",\n): ThemePropValue => {\n const value = getProp(theme, path, defaultValue);\n\n if (\n value != null &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"object\")\n ) {\n return value;\n }\n\n throw new ThemePropertyException(\n `${path} is not a string, number or plain object, but: ${typeof value}`,\n );\n};\n\n/**\n */\nexport const getThemeStringProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: string = \"\",\n): string => {\n const value = getProp(theme, path, defaultValue);\n\n if (typeof value === \"string\") {\n return value;\n } else if (typeof value === \"number\") {\n return value.toString();\n }\n\n throw new ThemePropertyException(\n `${path} is not a string, but: ${typeof value}`,\n );\n};\n\n/**\n */\nexport const getThemeNumberProp = (\n theme: $Shape<Theme> = {},\n path: string = \"\",\n defaultValue: number = 0,\n): number => {\n const value = getProp(theme, path, defaultValue);\n\n if (typeof value === \"number\") {\n return value;\n }\n\n throw new ThemePropertyException(\n `${path} is not a number, but: ${typeof value}`,\n );\n};\n\n/*\n * Retrieve property value from theme property of styled component\n */\n/**\n */\nexport const themeProp =\n (\n path: string,\n defaultValue?: ThemePropValue,\n ): (({ theme: Theme }) => ThemePropValue) =>\n ({ theme }: { theme: Theme }) =>\n getThemeProp(theme, path, defaultValue);\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAIA;AACA;AACO,MAAME,OAAO,GAAGA,CACrBC,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAA4B,GAAG,EAAE,KACb;EACpB,OAAOD,IAAI,KAAK,EAAE,GAAGC,YAAY,GAAG,IAAAC,YAAG,EAACH,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;AACpE,CAAC;;AAED;AACA;AADAE,OAAA,CAAAL,OAAA,GAAAA,OAAA;AAEO,MAAMM,YAAY,GAAGA,CAC1BL,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAA4B,GAAG,EAAE,KACd;EACnB,MAAMI,KAAK,GAAGP,OAAO,CAACC,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;EAEhD,IACEI,KAAK,IAAI,IAAI,KACZ,OAAOA,KAAK,KAAK,QAAQ,IACxB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,CAAC,EAC5B;IACA,OAAOA,KAAK;EACd;EAEA,MAAM,IAAIC,kCAAsB,CAC9B,GAAGN,IAAI,kDAAkD,OAAOK,KAAK,EACvE,CAAC;AACH,CAAC;;AAED;AACA;AADAF,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEO,MAAMG,kBAAkB,GAAGA,CAChCR,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAAoB,GAAG,EAAE,KACd;EACX,MAAMI,KAAK,GAAGP,OAAO,CAACC,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;EAEhD,IAAI,OAAOI,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpC,OAAOA,KAAK,CAACG,QAAQ,CAAC,CAAC;EACzB;EAEA,MAAM,IAAIF,kCAAsB,CAC9B,GAAGN,IAAI,0BAA0B,OAAOK,KAAK,EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AADAF,OAAA,CAAAI,kBAAA,GAAAA,kBAAA;AAEO,MAAME,kBAAkB,GAAGA,CAChCV,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAAoB,GAAG,CAAC,KACb;EACX,MAAMI,KAAK,GAAGP,OAAO,CAACC,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;EAEhD,IAAI,OAAOI,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,MAAM,IAAIC,kCAAsB,CAC9B,GAAGN,IAAI,0BAA0B,OAAOK,KAAK,EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AADAF,OAAA,CAAAM,kBAAA,GAAAA,kBAAA;AAEO,MAAMC,SAAS,GACpBA,CACEV,IAAY,EACZC,YAA6B,KAE/B,CAAC;EAAEF;AAAwB,CAAC,KAC1BK,YAAY,CAACL,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;AAACE,OAAA,CAAAO,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -28,11 +28,10 @@ const updateLocale = (state, locale) => {
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
*/
|
|
31
|
-
const setLocales = (state,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref;
|
|
31
|
+
const setLocales = (state, {
|
|
32
|
+
locale,
|
|
33
|
+
locales
|
|
34
|
+
}) => {
|
|
36
35
|
// set locale in cookie
|
|
37
36
|
if (state.locales.length > 1) {
|
|
38
37
|
(0, _Cookies.setCookie)("locale", locale);
|
|
@@ -67,9 +66,7 @@ const initialState = {
|
|
|
67
66
|
/**
|
|
68
67
|
* Form reducer
|
|
69
68
|
*/
|
|
70
|
-
const I18nReducer =
|
|
71
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
72
|
-
let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;
|
|
69
|
+
const I18nReducer = (state = initialState, action = void 0) => {
|
|
73
70
|
if (!action) {
|
|
74
71
|
return state;
|
|
75
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nReducer.js","names":["_Cache","_interopRequireDefault","require","_Cookies","_Locales","updateLocale","state","locale","locales","length","setCookie","clearCookie","Cache","clear","setLocales","
|
|
1
|
+
{"version":3,"file":"I18nReducer.js","names":["_Cache","_interopRequireDefault","require","_Cookies","_Locales","updateLocale","state","locale","locales","length","setCookie","clearCookie","Cache","clear","setLocales","getDefaultLocale","navigator","language","split","initialState","Locales","I18nReducer","action","type","payload","exports"],"sources":["../../../src/redux/_i18n/I18nReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport { setCookie, clearCookie } from \"../../utils/browser/Cookies\";\n\nimport Locales from \"../../i18n/Locales\";\n\nimport type { Reducer } from \"redux\";\nimport type { I18nState } from \"./types\";\nimport type { ReduxAction } from \"../types\";\n\n/**\n */\nconst updateLocale = (state: I18nState, locale: string) => {\n // set locale in cookie\n if (state.locales?.length > 1) {\n setCookie(\"locale\", locale);\n } else {\n clearCookie(\"locale\");\n }\n\n // clear cache because of cached contributions\n Cache.clear();\n\n return {\n ...state,\n locale,\n };\n};\n\n/**\n */\nconst setLocales = (\n state: I18nState,\n { locale, locales }: { locale: string, locales: Locales },\n) => {\n // set locale in cookie\n if (state.locales.length > 1) {\n setCookie(\"locale\", locale);\n } else {\n clearCookie(\"locale\");\n }\n\n if (locale) {\n return {\n ...state,\n locales,\n locale,\n };\n }\n\n return {\n ...state,\n locales,\n };\n};\n\nconst getDefaultLocale = () => {\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator?.language.split(\"-\")[0] || \"en\";\n }\n return \"en\";\n};\n\n// REDUCER\nconst initialState: I18nState = {\n locales: new Locales(),\n locale: getDefaultLocale(),\n};\n\n/**\n * Form reducer\n */\nexport const I18nReducer: Reducer<I18nState, ReduxAction> = (\n state = initialState,\n action = void 0,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"SET_LOCALES\":\n return setLocales(state, action.payload);\n\n case \"UPDATE_LOCALE\":\n return updateLocale(state, action.payload);\n\n default:\n return state;\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAMA;AACA;AACA,MAAMG,YAAY,GAAGA,CAACC,KAAgB,EAAEC,MAAc,KAAK;EACzD;EACA,IAAID,KAAK,CAACE,OAAO,EAAEC,MAAM,GAAG,CAAC,EAAE;IAC7B,IAAAC,kBAAS,EAAC,QAAQ,EAAEH,MAAM,CAAC;EAC7B,CAAC,MAAM;IACL,IAAAI,oBAAW,EAAC,QAAQ,CAAC;EACvB;;EAEA;EACAC,cAAK,CAACC,KAAK,CAAC,CAAC;EAEb,OAAO;IACL,GAAGP,KAAK;IACRC;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA,MAAMO,UAAU,GAAGA,CACjBR,KAAgB,EAChB;EAAEC,MAAM;EAAEC;AAA8C,CAAC,KACtD;EACH;EACA,IAAIF,KAAK,CAACE,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;IAC5B,IAAAC,kBAAS,EAAC,QAAQ,EAAEH,MAAM,CAAC;EAC7B,CAAC,MAAM;IACL,IAAAI,oBAAW,EAAC,QAAQ,CAAC;EACvB;EAEA,IAAIJ,MAAM,EAAE;IACV,OAAO;MACL,GAAGD,KAAK;MACRE,OAAO;MACPD;IACF,CAAC;EACH;EAEA,OAAO;IACL,GAAGD,KAAK;IACRE;EACF,CAAC;AACH,CAAC;AAED,MAAMO,gBAAgB,GAAGA,CAAA,KAAM;EAC7B,IAAI,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,EAAEC,QAAQ,EAAE;IAC3D,OAAOD,SAAS,EAAEC,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;EAClD;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA,MAAMC,YAAuB,GAAG;EAC9BX,OAAO,EAAE,IAAIY,gBAAO,CAAC,CAAC;EACtBb,MAAM,EAAEQ,gBAAgB,CAAC;AAC3B,CAAC;;AAED;AACA;AACA;AACO,MAAMM,WAA4C,GAAGA,CAC1Df,KAAK,GAAGa,YAAY,EACpBG,MAAM,GAAG,KAAK,CAAC,KACZ;EACH,IAAI,CAACA,MAAM,EAAE;IACX,OAAOhB,KAAK;EACd;EAEA,QAAQgB,MAAM,CAACC,IAAI;IACjB,KAAK,aAAa;MAChB,OAAOT,UAAU,CAACR,KAAK,EAAEgB,MAAM,CAACE,OAAO,CAAC;IAE1C,KAAK,eAAe;MAClB,OAAOnB,YAAY,CAACC,KAAK,EAAEgB,MAAM,CAACE,OAAO,CAAC;IAE5C;MACE,OAAOlB,KAAK;EAChB;AACF,CAAC;AAACmB,OAAA,CAAAJ,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -148,30 +148,26 @@ const loadModel = (key, href, options) => ({
|
|
|
148
148
|
/**
|
|
149
149
|
*/
|
|
150
150
|
exports.loadModel = loadModel;
|
|
151
|
-
const loadModularUI =
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
resolve(dispatch(loadModularUI(key, href, options, retryCount - 1, retryDelay)));
|
|
164
|
-
}, retryDelay);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Same request is already loading — do nothing
|
|
169
|
-
return _promise.default.resolve();
|
|
151
|
+
const loadModularUI = (key, href, options, retryCount = 3, retryDelay = 200) => (dispatch, getState) => {
|
|
152
|
+
const modularuiStore = getState()?.modularui;
|
|
153
|
+
const currentRequest = modularuiStore?.[key];
|
|
154
|
+
const isLoading = currentRequest?.status === _Constants.MODULARUI_STATUS.LOADING;
|
|
155
|
+
if (isLoading) {
|
|
156
|
+
const isDifferentRequest = currentRequest.requestOptions?.href?.toString() !== href.toString();
|
|
157
|
+
if (isDifferentRequest && retryCount > 0) {
|
|
158
|
+
return new _promise.default(resolve => {
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
resolve(dispatch(loadModularUI(key, href, options, retryCount - 1, retryDelay)));
|
|
161
|
+
}, retryDelay);
|
|
162
|
+
});
|
|
170
163
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return _promise.default.resolve(
|
|
174
|
-
}
|
|
164
|
+
|
|
165
|
+
// Same request is already loading — do nothing
|
|
166
|
+
return _promise.default.resolve();
|
|
167
|
+
}
|
|
168
|
+
dispatch((0, _ProgressIndicator.startProgress)());
|
|
169
|
+
const loadModelPromise = dispatch(loadModel(key, href, options));
|
|
170
|
+
return _promise.default.resolve(loadModelPromise).then(() => dispatch((0, _ProgressIndicator.finishProgress)())).catch(error => dispatch((0, _Error.handleError)(error)));
|
|
175
171
|
};
|
|
176
172
|
|
|
177
173
|
/**
|