@qrvey/utils 1.2.9-17 → 1.2.9-20
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 +729 -729
- package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/cjs/filters/helpers/ui/getUIValues.js +1 -1
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderConfig.d.ts +0 -2
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +2 -1
- package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +2 -3
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +2 -1
- package/dist/cjs/format/localization.d.ts +1 -0
- package/dist/cjs/format/localization.js +12 -3
- package/dist/cjs/globalization/helpers/getI18nCalendar.d.ts +4 -0
- package/dist/cjs/globalization/helpers/getI18nCalendar.js +69 -0
- package/dist/cjs/globalization/helpers/index.d.ts +1 -0
- package/dist/cjs/globalization/helpers/index.js +1 -0
- package/dist/cjs/globalization/interfaces/II18nConfig.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/{IResourceI18n.js → II18nConfig.js} +0 -0
- package/dist/cjs/globalization/interfaces/{IResourceI18n.d.ts → II18nResource.d.ts} +1 -1
- package/dist/cjs/globalization/interfaces/II18nResource.js +2 -0
- package/dist/cjs/globalization/interfaces/bucket_builder/II18nBucketBuilderModalBucket.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.js +2 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.js +2 -0
- package/dist/cjs/globalization/interfaces/calendar/index.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/calendar/index.js +14 -0
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
- package/dist/cjs/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.js +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderListModal.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/index.d.ts +3 -1
- package/dist/cjs/globalization/interfaces/index.js +3 -1
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +1 -0
- package/dist/cjs/globalization/labels/I18N_DEFAULT.d.ts +2 -2
- package/dist/cjs/globalization/labels/bucket_builder/I18N_BUCKET_BUILDER.js +2 -0
- package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
- package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.js +10 -0
- package/dist/cjs/globalization/labels/calendar/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/calendar/index.js +13 -0
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/cjs/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +6 -0
- package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +3 -1
- package/dist/cjs/globalization/labels/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/index.js +1 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/cjs/globalization/service/i18nextBuilder.d.ts +3 -3
- package/dist/cjs/globalization/service/initI18n.d.ts +2 -2
- package/dist/cjs/qrvey/helpers/transformValue.js +2 -1
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +2 -1
- package/dist/cjs/services/api/getDatasetColumns.api.js +2 -3
- package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/filters/helpers/ui/getUIValues.js +1 -1
- package/dist/filters/interfaces/builder/IFilterBuilderConfig.d.ts +0 -2
- package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +2 -1
- package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +2 -3
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +2 -1
- package/dist/format/localization.d.ts +1 -0
- package/dist/format/localization.js +10 -2
- package/dist/globalization/helpers/getI18nCalendar.d.ts +4 -0
- package/dist/globalization/helpers/getI18nCalendar.js +65 -0
- package/dist/globalization/helpers/index.d.ts +1 -0
- package/dist/globalization/helpers/index.js +1 -0
- package/dist/globalization/interfaces/II18nConfig.d.ts +6 -0
- package/dist/globalization/interfaces/{IResourceI18n.js → II18nConfig.js} +0 -0
- package/dist/globalization/interfaces/{IResourceI18n.d.ts → II18nResource.d.ts} +1 -1
- package/dist/globalization/interfaces/II18nResource.js +1 -0
- package/dist/globalization/interfaces/bucket_builder/II18nBucketBuilderModalBucket.d.ts +2 -0
- package/dist/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
- package/dist/globalization/interfaces/calendar/II18nCalendar.js +1 -0
- package/dist/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
- package/dist/globalization/interfaces/calendar/II18nCalendarProperties.js +1 -0
- package/dist/globalization/interfaces/calendar/index.d.ts +2 -0
- package/dist/globalization/interfaces/calendar/index.js +2 -0
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
- package/dist/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
- package/dist/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
- package/dist/globalization/interfaces/filters/II18nTokenBox.js +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderListModal.d.ts +2 -0
- package/dist/globalization/interfaces/index.d.ts +3 -1
- package/dist/globalization/interfaces/index.js +3 -1
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +1 -0
- package/dist/globalization/labels/I18N_DEFAULT.d.ts +2 -2
- package/dist/globalization/labels/bucket_builder/I18N_BUCKET_BUILDER.js +2 -0
- package/dist/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
- package/dist/globalization/labels/calendar/I18N_CALENDAR.js +7 -0
- package/dist/globalization/labels/calendar/index.d.ts +1 -0
- package/dist/globalization/labels/calendar/index.js +1 -0
- package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
- package/dist/globalization/labels/filters/I18N_FILTER.js +6 -0
- package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +3 -1
- package/dist/globalization/labels/index.d.ts +1 -0
- package/dist/globalization/labels/index.js +1 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/globalization/service/i18nextBuilder.d.ts +3 -3
- package/dist/globalization/service/initI18n.d.ts +2 -2
- package/dist/qrvey/helpers/transformValue.js +2 -1
- package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +2 -1
- package/dist/services/api/getDatasetColumns.api.js +3 -4
- package/package.json +1 -1
- package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -1
- package/src/filters/helpers/ui/getUIValues.ts +1 -1
- package/src/filters/interfaces/builder/IFilterBuilderConfig.ts +0 -2
- package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +3 -1
- package/src/filters/interfaces/panel/IFilterPanelConfig.ts +2 -3
- package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +2 -1
- package/src/format/localization.ts +12 -2
- package/src/globalization/helpers/getI18nCalendar.ts +68 -0
- package/src/globalization/helpers/index.ts +1 -0
- package/src/globalization/interfaces/II18nConfig.ts +7 -0
- package/src/globalization/interfaces/{IResourceI18n.ts → II18nResource.ts} +1 -1
- package/src/globalization/interfaces/bucket_builder/II18nBucketBuilderModalBucket.ts +2 -0
- package/src/globalization/interfaces/calendar/II18nCalendar.ts +7 -0
- package/src/globalization/interfaces/calendar/II18nCalendarProperties.ts +9 -0
- package/src/globalization/interfaces/calendar/index.ts +2 -0
- package/src/globalization/interfaces/common/II18nCommon.ts +2 -0
- package/src/globalization/interfaces/common/II18nDayNames.ts +8 -0
- package/src/globalization/interfaces/filters/II18nFilter.ts +2 -0
- package/src/globalization/interfaces/filters/II18nTokenBox.ts +6 -0
- package/src/globalization/interfaces/formula_builder/II18nFormulaBuilderListModal.ts +3 -1
- package/src/globalization/interfaces/index.ts +3 -1
- package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +1 -0
- package/src/globalization/labels/I18N_DEFAULT.ts +2 -2
- package/src/globalization/labels/bucket_builder/I18N_BUCKET_BUILDER.ts +2 -0
- package/src/globalization/labels/calendar/I18N_CALENDAR.ts +9 -0
- package/src/globalization/labels/calendar/index.ts +1 -0
- package/src/globalization/labels/common/I18N_COMMON.ts +2 -0
- package/src/globalization/labels/common/I18N_DAY_NAMES.ts +8 -0
- package/src/globalization/labels/filters/I18N_FILTER.ts +6 -0
- package/src/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.ts +3 -1
- package/src/globalization/labels/index.ts +1 -0
- package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +1 -0
- package/src/globalization/service/i18nextBuilder.ts +4 -4
- package/src/globalization/service/initI18n.ts +3 -3
- package/src/qrvey/helpers/transformValue.ts +1 -1
- package/src/qrvey/interfaces/ITransformValueSettings.ts +2 -1
- package/src/services/api/getDatasetColumns.api.ts +3 -4
- package/test/columns/isNumericalColumn.test.js +154 -0
|
@@ -12,7 +12,7 @@ function getFilterBuilderGeneralConfig(config = {}) {
|
|
|
12
12
|
apiKey: (0, getAttribute_1.getAttribute)(config, 'api_key') || config.apiKey,
|
|
13
13
|
appid: (0, getAttribute_1.getAttribute)(config, 'app_id') || config.appid,
|
|
14
14
|
domain: config.domain,
|
|
15
|
-
|
|
15
|
+
i18n: config.i18n,
|
|
16
16
|
qv_token: config.qv_token,
|
|
17
17
|
timezoneControl: (0, getAttribute_1.getAttribute)(config, 'timezone_control') || config.timezoneControl,
|
|
18
18
|
userid: (0, getAttribute_1.getAttribute)(config, 'user_id') || config.userid,
|
|
@@ -45,7 +45,7 @@ function getUIValues(filter, settings) {
|
|
|
45
45
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.IS_NULL:
|
|
46
46
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.IS_NOT_NULL:
|
|
47
47
|
return [{
|
|
48
|
-
value: FILTER_VALIDATOR_INFO_1.FILTER_VALIDATOR_INFO[filter.validator].label,
|
|
48
|
+
value: (settings === null || settings === void 0 ? void 0 : settings.translate) ? settings.translate('filter.validators.' + filter.validator.toLowerCase() + '_label') : FILTER_VALIDATOR_INFO_1.FILTER_VALIDATOR_INFO[filter.validator].label,
|
|
49
49
|
enabled: settings.addEnableds ? (_a = filter.values[0]) === null || _a === void 0 ? void 0 : _a.enabled : undefined,
|
|
50
50
|
}];
|
|
51
51
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.IN:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IResourceI18n } from "../../../globalization/interfaces/IResourceI18n";
|
|
2
1
|
import { IFBLogic } from "../backend/IFBLogic";
|
|
3
2
|
import { IFBUserFilters } from "../backend/IFBUserFilters";
|
|
4
3
|
import { IFSColumn } from "../common/IFSColumn";
|
|
@@ -15,7 +14,6 @@ import { IFilterBuilderSettings } from "./IFilterBuilderSettings";
|
|
|
15
14
|
* Structure for the configuration of the Filter Builder
|
|
16
15
|
*/
|
|
17
16
|
export interface IFilterBuilderConfig {
|
|
18
|
-
i18n?: IResourceI18n;
|
|
19
17
|
datasets?: string[];
|
|
20
18
|
filterData?: IFSData;
|
|
21
19
|
filterLabel?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
|
|
1
2
|
/**
|
|
2
3
|
* Structure for the Fiter Builder General config
|
|
3
4
|
*/
|
|
@@ -7,6 +8,6 @@ export interface IFilterBuilderGeneralConfig {
|
|
|
7
8
|
domain: string;
|
|
8
9
|
qv_token?: string;
|
|
9
10
|
timezoneControl?: string;
|
|
10
|
-
|
|
11
|
+
i18n?: II18nConfig;
|
|
11
12
|
userid: string;
|
|
12
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
|
|
2
2
|
import { IFilterBuilderConfig } from "../builder/IFilterBuilderConfig";
|
|
3
3
|
import { IFUDataStore } from "../ui/IFUDataStore";
|
|
4
4
|
/**
|
|
@@ -6,6 +6,5 @@ import { IFUDataStore } from "../ui/IFUDataStore";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IFilterPanelConfig extends IFUDataStore {
|
|
8
8
|
filterBuilderConfig?: IFilterBuilderConfig;
|
|
9
|
-
i18n?:
|
|
10
|
-
locale?: string;
|
|
9
|
+
i18n?: II18nConfig;
|
|
11
10
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
|
|
1
2
|
import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nServiceTranslate";
|
|
2
3
|
export interface IFUTransformFilterValuesSettings {
|
|
3
4
|
translate: II18nServiceTranslate;
|
|
4
|
-
|
|
5
|
+
i18n: II18nConfig;
|
|
5
6
|
suffixTranslateLabel?: string;
|
|
6
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { IFormatConfig, IFormatOutputFormat } from '../interfaces';
|
|
2
2
|
export declare const getLang: (locale: string | Record<string, any>) => Record<string, any>;
|
|
3
|
+
export declare const chooseLang: (config: Record<string, any>) => string;
|
|
3
4
|
export declare const formatWithLocale: (value: any, outputFormat: IFormatOutputFormat, config?: IFormatConfig) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatWithLocale = exports.getLang = void 0;
|
|
3
|
+
exports.formatWithLocale = exports.chooseLang = exports.getLang = void 0;
|
|
4
4
|
const definition_1 = require("./definition");
|
|
5
5
|
const getLang = (locale) => {
|
|
6
6
|
if (!locale)
|
|
@@ -11,6 +11,15 @@ const getLang = (locale) => {
|
|
|
11
11
|
return { lang: locale === "browser" ? window.navigator.language : locale };
|
|
12
12
|
};
|
|
13
13
|
exports.getLang = getLang;
|
|
14
|
+
const chooseLang = (config) => {
|
|
15
|
+
var _a, _b, _c, _d, _e;
|
|
16
|
+
const lang = (((_a = config === null || config === void 0 ? void 0 : config.i18n) === null || _a === void 0 ? void 0 : _a.lang) ||
|
|
17
|
+
((_c = (_b = config === null || config === void 0 ? void 0 : config.i18n) === null || _b === void 0 ? void 0 : _b.locale) === null || _c === void 0 ? void 0 : _c.lang) ||
|
|
18
|
+
((_d = config === null || config === void 0 ? void 0 : config.locale) === null || _d === void 0 ? void 0 : _d.lang) ||
|
|
19
|
+
config.lang);
|
|
20
|
+
return ((_e = lang) === null || _e === void 0 ? void 0 : _e.lang) || lang || definition_1.LANG_DEFAULT;
|
|
21
|
+
};
|
|
22
|
+
exports.chooseLang = chooseLang;
|
|
14
23
|
const formatWithLocale = (value, outputFormat, config = {}) => {
|
|
15
24
|
switch (outputFormat.type) {
|
|
16
25
|
case 'DATE':
|
|
@@ -42,10 +51,10 @@ function formatLocaleNumber(value, outputFormat, config) {
|
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
function getLocaleOptions(outputFormat) {
|
|
45
|
-
const { format, decimals, currency
|
|
54
|
+
const { format, decimals, currency } = outputFormat;
|
|
46
55
|
switch (format) {
|
|
47
56
|
case "Currency" /* CURRENCY */: {
|
|
48
|
-
const iso = definition_1.currencyISO.find(item => item.text ===
|
|
57
|
+
const iso = definition_1.currencyISO.find(item => (item.text === currency.text) || (item.text.includes(currency.label)));
|
|
49
58
|
return { style: "currency" /* CURRENCY */, currency: iso.label, maximumFractionDigits: decimals, minimumFractionDigits: 0 };
|
|
50
59
|
}
|
|
51
60
|
case "Scientific" /* SCIENTIFIC */: return { style: "decimal" /* DECIMAL */,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { II18nCalendarProperties } from "../interfaces/calendar/II18nCalendarProperties";
|
|
2
|
+
import { II18nServiceTranslate } from "../interfaces/II18nServiceTranslate";
|
|
3
|
+
import { I18nService } from "../service/i18nextBuilder";
|
|
4
|
+
export declare function getI18nCalendar(locale: I18nService | II18nServiceTranslate): II18nCalendarProperties;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getI18nCalendar = void 0;
|
|
4
|
+
const i18nextBuilder_1 = require("../service/i18nextBuilder");
|
|
5
|
+
function getI18nCalendar(locale) {
|
|
6
|
+
const localeOverride = locale instanceof i18nextBuilder_1.I18nService ? locale : typeof locale === 'function' ? { translate: locale } : undefined;
|
|
7
|
+
if (!localeOverride)
|
|
8
|
+
return undefined;
|
|
9
|
+
return {
|
|
10
|
+
clear: localeOverride.translate('common.calendar.clear'),
|
|
11
|
+
days: [
|
|
12
|
+
localeOverride.translate('common.day_names.sunday_dddd'),
|
|
13
|
+
localeOverride.translate('common.day_names.monday_dddd'),
|
|
14
|
+
localeOverride.translate('common.day_names.tuesday_dddd'),
|
|
15
|
+
localeOverride.translate('common.day_names.wednesday_dddd'),
|
|
16
|
+
localeOverride.translate('common.day_names.thursday_dddd'),
|
|
17
|
+
localeOverride.translate('common.day_names.friday_dddd'),
|
|
18
|
+
localeOverride.translate('common.day_names.saturday_dddd')
|
|
19
|
+
],
|
|
20
|
+
daysMin: [
|
|
21
|
+
localeOverride.translate('common.day_names.sunday_dd'),
|
|
22
|
+
localeOverride.translate('common.day_names.monday_dd'),
|
|
23
|
+
localeOverride.translate('common.day_names.tuesday_dd'),
|
|
24
|
+
localeOverride.translate('common.day_names.wednesday_dd'),
|
|
25
|
+
localeOverride.translate('common.day_names.thursday_dd'),
|
|
26
|
+
localeOverride.translate('common.day_names.friday_dd'),
|
|
27
|
+
localeOverride.translate('common.day_names.saturday_dd')
|
|
28
|
+
],
|
|
29
|
+
daysShort: [
|
|
30
|
+
localeOverride.translate('common.day_names.sunday_ddd'),
|
|
31
|
+
localeOverride.translate('common.day_names.monday_ddd'),
|
|
32
|
+
localeOverride.translate('common.day_names.tuesday_ddd'),
|
|
33
|
+
localeOverride.translate('common.day_names.wednesday_ddd'),
|
|
34
|
+
localeOverride.translate('common.day_names.thursday_ddd'),
|
|
35
|
+
localeOverride.translate('common.day_names.friday_ddd'),
|
|
36
|
+
localeOverride.translate('common.day_names.saturday_ddd')
|
|
37
|
+
],
|
|
38
|
+
months: [
|
|
39
|
+
localeOverride.translate('common.date_grouping.january_mmmm'),
|
|
40
|
+
localeOverride.translate('common.date_grouping.february_mmmm'),
|
|
41
|
+
localeOverride.translate('common.date_grouping.march_mmmm'),
|
|
42
|
+
localeOverride.translate('common.date_grouping.april_mmmm'),
|
|
43
|
+
localeOverride.translate('common.date_grouping.may_mmmm'),
|
|
44
|
+
localeOverride.translate('common.date_grouping.june_mmmm'),
|
|
45
|
+
localeOverride.translate('common.date_grouping.july_mmmm'),
|
|
46
|
+
localeOverride.translate('common.date_grouping.august_mmmm'),
|
|
47
|
+
localeOverride.translate('common.date_grouping.september_mmmm'),
|
|
48
|
+
localeOverride.translate('common.date_grouping.october_mmmm'),
|
|
49
|
+
localeOverride.translate('common.date_grouping.november_mmmm'),
|
|
50
|
+
localeOverride.translate('common.date_grouping.december_mmmm')
|
|
51
|
+
],
|
|
52
|
+
monthsShort: [
|
|
53
|
+
localeOverride.translate('common.date_grouping.january_mmm'),
|
|
54
|
+
localeOverride.translate('common.date_grouping.february_mmm'),
|
|
55
|
+
localeOverride.translate('common.date_grouping.march_mmm'),
|
|
56
|
+
localeOverride.translate('common.date_grouping.april_mmm'),
|
|
57
|
+
localeOverride.translate('common.date_grouping.may_mmm'),
|
|
58
|
+
localeOverride.translate('common.date_grouping.june_mmm'),
|
|
59
|
+
localeOverride.translate('common.date_grouping.july_mmm'),
|
|
60
|
+
localeOverride.translate('common.date_grouping.august_mmm'),
|
|
61
|
+
localeOverride.translate('common.date_grouping.september_mmm'),
|
|
62
|
+
localeOverride.translate('common.date_grouping.october_mmm'),
|
|
63
|
+
localeOverride.translate('common.date_grouping.november_mmm'),
|
|
64
|
+
localeOverride.translate('common.date_grouping.december_mmm')
|
|
65
|
+
],
|
|
66
|
+
today: localeOverride.translate('common.calendar.today')
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
exports.getI18nCalendar = getI18nCalendar;
|
|
@@ -10,5 +10,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./getI18nCalendar"), exports);
|
|
13
14
|
__exportStar(require("./getI18nDateGroupLabel"), exports);
|
|
14
15
|
__exportStar(require("./getReverseI18nGroupLabel"), exports);
|
|
File without changes
|
|
@@ -11,7 +11,7 @@ import { II18nBucketBuilder } from './bucket_builder/II18nBucketBuilder';
|
|
|
11
11
|
import { II18nCrossTabs } from './cross_tabs';
|
|
12
12
|
import { II18nChartBuilder } from '.';
|
|
13
13
|
import { II18nStyleThemes } from './style_themes/II18nStyleThemes';
|
|
14
|
-
export interface
|
|
14
|
+
export interface II18nResource {
|
|
15
15
|
bucket_builder?: II18nBucketBuilder;
|
|
16
16
|
chart_builder?: II18nChartBuilder;
|
|
17
17
|
common?: II18nCommon;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./II18nCalendar"), exports);
|
|
14
|
+
__exportStar(require("./II18nCalendarProperties"), exports);
|
|
@@ -5,8 +5,10 @@ import { II18nColumnTypesSuffixes } from "./II18nColumnTypesSuffixes";
|
|
|
5
5
|
import { II18nDateGrouping } from "./II18nDateGrouping";
|
|
6
6
|
import { II18nDayNames } from "./II18nDayNames";
|
|
7
7
|
import { II18nUnits } from "./II18nUnits";
|
|
8
|
+
import { II18nCalendar } from "../calendar/II18nCalendar";
|
|
8
9
|
export interface II18nCommon {
|
|
9
10
|
aggregate_labels: II18nAgreggateLabels;
|
|
11
|
+
calendar: II18nCalendar;
|
|
10
12
|
column_types: II18nColumnTypes;
|
|
11
13
|
column_types_suffixes: II18nColumnTypesSuffixes;
|
|
12
14
|
date_grouping: II18nDateGrouping;
|
|
@@ -7,6 +7,7 @@ import { II18nFilterOperator } from "./II18nFilterOperator";
|
|
|
7
7
|
import { II18nFilterScopes } from "./II18nFilterScopes";
|
|
8
8
|
import { II18nFilterPanelScopeTitle } from "./II18nFilterPanelScopeTitle";
|
|
9
9
|
import { II18nFilterDateSections } from "./II18nFilterDateSections";
|
|
10
|
+
import { II18nTokenBox } from './II18nTokenBox';
|
|
10
11
|
export interface II18nFilter {
|
|
11
12
|
date_sections: II18nFilterDateSections;
|
|
12
13
|
operators: II18nFilterOperator;
|
|
@@ -15,6 +16,7 @@ export interface II18nFilter {
|
|
|
15
16
|
scope_title: II18nFilterPanelScopeTitle;
|
|
16
17
|
scopes: II18nFilterScopes;
|
|
17
18
|
slidebar: II18nSlidebar;
|
|
19
|
+
token_box?: II18nTokenBox;
|
|
18
20
|
validators: II18nFilterValidator;
|
|
19
21
|
value_container: II18nValueContainer;
|
|
20
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './bucket_builder/index';
|
|
2
|
+
export * from './calendar/index';
|
|
2
3
|
export * from './chart_builder/index';
|
|
3
4
|
export * from './columns/index';
|
|
4
5
|
export * from './common/index';
|
|
@@ -9,6 +10,7 @@ export * from './formula_builder/index';
|
|
|
9
10
|
export * from './panel/index';
|
|
10
11
|
export * from './style_themes/index';
|
|
11
12
|
export * from './table_charts/index';
|
|
13
|
+
export * from './II18nConfig';
|
|
14
|
+
export * from './II18nResource';
|
|
12
15
|
export * from './II18nServiceTranslate';
|
|
13
16
|
export * from './II18nServiceTranslateOption';
|
|
14
|
-
export * from './IResourceI18n';
|
|
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./bucket_builder/index"), exports);
|
|
14
|
+
__exportStar(require("./calendar/index"), exports);
|
|
14
15
|
__exportStar(require("./chart_builder/index"), exports);
|
|
15
16
|
__exportStar(require("./columns/index"), exports);
|
|
16
17
|
__exportStar(require("./common/index"), exports);
|
|
@@ -21,6 +22,7 @@ __exportStar(require("./formula_builder/index"), exports);
|
|
|
21
22
|
__exportStar(require("./panel/index"), exports);
|
|
22
23
|
__exportStar(require("./style_themes/index"), exports);
|
|
23
24
|
__exportStar(require("./table_charts/index"), exports);
|
|
25
|
+
__exportStar(require("./II18nConfig"), exports);
|
|
26
|
+
__exportStar(require("./II18nResource"), exports);
|
|
24
27
|
__exportStar(require("./II18nServiceTranslate"), exports);
|
|
25
28
|
__exportStar(require("./II18nServiceTranslateOption"), exports);
|
|
26
|
-
__exportStar(require("./IResourceI18n"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const I18N_DEFAULT:
|
|
1
|
+
import { II18nResource } from "../interfaces/II18nResource";
|
|
2
|
+
export declare const I18N_DEFAULT: II18nResource;
|
|
@@ -97,6 +97,8 @@ exports.I18N_BUCKET_BUILDER = {
|
|
|
97
97
|
loading: 'Loading dependencies...',
|
|
98
98
|
title: 'Buckets',
|
|
99
99
|
add_bucketed_column: 'Add Bucketed Column',
|
|
100
|
+
information_text_link: 'Learn how to',
|
|
101
|
+
information_text_text: 'create and work with buckets',
|
|
100
102
|
},
|
|
101
103
|
operator: {
|
|
102
104
|
greater_than: 'Greater than',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './I18N_CALENDAR';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./I18N_CALENDAR"), exports);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.I18N_COMMON = void 0;
|
|
4
4
|
const RELATIVE_UNIT_INFO_1 = require("../../../dates/relative/constants/RELATIVE_UNIT_INFO");
|
|
5
|
+
const calendar_1 = require("../calendar");
|
|
5
6
|
const I18N_AGGREGATE_LABEL_1 = require("./I18N_AGGREGATE_LABEL");
|
|
6
7
|
const I18N_COLUMN_LABEL_1 = require("./I18N_COLUMN_LABEL");
|
|
7
8
|
const I18N_COLUMN_PROPERTY_LABEL_1 = require("./I18N_COLUMN_PROPERTY_LABEL");
|
|
@@ -9,6 +10,7 @@ const I18N_DATE_GROUPING_1 = require("./I18N_DATE_GROUPING");
|
|
|
9
10
|
const I18N_DAY_NAMES_1 = require("./I18N_DAY_NAMES");
|
|
10
11
|
exports.I18N_COMMON = {
|
|
11
12
|
aggregate_labels: I18N_AGGREGATE_LABEL_1.I18N_AGGREGATE_LABEL,
|
|
13
|
+
calendar: calendar_1.I18N_CALENDAR,
|
|
12
14
|
column_types: I18N_COLUMN_LABEL_1.I18N_COLUMN_LABEL,
|
|
13
15
|
column_types_suffixes: {
|
|
14
16
|
slidebar_one: 'Step',
|
|
@@ -5,6 +5,13 @@ const DATE_WEEK_DAYS_1 = require("../../../dates/constants/DATE_WEEK_DAYS");
|
|
|
5
5
|
const DATE_WEEK_DAYS_DDDD_1 = require("../../../dates/constants/DATE_WEEK_DAYS_DDDD");
|
|
6
6
|
const capitalize_1 = require("../../../general/string/capitalize");
|
|
7
7
|
exports.I18N_DAY_NAMES = {
|
|
8
|
+
sunday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[0].substring(0, 2)),
|
|
9
|
+
monday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[1].substring(0, 2)),
|
|
10
|
+
tuesday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[2].substring(0, 2)),
|
|
11
|
+
wednesday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[3].substring(0, 2)),
|
|
12
|
+
thursday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[4].substring(0, 2)),
|
|
13
|
+
friday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[5].substring(0, 2)),
|
|
14
|
+
saturday_dd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[6].substring(0, 2)),
|
|
8
15
|
sunday_ddd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[0]),
|
|
9
16
|
monday_ddd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[1]),
|
|
10
17
|
tuesday_ddd: (0, capitalize_1.capitalize)(DATE_WEEK_DAYS_1.DATE_WEEK_DAYS[2]),
|
|
@@ -29,6 +29,12 @@ exports.I18N_FILTER = {
|
|
|
29
29
|
},
|
|
30
30
|
scopes: I18N_FILTER_SCOPE_1.I18N_FILTER_SCOPE,
|
|
31
31
|
slidebar: I18N_SLIDEBAR_1.I18N_SLIDEBAR,
|
|
32
|
+
token_box: {
|
|
33
|
+
data_tokens: 'DataTokens',
|
|
34
|
+
search: 'Search',
|
|
35
|
+
system_tokens: 'SystemTokens',
|
|
36
|
+
user_tokens: 'UserTokens',
|
|
37
|
+
},
|
|
32
38
|
validators: I18N_FILTER_VALIDATOR_1.I18N_FILTER_VALIDATOR,
|
|
33
39
|
value_container: I18N_VALUE_CONTAINER_1.I18N_VALUE_CONTAINER,
|
|
34
40
|
};
|
|
@@ -5,7 +5,9 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
5
5
|
list_modal: {
|
|
6
6
|
title_header: 'Formulas',
|
|
7
7
|
create_button: 'Create Formula',
|
|
8
|
-
empty_message: 'No Formulas Yet'
|
|
8
|
+
empty_message: 'No Formulas Yet',
|
|
9
|
+
information_text_link: 'Learn how to',
|
|
10
|
+
information_text_text: 'create and work with formulas',
|
|
9
11
|
},
|
|
10
12
|
list_table: {
|
|
11
13
|
name: 'Formula Name',
|
|
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./bucket_builder"), exports);
|
|
14
|
+
__exportStar(require("./calendar"), exports);
|
|
14
15
|
__exportStar(require("./chart_builder"), exports);
|
|
15
16
|
__exportStar(require("./columns"), exports);
|
|
16
17
|
__exportStar(require("./common"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { II18nResource } from '../interfaces/II18nResource';
|
|
2
2
|
import { II18nServiceTranslateOption } from "../interfaces/II18nServiceTranslateOption";
|
|
3
3
|
export declare class I18nServiceBuilder {
|
|
4
|
-
static buildI18n(i18nDefault:
|
|
4
|
+
static buildI18n(i18nDefault: II18nResource, i18nResource: II18nResource): Promise<I18nService>;
|
|
5
5
|
private static _initI18n;
|
|
6
|
-
static setTranslations(i18nDefault: any, i18nResource:
|
|
6
|
+
static setTranslations(i18nDefault: any, i18nResource: II18nResource): II18nResource;
|
|
7
7
|
}
|
|
8
8
|
export declare abstract class I18nService {
|
|
9
9
|
abstract translate(key: string, options?: II18nServiceTranslateOption): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { II18nResource } from "../interfaces/II18nResource";
|
|
2
2
|
import { I18nService } from "../service/i18nextBuilder";
|
|
3
|
-
export declare function initI18n(i18nConfig?:
|
|
3
|
+
export declare function initI18n(i18nConfig?: II18nResource, i18nDefault?: II18nResource): Promise<I18nService>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
2
|
import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
|
|
3
|
+
import { II18nConfig } from "../../globalization/interfaces/II18nConfig";
|
|
3
4
|
import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
|
|
4
5
|
export interface ITransformValueSettings {
|
|
5
6
|
column: IColumn;
|
|
6
7
|
property: IColumnPropertyType;
|
|
7
8
|
translate: II18nServiceTranslate;
|
|
8
|
-
|
|
9
|
+
i18n: II18nConfig;
|
|
9
10
|
suffixTranslateLabel?: string;
|
|
10
11
|
}
|
|
@@ -7,7 +7,6 @@ exports.getDatasetColumns = void 0;
|
|
|
7
7
|
const CHART_ENDPOINT_1 = require("../constants/CHART_ENDPOINT");
|
|
8
8
|
const Request_1 = __importDefault(require("../helpers/Request"));
|
|
9
9
|
const BDatasetsToUIDatasets_adapter_1 = require("../adapters/BDatasetsToUIDatasets.adapter");
|
|
10
|
-
const definition_1 = require("../../format/definition");
|
|
11
10
|
const __1 = require("../..");
|
|
12
11
|
/**
|
|
13
12
|
* Get a dataset by Qrvey ID
|
|
@@ -15,11 +14,11 @@ const __1 = require("../..");
|
|
|
15
14
|
* @returns a promise
|
|
16
15
|
*/
|
|
17
16
|
function getDatasetColumns(config, qrveyid) {
|
|
17
|
+
const lang = (0, __1.chooseLang)(config);
|
|
18
18
|
return Request_1.default.post(Object.assign(Object.assign({}, config), { qrveyid, endpoint: CHART_ENDPOINT_1.CHART_ENDPOINT }), '/question/list', {
|
|
19
|
-
'lang': (0, __1.getLang)(config.lang || config.locale || definition_1.LANG_DEFAULT).lang,
|
|
20
19
|
'optionsAttributes': ['id', 'text', 'type', 'property', 'linked', 'linkid', 'qrveyid', 'bucketId', 'formulaId', 'formulaType', 'geogroup', 'outputFormat'],
|
|
21
20
|
'extend': true
|
|
22
|
-
})
|
|
21
|
+
}, { lang })
|
|
23
22
|
.then(BDatasetsToUIDatasets_adapter_1.BDatasetsToUIDatasets)
|
|
24
23
|
.catch(_e => []);
|
|
25
24
|
}
|
|
@@ -9,7 +9,7 @@ export function getFilterBuilderGeneralConfig(config = {}) {
|
|
|
9
9
|
apiKey: getAttribute(config, 'api_key') || config.apiKey,
|
|
10
10
|
appid: getAttribute(config, 'app_id') || config.appid,
|
|
11
11
|
domain: config.domain,
|
|
12
|
-
|
|
12
|
+
i18n: config.i18n,
|
|
13
13
|
qv_token: config.qv_token,
|
|
14
14
|
timezoneControl: getAttribute(config, 'timezone_control') || config.timezoneControl,
|
|
15
15
|
userid: getAttribute(config, 'user_id') || config.userid,
|
|
@@ -42,7 +42,7 @@ export function getUIValues(filter, settings) {
|
|
|
42
42
|
case FILTER_VALIDATOR.IS_NULL:
|
|
43
43
|
case FILTER_VALIDATOR.IS_NOT_NULL:
|
|
44
44
|
return [{
|
|
45
|
-
value: FILTER_VALIDATOR_INFO[filter.validator].label,
|
|
45
|
+
value: (settings === null || settings === void 0 ? void 0 : settings.translate) ? settings.translate('filter.validators.' + filter.validator.toLowerCase() + '_label') : FILTER_VALIDATOR_INFO[filter.validator].label,
|
|
46
46
|
enabled: settings.addEnableds ? (_a = filter.values[0]) === null || _a === void 0 ? void 0 : _a.enabled : undefined,
|
|
47
47
|
}];
|
|
48
48
|
case FILTER_VALIDATOR.IN:
|