@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.
- package/build/APIConfig.cjs +479 -0
- package/build/APIConfig.d.ts +12 -0
- package/build/APIConfig.js +367 -283
- package/build/APIutils.cjs +54 -0
- package/build/APIutils.js +7 -1
- package/build/Blocks.cjs +672 -0
- package/build/Blocks.d.ts +14 -1
- package/build/Blocks.js +523 -330
- package/build/CSVSourceConfig.cjs +99 -0
- package/build/CSVSourceConfig.js +63 -46
- package/build/ChartColors.cjs +593 -0
- package/build/ChartColors.d.ts +0 -1
- package/build/ChartColors.js +430 -366
- package/build/ChartLegends.cjs +157 -0
- package/build/ChartLegends.d.ts +0 -1
- package/build/ChartLegends.js +173 -54
- package/build/ChartMeasures.cjs +192 -0
- package/build/ChartMeasures.d.ts +0 -1
- package/build/ChartMeasures.js +197 -109
- package/build/Constants.cjs +21 -0
- package/build/Constants.js +3 -1
- package/build/DataFilters.cjs +176 -0
- package/build/DataFilters.js +100 -89
- package/build/Format.cjs +1038 -0
- package/build/Format.js +428 -378
- package/build/MapCSVSourceConfig.cjs +36 -0
- package/build/MapCSVSourceConfig.js +19 -8
- package/build/Measures.cjs +196 -0
- package/build/Measures.js +204 -108
- package/build/MobileConfigUtils.cjs +92 -0
- package/build/MobileConfigUtils.js +19 -8
- package/build/Tooltip.cjs +63 -0
- package/build/Tooltip.d.ts +1 -3
- package/build/Tooltip.js +27 -51
- package/build/Util.cjs +29 -0
- package/build/Util.js +7 -7
- package/build/hooks/index.cjs +1 -0
- package/build/hooks/index.js +0 -3
- package/build/icons/Chart.cjs +49 -0
- package/build/icons/Chart.d.ts +1 -2
- package/build/icons/Chart.js +10 -11
- package/build/icons/Generic.cjs +24 -0
- package/build/icons/Generic.d.ts +1 -2
- package/build/icons/Generic.js +25 -4
- package/build/icons/index.cjs +19 -0
- package/build/icons/index.js +2 -2
- package/build/index.cjs +225 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +47 -16
- package/package.json +16 -7
- 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
|
-
|
|
39
|
+
|
|
40
|
+
export default getTranslatedOptions
|