@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.
Files changed (209) hide show
  1. package/README.md +926 -766
  2. package/dist/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  3. package/dist/charts/constants/AGGREGATE_LABEL.js +1 -1
  4. package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  5. package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +1 -1
  6. package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  7. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  8. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.js +24 -0
  9. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  10. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.js +36 -0
  11. package/dist/cjs/filters/helpers/ui/index.d.ts +3 -0
  12. package/dist/cjs/filters/helpers/ui/index.js +3 -0
  13. package/dist/cjs/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  14. package/dist/cjs/filters/helpers/ui/transformFilterValues.js +22 -0
  15. package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  16. package/dist/cjs/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  17. package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  18. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  19. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +2 -0
  20. package/dist/cjs/filters/interfaces/ui/index.d.ts +3 -2
  21. package/dist/cjs/filters/interfaces/ui/index.js +3 -2
  22. package/dist/cjs/format/definition.d.ts +17 -0
  23. package/dist/cjs/format/definition.js +31 -1
  24. package/dist/cjs/format/format.d.ts +2 -1
  25. package/dist/cjs/format/format.js +8 -5
  26. package/dist/cjs/format/index.d.ts +1 -0
  27. package/dist/cjs/format/index.js +1 -0
  28. package/dist/cjs/format/localization.d.ts +3 -0
  29. package/dist/cjs/format/localization.js +56 -0
  30. package/dist/cjs/globalization/interfaces/IResourceI18n.d.ts +2 -0
  31. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  32. package/dist/cjs/globalization/interfaces/index.d.ts +4 -1
  33. package/dist/cjs/globalization/interfaces/index.js +4 -1
  34. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  35. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.js +2 -0
  36. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  37. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +2 -0
  38. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  39. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +2 -0
  40. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  41. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +2 -0
  42. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  43. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +2 -0
  44. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  45. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +2 -0
  46. package/dist/cjs/globalization/interfaces/style_themes/index.d.ts +6 -0
  47. package/dist/cjs/globalization/interfaces/style_themes/index.js +18 -0
  48. package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
  49. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  50. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  51. package/dist/cjs/globalization/labels/index.d.ts +5 -3
  52. package/dist/cjs/globalization/labels/index.js +5 -3
  53. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  54. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +57 -0
  55. package/dist/cjs/globalization/labels/style_themes/index.d.ts +1 -0
  56. package/dist/cjs/globalization/labels/style_themes/index.js +13 -0
  57. package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  58. package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  59. package/dist/cjs/interfaces/format/IFormatConfig.Interface.js +2 -0
  60. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  61. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.js +2 -0
  62. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  63. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.js +2 -0
  64. package/dist/cjs/interfaces/format/index.d.ts +3 -0
  65. package/dist/cjs/interfaces/format/index.js +15 -0
  66. package/dist/cjs/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  67. package/dist/cjs/interfaces/index.d.ts +1 -0
  68. package/dist/cjs/interfaces/index.js +1 -0
  69. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  70. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +23 -0
  71. package/dist/cjs/qrvey/helpers/index.d.ts +2 -0
  72. package/dist/cjs/qrvey/helpers/index.js +2 -0
  73. package/dist/cjs/qrvey/helpers/transformValue.d.ts +8 -0
  74. package/dist/cjs/qrvey/helpers/transformValue.js +46 -0
  75. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  76. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.js +2 -0
  77. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  78. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.js +2 -0
  79. package/dist/cjs/qrvey/interfaces/index.d.ts +2 -0
  80. package/dist/cjs/qrvey/interfaces/index.js +2 -0
  81. package/dist/cjs/services/api/getAllDatasets.api.d.ts +2 -1
  82. package/dist/cjs/services/api/getAllDatasets.api.js +2 -1
  83. package/dist/cjs/services/api/getDatasetColumns.api.js +3 -0
  84. package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  85. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  86. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.js +20 -0
  87. package/dist/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  88. package/dist/filters/helpers/ui/getUpdatedUIFilters.js +32 -0
  89. package/dist/filters/helpers/ui/index.d.ts +3 -0
  90. package/dist/filters/helpers/ui/index.js +3 -0
  91. package/dist/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  92. package/dist/filters/helpers/ui/transformFilterValues.js +18 -0
  93. package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  94. package/dist/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  95. package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  96. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  97. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +1 -0
  98. package/dist/filters/interfaces/ui/index.d.ts +3 -2
  99. package/dist/filters/interfaces/ui/index.js +3 -2
  100. package/dist/format/definition.d.ts +17 -0
  101. package/dist/format/definition.js +30 -0
  102. package/dist/format/format.d.ts +2 -1
  103. package/dist/format/format.js +6 -3
  104. package/dist/format/index.d.ts +1 -0
  105. package/dist/format/index.js +1 -0
  106. package/dist/format/localization.d.ts +3 -0
  107. package/dist/format/localization.js +51 -0
  108. package/dist/globalization/interfaces/IResourceI18n.d.ts +2 -0
  109. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  110. package/dist/globalization/interfaces/index.d.ts +4 -1
  111. package/dist/globalization/interfaces/index.js +4 -1
  112. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  113. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.js +1 -0
  114. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  115. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +1 -0
  116. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  117. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +1 -0
  118. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  119. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +1 -0
  120. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  121. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +1 -0
  122. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  123. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +1 -0
  124. package/dist/globalization/interfaces/style_themes/index.d.ts +6 -0
  125. package/dist/globalization/interfaces/style_themes/index.js +6 -0
  126. package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
  127. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  128. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  129. package/dist/globalization/labels/index.d.ts +5 -3
  130. package/dist/globalization/labels/index.js +5 -3
  131. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  132. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +54 -0
  133. package/dist/globalization/labels/style_themes/index.d.ts +1 -0
  134. package/dist/globalization/labels/style_themes/index.js +1 -0
  135. package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  136. package/dist/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  137. package/dist/interfaces/format/IFormatConfig.Interface.js +1 -0
  138. package/dist/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  139. package/dist/interfaces/format/IFormatCurrency.Interface.js +1 -0
  140. package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  141. package/dist/interfaces/format/IFormatOutputFormat.Interface.js +1 -0
  142. package/dist/interfaces/format/index.d.ts +3 -0
  143. package/dist/interfaces/format/index.js +3 -0
  144. package/dist/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  145. package/dist/interfaces/index.d.ts +1 -0
  146. package/dist/interfaces/index.js +1 -0
  147. package/dist/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  148. package/dist/qrvey/helpers/getValueWithSuffixes.js +19 -0
  149. package/dist/qrvey/helpers/index.d.ts +2 -0
  150. package/dist/qrvey/helpers/index.js +2 -0
  151. package/dist/qrvey/helpers/transformValue.d.ts +8 -0
  152. package/dist/qrvey/helpers/transformValue.js +42 -0
  153. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  154. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.js +1 -0
  155. package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  156. package/dist/qrvey/interfaces/ITransformValueSettings.js +1 -0
  157. package/dist/qrvey/interfaces/index.d.ts +2 -0
  158. package/dist/qrvey/interfaces/index.js +2 -0
  159. package/dist/services/api/getAllDatasets.api.d.ts +2 -1
  160. package/dist/services/api/getAllDatasets.api.js +2 -1
  161. package/dist/services/api/getDatasetColumns.api.js +3 -0
  162. package/package.json +1 -1
  163. package/src/charts/constants/AGGREGATE_LABEL.ts +1 -1
  164. package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -0
  165. package/src/filters/helpers/ui/getQrveyIdsByUIFilters.ts +22 -0
  166. package/src/filters/helpers/ui/getUpdatedUIFilters.ts +34 -0
  167. package/src/filters/helpers/ui/index.ts +3 -0
  168. package/src/filters/helpers/ui/transformFilterValues.ts +29 -0
  169. package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +2 -1
  170. package/src/filters/interfaces/panel/IFPSettingsGeneral.ts +2 -1
  171. package/src/filters/interfaces/panel/IFilterPanelConfig.ts +1 -0
  172. package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +7 -0
  173. package/src/filters/interfaces/ui/index.ts +3 -2
  174. package/src/format/definition.ts +45 -0
  175. package/src/format/format.ts +19 -15
  176. package/src/format/index.ts +1 -0
  177. package/src/format/localization.ts +52 -0
  178. package/src/globalization/interfaces/IResourceI18n.ts +2 -0
  179. package/src/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.ts +5 -3
  180. package/src/globalization/interfaces/index.ts +4 -1
  181. package/src/globalization/interfaces/style_themes/II18nStyleThemes.ts +14 -0
  182. package/src/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.ts +6 -0
  183. package/src/globalization/interfaces/style_themes/II18nStyleThemesMenu.ts +6 -0
  184. package/src/globalization/interfaces/style_themes/II18nStyleThemesMessages.ts +9 -0
  185. package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +27 -0
  186. package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +3 -0
  187. package/src/globalization/interfaces/style_themes/index.ts +6 -0
  188. package/src/globalization/labels/I18N_DEFAULT.ts +2 -0
  189. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
  190. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +8 -6
  191. package/src/globalization/labels/index.ts +5 -3
  192. package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +56 -0
  193. package/src/globalization/labels/style_themes/index.ts +1 -0
  194. package/src/globalization/labels/table_charts/I18N_TABLE_CHARTS.ts +1 -1
  195. package/src/interfaces/format/IFormatConfig.Interface.ts +5 -0
  196. package/src/interfaces/format/IFormatCurrency.Interface.ts +4 -0
  197. package/src/interfaces/format/IFormatOutputFormat.Interface.ts +9 -0
  198. package/src/interfaces/format/index.ts +3 -0
  199. package/src/interfaces/general/IGeneralWidgetConfig.ts +2 -0
  200. package/src/interfaces/index.ts +1 -0
  201. package/src/qrvey/helpers/getValueWithSuffixes.ts +19 -0
  202. package/src/qrvey/helpers/index.ts +2 -0
  203. package/src/qrvey/helpers/transformValue.ts +47 -0
  204. package/src/qrvey/interfaces/IGetValueWithSuffixesSettings.ts +12 -0
  205. package/src/qrvey/interfaces/ITransformValueSettings.ts +12 -0
  206. package/src/qrvey/interfaces/index.ts +2 -0
  207. package/src/services/api/getAllDatasets.api.ts +3 -2
  208. package/src/services/api/getDatasetColumns.api.ts +3 -0
  209. package/test/format.test.js +11 -11
