@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
|
@@ -4,17 +4,13 @@ import createTheme from "./createTheme";
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
/**
|
|
6
6
|
*/
|
|
7
|
-
const ThemeProvider =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
preferences
|
|
15
|
-
} = _ref2;
|
|
16
|
-
return preferences.theme;
|
|
17
|
-
});
|
|
7
|
+
const ThemeProvider = ({
|
|
8
|
+
theme,
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
const storedTheme = useSelector(({
|
|
12
|
+
preferences
|
|
13
|
+
}) => preferences.theme);
|
|
18
14
|
const finalTheme = createTheme(storedTheme, theme);
|
|
19
15
|
return /*#__PURE__*/_jsx(SCThemeProvider, {
|
|
20
16
|
theme: finalTheme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","names":["useSelector","ThemeProvider","SCThemeProvider","createTheme","jsx","_jsx","
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","names":["useSelector","ThemeProvider","SCThemeProvider","createTheme","jsx","_jsx","theme","children","storedTheme","preferences","finalTheme","displayName"],"sources":["../../src/react-theme/ThemeProvider.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { ThemeProvider as SCThemeProvider } from \"styled-components\";\n\nimport createTheme from \"./createTheme\";\n\nimport type { Node } from \"react\";\nimport type { Theme } from \"./types\";\n\nexport type Props = {\n +theme?: Theme | Array<Theme>,\n +children: Node,\n};\n\n/**\n */\nconst ThemeProvider = ({ theme, children }: Props): Node => {\n const storedTheme = useSelector(({ preferences }) => preferences.theme);\n const finalTheme = createTheme(storedTheme, theme);\n\n return <SCThemeProvider theme={finalTheme}>{children}</SCThemeProvider>;\n};\nThemeProvider.displayName = \"BI.ThemeProvider\";\n\nexport default ThemeProvider;\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AACzC,SAASC,aAAa,IAAIC,eAAe,QAAQ,mBAAmB;AAEpE,OAAOC,WAAW,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUxC;AACA;AACA,MAAMJ,aAAa,GAAGA,CAAC;EAAEK,KAAK;EAAEC;AAAgB,CAAC,KAAW;EAC1D,MAAMC,WAAW,GAAGR,WAAW,CAAC,CAAC;IAAES;EAAY,CAAC,KAAKA,WAAW,CAACH,KAAK,CAAC;EACvE,MAAMI,UAAU,GAAGP,WAAW,CAACK,WAAW,EAAEF,KAAK,CAAC;EAElD,oBAAOD,IAAA,CAACH,eAAe;IAACI,KAAK,EAAEI,UAAW;IAAAH,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AACzE,CAAC;AACDN,aAAa,CAACU,WAAW,GAAG,kBAAkB;AAE9C,eAAeV,aAAa","ignoreList":[]}
|
|
@@ -8,8 +8,7 @@ const replacePlaceholders = inputTheme => {
|
|
|
8
8
|
var _context;
|
|
9
9
|
const possibleKeys = _mapInstanceProperty(_context = _Object$keys(inputTheme)).call(_context, key => `\\b${key}\\b`).join("|");
|
|
10
10
|
const re = new RegExp(`\\$(${possibleKeys})`, "g");
|
|
11
|
-
_Object$entries(inputTheme).forEach(
|
|
12
|
-
let [key, value] = _ref;
|
|
11
|
+
_Object$entries(inputTheme).forEach(([key, value]) => {
|
|
13
12
|
if (key !== "settings" && typeof value === "string") {
|
|
14
13
|
inputTheme[key] = value.replace(re,
|
|
15
14
|
// $FlowIssue[incompatible-call]
|
|
@@ -18,14 +17,11 @@ const replacePlaceholders = inputTheme => {
|
|
|
18
17
|
});
|
|
19
18
|
return inputTheme;
|
|
20
19
|
};
|
|
21
|
-
const generateTheme =
|
|
20
|
+
const generateTheme = (storedTheme, ...themeElements) => {
|
|
22
21
|
const storedSettings = storedTheme?.settings ?? {};
|
|
23
22
|
let generatedTheme = {
|
|
24
23
|
settings: {}
|
|
25
24
|
};
|
|
26
|
-
for (var _len = arguments.length, themeElements = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
27
|
-
themeElements[_key - 1] = arguments[_key];
|
|
28
|
-
}
|
|
29
25
|
for (const element of themeElements) {
|
|
30
26
|
if (typeof element === "function") {
|
|
31
27
|
generatedTheme = element(replacePlaceholders(generatedTheme));
|
|
@@ -94,10 +90,7 @@ const generateTheme = function (storedTheme) {
|
|
|
94
90
|
* SECONDARY_COLOR: "#00ff00",
|
|
95
91
|
* }
|
|
96
92
|
*/
|
|
97
|
-
const createTheme =
|
|
98
|
-
for (var _len2 = arguments.length, themeConfigs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
99
|
-
themeConfigs[_key2 - 1] = arguments[_key2];
|
|
100
|
-
}
|
|
93
|
+
const createTheme = (storedTheme, ...themeConfigs) => {
|
|
101
94
|
const customTheme = generateTheme(storedTheme, ...flattenDeep(themeConfigs));
|
|
102
95
|
if (customTheme) {
|
|
103
96
|
setSettings(customTheme.settings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.js","names":["flattenDeep","isPlainObject","setSettings","replacePlaceholders","inputTheme","_context","possibleKeys","_mapInstanceProperty","_Object$keys","call","key","join","re","RegExp","_Object$entries","forEach","
|
|
1
|
+
{"version":3,"file":"createTheme.js","names":["flattenDeep","isPlainObject","setSettings","replacePlaceholders","inputTheme","_context","possibleKeys","_mapInstanceProperty","_Object$keys","call","key","join","re","RegExp","_Object$entries","forEach","value","replace","match","capture","generateTheme","storedTheme","themeElements","storedSettings","settings","generatedTheme","element","generatedSettings","createTheme","themeConfigs","customTheme"],"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 set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,aAAa,CAACyB,OAAO,CAAC,EAAE;MACjC,MAAMC,iBAAiB,GAAGF,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,GAAGG,iBAAiB;UACpB,GAAGD,OAAO,CAACF,QAAQ;UACnB,GAAGD;QACL,CAAC;MACH;IACF;EACF;;EAEA;EACA,OAAOpB,mBAAmB,CAACsB,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,MAAMG,WAAW,GAAGA,CAClBP,WAAkB,EAClB,GAAGQ,YAAgD,KAS5C;EACP,MAAMC,WAAW,GAAGV,aAAa,CAACC,WAAW,EAAE,GAAGrB,WAAW,CAAC6B,YAAY,CAAC,CAAC;EAE5E,IAAIC,WAAW,EAAE;IACf5B,WAAW,CAAC4B,WAAW,CAACN,QAAQ,CAAC;EACnC;EAEA,OAAOM,WAAW;AACpB,CAAC;AAED,eAAeF,WAAW","ignoreList":[]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { getThemeProp } from "./themeProps";
|
|
2
2
|
/**
|
|
3
3
|
*/
|
|
4
|
-
const renderBackground = (path, defaultValue) =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} = _ref;
|
|
4
|
+
const renderBackground = (path, defaultValue) => ({
|
|
5
|
+
theme
|
|
6
|
+
}) => {
|
|
8
7
|
const value = getThemeProp(theme, path, defaultValue);
|
|
9
8
|
if (typeof value === "string") {
|
|
10
9
|
return `background: ${value}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","names":["getThemeProp","renderBackground","path","defaultValue","
|
|
1
|
+
{"version":3,"file":"background.js","names":["getThemeProp","renderBackground","path","defaultValue","theme","value"],"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,SAASA,YAAY,QAAQ,cAAc;AAI3C;AACA;AACA,MAAMC,gBAAgB,GACpBA,CAACC,IAAY,EAAEC,YAAqB,KACpC,CAAC;EAAEC;AAAsB,CAAC,KAAK;EAC7B,MAAMC,KAAK,GAAGL,YAAY,CAACI,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;AAEH,SAASJ,gBAAgB","ignoreList":[]}
|
|
@@ -5,33 +5,24 @@ import { getThemeProp } from "./themeProps";
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
*/
|
|
8
|
-
const darkenColor = (amount, path, defaultValue) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
12
|
-
return darken(amount, getThemeProp(theme, path, defaultValue));
|
|
13
|
-
};
|
|
8
|
+
const darkenColor = (amount, path, defaultValue) => ({
|
|
9
|
+
theme
|
|
10
|
+
}) => darken(amount, getThemeProp(theme, path, defaultValue));
|
|
14
11
|
|
|
15
12
|
/*
|
|
16
13
|
* Themed color x amount lightened
|
|
17
14
|
*/
|
|
18
15
|
/**
|
|
19
16
|
*/
|
|
20
|
-
const lightenColor = (amount, path, defaultValue) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref2;
|
|
24
|
-
return lighten(amount, getThemeProp(theme, path, defaultValue));
|
|
25
|
-
};
|
|
17
|
+
const lightenColor = (amount, path, defaultValue) => ({
|
|
18
|
+
theme
|
|
19
|
+
}) => lighten(amount, getThemeProp(theme, path, defaultValue));
|
|
26
20
|
|
|
27
21
|
/*
|
|
28
22
|
* Make a color lighter or darker in the same color family
|
|
29
23
|
*/
|
|
30
24
|
/**
|
|
31
25
|
*/
|
|
32
|
-
const changeHSL =
|
|
33
|
-
let hueAdjustment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
34
|
-
return hsl(parseToHsl(color).hue + hueAdjustment, saturation, lightness);
|
|
35
|
-
};
|
|
26
|
+
const changeHSL = (color, saturation, lightness, hueAdjustment = 0) => hsl(parseToHsl(color).hue + hueAdjustment, saturation, lightness);
|
|
36
27
|
export { darkenColor, lightenColor, changeHSL };
|
|
37
28
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["darken","hsl","lighten","parseToHsl","getThemeProp","darkenColor","amount","path","defaultValue","
|
|
1
|
+
{"version":3,"file":"colors.js","names":["darken","hsl","lighten","parseToHsl","getThemeProp","darkenColor","amount","path","defaultValue","theme","lightenColor","changeHSL","color","saturation","lightness","hueAdjustment","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,SAASA,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,UAAU,QAAQ,UAAU;AAC3D,SAASC,YAAY,QAAQ,cAAc;AAI3C;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GACfA,CACEC,MAAuB,EACvBC,IAAY,EACZC,YAAqB,KAEvB,CAAC;EAAEC;AAAsB,CAAC,KACxBT,MAAM,CAACM,MAAM,EAAEF,YAAY,CAACK,KAAK,EAAEF,IAAI,EAAEC,YAAY,CAAC,CAAC;;AAE3D;AACA;AACA;AACA;AACA;AACA,MAAME,YAAY,GAChBA,CACEJ,MAAuB,EACvBC,IAAY,EACZC,YAAqB,KAEvB,CAAC;EAAEC;AAAsB,CAAC,KACxBP,OAAO,CAACI,MAAM,EAAEF,YAAY,CAACK,KAAK,EAAEF,IAAI,EAAEC,YAAY,CAAC,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,GAAGA,CAChBC,KAAa,EACbC,UAAmB,EACnBC,SAAkB,EAClBC,aAAqB,GAAG,CAAC,KACdd,GAAG,CAACE,UAAU,CAACS,KAAK,CAAC,CAACI,GAAG,GAAGD,aAAa,EAAEF,UAAU,EAAEC,SAAS,CAAC;AAE9E,SAAST,WAAW,EAAEK,YAAY,EAAEC,SAAS","ignoreList":[]}
|
|
@@ -27,10 +27,7 @@ const getYIQ = color => {
|
|
|
27
27
|
* When the contrast between the color and the light or dark color is too low,
|
|
28
28
|
* the preferred color is returned
|
|
29
29
|
*/
|
|
30
|
-
const getContrastYIQ =
|
|
31
|
-
let dark = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#212529";
|
|
32
|
-
let light = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#fff";
|
|
33
|
-
let preferredColor = arguments.length > 3 ? arguments[3] : undefined;
|
|
30
|
+
const getContrastYIQ = (color, dark = "#212529", light = "#fff", preferredColor) => {
|
|
34
31
|
const yiqColor = getYIQ(color);
|
|
35
32
|
if (preferredColor && getColorContrast(color, preferredColor) >= 4.5) {
|
|
36
33
|
return preferredColor;
|
|
@@ -66,21 +63,16 @@ const getBackgroundColor = (theme, bgColorProperty, defaultValue) => {
|
|
|
66
63
|
* Retrieve the contrast color for the given background property,
|
|
67
64
|
* based on theme properties
|
|
68
65
|
*/
|
|
69
|
-
const renderContrastColor =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const preferredColor = getThemeStringProp(theme, preferredColorProperty);
|
|
80
|
-
const darkColor = getThemeStringProp(theme, standardDarkProperty, "#212529");
|
|
81
|
-
const lightColor = getThemeStringProp(theme, standardLightProperty, "#fff");
|
|
82
|
-
return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);
|
|
83
|
-
};
|
|
66
|
+
const renderContrastColor = (bgColorProperty, preferredColorProperty, standardDarkProperty = "YIQ_DARK_COLOR", standardLightProperty = "YIQ_LIGHT_COLOR") => ({
|
|
67
|
+
theme = {
|
|
68
|
+
settings: {}
|
|
69
|
+
}
|
|
70
|
+
}) => {
|
|
71
|
+
const bgColor = getBackgroundColor(theme, bgColorProperty, "#ffffff");
|
|
72
|
+
const preferredColor = getThemeStringProp(theme, preferredColorProperty);
|
|
73
|
+
const darkColor = getThemeStringProp(theme, standardDarkProperty, "#212529");
|
|
74
|
+
const lightColor = getThemeStringProp(theme, standardLightProperty, "#fff");
|
|
75
|
+
return getContrastYIQ(bgColor, darkColor, lightColor, preferredColor);
|
|
84
76
|
};
|
|
85
77
|
export { getColorContrast, getYIQ, getContrastYIQ, renderContrastColor };
|
|
86
78
|
//# sourceMappingURL=contrast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrast.js","names":["getLuminance","parseToRgb","getThemeStringProp","getProp","ThemePropertyException","getColorContrast","color1","color2","luminance1","luminance2","parseFloat","toFixed","getYIQ","color","rgb","red","green","blue","getContrastYIQ","dark","
|
|
1
|
+
{"version":3,"file":"contrast.js","names":["getLuminance","parseToRgb","getThemeStringProp","getProp","ThemePropertyException","getColorContrast","color1","color2","luminance1","luminance2","parseFloat","toFixed","getYIQ","color","rgb","red","green","blue","getContrastYIQ","dark","light","preferredColor","yiqColor","darkColor","lightColor","getBackgroundColor","theme","bgColorProperty","defaultValue","bgColor","backgroundColor","renderContrastColor","preferredColorProperty","standardDarkProperty","standardLightProperty","settings"],"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,SAASA,YAA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B,kBAAkB,CAACwB,KAAK,EAAEQ,qBAAqB,EAAE,MAAM,CAAC;EAE3E,OAAOhB,cAAc,CAACW,OAAO,EAAEN,SAAS,EAAEC,UAAU,EAAEH,cAAc,CAAC;AACvE,CAAC;AAEH,SAAShB,gBAAgB,EAAEO,MAAM,EAAEM,cAAc,EAAEa,mBAAmB","ignoreList":[]}
|
|
@@ -7,22 +7,16 @@ const DEFAULT_CORNER_PROPERTY = "border-radius";
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
*/
|
|
10
|
-
const roundedCorners =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (theme.ROUNDED_CORNERS) {
|
|
21
|
-
const propertyName = property && property !== DEFAULT_CORNER_PROPERTY ? `border-${property}-radius` : DEFAULT_CORNER_PROPERTY;
|
|
22
|
-
return `${propertyName}: ${getThemeStringProp(theme, path, defaultValue)}`;
|
|
23
|
-
}
|
|
24
|
-
return "";
|
|
25
|
-
};
|
|
10
|
+
const roundedCorners = (property = DEFAULT_CORNER_PROPERTY, path = "BORDER_RADIUS", defaultValue = "0.25rem") => ({
|
|
11
|
+
theme = {
|
|
12
|
+
settings: {}
|
|
13
|
+
}
|
|
14
|
+
}) => {
|
|
15
|
+
if (theme.ROUNDED_CORNERS) {
|
|
16
|
+
const propertyName = property && property !== DEFAULT_CORNER_PROPERTY ? `border-${property}-radius` : DEFAULT_CORNER_PROPERTY;
|
|
17
|
+
return `${propertyName}: ${getThemeStringProp(theme, path, defaultValue)}`;
|
|
18
|
+
}
|
|
19
|
+
return "";
|
|
26
20
|
};
|
|
27
21
|
export { roundedCorners };
|
|
28
22
|
//# sourceMappingURL=corners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corners.js","names":["getThemeStringProp","DEFAULT_CORNER_PROPERTY","roundedCorners","property","
|
|
1
|
+
{"version":3,"file":"corners.js","names":["getThemeStringProp","DEFAULT_CORNER_PROPERTY","roundedCorners","property","path","defaultValue","theme","settings","ROUNDED_CORNERS","propertyName"],"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,SAASA,kBAAkB,QAAQ,cAAc;AAIjD,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,KAAKT,kBAAkB,CAC3CM,KAAK,EACLF,IAAI,EACJC,YACF,CAAC,EAAE;EACL;EAEA,OAAO,EAAE;AACX,CAAC;AAEH,SAASH,cAAc","ignoreList":[]}
|
|
@@ -6,10 +6,7 @@ import IllegalStateException from "../../exceptions/IllegalStateException";
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*/
|
|
9
|
-
const getSize =
|
|
10
|
-
let ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
11
|
-
let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "SPACER";
|
|
12
|
-
let unit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "rem";
|
|
9
|
+
const getSize = (theme, ratio = 1, path = "SPACER", unit = "rem") => {
|
|
13
10
|
if (typeof ratio === "string") {
|
|
14
11
|
return ratio;
|
|
15
12
|
}
|
|
@@ -28,17 +25,11 @@ const getSize = function (theme) {
|
|
|
28
25
|
*/
|
|
29
26
|
/**
|
|
30
27
|
*/
|
|
31
|
-
const spacer =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
settings: {}
|
|
37
|
-
}
|
|
38
|
-
} = _ref;
|
|
39
|
-
return getSize(theme, ratio);
|
|
40
|
-
};
|
|
41
|
-
};
|
|
28
|
+
const spacer = (ratio = 1) => ({
|
|
29
|
+
theme = {
|
|
30
|
+
settings: {}
|
|
31
|
+
}
|
|
32
|
+
}) => getSize(theme, ratio);
|
|
42
33
|
|
|
43
34
|
/*
|
|
44
35
|
* Render spacers based on the given ratio * theme SPACER
|
|
@@ -47,35 +38,21 @@ const spacer = function () {
|
|
|
47
38
|
*/
|
|
48
39
|
/**
|
|
49
40
|
*/
|
|
50
|
-
const spacers =
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
const spacers = (...ratios) => ({
|
|
42
|
+
theme = {
|
|
43
|
+
settings: {}
|
|
53
44
|
}
|
|
54
|
-
|
|
55
|
-
let {
|
|
56
|
-
theme = {
|
|
57
|
-
settings: {}
|
|
58
|
-
}
|
|
59
|
-
} = _ref2;
|
|
60
|
-
return _mapInstanceProperty(ratios).call(ratios, ratio => getSize(theme, ratio)).join(" ");
|
|
61
|
-
};
|
|
62
|
-
};
|
|
45
|
+
}) => _mapInstanceProperty(ratios).call(ratios, ratio => getSize(theme, ratio)).join(" ");
|
|
63
46
|
|
|
64
47
|
/*
|
|
65
48
|
* Render a gutter based on GUTTER property
|
|
66
49
|
*/
|
|
67
50
|
/**
|
|
68
51
|
*/
|
|
69
|
-
const gutter =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
settings: {}
|
|
75
|
-
}
|
|
76
|
-
} = _ref3;
|
|
77
|
-
return getSize(theme, ratio, "GRID_GUTTER", "px");
|
|
78
|
-
};
|
|
79
|
-
};
|
|
52
|
+
const gutter = (ratio = 1) => ({
|
|
53
|
+
theme = {
|
|
54
|
+
settings: {}
|
|
55
|
+
}
|
|
56
|
+
}) => getSize(theme, ratio, "GRID_GUTTER", "px");
|
|
80
57
|
export { spacer, spacers, gutter };
|
|
81
58
|
//# sourceMappingURL=spacers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacers.js","names":["Big","IllegalArgumentException","IllegalStateException","getSize","theme","ratio","
|
|
1
|
+
{"version":3,"file":"spacers.js","names":["Big","IllegalArgumentException","IllegalStateException","getSize","theme","ratio","path","unit","size","times","_JSON$stringify","spacer","settings","spacers","ratios","_mapInstanceProperty","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,OAAOA,GAAG,MAAM,QAAQ;AAGxB,OAAOC,wBAAwB,MAAM,2CAA2C;AAChF,OAAOC,qBAAqB,MAAM,wCAAwC;;AAE1E;AACA;AACA,MAAMC,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,GAAGR,GAAG,CAACK,KAAK,CAAC,CAACI,KAAK,CAACL,KAAK,CAACE,IAAI,CAAC,CAAC;MAC1C,OAAO,GAAGE,IAAI,GAAGD,IAAI,EAAE;IACzB;IACA,MAAM,IAAIL,qBAAqB,CAAC,QAAQI,IAAI,mBAAmB,CAAC;EAClE;EAEA,MAAM,IAAIL,wBAAwB,CAChC,SAASS,eAAA,CAAeL,KAAK,CAAC,6BAChC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMM,MAAM,GACVA,CAACN,KAAa,GAAG,CAAC,KAClB,CAAC;EAAED,KAAK,GAAG;IAAEQ,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3CT,OAAO,CAACC,KAAK,EAAEC,KAAK,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,OAAO,GACXA,CAAC,GAAGC,MAA8B,KAClC,CAAC;EAAEV,KAAK,GAAG;IAAEQ,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3CG,oBAAA,CAAAD,MAAM,EAAAE,IAAA,CAANF,MAAM,EAAMT,KAAK,IAAKF,OAAO,CAACC,KAAK,EAAEC,KAAK,CAAC,CAAC,CAACY,IAAI,CAAC,GAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GACVA,CAACb,KAAa,GAAG,CAAC,KAClB,CAAC;EAAED,KAAK,GAAG;IAAEQ,QAAQ,EAAE,CAAC;EAAE;AAAkB,CAAC,KAC3CT,OAAO,CAACC,KAAK,EAAEC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC;AAE9C,SAASM,MAAM,EAAEE,OAAO,EAAEK,MAAM","ignoreList":[]}
|
|
@@ -2,19 +2,13 @@ import { get } from "../../utils/helpers/objects";
|
|
|
2
2
|
import { ThemePropertyException } from "../../exceptions";
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
|
-
export const getProp =
|
|
6
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
8
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
5
|
+
export const getProp = (theme = {}, path = "", defaultValue = "") => {
|
|
9
6
|
return path === "" ? defaultValue : get(theme, path, defaultValue);
|
|
10
7
|
};
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
*/
|
|
14
|
-
export const getThemeProp =
|
|
15
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
17
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
11
|
+
export const getThemeProp = (theme = {}, path = "", defaultValue = "") => {
|
|
18
12
|
const value = getProp(theme, path, defaultValue);
|
|
19
13
|
if (value != null && (typeof value === "string" || typeof value === "number" || typeof value === "object")) {
|
|
20
14
|
return value;
|
|
@@ -24,10 +18,7 @@ export const getThemeProp = function () {
|
|
|
24
18
|
|
|
25
19
|
/**
|
|
26
20
|
*/
|
|
27
|
-
export const getThemeStringProp =
|
|
28
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
30
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
21
|
+
export const getThemeStringProp = (theme = {}, path = "", defaultValue = "") => {
|
|
31
22
|
const value = getProp(theme, path, defaultValue);
|
|
32
23
|
if (typeof value === "string") {
|
|
33
24
|
return value;
|
|
@@ -39,10 +30,7 @@ export const getThemeStringProp = function () {
|
|
|
39
30
|
|
|
40
31
|
/**
|
|
41
32
|
*/
|
|
42
|
-
export const getThemeNumberProp =
|
|
43
|
-
let theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
44
|
-
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
45
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
33
|
+
export const getThemeNumberProp = (theme = {}, path = "", defaultValue = 0) => {
|
|
46
34
|
const value = getProp(theme, path, defaultValue);
|
|
47
35
|
if (typeof value === "number") {
|
|
48
36
|
return value;
|
|
@@ -55,10 +43,7 @@ export const getThemeNumberProp = function () {
|
|
|
55
43
|
*/
|
|
56
44
|
/**
|
|
57
45
|
*/
|
|
58
|
-
export const themeProp = (path, defaultValue) =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} = _ref;
|
|
62
|
-
return getThemeProp(theme, path, defaultValue);
|
|
63
|
-
};
|
|
46
|
+
export const themeProp = (path, defaultValue) => ({
|
|
47
|
+
theme
|
|
48
|
+
}) => getThemeProp(theme, path, defaultValue);
|
|
64
49
|
//# sourceMappingURL=themeProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeProps.js","names":["get","ThemePropertyException","getProp","theme","
|
|
1
|
+
{"version":3,"file":"themeProps.js","names":["get","ThemePropertyException","getProp","theme","path","defaultValue","getThemeProp","value","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,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,SAASC,sBAAsB,QAAQ,kBAAkB;AAIzD;AACA;AACA,OAAO,MAAMC,OAAO,GAAGA,CACrBC,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAA4B,GAAG,EAAE,KACb;EACpB,OAAOD,IAAI,KAAK,EAAE,GAAGC,YAAY,GAAGL,GAAG,CAACG,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;AACpE,CAAC;;AAED;AACA;AACA,OAAO,MAAMC,YAAY,GAAGA,CAC1BH,KAAoB,GAAG,CAAC,CAAC,EACzBC,IAAY,GAAG,EAAE,EACjBC,YAA4B,GAAG,EAAE,KACd;EACnB,MAAME,KAAK,GAAGL,OAAO,CAACC,KAAK,EAAEC,IAAI,EAAEC,YAAY,CAAC;EAEhD,IACEE,KAAK,IAAI,IAAI,KACZ,OAAOA,KAAK,KAAK,QAAQ,IACxB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAO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|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
*/
|
|
24
|
-
const setLocales = (state,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
24
|
+
const setLocales = (state, {
|
|
25
|
+
locale,
|
|
26
|
+
locales
|
|
27
|
+
}) => {
|
|
29
28
|
// set locale in cookie
|
|
30
29
|
if (state.locales.length > 1) {
|
|
31
30
|
setCookie("locale", locale);
|
|
@@ -60,9 +59,7 @@ const initialState = {
|
|
|
60
59
|
/**
|
|
61
60
|
* Form reducer
|
|
62
61
|
*/
|
|
63
|
-
export const I18nReducer =
|
|
64
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
65
|
-
let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;
|
|
62
|
+
export const I18nReducer = (state = initialState, action = void 0) => {
|
|
66
63
|
if (!action) {
|
|
67
64
|
return state;
|
|
68
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nReducer.js","names":["Cache","setCookie","clearCookie","Locales","updateLocale","state","locale","locales","length","clear","setLocales","
|
|
1
|
+
{"version":3,"file":"I18nReducer.js","names":["Cache","setCookie","clearCookie","Locales","updateLocale","state","locale","locales","length","clear","setLocales","getDefaultLocale","navigator","language","split","initialState","I18nReducer","action","type","payload"],"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,OAAOA,KAAK,MAAM,2BAA2B;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,6BAA6B;AAEpE,OAAOC,OAAO,MAAM,oBAAoB;AAMxC;AACA;AACA,MAAMC,YAAY,GAAGA,CAACC,KAAgB,EAAEC,MAAc,KAAK;EACzD;EACA,IAAID,KAAK,CAACE,OAAO,EAAEC,MAAM,GAAG,CAAC,EAAE;IAC7BP,SAAS,CAAC,QAAQ,EAAEK,MAAM,CAAC;EAC7B,CAAC,MAAM;IACLJ,WAAW,CAAC,QAAQ,CAAC;EACvB;;EAEA;EACAF,KAAK,CAACS,KAAK,CAAC,CAAC;EAEb,OAAO;IACL,GAAGJ,KAAK;IACRC;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA,MAAMI,UAAU,GAAGA,CACjBL,KAAgB,EAChB;EAAEC,MAAM;EAAEC;AAA8C,CAAC,KACtD;EACH;EACA,IAAIF,KAAK,CAACE,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;IA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