@devgateway/dvz-wp-commons 1.2.0 → 1.3.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.
Files changed (51) hide show
  1. package/build/APIConfig.cjs +479 -0
  2. package/build/APIConfig.d.ts +12 -0
  3. package/build/APIConfig.js +367 -283
  4. package/build/APIutils.cjs +54 -0
  5. package/build/APIutils.js +7 -1
  6. package/build/Blocks.cjs +672 -0
  7. package/build/Blocks.d.ts +14 -1
  8. package/build/Blocks.js +523 -330
  9. package/build/CSVSourceConfig.cjs +99 -0
  10. package/build/CSVSourceConfig.js +63 -46
  11. package/build/ChartColors.cjs +593 -0
  12. package/build/ChartColors.d.ts +0 -1
  13. package/build/ChartColors.js +430 -366
  14. package/build/ChartLegends.cjs +157 -0
  15. package/build/ChartLegends.d.ts +0 -1
  16. package/build/ChartLegends.js +173 -54
  17. package/build/ChartMeasures.cjs +192 -0
  18. package/build/ChartMeasures.d.ts +0 -1
  19. package/build/ChartMeasures.js +197 -109
  20. package/build/Constants.cjs +21 -0
  21. package/build/Constants.js +3 -1
  22. package/build/DataFilters.cjs +176 -0
  23. package/build/DataFilters.js +100 -89
  24. package/build/Format.cjs +1038 -0
  25. package/build/Format.js +428 -378
  26. package/build/MapCSVSourceConfig.cjs +36 -0
  27. package/build/MapCSVSourceConfig.js +19 -8
  28. package/build/Measures.cjs +196 -0
  29. package/build/Measures.js +204 -108
  30. package/build/MobileConfigUtils.cjs +92 -0
  31. package/build/MobileConfigUtils.js +19 -8
  32. package/build/Tooltip.cjs +63 -0
  33. package/build/Tooltip.d.ts +1 -3
  34. package/build/Tooltip.js +27 -51
  35. package/build/Util.cjs +29 -0
  36. package/build/Util.js +7 -7
  37. package/build/hooks/index.cjs +1 -0
  38. package/build/hooks/index.js +0 -3
  39. package/build/icons/Chart.cjs +49 -0
  40. package/build/icons/Chart.d.ts +1 -2
  41. package/build/icons/Chart.js +10 -11
  42. package/build/icons/Generic.cjs +24 -0
  43. package/build/icons/Generic.d.ts +1 -2
  44. package/build/icons/Generic.js +25 -4
  45. package/build/icons/index.cjs +19 -0
  46. package/build/icons/index.js +2 -2
  47. package/build/index.cjs +225 -0
  48. package/build/index.d.ts +1 -1
  49. package/build/index.js +47 -16
  50. package/package.json +16 -7
  51. package/build/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isSupersetAPI = exports.getTranslation = exports.getTranslatedOptions = exports.default = void 0;
7
+ const getTranslatedOptions = options => {
8
+ const currentLocale = (window._user_locale ? window._user_locale : '').toUpperCase();
9
+ if (options && options instanceof Array) {
10
+ debugger;
11
+ return options.map(o => {
12
+ let {
13
+ label,
14
+ value,
15
+ labels
16
+ } = o;
17
+ if (labels && labels[currentLocale]) {
18
+ label = labels[currentLocale];
19
+ }
20
+ if (!label) {
21
+ label = value;
22
+ }
23
+ return {
24
+ ...o,
25
+ label,
26
+ value
27
+ };
28
+ });
29
+ }
30
+ return [];
31
+ };
32
+ exports.getTranslatedOptions = getTranslatedOptions;
33
+ const getTranslation = translatable => {
34
+ const currentLocale = (window._user_locale ? window._user_locale : '').toUpperCase();
35
+ let {
36
+ label,
37
+ labels,
38
+ value
39
+ } = translatable;
40
+ if (labels && labels[currentLocale]) {
41
+ label = labels[currentLocale];
42
+ }
43
+ return label || value || translatable;
44
+ };
45
+ exports.getTranslation = getTranslation;
46
+ const isSupersetAPI = (app, apps) => {
47
+ if (app == 'csv' || !apps) {
48
+ return false;
49
+ }
50
+ const appObj = apps.filter(a => a.value == app)[0];
51
+ return appObj && appObj.settings && appObj.settings.metadata && appObj.settings.metadata.superset == 'true';
52
+ };
53
+ exports.isSupersetAPI = isSupersetAPI;
54
+ module.exports = getTranslatedOptions;
package/build/APIutils.js CHANGED
@@ -14,8 +14,11 @@ export const getTranslatedOptions = (options) => {
14
14
  });
15
15
  }
16
16
  return [];
17
+
17
18
  };
19
+
18
20
  export const getTranslation = (translatable) => {
21
+
19
22
  const currentLocale = (window._user_locale ? window._user_locale : '').toUpperCase();
20
23
  let { label, labels, value } = translatable;
21
24
  if (labels && labels[currentLocale]) {
@@ -23,7 +26,9 @@ export const getTranslation = (translatable) => {
23
26
  }
24
27
  return label || value || translatable;
25
28
  };
29
+
26
30
  export const isSupersetAPI = (app, apps) => {
31
+
27
32
  if (app == 'csv' || !apps) {
28
33
  return false;
29
34
  }
@@ -31,4 +36,5 @@ export const isSupersetAPI = (app, apps) => {
31
36
  return appObj && appObj.settings && appObj.settings.metadata
32
37
  && appObj.settings.metadata.superset == 'true';
33
38
  };
34
- export default getTranslatedOptions;
39
+
40
+ export default getTranslatedOptions