@@ -0,0 +1,3 @@
1
+ export interface II18nStyleThemesTooltips {
2
+ theme_used_in_all_applications: string;
3
+ }
@@ -0,0 +1,6 @@
1
+ export * from './II18nStyleThemes';
2
+ export * from './II18nStyleThemesDeleteDialog';
3
+ export * from './II18nStyleThemesMenu';
4
+ export * from './II18nStyleThemesMessages';
5
+ export * from './II18nStyleThemesTheme';
6
+ export * from './II18nStyleThemesTooltips';
@@ -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: 'Trends line',
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 outliers',
22
+ display_outliers_check: 'Display Outliers',
23
23
  line_opacity: 'Line Opacity',
24
- map_borders: 'Map borders',
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
- automatic_resize: 'Automatic Resize',
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', // used
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 {0} of {1} ',
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'
@@ -0,0 +1,5 @@
1
+ export interface IFormatConfig {
2
+ lang?: string;
3
+ options?: object;
4
+ isMultiplied?: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface IFormatCurrency {
2
+ text: string;
3
+ label: string;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { IFormatCurrency } from "./IFormatCurrency.Interface";
2
+
3
+ export interface IFormatOutputFormat {
4
+ format: string;
5
+ type: string;
6
+ decimals?: number;
7
+ currency?: IFormatCurrency;
8
+ backup_currency?: IFormatCurrency;
9
+ }
@@ -0,0 +1,3 @@
1
+ export * from './IFormatConfig.Interface';
2
+ export * from './IFormatOutputFormat.Interface';
3
+ export * from './IFormatCurrency.Interface';
@@ -3,8 +3,10 @@ export interface IGeneralWidgetConfig {
3
3
  apiKey?: string;
4
4
  qrveyid?: string;
5
5
  qv_token?: string;
6
+ locale?: string;
6
7
  timezoneControl?: string;
7
8
  isFromAN?: boolean;
8
9
  appid: string;
9
10
  userid: string;
11
+ lang?: string;
10
12
  }
@@ -2,3 +2,4 @@ export * from './Chart.Interface';
2
2
  export * from './IChartBuilder.Interface';
3
3
  export * from './general';
4
4
  export * from './Qrvey.Interface';
5
+ export * from './format';
@@ -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
+ }
@@ -1,2 +1,4 @@
1
1
  export * from './getColumnsLabel';
2
2
  export * from './getPropertyLabel';
3
+ export * from './getValueWithSuffixes';
4
+ export * from './transformValue';
@@ -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
+ }
@@ -3,3 +3,5 @@ export * from './ICalculation';
3
3
  export * from './ICalculationInfo';
4
4
  export * from './ICalculationType';
5
5
  export * from './IDataset';
6
+ export * from './IGetValueWithSuffixesSettings';
7
+ export * from './ITransformValueSettings';
@@ -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 qrveyids Collection of Qrvey IDs
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 (config: IGeneralWidgetConfig, pickDatasets: string[] = []): Promise<IDataset[]> {
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
  })
@@ -1,29 +1,29 @@
1
- const { formatValue, defineFormat, formatAbbreviated } = require('../dist/cjs');
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 = formatValue('1000000', {
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 = formatValue('1000000', {
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 = formatValue('1000000', {
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 = formatValue('1000000', {
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 = formatValue('2021-08-06', {
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 = formatValue('2021-08-06 05:30:50', {
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 = formatValue('2021-06-09T13:15:46', {
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 = formatValue('2021-06-09T13:15:46', {
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 = formatValue('2018-01-01T00:00:00', {
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 = formatValue('1000000', format);
339
+ const currency = addFormat('1000000', format);
340
340
  expect(currency).toEqual(' $1,000,000.000');
341
341
  });
342
342