@qrvey/utils 1.12.0-9 → 1.12.0
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/dist/charts/adapters/endpointData.js +3 -4
- package/dist/charts/adapters/endpointDataGet.js +2 -2
- package/dist/cjs/charts/adapters/endpointData.js +2 -3
- package/dist/cjs/charts/adapters/endpointDataGet.js +1 -1
- package/dist/cjs/constants/Charts.Const.d.ts +4 -1
- package/dist/cjs/constants/Charts.Const.js +3 -0
- package/dist/cjs/filters/adapters/FDToFlatUI.js +2 -2
- package/dist/cjs/filters/adapters/FDToUI.js +2 -2
- package/dist/cjs/filters/adapters/UIToFD.js +2 -2
- package/dist/cjs/filters/adapters/UIToFlatUI.js +2 -2
- package/dist/cjs/filters/adapters/UIToOldLogic.js +2 -2
- package/dist/cjs/filters/adapters/adaptFilterData.js +2 -2
- package/dist/cjs/filters/adapters/flatUIToFD.js +2 -2
- package/dist/cjs/filters/adapters/flatUIToOldLogic.js +2 -2
- package/dist/cjs/filters/adapters/flatUIToUI.js +2 -2
- package/dist/cjs/filters/helpers/OLD_getAggFilters.js +2 -2
- package/dist/cjs/filters/helpers/backend/getLogicByScopes.js +2 -2
- package/dist/cjs/filters/helpers/common/excludeFiltersByAggregateColumn.js +2 -2
- package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +2 -2
- package/dist/cjs/filters/helpers/common/excludeFiltersByScopes.js +2 -2
- package/dist/cjs/filters/helpers/common/getFiltersByAggregateColumn.js +2 -2
- package/dist/cjs/filters/helpers/common/getFiltersByParams.js +2 -2
- package/dist/cjs/filters/helpers/common/getFiltersByScopes.js +2 -2
- package/dist/cjs/filters/helpers/common/getFiltersByScopesIds.js +2 -2
- package/dist/cjs/filters/helpers/common/getFiltersByVisibility.js +2 -2
- package/dist/cjs/filters/helpers/settings/getFilterSettings.js +4 -4
- package/dist/cjs/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
- package/dist/cjs/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIFlatFilterByParams.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
- package/dist/cjs/filters/services/UChartApi.js +2 -2
- package/dist/cjs/filters/services/UChartPaginationApi.js +3 -3
- package/dist/cjs/format/format.js +2 -2
- package/dist/cjs/general/array/filterNestedTree.js +2 -2
- package/dist/cjs/general/object/objectCopy.js +8 -7
- package/dist/cjs/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderChartLabels.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderChartNames.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderMenuActions.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderRadarType.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderRadarType.js +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/dashboard/II18nDashboard.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardToast.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModal.d.ts +67 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModal.js +2 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalApplyButtonLabel.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalApplyButtonLabel.js +2 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalErrorMessages.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalErrorMessages.js +2 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalRecurrence.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalRecurrence.js +2 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalTimeStamp.d.ts +7 -0
- package/dist/cjs/globalization/interfaces/export/II18nExportingModalTimeStamp.js +2 -0
- package/dist/cjs/globalization/interfaces/export/index.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/export/index.js +21 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionHour.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionMillisecond.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionMillisecond.js +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionText.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionText.js +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/panel/I18nPanelColumnInteractive.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/panel/I18nPanelColumnInteractive.js +2 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanel.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelErrors.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelTooltips.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/panel/index.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/panel/index.js +1 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +4 -1
- package/dist/cjs/globalization/labels/I18N_DEFAULT.d.ts +1 -1
- package/dist/cjs/globalization/labels/I18N_DEFAULT.js +3 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +7 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +7 -2
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +18 -0
- package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +2 -0
- package/dist/cjs/globalization/labels/export/I18N_EXPORT_MODAL.d.ts +5 -0
- package/dist/cjs/globalization/labels/export/I18N_EXPORT_MODAL.js +78 -0
- package/dist/cjs/globalization/labels/export/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/export/index.js +17 -0
- package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +20 -5
- package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +9 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +4 -1
- package/dist/cjs/globalization/service/i18nextBuilder.js +2 -3
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/services/helpers/Request.js +5 -2
- package/dist/cjs/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK.d.ts +6 -0
- package/dist/cjs/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK.js +10 -0
- package/dist/cjs/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT.d.ts +6 -0
- package/dist/cjs/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT.js +10 -0
- package/dist/cjs/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +39 -0
- package/dist/cjs/themes/constants/AUTOMATIC_CSS_VARIABLES.js +22 -0
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +15 -0
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +19 -0
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +15 -0
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +19 -0
- package/dist/cjs/themes/constants/CANVAS_CSS_VARIABLES.d.ts +6 -0
- package/dist/cjs/themes/constants/CANVAS_CSS_VARIABLES.js +10 -0
- package/dist/cjs/themes/constants/COLOR_TYPE.d.ts +4 -0
- package/dist/cjs/themes/constants/COLOR_TYPE.js +8 -0
- package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +4 -0
- package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.js +8 -0
- package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +15 -0
- package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.js +19 -0
- package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +1 -0
- package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +4 -0
- package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +1 -0
- package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.js +4 -0
- package/dist/cjs/themes/constants/index.d.ts +10 -0
- package/dist/cjs/themes/constants/index.js +26 -0
- package/dist/cjs/themes/helpers/getCSSVariablesByDestination.d.ts +45 -0
- package/dist/cjs/themes/helpers/getCSSVariablesByDestination.js +15 -0
- package/dist/cjs/themes/helpers/index.d.ts +7 -0
- package/dist/cjs/themes/helpers/index.js +23 -0
- package/dist/cjs/themes/helpers/isDarkColor.d.ts +7 -0
- package/dist/cjs/themes/helpers/isDarkColor.js +15 -0
- package/dist/cjs/themes/helpers/isHexadecimalColor.d.ts +6 -0
- package/dist/cjs/themes/helpers/isHexadecimalColor.js +14 -0
- package/dist/cjs/themes/helpers/isRGBAColor.d.ts +6 -0
- package/dist/cjs/themes/helpers/isRGBAColor.js +14 -0
- package/dist/cjs/themes/helpers/lightOrDark.d.ts +9 -0
- package/dist/cjs/themes/helpers/lightOrDark.js +56 -0
- package/dist/cjs/themes/helpers/setAutomaticCSSVariablesForDark.d.ts +9 -0
- package/dist/cjs/themes/helpers/setAutomaticCSSVariablesForDark.js +43 -0
- package/dist/cjs/themes/index.d.ts +3 -0
- package/dist/cjs/themes/index.js +19 -0
- package/dist/cjs/themes/interfaces/IColorCSSVariableDestination.d.ts +2 -0
- package/dist/cjs/themes/interfaces/IColorCSSVariableDestination.js +2 -0
- package/dist/cjs/themes/interfaces/IColorType.d.ts +2 -0
- package/dist/cjs/themes/interfaces/IColorType.js +2 -0
- package/dist/cjs/themes/interfaces/index.d.ts +2 -0
- package/dist/cjs/themes/interfaces/index.js +18 -0
- package/dist/cjs/tokens/getCleanCustomTokens.d.ts +9 -0
- package/dist/cjs/tokens/getCleanCustomTokens.js +22 -0
- package/dist/cjs/tokens/getCustomtonTokens.d.ts +3 -3
- package/dist/cjs/tokens/getCustomtonTokens.js +7 -4
- package/dist/cjs/tokens/getCustomtonTokensWithKeys.js +1 -1
- package/dist/cjs/tokens/index.d.ts +1 -0
- package/dist/cjs/tokens/index.js +1 -0
- package/dist/constants/Charts.Const.d.ts +4 -1
- package/dist/constants/Charts.Const.js +3 -0
- package/dist/filters/adapters/FDToFlatUI.js +2 -2
- package/dist/filters/adapters/FDToUI.js +2 -2
- package/dist/filters/adapters/UIToFD.js +2 -2
- package/dist/filters/adapters/UIToFlatUI.js +2 -2
- package/dist/filters/adapters/UIToOldLogic.js +2 -2
- package/dist/filters/adapters/adaptFilterData.js +2 -2
- package/dist/filters/adapters/flatUIToFD.js +2 -2
- package/dist/filters/adapters/flatUIToOldLogic.js +2 -2
- package/dist/filters/adapters/flatUIToUI.js +2 -2
- package/dist/filters/helpers/OLD_getAggFilters.js +2 -2
- package/dist/filters/helpers/backend/getLogicByScopes.js +2 -2
- package/dist/filters/helpers/common/excludeFiltersByAggregateColumn.js +2 -2
- package/dist/filters/helpers/common/excludeFiltersByParams.js +2 -2
- package/dist/filters/helpers/common/excludeFiltersByScopes.js +2 -2
- package/dist/filters/helpers/common/getFiltersByAggregateColumn.js +2 -2
- package/dist/filters/helpers/common/getFiltersByParams.js +2 -2
- package/dist/filters/helpers/common/getFiltersByScopes.js +2 -2
- package/dist/filters/helpers/common/getFiltersByScopesIds.js +2 -2
- package/dist/filters/helpers/common/getFiltersByVisibility.js +2 -2
- package/dist/filters/helpers/settings/getFilterSettings.js +4 -4
- package/dist/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
- package/dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
- package/dist/filters/helpers/ui/getUIFlatFilterByParams.js +2 -2
- package/dist/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
- package/dist/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
- package/dist/filters/services/UChartApi.js +2 -2
- package/dist/filters/services/UChartPaginationApi.js +3 -3
- package/dist/format/format.js +2 -2
- package/dist/general/array/filterNestedTree.js +2 -2
- package/dist/general/object/objectCopy.js +8 -7
- package/dist/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderChartLabels.d.ts +1 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderChartNames.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderMenuActions.d.ts +5 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderRadarType.d.ts +6 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +9 -0
- package/dist/globalization/interfaces/dashboard/II18nDashboard.d.ts +1 -0
- package/dist/globalization/interfaces/dashboard/II18nDashboardToast.d.ts +1 -0
- package/dist/globalization/interfaces/export/II18nExportingModal.d.ts +67 -0
- package/dist/globalization/interfaces/export/II18nExportingModalApplyButtonLabel.d.ts +3 -0
- package/dist/globalization/interfaces/export/II18nExportingModalApplyButtonLabel.js +1 -0
- package/dist/globalization/interfaces/export/II18nExportingModalErrorMessages.d.ts +3 -0
- package/dist/globalization/interfaces/export/II18nExportingModalErrorMessages.js +1 -0
- package/dist/globalization/interfaces/export/II18nExportingModalRecurrence.d.ts +6 -0
- package/dist/globalization/interfaces/export/II18nExportingModalRecurrence.js +1 -0
- package/dist/globalization/interfaces/export/II18nExportingModalTimeStamp.d.ts +7 -0
- package/dist/globalization/interfaces/export/II18nExportingModalTimeStamp.js +1 -0
- package/dist/globalization/interfaces/export/index.d.ts +5 -0
- package/dist/globalization/interfaces/export/index.js +5 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionHour.d.ts +2 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionMillisecond.d.ts +5 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionMillisecond.js +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionText.d.ts +5 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionText.js +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +4 -0
- package/dist/globalization/interfaces/panel/I18nPanelColumnInteractive.d.ts +5 -0
- package/dist/globalization/interfaces/panel/I18nPanelColumnInteractive.js +1 -0
- package/dist/globalization/interfaces/panel/II18nPanel.d.ts +2 -0
- package/dist/globalization/interfaces/panel/II18nPanelErrors.d.ts +1 -0
- package/dist/globalization/interfaces/panel/II18nPanelTooltips.d.ts +3 -0
- package/dist/globalization/interfaces/panel/index.d.ts +1 -0
- package/dist/globalization/interfaces/panel/index.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +4 -1
- package/dist/globalization/labels/I18N_DEFAULT.d.ts +1 -1
- package/dist/globalization/labels/I18N_DEFAULT.js +3 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +7 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +7 -2
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +18 -0
- package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +2 -0
- package/dist/globalization/labels/export/I18N_EXPORT_MODAL.d.ts +5 -0
- package/dist/globalization/labels/export/I18N_EXPORT_MODAL.js +75 -0
- package/dist/globalization/labels/export/index.d.ts +1 -0
- package/dist/globalization/labels/export/index.js +1 -0
- package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +20 -5
- package/dist/globalization/labels/panel/I18N_PANEL.js +9 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +4 -1
- package/dist/globalization/service/i18nextBuilder.js +3 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/services/helpers/Request.js +5 -2
- package/dist/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK.d.ts +6 -0
- package/dist/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK.js +7 -0
- package/dist/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT.d.ts +6 -0
- package/dist/themes/constants/AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT.js +7 -0
- package/dist/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +39 -0
- package/dist/themes/constants/AUTOMATIC_CSS_VARIABLES.js +19 -0
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +15 -0
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +16 -0
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +15 -0
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +16 -0
- package/dist/themes/constants/CANVAS_CSS_VARIABLES.d.ts +6 -0
- package/dist/themes/constants/CANVAS_CSS_VARIABLES.js +7 -0
- package/dist/themes/constants/COLOR_TYPE.d.ts +4 -0
- package/dist/themes/constants/COLOR_TYPE.js +5 -0
- package/dist/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +4 -0
- package/dist/themes/constants/CSS_VARIABLE_DESTINATION.js +5 -0
- package/dist/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +15 -0
- package/dist/themes/constants/GLOBAL_CSS_VARIABLES.js +16 -0
- package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +1 -0
- package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +1 -0
- package/dist/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +1 -0
- package/dist/themes/constants/RGBA_REGULAR_EXPRESION.js +1 -0
- package/dist/themes/constants/index.d.ts +10 -0
- package/dist/themes/constants/index.js +10 -0
- package/dist/themes/helpers/getCSSVariablesByDestination.d.ts +45 -0
- package/dist/themes/helpers/getCSSVariablesByDestination.js +11 -0
- package/dist/themes/helpers/index.d.ts +7 -0
- package/dist/themes/helpers/index.js +7 -0
- package/dist/themes/helpers/isDarkColor.d.ts +7 -0
- package/dist/themes/helpers/isDarkColor.js +11 -0
- package/dist/themes/helpers/isHexadecimalColor.d.ts +6 -0
- package/dist/themes/helpers/isHexadecimalColor.js +10 -0
- package/dist/themes/helpers/isRGBAColor.d.ts +6 -0
- package/dist/themes/helpers/isRGBAColor.js +10 -0
- package/dist/themes/helpers/lightOrDark.d.ts +9 -0
- package/dist/themes/helpers/lightOrDark.js +52 -0
- package/dist/themes/helpers/setAutomaticCSSVariablesForDark.d.ts +9 -0
- package/dist/themes/helpers/setAutomaticCSSVariablesForDark.js +39 -0
- package/dist/themes/index.d.ts +3 -0
- package/dist/themes/index.js +3 -0
- package/dist/themes/interfaces/IColorCSSVariableDestination.d.ts +2 -0
- package/dist/themes/interfaces/IColorCSSVariableDestination.js +1 -0
- package/dist/themes/interfaces/IColorType.d.ts +2 -0
- package/dist/themes/interfaces/IColorType.js +1 -0
- package/dist/themes/interfaces/index.d.ts +2 -0
- package/dist/themes/interfaces/index.js +2 -0
- package/dist/tokens/getCleanCustomTokens.d.ts +9 -0
- package/dist/tokens/getCleanCustomTokens.js +18 -0
- package/dist/tokens/getCustomtonTokens.d.ts +3 -3
- package/dist/tokens/getCustomtonTokens.js +8 -5
- package/dist/tokens/getCustomtonTokensWithKeys.js +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +1 -0
- package/package.json +1 -1
- package/dist/cjs/tokens/getCustomtonTokensWithKeys.test.js +0 -23
- package/dist/tokens/getCustomtonTokensWithKeys.test.js +0 -21
- /package/dist/{cjs/tokens/getCustomtonTokensWithKeys.test.d.ts → globalization/interfaces/chart_builder/II18nChartBuilderRadarType.js} +0 -0
- /package/dist/{tokens/getCustomtonTokensWithKeys.test.d.ts → globalization/interfaces/export/II18nExportingModal.js} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK } from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK";
|
|
2
|
+
import { AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT } from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT";
|
|
3
|
+
import { AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK } from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK";
|
|
4
|
+
import { AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT } from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT";
|
|
5
|
+
import { COLOR_TYPE } from "./COLOR_TYPE";
|
|
6
|
+
import { CSS_VARIABLE_DESTINATION } from "./CSS_VARIABLE_DESTINATION";
|
|
7
|
+
/**
|
|
8
|
+
* Collection of CSS Variables for the theme and its assigned values.
|
|
9
|
+
*/
|
|
10
|
+
export const AUTOMATIC_CANVAS_CSS_VARIABLES = {
|
|
11
|
+
[CSS_VARIABLE_DESTINATION.GLOBAL]: {
|
|
12
|
+
[COLOR_TYPE.DARK]: AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK,
|
|
13
|
+
[COLOR_TYPE.LIGHT]: AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT,
|
|
14
|
+
},
|
|
15
|
+
[CSS_VARIABLE_DESTINATION.CANVAS]: {
|
|
16
|
+
[COLOR_TYPE.DARK]: AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK,
|
|
17
|
+
[COLOR_TYPE.LIGHT]: AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection of CSS Variables for Dark Theme and its assigned values.
|
|
3
|
+
*/
|
|
4
|
+
export declare const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK: {
|
|
5
|
+
"--qv-global-header-background-color": string;
|
|
6
|
+
"--qv-global-opacity-black-color": string;
|
|
7
|
+
"--qv-global-border-color": string;
|
|
8
|
+
"--qv-global-divider-color": string;
|
|
9
|
+
"--qv-global-hover-color": string;
|
|
10
|
+
"--qv-global-placeholder-color": string;
|
|
11
|
+
"--qv-pills-background-color": string;
|
|
12
|
+
"--qv-global-text-color": string;
|
|
13
|
+
"--qv-global-text-secondary-color": string;
|
|
14
|
+
"--qv-global-text-tertiary-color": string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GLOBAL_CSS_VARIABLES } from "./GLOBAL_CSS_VARIABLES";
|
|
2
|
+
/**
|
|
3
|
+
* Collection of CSS Variables for Dark Theme and its assigned values.
|
|
4
|
+
*/
|
|
5
|
+
export const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK = {
|
|
6
|
+
[GLOBAL_CSS_VARIABLES.HEADER_BACKGROUND_COLOR]: "#FFFFFF20",
|
|
7
|
+
[GLOBAL_CSS_VARIABLES.BACKGROUND_OPACITY_BLACK_COLOR]: "#00000010",
|
|
8
|
+
[GLOBAL_CSS_VARIABLES.BORDER_COLOR]: "#FFFFFF20",
|
|
9
|
+
[GLOBAL_CSS_VARIABLES.DIVIDER_COLOR]: "#FFFFFF20",
|
|
10
|
+
[GLOBAL_CSS_VARIABLES.HOVER_COLOR]: "#FFFFFF10",
|
|
11
|
+
[GLOBAL_CSS_VARIABLES.PLACEHOLDER_COLOR]: "#FFFFFF90",
|
|
12
|
+
[GLOBAL_CSS_VARIABLES.PILLS_BACKGROUND_COLOR]: "#00000020",
|
|
13
|
+
[GLOBAL_CSS_VARIABLES.TEXT_COLOR]: "#FFFFFF",
|
|
14
|
+
[GLOBAL_CSS_VARIABLES.TEXT_SECONDARY_COLOR]: "#FFFFFF90",
|
|
15
|
+
[GLOBAL_CSS_VARIABLES.TEXT_TERTIARY_COLOR]: "#FFFFFF80",
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection of CSS Variables for Light Themes and its assigned values.
|
|
3
|
+
*/
|
|
4
|
+
export declare const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT: {
|
|
5
|
+
"--qv-global-header-background-color": string;
|
|
6
|
+
"--qv-global-opacity-black-color": string;
|
|
7
|
+
"--qv-global-border-color": string;
|
|
8
|
+
"--qv-global-divider-color": string;
|
|
9
|
+
"--qv-global-hover-color": string;
|
|
10
|
+
"--qv-global-placeholder-color": string;
|
|
11
|
+
"--qv-pills-background-color": string;
|
|
12
|
+
"--qv-global-text-color": any;
|
|
13
|
+
"--qv-global-text-secondary-color": string;
|
|
14
|
+
"--qv-global-text-tertiary-color": string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GLOBAL_CSS_VARIABLES } from "./GLOBAL_CSS_VARIABLES";
|
|
2
|
+
/**
|
|
3
|
+
* Collection of CSS Variables for Light Themes and its assigned values.
|
|
4
|
+
*/
|
|
5
|
+
export const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT = {
|
|
6
|
+
[GLOBAL_CSS_VARIABLES.HEADER_BACKGROUND_COLOR]: "#00000009",
|
|
7
|
+
[GLOBAL_CSS_VARIABLES.BACKGROUND_OPACITY_BLACK_COLOR]: "#FFFFFF10",
|
|
8
|
+
[GLOBAL_CSS_VARIABLES.BORDER_COLOR]: "#00000020",
|
|
9
|
+
[GLOBAL_CSS_VARIABLES.DIVIDER_COLOR]: "#00000020",
|
|
10
|
+
[GLOBAL_CSS_VARIABLES.HOVER_COLOR]: "#00000010",
|
|
11
|
+
[GLOBAL_CSS_VARIABLES.PLACEHOLDER_COLOR]: "#00000070",
|
|
12
|
+
[GLOBAL_CSS_VARIABLES.PILLS_BACKGROUND_COLOR]: "#FFFFFF40",
|
|
13
|
+
[GLOBAL_CSS_VARIABLES.TEXT_COLOR]: undefined,
|
|
14
|
+
[GLOBAL_CSS_VARIABLES.TEXT_SECONDARY_COLOR]: "#00000080",
|
|
15
|
+
[GLOBAL_CSS_VARIABLES.TEXT_TERTIARY_COLOR]: "#00000070",
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection of CSS Variables to apply for Dark Theme
|
|
3
|
+
*/
|
|
4
|
+
export declare enum GLOBAL_CSS_VARIABLES {
|
|
5
|
+
BACKGROUND_OPACITY_BLACK_COLOR = "--qv-global-opacity-black-color",
|
|
6
|
+
HEADER_BACKGROUND_COLOR = "--qv-global-header-background-color",
|
|
7
|
+
BORDER_COLOR = "--qv-global-border-color",
|
|
8
|
+
DIVIDER_COLOR = "--qv-global-divider-color",
|
|
9
|
+
HOVER_COLOR = "--qv-global-hover-color",
|
|
10
|
+
PLACEHOLDER_COLOR = "--qv-global-placeholder-color",
|
|
11
|
+
PILLS_BACKGROUND_COLOR = "--qv-pills-background-color",
|
|
12
|
+
TEXT_COLOR = "--qv-global-text-color",
|
|
13
|
+
TEXT_SECONDARY_COLOR = "--qv-global-text-secondary-color",
|
|
14
|
+
TEXT_TERTIARY_COLOR = "--qv-global-text-tertiary-color"
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection of CSS Variables to apply for Dark Theme
|
|
3
|
+
*/
|
|
4
|
+
export var GLOBAL_CSS_VARIABLES;
|
|
5
|
+
(function (GLOBAL_CSS_VARIABLES) {
|
|
6
|
+
GLOBAL_CSS_VARIABLES["BACKGROUND_OPACITY_BLACK_COLOR"] = "--qv-global-opacity-black-color";
|
|
7
|
+
GLOBAL_CSS_VARIABLES["HEADER_BACKGROUND_COLOR"] = "--qv-global-header-background-color";
|
|
8
|
+
GLOBAL_CSS_VARIABLES["BORDER_COLOR"] = "--qv-global-border-color";
|
|
9
|
+
GLOBAL_CSS_VARIABLES["DIVIDER_COLOR"] = "--qv-global-divider-color";
|
|
10
|
+
GLOBAL_CSS_VARIABLES["HOVER_COLOR"] = "--qv-global-hover-color";
|
|
11
|
+
GLOBAL_CSS_VARIABLES["PLACEHOLDER_COLOR"] = "--qv-global-placeholder-color";
|
|
12
|
+
GLOBAL_CSS_VARIABLES["PILLS_BACKGROUND_COLOR"] = "--qv-pills-background-color";
|
|
13
|
+
GLOBAL_CSS_VARIABLES["TEXT_COLOR"] = "--qv-global-text-color";
|
|
14
|
+
GLOBAL_CSS_VARIABLES["TEXT_SECONDARY_COLOR"] = "--qv-global-text-secondary-color";
|
|
15
|
+
GLOBAL_CSS_VARIABLES["TEXT_TERTIARY_COLOR"] = "--qv-global-text-tertiary-color";
|
|
16
|
+
})(GLOBAL_CSS_VARIABLES || (GLOBAL_CSS_VARIABLES = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HEXADECIMAL_REGULAR_EXPRESSION: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const HEXADECIMAL_REGULAR_EXPRESSION = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RGBA_REGULAR_EXPRESSION: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const RGBA_REGULAR_EXPRESSION = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK";
|
|
2
|
+
export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT";
|
|
3
|
+
export * from "./AUTOMATIC_CSS_VARIABLES";
|
|
4
|
+
export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK";
|
|
5
|
+
export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT";
|
|
6
|
+
export * from "./COLOR_TYPE";
|
|
7
|
+
export * from "./CSS_VARIABLE_DESTINATION";
|
|
8
|
+
export * from "./GLOBAL_CSS_VARIABLES";
|
|
9
|
+
export * from "./HEXADECIMAL_REGULAR_EXPRESSION";
|
|
10
|
+
export * from "./RGBA_REGULAR_EXPRESION";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_DARK";
|
|
2
|
+
export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT";
|
|
3
|
+
export * from "./AUTOMATIC_CSS_VARIABLES";
|
|
4
|
+
export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK";
|
|
5
|
+
export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT";
|
|
6
|
+
export * from "./COLOR_TYPE";
|
|
7
|
+
export * from "./CSS_VARIABLE_DESTINATION";
|
|
8
|
+
export * from "./GLOBAL_CSS_VARIABLES";
|
|
9
|
+
export * from "./HEXADECIMAL_REGULAR_EXPRESSION";
|
|
10
|
+
export * from "./RGBA_REGULAR_EXPRESION";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IColorCSSVariableDestination } from "../interfaces/IColorCSSVariableDestination";
|
|
2
|
+
/**
|
|
3
|
+
* Gets CSS variables depending on the destination of them.
|
|
4
|
+
* - Destination is the place where the CSS variables are going to be applied. With this, the right CSS variables are searched and set.
|
|
5
|
+
* @param destination the string of the destination.
|
|
6
|
+
* @returns the CSS variables and their values.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCSSVariablesByDestination(destination?: IColorCSSVariableDestination): {
|
|
9
|
+
DARK: {
|
|
10
|
+
"--qv-global-header-background-color": string; /**
|
|
11
|
+
* Gets CSS variables depending on the destination of them.
|
|
12
|
+
* - Destination is the place where the CSS variables are going to be applied. With this, the right CSS variables are searched and set.
|
|
13
|
+
* @param destination the string of the destination.
|
|
14
|
+
* @returns the CSS variables and their values.
|
|
15
|
+
*/
|
|
16
|
+
"--qv-global-opacity-black-color": string;
|
|
17
|
+
"--qv-global-border-color": string;
|
|
18
|
+
"--qv-global-divider-color": string;
|
|
19
|
+
"--qv-global-hover-color": string;
|
|
20
|
+
"--qv-global-placeholder-color": string;
|
|
21
|
+
"--qv-pills-background-color": string;
|
|
22
|
+
"--qv-global-text-color": string;
|
|
23
|
+
"--qv-global-text-secondary-color": string;
|
|
24
|
+
"--qv-global-text-tertiary-color": string;
|
|
25
|
+
};
|
|
26
|
+
LIGHT: {
|
|
27
|
+
"--qv-global-header-background-color": string;
|
|
28
|
+
"--qv-global-opacity-black-color": string;
|
|
29
|
+
"--qv-global-border-color": string;
|
|
30
|
+
"--qv-global-divider-color": string;
|
|
31
|
+
"--qv-global-hover-color": string;
|
|
32
|
+
"--qv-global-placeholder-color": string;
|
|
33
|
+
"--qv-pills-background-color": string;
|
|
34
|
+
"--qv-global-text-color": any;
|
|
35
|
+
"--qv-global-text-secondary-color": string;
|
|
36
|
+
"--qv-global-text-tertiary-color": string;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
DARK: {
|
|
40
|
+
"--qv-canvas-border-color": string;
|
|
41
|
+
};
|
|
42
|
+
LIGHT: {
|
|
43
|
+
"--qv-canvas-border-color": string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AUTOMATIC_CANVAS_CSS_VARIABLES } from "../constants/AUTOMATIC_CSS_VARIABLES";
|
|
2
|
+
import { CSS_VARIABLE_DESTINATION } from "../constants/CSS_VARIABLE_DESTINATION";
|
|
3
|
+
/**
|
|
4
|
+
* Gets CSS variables depending on the destination of them.
|
|
5
|
+
* - Destination is the place where the CSS variables are going to be applied. With this, the right CSS variables are searched and set.
|
|
6
|
+
* @param destination the string of the destination.
|
|
7
|
+
* @returns the CSS variables and their values.
|
|
8
|
+
*/
|
|
9
|
+
export function getCSSVariablesByDestination(destination = CSS_VARIABLE_DESTINATION.GLOBAL) {
|
|
10
|
+
return AUTOMATIC_CANVAS_CSS_VARIABLES[destination];
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./getCSSVariablesByDestination";
|
|
2
|
+
export * from "./lightOrDark";
|
|
3
|
+
export * from "./isDarkColor";
|
|
4
|
+
export * from "./isHexadecimalColor";
|
|
5
|
+
export * from "./isRGBAColor";
|
|
6
|
+
export * from "./lightOrDark";
|
|
7
|
+
export * from "./setAutomaticCSSVariablesForDark";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./getCSSVariablesByDestination";
|
|
2
|
+
export * from "./lightOrDark";
|
|
3
|
+
export * from "./isDarkColor";
|
|
4
|
+
export * from "./isHexadecimalColor";
|
|
5
|
+
export * from "./isRGBAColor";
|
|
6
|
+
export * from "./lightOrDark";
|
|
7
|
+
export * from "./setAutomaticCSSVariablesForDark";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if the Color is dark or light.
|
|
3
|
+
* Uses the lightOrDark module.
|
|
4
|
+
* @param color the string of the color (RGBA, or Hexadecimal)
|
|
5
|
+
* @returns true: the color is dark.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isDarkColor(color: string, brightnessThreshold?: number): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { COLOR_TYPE } from "../constants/COLOR_TYPE";
|
|
2
|
+
import { lightOrDark } from "./lightOrDark";
|
|
3
|
+
/**
|
|
4
|
+
* Determines if the Color is dark or light.
|
|
5
|
+
* Uses the lightOrDark module.
|
|
6
|
+
* @param color the string of the color (RGBA, or Hexadecimal)
|
|
7
|
+
* @returns true: the color is dark.
|
|
8
|
+
*/
|
|
9
|
+
export function isDarkColor(color, brightnessThreshold = 127.5) {
|
|
10
|
+
return lightOrDark(color, brightnessThreshold) === COLOR_TYPE.DARK;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { HEXADECIMAL_REGULAR_EXPRESSION } from "../constants/HEXADECIMAL_REGULAR_EXPRESSION";
|
|
3
|
+
/**
|
|
4
|
+
* Validates if the given color is an hexadecimal structure
|
|
5
|
+
* @param color the string of the color
|
|
6
|
+
* @returns true: the color is an hexadecimal type
|
|
7
|
+
*/
|
|
8
|
+
export function isHexadecimalColor(color = "") {
|
|
9
|
+
return !isEmpty(color === null || color === void 0 ? void 0 : color.match(HEXADECIMAL_REGULAR_EXPRESSION));
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { RGBA_REGULAR_EXPRESSION } from "../constants/RGBA_REGULAR_EXPRESION";
|
|
3
|
+
/**
|
|
4
|
+
* Validates if the given color is an RGBA structure
|
|
5
|
+
* @param color the string of the color
|
|
6
|
+
* @returns true: the color is an RGBA type
|
|
7
|
+
*/
|
|
8
|
+
export function isRGBAColor(color = "") {
|
|
9
|
+
return !isEmpty(color === null || color === void 0 ? void 0 : color.match(RGBA_REGULAR_EXPRESSION));
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IColorType } from "../interfaces/IColorType";
|
|
2
|
+
/**
|
|
3
|
+
* Validates if the given color is light or dark
|
|
4
|
+
* The module extracts the rgba channels and calculate the brightness or darkness by a threshold
|
|
5
|
+
* - If there is not color provided, the returning will be Light
|
|
6
|
+
* @param color the string of the color.
|
|
7
|
+
* @returns the color type (Dark or Light)
|
|
8
|
+
*/
|
|
9
|
+
export declare function lightOrDark(color: string, brightnessThreshold?: number, opacityThreshold?: number): IColorType;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { COLOR_TYPE } from "../constants/COLOR_TYPE";
|
|
3
|
+
import { RGBA_REGULAR_EXPRESSION } from "../constants/RGBA_REGULAR_EXPRESION";
|
|
4
|
+
import { isHexadecimalColor } from "./isHexadecimalColor";
|
|
5
|
+
import { isRGBAColor } from "./isRGBAColor";
|
|
6
|
+
/**
|
|
7
|
+
* Validates if the given color is light or dark
|
|
8
|
+
* The module extracts the rgba channels and calculate the brightness or darkness by a threshold
|
|
9
|
+
* - If there is not color provided, the returning will be Light
|
|
10
|
+
* @param color the string of the color.
|
|
11
|
+
* @returns the color type (Dark or Light)
|
|
12
|
+
*/
|
|
13
|
+
export function lightOrDark(color, brightnessThreshold = 127.5, opacityThreshold = 0.5) {
|
|
14
|
+
if (isEmpty(color))
|
|
15
|
+
return COLOR_TYPE.LIGHT;
|
|
16
|
+
const rgbaColor = isRGBAColor(color);
|
|
17
|
+
const hexadecimalColor = isHexadecimalColor(color);
|
|
18
|
+
if (!rgbaColor && !hexadecimalColor)
|
|
19
|
+
return;
|
|
20
|
+
let r, g, b, a;
|
|
21
|
+
if (rgbaColor) {
|
|
22
|
+
const colors = color.match(RGBA_REGULAR_EXPRESSION);
|
|
23
|
+
r = Number(colors[1]);
|
|
24
|
+
g = Number(colors[2]);
|
|
25
|
+
b = Number(colors[3]);
|
|
26
|
+
a = rgbaOpacity(color);
|
|
27
|
+
}
|
|
28
|
+
if (hexadecimalColor) {
|
|
29
|
+
const colorCode = +`0x${color
|
|
30
|
+
.slice(1)
|
|
31
|
+
.replace(color.length < 5 && /./g, "$&$&")}`;
|
|
32
|
+
r = colorCode >> 16;
|
|
33
|
+
g = (colorCode >> 8) & 255;
|
|
34
|
+
b = colorCode & 255;
|
|
35
|
+
a = hexadecimalOpacity(color);
|
|
36
|
+
}
|
|
37
|
+
// HSP equation from http://alienryderflex.com/hsp.html
|
|
38
|
+
const hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));
|
|
39
|
+
if (hsp > brightnessThreshold || a < opacityThreshold) {
|
|
40
|
+
return COLOR_TYPE.LIGHT;
|
|
41
|
+
}
|
|
42
|
+
return COLOR_TYPE.DARK;
|
|
43
|
+
}
|
|
44
|
+
function hexadecimalOpacity(hexadecimal) {
|
|
45
|
+
const opacityHexa = hexadecimal.slice(7) || "FF";
|
|
46
|
+
return parseInt(opacityHexa, 16) / 255;
|
|
47
|
+
}
|
|
48
|
+
function rgbaOpacity(rgba) {
|
|
49
|
+
var _a;
|
|
50
|
+
const colors = rgba.match(RGBA_REGULAR_EXPRESSION);
|
|
51
|
+
return (_a = Number(colors[4])) !== null && _a !== void 0 ? _a : 1;
|
|
52
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IColorCSSVariableDestination } from "../interfaces/IColorCSSVariableDestination";
|
|
2
|
+
import { IColorType } from "../interfaces/IColorType";
|
|
3
|
+
/**
|
|
4
|
+
* Sets CSS Variables into a given wrapper collection.
|
|
5
|
+
* For the Dark Theme feature.
|
|
6
|
+
* @param colorType the color type
|
|
7
|
+
* @param wrapperTags the html elements to set the CSS variables
|
|
8
|
+
*/
|
|
9
|
+
export declare function setAutomaticCSSVariablesForDark(colorType: IColorType, wrapperTags: string[], destination?: IColorCSSVariableDestination): void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { CSS_VARIABLE_DESTINATION } from "../constants/CSS_VARIABLE_DESTINATION";
|
|
3
|
+
import { getCSSVariablesByDestination } from "./getCSSVariablesByDestination";
|
|
4
|
+
/**
|
|
5
|
+
* Sets CSS Variables into a given wrapper collection.
|
|
6
|
+
* For the Dark Theme feature.
|
|
7
|
+
* @param colorType the color type
|
|
8
|
+
* @param wrapperTags the html elements to set the CSS variables
|
|
9
|
+
*/
|
|
10
|
+
export function setAutomaticCSSVariablesForDark(colorType, wrapperTags, destination = CSS_VARIABLE_DESTINATION.GLOBAL) {
|
|
11
|
+
if (isEmpty(colorType) || isEmpty(wrapperTags))
|
|
12
|
+
return;
|
|
13
|
+
const cssVariables = getCSSVariablesByDestination(destination);
|
|
14
|
+
const cssVariablesKeys = Object.keys(cssVariables[colorType] || {});
|
|
15
|
+
wrapperTags.forEach((wrapperTag) => {
|
|
16
|
+
const wrapperElement = document.querySelector(wrapperTag);
|
|
17
|
+
setCSSVariable(wrapperElement, cssVariablesKeys, cssVariables[colorType]);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sets CSS Variables into a given wrapper collection.
|
|
22
|
+
* For the Dark Theme feature.
|
|
23
|
+
* @param colorType the color type
|
|
24
|
+
* @param wrapper the html element to set the CSS variables
|
|
25
|
+
* @param cssVariables the CSS variables name to apply the style property
|
|
26
|
+
*/
|
|
27
|
+
function setCSSVariable(wrapper, cssVariables, cssProperties) {
|
|
28
|
+
if (isEmpty(wrapper) || isEmpty(cssVariables))
|
|
29
|
+
return;
|
|
30
|
+
cssVariables.forEach((cssVariable) => {
|
|
31
|
+
const cssProperty = cssProperties[cssVariable];
|
|
32
|
+
if (isEmpty(cssProperty)) {
|
|
33
|
+
wrapper.style.removeProperty(cssVariable);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
wrapper.style.setProperty(cssVariable, cssProperty);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICustomTokensComplex } from "../interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* The function `getCleanCustomTokens` takes an object `customTokens` and returns a new object
|
|
4
|
+
* `cleanTokens` with filtered values based on certain conditions.
|
|
5
|
+
* @param {ICustomTokensComplex} customTokens - The `customTokens` parameter is an object of type
|
|
6
|
+
* `ICustomTokensComplex`.
|
|
7
|
+
* @returns a cleaned version of the customTokens object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCleanCustomTokens(customTokens?: ICustomTokensComplex): ICustomTokensComplex;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _hasProperty, isEmpty } from "../general";
|
|
2
|
+
/**
|
|
3
|
+
* The function `getCleanCustomTokens` takes an object `customTokens` and returns a new object
|
|
4
|
+
* `cleanTokens` with filtered values based on certain conditions.
|
|
5
|
+
* @param {ICustomTokensComplex} customTokens - The `customTokens` parameter is an object of type
|
|
6
|
+
* `ICustomTokensComplex`.
|
|
7
|
+
* @returns a cleaned version of the customTokens object.
|
|
8
|
+
*/
|
|
9
|
+
export function getCleanCustomTokens(customTokens = {}) {
|
|
10
|
+
const cleanTokens = {};
|
|
11
|
+
for (const tokenKey in customTokens) {
|
|
12
|
+
if (_hasProperty(customTokens, tokenKey)) {
|
|
13
|
+
const tokensGroup = customTokens[tokenKey];
|
|
14
|
+
cleanTokens[tokenKey] = tokensGroup.filter((token) => !isEmpty(token.value) && (token.label || token.key));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return cleanTokens;
|
|
18
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ICustomTokensComplex, ICustomTokensSimple } from "../interfaces";
|
|
2
2
|
/**
|
|
3
3
|
* The function `getCustomtonTokens` takes a configuration object and returns a parsed version of the
|
|
4
|
-
* custom tokens.
|
|
4
|
+
* custom tokens, with keys and values appropriately formatted.
|
|
5
5
|
* @param {ICustomTokensSimple | ICustomTokensComplex} customtonTokensConfig - The
|
|
6
|
-
* `customtonTokensConfig` parameter is an object that can
|
|
7
|
-
* `ICustomTokensComplex`.
|
|
6
|
+
* `customtonTokensConfig` parameter is an object that can have two possible types:
|
|
7
|
+
* `ICustomTokensSimple` or `ICustomTokensComplex`.
|
|
8
8
|
* @returns an object of type `ICustomTokensComplex`.
|
|
9
9
|
*/
|
|
10
10
|
export declare function getCustomtonTokens(customtonTokensConfig: ICustomTokensSimple | ICustomTokensComplex): ICustomTokensComplex;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CUSTOM_TOKEN_DEFAULT_KEY } from "../constants";
|
|
2
|
-
import { camelize } from "../general";
|
|
2
|
+
import { camelize, isEmpty } from "../general";
|
|
3
|
+
import { getCleanCustomTokens } from "./getCleanCustomTokens";
|
|
3
4
|
import { getCustomtonTokensWithKeys } from "./getCustomtonTokensWithKeys";
|
|
4
5
|
/**
|
|
5
6
|
* The function `getCustomtonTokens` takes a configuration object and returns a parsed version of the
|
|
6
|
-
* custom tokens.
|
|
7
|
+
* custom tokens, with keys and values appropriately formatted.
|
|
7
8
|
* @param {ICustomTokensSimple | ICustomTokensComplex} customtonTokensConfig - The
|
|
8
|
-
* `customtonTokensConfig` parameter is an object that can
|
|
9
|
-
* `ICustomTokensComplex`.
|
|
9
|
+
* `customtonTokensConfig` parameter is an object that can have two possible types:
|
|
10
|
+
* `ICustomTokensSimple` or `ICustomTokensComplex`.
|
|
10
11
|
* @returns an object of type `ICustomTokensComplex`.
|
|
11
12
|
*/
|
|
12
13
|
export function getCustomtonTokens(customtonTokensConfig) {
|
|
@@ -34,5 +35,7 @@ export function getCustomtonTokens(customtonTokensConfig) {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
if (isEmpty(customTokensparsed[CUSTOM_TOKEN_DEFAULT_KEY]))
|
|
39
|
+
delete customTokensparsed[CUSTOM_TOKEN_DEFAULT_KEY];
|
|
40
|
+
return getCleanCustomTokens(customTokensparsed);
|
|
38
41
|
}
|
|
@@ -10,5 +10,5 @@ import { camelize } from "../general";
|
|
|
10
10
|
* `CustomTokens` object.
|
|
11
11
|
*/
|
|
12
12
|
export function getCustomtonTokensWithKeys(customTokens) {
|
|
13
|
-
return customTokens.map((token) => (Object.assign(Object.assign({}, token), { key: camelize((token === null || token === void 0 ? void 0 : token.key) || token.label) })));
|
|
13
|
+
return customTokens.map((token) => (Object.assign(Object.assign({}, token), { label: token.label || token.key, key: camelize((token === null || token === void 0 ? void 0 : token.key) || token.label) })));
|
|
14
14
|
}
|
package/dist/tokens/index.d.ts
CHANGED
package/dist/tokens/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getCustomtonTokensWithKeys_1 = require("../../src/tokens/getCustomtonTokensWithKeys");
|
|
4
|
-
describe("getCustomtonTokensWithKeys", () => {
|
|
5
|
-
test("should add camelized key to custom tokens", () => {
|
|
6
|
-
const customTokens = [
|
|
7
|
-
{ label: "token one", value: "value1" },
|
|
8
|
-
{ label: "Token 2", value: "value2", key: "{{token dos}}" },
|
|
9
|
-
{ label: "3rd token", value: "value3" },
|
|
10
|
-
];
|
|
11
|
-
const result = (0, getCustomtonTokensWithKeys_1.getCustomtonTokensWithKeys)(customTokens);
|
|
12
|
-
expect(result).toEqual([
|
|
13
|
-
{ label: "token one", value: "value1", key: "tokenOne" },
|
|
14
|
-
{ label: "Token 2", value: "value2", key: "tokenDos" },
|
|
15
|
-
{ label: "3rd token", value: "value3", key: "3rdToken" },
|
|
16
|
-
]);
|
|
17
|
-
});
|
|
18
|
-
test("should handle empty array", () => {
|
|
19
|
-
const emptyTokens = [];
|
|
20
|
-
const result = (0, getCustomtonTokensWithKeys_1.getCustomtonTokensWithKeys)(emptyTokens);
|
|
21
|
-
expect(result).toEqual([]);
|
|
22
|
-
});
|
|
23
|
-
});
|