@devgateway/dvz-wp-commons 1.1.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 +31 -42
- package/build/APIConfig.js +366 -277
- package/build/APIutils.cjs +54 -0
- package/build/APIutils.d.ts +3 -3
- package/build/APIutils.js +11 -1
- package/build/Blocks.cjs +672 -0
- package/build/Blocks.d.ts +42 -65
- package/build/Blocks.js +524 -346
- package/build/CSVSourceConfig.cjs +99 -0
- package/build/CSVSourceConfig.d.ts +2 -3
- package/build/CSVSourceConfig.js +63 -41
- package/build/ChartColors.cjs +593 -0
- package/build/ChartColors.d.ts +4 -46
- package/build/ChartColors.js +431 -380
- package/build/ChartLegends.cjs +157 -0
- package/build/ChartLegends.d.ts +1 -33
- package/build/ChartLegends.js +173 -69
- package/build/ChartMeasures.cjs +192 -0
- package/build/ChartMeasures.d.ts +1 -23
- package/build/ChartMeasures.js +195 -108
- package/build/Constants.cjs +21 -0
- package/build/Constants.d.ts +18 -15
- package/build/Constants.js +3 -1
- package/build/DataFilters.cjs +176 -0
- package/build/DataFilters.d.ts +1 -12
- package/build/DataFilters.js +100 -93
- package/build/Format.cjs +1038 -0
- package/build/Format.d.ts +8 -10
- package/build/Format.js +428 -379
- package/build/MapCSVSourceConfig.cjs +36 -0
- package/build/MapCSVSourceConfig.d.ts +7 -9
- package/build/MapCSVSourceConfig.js +19 -9
- package/build/Measures.cjs +196 -0
- package/build/Measures.d.ts +1 -24
- package/build/Measures.js +208 -119
- package/build/MobileConfigUtils.cjs +92 -0
- package/build/MobileConfigUtils.d.ts +6 -6
- package/build/MobileConfigUtils.js +39 -32
- 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.d.ts +5 -6
- package/build/Util.js +9 -9
- 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.d.ts +2 -2
- package/build/icons/index.js +2 -2
- package/build/index.cjs +225 -0
- package/build/index.d.ts +16 -18
- package/build/index.js +47 -19
- package/package.json +39 -30
- package/build/post-type.d.ts +0 -193
- package/build/post-type.js +0 -12
- package/build/tsconfig.tsbuildinfo +0 -1
- package/build/types.d.ts +0 -349
- package/build/types.js +0 -33
|
@@ -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.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export function getTranslatedOptions(options: any): any[];
|
|
2
|
+
export function getTranslation(translatable: any): any;
|
|
3
|
+
export function isSupersetAPI(app: any, apps: any): any;
|
|
4
4
|
export default getTranslatedOptions;
|
package/build/APIutils.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
export const getTranslatedOptions = (options) => {
|
|
2
2
|
const currentLocale = (window._user_locale ? window._user_locale : '').toUpperCase();
|
|
3
3
|
if (options && options instanceof Array) {
|
|
4
|
+
debugger;
|
|
4
5
|
return options.map(o => {
|
|
5
6
|
let { label, value, labels } = o;
|
|
6
7
|
if (labels && labels[currentLocale]) {
|
|
7
8
|
label = labels[currentLocale];
|
|
8
9
|
}
|
|
10
|
+
if (!label) {
|
|
11
|
+
label = value;
|
|
12
|
+
}
|
|
9
13
|
return { ...o, label, value };
|
|
10
14
|
});
|
|
11
15
|
}
|
|
12
16
|
return [];
|
|
17
|
+
|
|
13
18
|
};
|
|
19
|
+
|
|
14
20
|
export const getTranslation = (translatable) => {
|
|
21
|
+
|
|
15
22
|
const currentLocale = (window._user_locale ? window._user_locale : '').toUpperCase();
|
|
16
23
|
let { label, labels, value } = translatable;
|
|
17
24
|
if (labels && labels[currentLocale]) {
|
|
@@ -19,7 +26,9 @@ export const getTranslation = (translatable) => {
|
|
|
19
26
|
}
|
|
20
27
|
return label || value || translatable;
|
|
21
28
|
};
|
|
29
|
+
|
|
22
30
|
export const isSupersetAPI = (app, apps) => {
|
|
31
|
+
|
|
23
32
|
if (app == 'csv' || !apps) {
|
|
24
33
|
return false;
|
|
25
34
|
}
|
|
@@ -27,4 +36,5 @@ export const isSupersetAPI = (app, apps) => {
|
|
|
27
36
|
return appObj && appObj.settings && appObj.settings.metadata
|
|
28
37
|
&& appObj.settings.metadata.superset == 'true';
|
|
29
38
|
};
|
|
30
|
-
|
|
39
|
+
|
|
40
|
+
export default getTranslatedOptions
|