@qrvey/utils 1.2.9-13 → 1.2.9-17
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/README.md +926 -766
- package/dist/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
- package/dist/charts/constants/AGGREGATE_LABEL.js +1 -1
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +1 -1
- package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
- package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
- package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.js +24 -0
- package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
- package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.js +36 -0
- package/dist/cjs/filters/helpers/ui/index.d.ts +3 -0
- package/dist/cjs/filters/helpers/ui/index.js +3 -0
- package/dist/cjs/filters/helpers/ui/transformFilterValues.d.ts +4 -0
- package/dist/cjs/filters/helpers/ui/transformFilterValues.js +22 -0
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
- package/dist/cjs/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
- package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +2 -0
- package/dist/cjs/filters/interfaces/ui/index.d.ts +3 -2
- package/dist/cjs/filters/interfaces/ui/index.js +3 -2
- package/dist/cjs/format/definition.d.ts +17 -0
- package/dist/cjs/format/definition.js +31 -1
- package/dist/cjs/format/format.d.ts +2 -1
- package/dist/cjs/format/format.js +8 -5
- package/dist/cjs/format/index.d.ts +1 -0
- package/dist/cjs/format/index.js +1 -0
- package/dist/cjs/format/localization.d.ts +3 -0
- package/dist/cjs/format/localization.js +56 -0
- package/dist/cjs/globalization/interfaces/IResourceI18n.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
- package/dist/cjs/globalization/interfaces/index.d.ts +4 -1
- package/dist/cjs/globalization/interfaces/index.js +4 -1
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +2 -0
- package/dist/cjs/globalization/interfaces/style_themes/index.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/style_themes/index.js +18 -0
- package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
- package/dist/cjs/globalization/labels/index.d.ts +5 -3
- package/dist/cjs/globalization/labels/index.js +5 -3
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +57 -0
- package/dist/cjs/globalization/labels/style_themes/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/style_themes/index.js +13 -0
- package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
- package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
- package/dist/cjs/interfaces/format/IFormatConfig.Interface.js +2 -0
- package/dist/cjs/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
- package/dist/cjs/interfaces/format/IFormatCurrency.Interface.js +2 -0
- package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
- package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.js +2 -0
- package/dist/cjs/interfaces/format/index.d.ts +3 -0
- package/dist/cjs/interfaces/format/index.js +15 -0
- package/dist/cjs/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
- package/dist/cjs/interfaces/index.d.ts +1 -0
- package/dist/cjs/interfaces/index.js +1 -0
- package/dist/cjs/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
- package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +23 -0
- package/dist/cjs/qrvey/helpers/index.d.ts +2 -0
- package/dist/cjs/qrvey/helpers/index.js +2 -0
- package/dist/cjs/qrvey/helpers/transformValue.d.ts +8 -0
- package/dist/cjs/qrvey/helpers/transformValue.js +46 -0
- package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
- package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.js +2 -0
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.js +2 -0
- package/dist/cjs/qrvey/interfaces/index.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/index.js +2 -0
- package/dist/cjs/services/api/getAllDatasets.api.d.ts +2 -1
- package/dist/cjs/services/api/getAllDatasets.api.js +2 -1
- package/dist/cjs/services/api/getDatasetColumns.api.js +3 -0
- package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
- package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
- package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.js +20 -0
- package/dist/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
- package/dist/filters/helpers/ui/getUpdatedUIFilters.js +32 -0
- package/dist/filters/helpers/ui/index.d.ts +3 -0
- package/dist/filters/helpers/ui/index.js +3 -0
- package/dist/filters/helpers/ui/transformFilterValues.d.ts +4 -0
- package/dist/filters/helpers/ui/transformFilterValues.js +18 -0
- package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
- package/dist/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
- package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +1 -0
- package/dist/filters/interfaces/ui/index.d.ts +3 -2
- package/dist/filters/interfaces/ui/index.js +3 -2
- package/dist/format/definition.d.ts +17 -0
- package/dist/format/definition.js +30 -0
- package/dist/format/format.d.ts +2 -1
- package/dist/format/format.js +6 -3
- package/dist/format/index.d.ts +1 -0
- package/dist/format/index.js +1 -0
- package/dist/format/localization.d.ts +3 -0
- package/dist/format/localization.js +51 -0
- package/dist/globalization/interfaces/IResourceI18n.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
- package/dist/globalization/interfaces/index.d.ts +4 -1
- package/dist/globalization/interfaces/index.js +4 -1
- package/dist/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemes.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +1 -0
- package/dist/globalization/interfaces/style_themes/index.d.ts +6 -0
- package/dist/globalization/interfaces/style_themes/index.js +6 -0
- package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
- package/dist/globalization/labels/index.d.ts +5 -3
- package/dist/globalization/labels/index.js +5 -3
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +54 -0
- package/dist/globalization/labels/style_themes/index.d.ts +1 -0
- package/dist/globalization/labels/style_themes/index.js +1 -0
- package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
- package/dist/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
- package/dist/interfaces/format/IFormatConfig.Interface.js +1 -0
- package/dist/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
- package/dist/interfaces/format/IFormatCurrency.Interface.js +1 -0
- package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
- package/dist/interfaces/format/IFormatOutputFormat.Interface.js +1 -0
- package/dist/interfaces/format/index.d.ts +3 -0
- package/dist/interfaces/format/index.js +3 -0
- package/dist/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
- package/dist/qrvey/helpers/getValueWithSuffixes.js +19 -0
- package/dist/qrvey/helpers/index.d.ts +2 -0
- package/dist/qrvey/helpers/index.js +2 -0
- package/dist/qrvey/helpers/transformValue.d.ts +8 -0
- package/dist/qrvey/helpers/transformValue.js +42 -0
- package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
- package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.js +1 -0
- package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
- package/dist/qrvey/interfaces/ITransformValueSettings.js +1 -0
- package/dist/qrvey/interfaces/index.d.ts +2 -0
- package/dist/qrvey/interfaces/index.js +2 -0
- package/dist/services/api/getAllDatasets.api.d.ts +2 -1
- package/dist/services/api/getAllDatasets.api.js +2 -1
- package/dist/services/api/getDatasetColumns.api.js +3 -0
- package/package.json +1 -1
- package/src/charts/constants/AGGREGATE_LABEL.ts +1 -1
- package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -0
- package/src/filters/helpers/ui/getQrveyIdsByUIFilters.ts +22 -0
- package/src/filters/helpers/ui/getUpdatedUIFilters.ts +34 -0
- package/src/filters/helpers/ui/index.ts +3 -0
- package/src/filters/helpers/ui/transformFilterValues.ts +29 -0
- package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +2 -1
- package/src/filters/interfaces/panel/IFPSettingsGeneral.ts +2 -1
- package/src/filters/interfaces/panel/IFilterPanelConfig.ts +1 -0
- package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +7 -0
- package/src/filters/interfaces/ui/index.ts +3 -2
- package/src/format/definition.ts +45 -0
- package/src/format/format.ts +19 -15
- package/src/format/index.ts +1 -0
- package/src/format/localization.ts +52 -0
- package/src/globalization/interfaces/IResourceI18n.ts +2 -0
- package/src/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.ts +5 -3
- package/src/globalization/interfaces/index.ts +4 -1
- package/src/globalization/interfaces/style_themes/II18nStyleThemes.ts +14 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.ts +6 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesMenu.ts +6 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesMessages.ts +9 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +27 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +3 -0
- package/src/globalization/interfaces/style_themes/index.ts +6 -0
- package/src/globalization/labels/I18N_DEFAULT.ts +2 -0
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +8 -6
- package/src/globalization/labels/index.ts +5 -3
- package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +56 -0
- package/src/globalization/labels/style_themes/index.ts +1 -0
- package/src/globalization/labels/table_charts/I18N_TABLE_CHARTS.ts +1 -1
- package/src/interfaces/format/IFormatConfig.Interface.ts +5 -0
- package/src/interfaces/format/IFormatCurrency.Interface.ts +4 -0
- package/src/interfaces/format/IFormatOutputFormat.Interface.ts +9 -0
- package/src/interfaces/format/index.ts +3 -0
- package/src/interfaces/general/IGeneralWidgetConfig.ts +2 -0
- package/src/interfaces/index.ts +1 -0
- package/src/qrvey/helpers/getValueWithSuffixes.ts +19 -0
- package/src/qrvey/helpers/index.ts +2 -0
- package/src/qrvey/helpers/transformValue.ts +47 -0
- package/src/qrvey/interfaces/IGetValueWithSuffixesSettings.ts +12 -0
- package/src/qrvey/interfaces/ITransformValueSettings.ts +12 -0
- package/src/qrvey/interfaces/index.ts +2 -0
- package/src/services/api/getAllDatasets.api.ts +3 -2
- package/src/services/api/getDatasetColumns.api.ts +3 -0
- package/test/format.test.js +11 -11
|
@@ -11,6 +11,7 @@ import { I18N_FILTER_DISPLAY } from "./filters/I18N_FILTER_DISPLAY";
|
|
|
11
11
|
import { I18N_BUCKET_BUILDER } from "./bucket_builder/I18N_BUCKET_BUILDER";
|
|
12
12
|
import { I18N_CROSS_TABS } from './cross_tabs';
|
|
13
13
|
import { I18N_CHART_BUILDER } from "./chart_builder";
|
|
14
|
+
import { I18N_STYLE_THEMES } from "./style_themes";
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
export const I18N_DEFAULT: IResourceI18n = {
|
|
@@ -25,5 +26,6 @@ export const I18N_DEFAULT: IResourceI18n = {
|
|
|
25
26
|
filter_panel: I18N_FILTER_PANEL,
|
|
26
27
|
formula_builder: I18N_FORMULA_BUILDER,
|
|
27
28
|
panel: I18N_PANEL,
|
|
29
|
+
style_themes: I18N_STYLE_THEMES,
|
|
28
30
|
table_charts: I18N_TABLE_CHARTS,
|
|
29
31
|
};
|
|
@@ -3,7 +3,7 @@ import { II18nChartBuilder } from "../..";
|
|
|
3
3
|
type LayerOptions = 'trends_line' | 'references_line';
|
|
4
4
|
export const I18N_CHART_BUILDER_LAYER_OPTIONS: Pick<II18nChartBuilder, LayerOptions> = {
|
|
5
5
|
trends_line: {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Trend Line',
|
|
7
7
|
type: 'Type',
|
|
8
8
|
type_none: 'None',
|
|
9
9
|
type_standard_linear_regression: 'Standard Linear Regression',
|
|
@@ -19,9 +19,9 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOpti
|
|
|
19
19
|
comparision_color: 'Comparision Color',
|
|
20
20
|
data_labels_check: 'Data Labels',
|
|
21
21
|
default_format_title: 'Format',
|
|
22
|
-
display_outliers_check: 'Display
|
|
22
|
+
display_outliers_check: 'Display Outliers',
|
|
23
23
|
line_opacity: 'Line Opacity',
|
|
24
|
-
map_borders: 'Map
|
|
24
|
+
map_borders: 'Map Borders',
|
|
25
25
|
needle_color: 'Needle Color',
|
|
26
26
|
opacity: 'Opacity',
|
|
27
27
|
percentage_check: 'Percentage',
|
|
@@ -156,13 +156,15 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOpti
|
|
|
156
156
|
names_rotation: 'Names Rotation',
|
|
157
157
|
},
|
|
158
158
|
font_options: {
|
|
159
|
+
automatic_resize: 'Automatic Resize',
|
|
159
160
|
color: 'Font Color',
|
|
161
|
+
disabled: '<i>Automatic Resize</i> is active, disable it to set the size manually.',
|
|
162
|
+
select_option_placeholder: 'Select Option',
|
|
163
|
+
size: 'Font Size',
|
|
160
164
|
style: 'Font Style',
|
|
161
|
-
style_regular: 'Regular',
|
|
162
165
|
style_bold: 'Bold',
|
|
163
166
|
style_italic: 'Italic',
|
|
164
|
-
|
|
165
|
-
size: 'Font Size',
|
|
167
|
+
style_regular: 'Regular',
|
|
166
168
|
},
|
|
167
169
|
circle_size: {
|
|
168
170
|
title: 'Circle Size',
|
|
@@ -186,7 +188,7 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOpti
|
|
|
186
188
|
target_value: 'Target Value'
|
|
187
189
|
},
|
|
188
190
|
table_style_options: {
|
|
189
|
-
typeface: 'Typeface',
|
|
191
|
+
typeface: 'Typeface',
|
|
190
192
|
weight: 'Weight',
|
|
191
193
|
weight_bold: 'Bold',
|
|
192
194
|
weight_normal: 'normal',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
export * from './bucket_builder';
|
|
2
|
+
export * from './chart_builder';
|
|
1
3
|
export * from './columns';
|
|
2
4
|
export * from './common';
|
|
5
|
+
export * from './cross_tabs';
|
|
3
6
|
export * from './dashboard';
|
|
4
7
|
export * from './filters';
|
|
8
|
+
export * from './formula_builder';
|
|
5
9
|
export * from './panel';
|
|
10
|
+
export * from './style_themes';
|
|
6
11
|
export * from './table_charts';
|
|
7
12
|
export * from './I18N_DEFAULT';
|
|
8
|
-
export * from './formula_builder';
|
|
9
|
-
export * from './bucket_builder';
|
|
10
|
-
export * from './chart_builder';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { II18nStyleThemes } from "../../interfaces/style_themes/II18nStyleThemes";
|
|
2
|
+
|
|
3
|
+
export const I18N_STYLE_THEMES: II18nStyleThemes = {
|
|
4
|
+
delete_dialog: {
|
|
5
|
+
no: 'No',
|
|
6
|
+
theme_in_use: 'This theme is in use. If you delete it the visualizations will reset to the default theme.',
|
|
7
|
+
want_to_continue: 'Are you sure you want to continue?',
|
|
8
|
+
yes: 'Yes',
|
|
9
|
+
},
|
|
10
|
+
menu: {
|
|
11
|
+
delete: 'Delete',
|
|
12
|
+
duplicate: 'Duplicate',
|
|
13
|
+
edit: 'Edit',
|
|
14
|
+
use_all: 'Use in all applications',
|
|
15
|
+
},
|
|
16
|
+
messages: {
|
|
17
|
+
theme_could_not_be_created: 'Theme could not be created.',
|
|
18
|
+
theme_could_not_be_deleted: 'Theme could not be deleted.',
|
|
19
|
+
theme_could_not_be_duplicated: 'Theme could not be duplicated.',
|
|
20
|
+
theme_could_not_be_saved: 'Theme could not be saved.',
|
|
21
|
+
theme_could_not_be_selected: 'Theme could not be selected.',
|
|
22
|
+
theme_could_not_be_used_in_all_applications: 'Theme could not be used in all applications.',
|
|
23
|
+
themes_could_not_be_loaded: 'Themes could not be loaded.',
|
|
24
|
+
},
|
|
25
|
+
theme: {
|
|
26
|
+
axis_data_labels: 'Axis and Data Labels',
|
|
27
|
+
cancel_theme: 'Cancel',
|
|
28
|
+
chart_titles_color: 'Chart Titles Color',
|
|
29
|
+
copy: 'Copy',
|
|
30
|
+
create_theme: 'Create New Theme',
|
|
31
|
+
data_styles: 'Data Styles',
|
|
32
|
+
data_visualization: 'Data Visualization',
|
|
33
|
+
edit_theme: 'Edit Theme',
|
|
34
|
+
generate_new: 'Generate New',
|
|
35
|
+
header_font_color: 'Header Font Color',
|
|
36
|
+
id: 'ID',
|
|
37
|
+
legends: 'Legends',
|
|
38
|
+
main_color: 'Main Color',
|
|
39
|
+
name_placeholder: 'Type name',
|
|
40
|
+
panel_styles: 'Panel Styles',
|
|
41
|
+
qrvey_theme: 'Qrvey Theme',
|
|
42
|
+
restore_to_default: 'Restore to Default',
|
|
43
|
+
save_theme: 'Save Theme',
|
|
44
|
+
table_header_styles: 'Table Header Styles',
|
|
45
|
+
text_styles: 'Text Styles',
|
|
46
|
+
tooltips: 'Tooltips',
|
|
47
|
+
typeface: 'Typeface',
|
|
48
|
+
untitled_theme: 'Untitled',
|
|
49
|
+
use_theme_in_all_apps: 'Use Theme in All Apps',
|
|
50
|
+
values: 'Values',
|
|
51
|
+
},
|
|
52
|
+
title: 'Style Themes',
|
|
53
|
+
tooltips: {
|
|
54
|
+
theme_used_in_all_applications: 'This theme is being used in all applications',
|
|
55
|
+
}
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './I18N_STYLE_THEMES';
|
|
@@ -11,7 +11,7 @@ export const I18N_TABLE_CHARTS: II18nTableCharts = {
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
pagination: {
|
|
14
|
-
page_info: 'Page {
|
|
14
|
+
page_info: 'Page {{currentPage}} of {{pages}}',
|
|
15
15
|
records: 'Records',
|
|
16
16
|
records_per_page: 'Records per page',
|
|
17
17
|
total_records: 'Total records'
|
package/src/interfaces/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { isNaNV2 } from "../../general/mix/isNaNV2";
|
|
3
|
+
import { IGetValueWithSuffixesSettings } from "../interfaces/IGetValueWithSuffixesSettings";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get a string value with suffixes if available.
|
|
7
|
+
* Add suffix into the value string. Prioritized for numeric values.
|
|
8
|
+
* @param value a number or string
|
|
9
|
+
* @param suffixes An object with singular or plural suffix string.
|
|
10
|
+
* @returns a string value with suffix
|
|
11
|
+
*/
|
|
12
|
+
export function getValueWithSuffixes(value: string | number, settings: IGetValueWithSuffixesSettings): string {
|
|
13
|
+
let suffix = '';
|
|
14
|
+
if (!isNaNV2(value)) {
|
|
15
|
+
if (!isEmpty(settings.suffixTranslateLabel) && !isEmpty(settings.translate)) suffix = settings.translate(settings.suffixTranslateLabel, { count: +value });
|
|
16
|
+
if (!isEmpty(settings.suffixes)) suffix = (+value > 1 || +value === 0) ? settings.suffixes.plural : settings.suffixes.singular;
|
|
17
|
+
}
|
|
18
|
+
return value + (!isEmpty(suffix) ? ' ' + suffix : '');
|
|
19
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isDateColumn } from "../../columns/helpers/isDateColumn";
|
|
2
|
+
import { isNumericalColumn } from "../../columns/helpers/isNumericalColumn";
|
|
3
|
+
import { IDateColumnPropertyType } from "../../columns/interfaces/IDateColumnPropertyType";
|
|
4
|
+
import { DATE_GROUPING_PROPERTY } from "../../dates/constants/DATE_GROUPING_PROPERTY";
|
|
5
|
+
import { DATE_GROUPING_TIME_PROPERTY } from "../../dates/constants/DATE_GROUPING_TIME_PROPERTY";
|
|
6
|
+
import { addFormat } from "../../format/format";
|
|
7
|
+
import { getI18nDateGroupLabel } from "../../globalization/helpers/getI18nDateGroupLabel";
|
|
8
|
+
import { ITransformValueSettings } from "../interfaces/ITransformValueSettings";
|
|
9
|
+
import { getValueWithSuffixes } from "./getValueWithSuffixes";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transforms a value depending of localization/globalization and extras settings.
|
|
13
|
+
* @param value A value to transform
|
|
14
|
+
* @param settings The settings of the transformValue function
|
|
15
|
+
* @returns A transformed value
|
|
16
|
+
*/
|
|
17
|
+
export function transformValue(value: string, settings: ITransformValueSettings): string {
|
|
18
|
+
const valueWithI18n = getI18nDateGroupLabel(value, settings.property as IDateColumnPropertyType, settings.translate);
|
|
19
|
+
|
|
20
|
+
const valueWithLocalization = addFormat(valueWithI18n, getOutputFormat(settings), getFormatConfig(settings));
|
|
21
|
+
return getValueWithSuffixes(valueWithLocalization, { suffixTranslateLabel: settings.suffixTranslateLabel, translate: settings.translate });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Gets the outputformat settings
|
|
26
|
+
* @param settings The settings of the transformValue function
|
|
27
|
+
* @returns the outputformat settings
|
|
28
|
+
*/
|
|
29
|
+
function getOutputFormat(settings: ITransformValueSettings) {
|
|
30
|
+
let type, format;
|
|
31
|
+
if (isDateColumn(settings.column) && [DATE_GROUPING_PROPERTY.DAY, DATE_GROUPING_TIME_PROPERTY.HOUR, DATE_GROUPING_TIME_PROPERTY.MINUTE, DATE_GROUPING_TIME_PROPERTY.SECOND].includes(settings.property as any)) {
|
|
32
|
+
type = 'DATE';
|
|
33
|
+
format = 'Default';
|
|
34
|
+
} else if (isNumericalColumn(settings.column)) {
|
|
35
|
+
type = 'NUMERIC';
|
|
36
|
+
}
|
|
37
|
+
return { type, format };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gets the format config
|
|
42
|
+
* @param settings The settings of the transformValue function
|
|
43
|
+
* @returns the format config
|
|
44
|
+
*/
|
|
45
|
+
function getFormatConfig(settings: ITransformValueSettings) {
|
|
46
|
+
return { lang: settings.locale };
|
|
47
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
|
|
2
|
+
|
|
3
|
+
export interface IGetValueWithSuffixesSettings {
|
|
4
|
+
translate?: II18nServiceTranslate; // Function for getting translations
|
|
5
|
+
suffixTranslateLabel?: string; // Label of the i18n path for translations
|
|
6
|
+
suffixes?: IGetValueWithSuffixesSettingsSuffixes; // Manual suffixes to add if the translate and the suffixes translate label is not present
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface IGetValueWithSuffixesSettingsSuffixes {
|
|
10
|
+
singular: string;
|
|
11
|
+
plural: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
|
+
import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
|
|
3
|
+
import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
|
|
4
|
+
|
|
5
|
+
export interface ITransformValueSettings {
|
|
6
|
+
column: IColumn;
|
|
7
|
+
property: IColumnPropertyType;
|
|
8
|
+
|
|
9
|
+
translate: II18nServiceTranslate; // Function for getting translations
|
|
10
|
+
locale: string; // The locale string
|
|
11
|
+
suffixTranslateLabel?: string // The i18n label for the suffix values.
|
|
12
|
+
}
|
|
@@ -6,10 +6,11 @@ import { getDatasetColumns } from "./getDatasetColumns.api";
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Get a dataset list from a collection of Qrvey IDs
|
|
9
|
-
* @param
|
|
9
|
+
* @param config the widget config. Includes the appid and others configuration properties
|
|
10
|
+
* @param pickDatasets Collection of Qrvey IDs for filtering the request
|
|
10
11
|
* @returns a promise
|
|
11
12
|
*/
|
|
12
|
-
export function getAllDatasets
|
|
13
|
+
export function getAllDatasets(config: IGeneralWidgetConfig, pickDatasets: string[] = []): Promise<IDataset[]> {
|
|
13
14
|
return getAllQrveys({ ...config }, { status: ['RUNNING', 'FINISHED', 'PAUSED'], loadAll: true })
|
|
14
15
|
.then((qrveys) => {
|
|
15
16
|
let datasets = qrveys.Items.filter(filterSupportedDatasets);
|
|
@@ -3,6 +3,8 @@ import { IDataset } from "../../qrvey/interfaces/IDataset";
|
|
|
3
3
|
import { CHART_ENDPOINT } from "../constants/CHART_ENDPOINT";
|
|
4
4
|
import Request from "../helpers/Request";
|
|
5
5
|
import { BDatasetsToUIDatasets } from "../adapters/BDatasetsToUIDatasets.adapter";
|
|
6
|
+
import { LANG_DEFAULT } from "../../format/definition";
|
|
7
|
+
import { getLang } from "../..";
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Get a dataset by Qrvey ID
|
|
@@ -11,6 +13,7 @@ import { BDatasetsToUIDatasets } from "../adapters/BDatasetsToUIDatasets.adapter
|
|
|
11
13
|
*/
|
|
12
14
|
export function getDatasetColumns(config: IGeneralWidgetConfig, qrveyid?: string): Promise<IDataset[]> {
|
|
13
15
|
return Request.post({ ...config, qrveyid, endpoint: CHART_ENDPOINT }, '/question/list', {
|
|
16
|
+
'lang': getLang(config.lang || config.locale || LANG_DEFAULT).lang,
|
|
14
17
|
'optionsAttributes': ['id', 'text', 'type', 'property', 'linked', 'linkid', 'qrveyid', 'bucketId', 'formulaId', 'formulaType', 'geogroup', 'outputFormat'],
|
|
15
18
|
'extend': true
|
|
16
19
|
})
|
package/test/format.test.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { addFormat, defineFormat, formatAbbreviated } = require('../dist/cjs');
|
|
2
2
|
|
|
3
3
|
describe('Testing format util', function () {
|
|
4
4
|
test('Number formats', function () {
|
|
5
|
-
const abbreviated =
|
|
5
|
+
const abbreviated = addFormat('1000000', {
|
|
6
6
|
"type": "NUMERIC",
|
|
7
7
|
"format": "Abbreviated",
|
|
8
8
|
"decimals": "3"
|
|
9
9
|
});
|
|
10
10
|
expect(abbreviated).toEqual('1.00M');
|
|
11
11
|
|
|
12
|
-
const numeric =
|
|
12
|
+
const numeric = addFormat('1000000', {
|
|
13
13
|
"type": "NUMERIC",
|
|
14
14
|
"format": "Numeric",
|
|
15
15
|
"decimals": "3"
|
|
16
16
|
});
|
|
17
17
|
expect(numeric).toEqual('1,000,000.000');
|
|
18
18
|
|
|
19
|
-
const currency =
|
|
19
|
+
const currency = addFormat('1000000', {
|
|
20
20
|
"type": "NUMERIC",
|
|
21
21
|
"format": "Currency",
|
|
22
22
|
"decimals": "3"
|
|
23
23
|
});
|
|
24
24
|
expect(currency).toEqual(' $1,000,000.000');
|
|
25
25
|
|
|
26
|
-
const percentage =
|
|
26
|
+
const percentage = addFormat('1000000', {
|
|
27
27
|
"type": "NUMERIC",
|
|
28
28
|
"format": "Percentage",
|
|
29
29
|
"decimals": "3"
|
|
@@ -32,31 +32,31 @@ describe('Testing format util', function () {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
test('Date formats', function () {
|
|
35
|
-
const yyyyMMdd =
|
|
35
|
+
const yyyyMMdd = addFormat('2021-08-06', {
|
|
36
36
|
"type": "DATE",
|
|
37
37
|
"format": "MM/DD/YYYY HH24:MM:SS"
|
|
38
38
|
});
|
|
39
39
|
expect(yyyyMMdd).toEqual('08/06/2021 00:00:00');
|
|
40
40
|
|
|
41
|
-
const yyyyMMddHHmmSS =
|
|
41
|
+
const yyyyMMddHHmmSS = addFormat('2021-08-06 05:30:50', {
|
|
42
42
|
"type": "DATE",
|
|
43
43
|
"format": "MM/DD/YYYY HH24:MM:SS"
|
|
44
44
|
});
|
|
45
45
|
expect(yyyyMMddHHmmSS).toEqual('08/06/2021 05:30:50');
|
|
46
46
|
|
|
47
|
-
const ISOFormat =
|
|
47
|
+
const ISOFormat = addFormat('2021-06-09T13:15:46', {
|
|
48
48
|
"type": "DATE",
|
|
49
49
|
"format": "MM/DD/YYYY hh:MM:SS"
|
|
50
50
|
});
|
|
51
51
|
expect(ISOFormat).toEqual('06/09/2021 01:15:46');
|
|
52
52
|
|
|
53
|
-
const ISOFormatRandom =
|
|
53
|
+
const ISOFormatRandom = addFormat('2021-06-09T13:15:46', {
|
|
54
54
|
"type": "DATE",
|
|
55
55
|
"format": "MM YYYY H M s"
|
|
56
56
|
});
|
|
57
57
|
expect(ISOFormatRandom).toEqual('06 2021 13 6 46');
|
|
58
58
|
|
|
59
|
-
const ISOFormatRandom1 =
|
|
59
|
+
const ISOFormatRandom1 = addFormat('2018-01-01T00:00:00', {
|
|
60
60
|
"type": "DATE",
|
|
61
61
|
"format": "Q MMMM Do ddd"
|
|
62
62
|
});
|
|
@@ -336,7 +336,7 @@ describe('Define format tests', function () {
|
|
|
336
336
|
|
|
337
337
|
const format = defineFormat(column, true);
|
|
338
338
|
expect(format).toEqual({ type: 'NUMERIC', format: 'Currency', decimals: '3' });
|
|
339
|
-
const currency =
|
|
339
|
+
const currency = addFormat('1000000', format);
|
|
340
340
|
expect(currency).toEqual(' $1,000,000.000');
|
|
341
341
|
});
|
|
342
342
|
|