@qrvey/utils 1.16.1-1 → 1.16.1-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.
- package/dist/cache-managers/cache-platform-config-manager.d.ts +8 -0
- package/dist/cache-managers/cache-platform-config-manager.js +37 -0
- package/dist/cache-managers/clean-cache-managers.js +3 -0
- package/dist/cache-managers/index.d.ts +1 -0
- package/dist/cache-managers/index.js +1 -0
- package/dist/charts/helpers/styleSettingsByChartType.js +1 -0
- package/dist/charts/interfaces/IChartV2.d.ts +1 -0
- package/dist/cjs/cache-managers/cache-platform-config-manager.d.ts +8 -0
- package/dist/cjs/cache-managers/cache-platform-config-manager.js +41 -0
- package/dist/cjs/cache-managers/clean-cache-managers.js +3 -0
- package/dist/cjs/cache-managers/index.d.ts +1 -0
- package/dist/cjs/cache-managers/index.js +1 -0
- package/dist/cjs/charts/helpers/styleSettingsByChartType.js +1 -0
- package/dist/cjs/charts/interfaces/IChartV2.d.ts +1 -0
- package/dist/cjs/column_format/helpers/columnTypeByChart.d.ts +1 -1
- package/dist/cjs/column_format/helpers/parseFormulaTypeByCharts.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IBColumn.d.ts +3 -1
- package/dist/cjs/columns/interfaces/IColumn.d.ts +6 -5
- package/dist/cjs/filters/helpers/OLD_getAggFilters.js +32 -49
- package/dist/cjs/format/definition.d.ts +1 -0
- package/dist/cjs/format/definition.js +27 -27
- package/dist/cjs/format/format.d.ts +1 -1
- package/dist/cjs/format/helpers/getCurrencySymbolByCode.d.ts +1 -0
- package/dist/cjs/format/helpers/getCurrencySymbolByCode.js +10 -2
- package/dist/cjs/format/helpers/isDefaultCurrent.js +1 -2
- package/dist/cjs/format/localization.js +5 -5
- package/dist/cjs/formulas/constants/FORMULA.d.ts +1 -0
- package/dist/cjs/general/object/traverseTree.d.ts +16 -0
- package/dist/cjs/general/object/traverseTree.js +37 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderMenuActions.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelTooltips.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/table_charts/II18nTableCharts.d.ts +5 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +2 -1
- package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +1 -0
- package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +5 -0
- package/dist/cjs/services/adapters/BColumnsToUIColumns.adapter.js +1 -0
- package/dist/cjs/services/api/platformConfig.api.d.ts +2 -0
- package/dist/cjs/services/api/platformConfig.api.js +20 -0
- package/dist/column_format/helpers/columnTypeByChart.d.ts +1 -1
- package/dist/column_format/helpers/parseFormulaTypeByCharts.d.ts +1 -1
- package/dist/columns/interfaces/IBColumn.d.ts +3 -1
- package/dist/columns/interfaces/IColumn.d.ts +6 -5
- package/dist/filters/helpers/OLD_getAggFilters.js +32 -49
- package/dist/format/definition.d.ts +1 -0
- package/dist/format/definition.js +27 -27
- package/dist/format/format.d.ts +1 -1
- package/dist/format/helpers/getCurrencySymbolByCode.d.ts +1 -0
- package/dist/format/helpers/getCurrencySymbolByCode.js +8 -1
- package/dist/format/helpers/isDefaultCurrent.js +1 -2
- package/dist/format/localization.js +6 -6
- package/dist/formulas/constants/FORMULA.d.ts +1 -0
- package/dist/general/object/traverseTree.d.ts +16 -0
- package/dist/general/object/traverseTree.js +33 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderMenuActions.d.ts +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +1 -0
- package/dist/globalization/interfaces/panel/II18nPanelTooltips.d.ts +1 -0
- package/dist/globalization/interfaces/table_charts/II18nTableCharts.d.ts +5 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +2 -1
- package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +1 -0
- package/dist/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +5 -0
- package/dist/services/adapters/BColumnsToUIColumns.adapter.js +1 -0
- package/dist/services/api/platformConfig.api.d.ts +2 -0
- package/dist/services/api/platformConfig.api.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QrveyCacheManager, QvCacheStoreProperties } from "./cache-manager";
|
|
2
|
+
import { IGetPermissionsConfig } from "./cache-permissions-manager";
|
|
3
|
+
export declare class PlatformConfigCacheManager extends QrveyCacheManager<QvCacheStoreProperties, IGetPermissionsConfig> {
|
|
4
|
+
static getInstance(): any;
|
|
5
|
+
protected getConfigEntityId(): keyof IGetPermissionsConfig;
|
|
6
|
+
protected buildStoreId({ app_id }: IGetPermissionsConfig): string;
|
|
7
|
+
protected fetchDataAndUpdateStore(state: QvCacheStoreProperties, config: IGetPermissionsConfig): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { QrveyCacheManager } from "./cache-manager";
|
|
11
|
+
import { getPlatformConfig } from "../services/api/platformConfig.api";
|
|
12
|
+
export class PlatformConfigCacheManager extends QrveyCacheManager {
|
|
13
|
+
static getInstance() {
|
|
14
|
+
if (!window.qvPlatformConfigCacheManager) {
|
|
15
|
+
window.qvPlatformConfigCacheManager = new PlatformConfigCacheManager();
|
|
16
|
+
}
|
|
17
|
+
return window.qvPlatformConfigCacheManager;
|
|
18
|
+
}
|
|
19
|
+
getConfigEntityId() {
|
|
20
|
+
return "app_id";
|
|
21
|
+
}
|
|
22
|
+
buildStoreId({ app_id }) {
|
|
23
|
+
return `${app_id}`;
|
|
24
|
+
}
|
|
25
|
+
fetchDataAndUpdateStore(state, config) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
return getPlatformConfig(config)
|
|
28
|
+
.then((platformConfig) => {
|
|
29
|
+
state.entity = platformConfig;
|
|
30
|
+
state.error = null;
|
|
31
|
+
})
|
|
32
|
+
.catch((e) => {
|
|
33
|
+
state.error = e;
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -11,6 +11,7 @@ import { ChartCacheManager } from "./cache-chart-manager";
|
|
|
11
11
|
import { MetricCacheManager } from "./cache-metric-manager";
|
|
12
12
|
import { ModelCacheManager } from "./cache-model-manager";
|
|
13
13
|
import { PermissionsCacheManager } from "./cache-permissions-manager";
|
|
14
|
+
import { PlatformConfigCacheManager } from "./cache-platform-config-manager";
|
|
14
15
|
import { ThemeCacheManager } from "./cache-theme-manager";
|
|
15
16
|
export const cleanCacheManagers = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
17
|
const chartManager = ChartCacheManager.getInstance();
|
|
@@ -23,4 +24,6 @@ export const cleanCacheManagers = () => __awaiter(void 0, void 0, void 0, functi
|
|
|
23
24
|
yield permissionsManager.cleanAllStores();
|
|
24
25
|
const themeManager = ThemeCacheManager.getInstance();
|
|
25
26
|
yield themeManager.cleanAllStores();
|
|
27
|
+
const platformConfigManager = PlatformConfigCacheManager.getInstance();
|
|
28
|
+
yield platformConfigManager.cleanAllStores();
|
|
26
29
|
});
|
|
@@ -2,6 +2,7 @@ export * from "./cache-chart-manager";
|
|
|
2
2
|
export * from "./cache-manager";
|
|
3
3
|
export * from "./cache-metric-manager";
|
|
4
4
|
export * from "./cache-model-manager";
|
|
5
|
+
export * from "./cache-platform-config-manager";
|
|
5
6
|
export * from "./cache-permissions-manager";
|
|
6
7
|
export * from "./cache-theme-manager";
|
|
7
8
|
export * from "./clean-cache-managers";
|
|
@@ -2,6 +2,7 @@ export * from "./cache-chart-manager";
|
|
|
2
2
|
export * from "./cache-manager";
|
|
3
3
|
export * from "./cache-metric-manager";
|
|
4
4
|
export * from "./cache-model-manager";
|
|
5
|
+
export * from "./cache-platform-config-manager";
|
|
5
6
|
export * from "./cache-permissions-manager";
|
|
6
7
|
export * from "./cache-theme-manager";
|
|
7
8
|
export * from "./clean-cache-managers";
|
|
@@ -199,6 +199,7 @@ export const parseStyleSettingByType = (type, { stylesSettings, globalSettings,
|
|
|
199
199
|
column_resizing: _get(globalSettings, "table_menu.column_resizing", true),
|
|
200
200
|
column_arrangement: _get(globalSettings, "table_menu.column_arrangement", true),
|
|
201
201
|
column_update: _get(globalSettings, "table_menu.column_update", false),
|
|
202
|
+
grouping_column_update: _get(globalSettings, "table_menu.grouping_column_update", false),
|
|
202
203
|
change_aggregation: _get(globalSettings, "table_menu.change_aggregation", false),
|
|
203
204
|
pagination: isGrouped
|
|
204
205
|
? {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QrveyCacheManager, QvCacheStoreProperties } from "./cache-manager";
|
|
2
|
+
import { IGetPermissionsConfig } from "./cache-permissions-manager";
|
|
3
|
+
export declare class PlatformConfigCacheManager extends QrveyCacheManager<QvCacheStoreProperties, IGetPermissionsConfig> {
|
|
4
|
+
static getInstance(): any;
|
|
5
|
+
protected getConfigEntityId(): keyof IGetPermissionsConfig;
|
|
6
|
+
protected buildStoreId({ app_id }: IGetPermissionsConfig): string;
|
|
7
|
+
protected fetchDataAndUpdateStore(state: QvCacheStoreProperties, config: IGetPermissionsConfig): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PlatformConfigCacheManager = void 0;
|
|
13
|
+
const cache_manager_1 = require("./cache-manager");
|
|
14
|
+
const platformConfig_api_1 = require("../services/api/platformConfig.api");
|
|
15
|
+
class PlatformConfigCacheManager extends cache_manager_1.QrveyCacheManager {
|
|
16
|
+
static getInstance() {
|
|
17
|
+
if (!window.qvPlatformConfigCacheManager) {
|
|
18
|
+
window.qvPlatformConfigCacheManager = new PlatformConfigCacheManager();
|
|
19
|
+
}
|
|
20
|
+
return window.qvPlatformConfigCacheManager;
|
|
21
|
+
}
|
|
22
|
+
getConfigEntityId() {
|
|
23
|
+
return "app_id";
|
|
24
|
+
}
|
|
25
|
+
buildStoreId({ app_id }) {
|
|
26
|
+
return `${app_id}`;
|
|
27
|
+
}
|
|
28
|
+
fetchDataAndUpdateStore(state, config) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return (0, platformConfig_api_1.getPlatformConfig)(config)
|
|
31
|
+
.then((platformConfig) => {
|
|
32
|
+
state.entity = platformConfig;
|
|
33
|
+
state.error = null;
|
|
34
|
+
})
|
|
35
|
+
.catch((e) => {
|
|
36
|
+
state.error = e;
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.PlatformConfigCacheManager = PlatformConfigCacheManager;
|
|
@@ -14,6 +14,7 @@ const cache_chart_manager_1 = require("./cache-chart-manager");
|
|
|
14
14
|
const cache_metric_manager_1 = require("./cache-metric-manager");
|
|
15
15
|
const cache_model_manager_1 = require("./cache-model-manager");
|
|
16
16
|
const cache_permissions_manager_1 = require("./cache-permissions-manager");
|
|
17
|
+
const cache_platform_config_manager_1 = require("./cache-platform-config-manager");
|
|
17
18
|
const cache_theme_manager_1 = require("./cache-theme-manager");
|
|
18
19
|
const cleanCacheManagers = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
20
|
const chartManager = cache_chart_manager_1.ChartCacheManager.getInstance();
|
|
@@ -26,5 +27,7 @@ const cleanCacheManagers = () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
26
27
|
yield permissionsManager.cleanAllStores();
|
|
27
28
|
const themeManager = cache_theme_manager_1.ThemeCacheManager.getInstance();
|
|
28
29
|
yield themeManager.cleanAllStores();
|
|
30
|
+
const platformConfigManager = cache_platform_config_manager_1.PlatformConfigCacheManager.getInstance();
|
|
31
|
+
yield platformConfigManager.cleanAllStores();
|
|
29
32
|
});
|
|
30
33
|
exports.cleanCacheManagers = cleanCacheManagers;
|
|
@@ -2,6 +2,7 @@ export * from "./cache-chart-manager";
|
|
|
2
2
|
export * from "./cache-manager";
|
|
3
3
|
export * from "./cache-metric-manager";
|
|
4
4
|
export * from "./cache-model-manager";
|
|
5
|
+
export * from "./cache-platform-config-manager";
|
|
5
6
|
export * from "./cache-permissions-manager";
|
|
6
7
|
export * from "./cache-theme-manager";
|
|
7
8
|
export * from "./clean-cache-managers";
|
|
@@ -18,6 +18,7 @@ __exportStar(require("./cache-chart-manager"), exports);
|
|
|
18
18
|
__exportStar(require("./cache-manager"), exports);
|
|
19
19
|
__exportStar(require("./cache-metric-manager"), exports);
|
|
20
20
|
__exportStar(require("./cache-model-manager"), exports);
|
|
21
|
+
__exportStar(require("./cache-platform-config-manager"), exports);
|
|
21
22
|
__exportStar(require("./cache-permissions-manager"), exports);
|
|
22
23
|
__exportStar(require("./cache-theme-manager"), exports);
|
|
23
24
|
__exportStar(require("./clean-cache-managers"), exports);
|
|
@@ -202,6 +202,7 @@ const parseStyleSettingByType = (type, { stylesSettings, globalSettings, isGroup
|
|
|
202
202
|
column_resizing: (0, general_1._get)(globalSettings, "table_menu.column_resizing", true),
|
|
203
203
|
column_arrangement: (0, general_1._get)(globalSettings, "table_menu.column_arrangement", true),
|
|
204
204
|
column_update: (0, general_1._get)(globalSettings, "table_menu.column_update", false),
|
|
205
|
+
grouping_column_update: (0, general_1._get)(globalSettings, "table_menu.grouping_column_update", false),
|
|
205
206
|
change_aggregation: (0, general_1._get)(globalSettings, "table_menu.change_aggregation", false),
|
|
206
207
|
pagination: isGrouped
|
|
207
208
|
? {
|
|
@@ -13,4 +13,4 @@ import { IChartShelfType } from "../interfaces/IChartShelfType";
|
|
|
13
13
|
* grouped.
|
|
14
14
|
* @returns The column type of the column.
|
|
15
15
|
*/
|
|
16
|
-
export declare const columnTypeByChart: (column: IChartColumn, shelfType: IChartShelfType, chartGroup: IChartGroupType, isGroupedTable?: boolean) => "
|
|
16
|
+
export declare const columnTypeByChart: (column: IChartColumn, shelfType: IChartShelfType, chartGroup: IChartGroupType, isGroupedTable?: boolean) => import("../..").COMPLEX_COLUMN | import("../..").COMPOUND_COLUMN | "NUMERIC" | NUMERICAL_COLUMN | "DATE" | "TEXT_LABEL" | COLUMN.SINGLE_CHOICE | COLUMN.MULTIPLE_CHOICE | COLUMN.YES_NO | COLUMN.RANKING | COLUMN.DATE | COLUMN.TIME | COLUMN.SIGNATURE | COLUMN.DROPDOWN | COLUMN.IMAGE | COLUMN.EMAIL_FORM | COLUMN.PHONE | COLUMN.PASSWORD | COLUMN.TEXT_LABEL | COLUMN.TEXT_CATEGORY | COLUMN.LOOKUP | COLUMN.TEXT_FORMULA | COLUMN.NUMERIC_FORMULA | COLUMN.DATE_FORMULA | COLUMN.AGGREGATED_FORMULA | COLUMN.BUCKET | COLUMN.SLIDEBAR | COLUMN.NUMERIC | COLUMN.RATING | COLUMN.TEXTFIELD | COLUMN.LONGTEXT | COLUMN.IMAGEUPLOAD | COLUMN.FILEUPLOAD | COLUMN.EXPRESSION | COLUMN.NAME | COLUMN.USADDRESS | COLUMN.ADDRESS;
|
|
@@ -4,4 +4,4 @@ import { IFormulaType } from "../..";
|
|
|
4
4
|
* @param {IFormulaType} type - IFormulaType - this is the type of the formula.
|
|
5
5
|
* @returns The type of the formula.
|
|
6
6
|
*/
|
|
7
|
-
export declare const parseFormulaTypeByCharts: (type: IFormulaType) => "
|
|
7
|
+
export declare const parseFormulaTypeByCharts: (type: IFormulaType) => "NUMERIC" | "DATE" | "TEXT_LABEL";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IFormulaType } from "../../formulas/interfaces/IFormulaType";
|
|
2
1
|
import { IBColumAnswer } from "./IBColumAnswer";
|
|
3
2
|
import { IBColumnAnswerExpression } from "./IBColumnAnswerExpression";
|
|
4
3
|
import { IBColumnAnswerExpressionCategory } from "./IBColumnAnswerExpressionCategory";
|
|
@@ -8,6 +7,8 @@ import { IColumnImageUploadOption } from "./IColumnImageUploadOption";
|
|
|
8
7
|
import { IColumnOutputFormatSettings } from "./IColumnOutputFormatSettings";
|
|
9
8
|
import { IColumnPropertyType } from "./IColumnPropertyType";
|
|
10
9
|
import { IColumnType } from "./IColumnType";
|
|
10
|
+
import { AGGREGATE_FORMULA_TYPE } from "../../formulas/constants/FORMULA";
|
|
11
|
+
import { IFormulaType } from "../../formulas/interfaces/IFormulaType";
|
|
11
12
|
/**
|
|
12
13
|
* Structure for columns received in the question/list, model endpoints
|
|
13
14
|
*/
|
|
@@ -15,6 +16,7 @@ export interface IBColumn extends Partial<IBColumAnswer>, Partial<IBColumnAnswer
|
|
|
15
16
|
bucketId?: string;
|
|
16
17
|
formulaId?: string;
|
|
17
18
|
formulaType?: IFormulaType;
|
|
19
|
+
formulaInputType?: AGGREGATE_FORMULA_TYPE;
|
|
18
20
|
geogroup?: boolean;
|
|
19
21
|
id: string;
|
|
20
22
|
imageUploadOption?: IColumnImageUploadOption;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IColumnCalculationType } from "../../qrvey/interfaces/ICalculationType";
|
|
2
|
-
import { IColumnPropertyType } from "./IColumnPropertyType";
|
|
3
|
-
import { IColumnSortingSettings } from "./IColumnSortingSettings";
|
|
4
1
|
import { IBColumn } from "./IBColumn";
|
|
5
|
-
import { IAggregateType } from "../../charts/interfaces/IAggregateType";
|
|
6
2
|
import { IBColumnAnswerExpressionWord } from "./IBColumnAnswerExpressionWord";
|
|
7
3
|
import { IBColumnAnswerLookupValueValue } from "./IBColumnAnswerLookupValueValue";
|
|
4
|
+
import { IColumnPropertyType } from "./IColumnPropertyType";
|
|
5
|
+
import { IColumnSortingSettings } from "./IColumnSortingSettings";
|
|
6
|
+
import { IAggregateType } from "../../charts/interfaces/IAggregateType";
|
|
7
|
+
import { AGGREGATE_FORMULA_TYPE } from "../../formulas/constants/FORMULA";
|
|
8
|
+
import { IColumnCalculationType } from "../../qrvey/interfaces/ICalculationType";
|
|
8
9
|
/**
|
|
9
10
|
* Structure for columns used in the App frontend side
|
|
10
11
|
*/
|
|
@@ -22,5 +23,5 @@ export interface IColumn extends Omit<IBColumn, "text" | "bucketId" | "formulaId
|
|
|
22
23
|
property?: IColumnPropertyType;
|
|
23
24
|
slidebarValue?: number;
|
|
24
25
|
sorting?: IColumnSortingSettings;
|
|
25
|
-
formulaInputType?:
|
|
26
|
+
formulaInputType?: AGGREGATE_FORMULA_TYPE;
|
|
26
27
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAggFilters = void 0;
|
|
4
|
-
const COLUMN_1 = require("../../columns/constants/COLUMN");
|
|
5
4
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
6
|
-
const objectCopy_1 = require("../../general/object/objectCopy");
|
|
7
5
|
const get_1 = require("../../general/object/get");
|
|
8
|
-
const
|
|
6
|
+
const objectCopy_1 = require("../../general/object/objectCopy");
|
|
7
|
+
const traverseTree_1 = require("../../general/object/traverseTree");
|
|
8
|
+
const adapters_1 = require("../adapters");
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated soon
|
|
11
11
|
* @param logics
|
|
@@ -14,33 +14,26 @@ const FILTER_OPERATOR_1 = require("../constants/common/FILTER_OPERATOR");
|
|
|
14
14
|
*/
|
|
15
15
|
function getAggFilters(logics = [], summaries = []) {
|
|
16
16
|
const aggregateFilters = getAggregateFilters(logics);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.filter(Boolean),
|
|
40
|
-
});
|
|
41
|
-
})
|
|
42
|
-
.filter((aggFilter) => aggFilter && aggFilter.expressions && aggFilter.expressions.length);
|
|
43
|
-
return aggFilters && concatAggFilters(aggFilters);
|
|
17
|
+
const logic = (0, objectCopy_1.objectCopy)((0, adapters_1.FDToLogic)((0, adapters_1.adaptFilterData)({ logic: aggregateFilters })));
|
|
18
|
+
if ((0, isEmpty_1.isEmpty)(logic) || (0, isEmpty_1.isEmpty)(logic[0].filters))
|
|
19
|
+
return;
|
|
20
|
+
(0, traverseTree_1.traverseTree)({
|
|
21
|
+
root: logic[0].filters,
|
|
22
|
+
getChildren: (node) => node.expressions,
|
|
23
|
+
isLeaf: (node) => !("operator" in node),
|
|
24
|
+
onLeaf: (expression) => {
|
|
25
|
+
const { enabled, validationType, value } = expression;
|
|
26
|
+
const summaryIndex = getIndexByExpression(expression, summaries);
|
|
27
|
+
Object.keys(expression).forEach((key) => {
|
|
28
|
+
delete expression[key];
|
|
29
|
+
});
|
|
30
|
+
expression.enabled = enabled;
|
|
31
|
+
expression.summaryIndex = summaryIndex;
|
|
32
|
+
expression.validationType = validationType;
|
|
33
|
+
expression.value = value;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return logic[0].filters[0];
|
|
44
37
|
}
|
|
45
38
|
exports.getAggFilters = getAggFilters;
|
|
46
39
|
/**
|
|
@@ -69,23 +62,13 @@ function getAggregateFilters(logics = []) {
|
|
|
69
62
|
return newLogics;
|
|
70
63
|
}, []);
|
|
71
64
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function getExpressionsInLogic(logics = []) {
|
|
84
|
-
return logics.reduce((expressions, logic) => {
|
|
85
|
-
let _expressions = expressions;
|
|
86
|
-
logic.filters.forEach((filter) => {
|
|
87
|
-
_expressions = _expressions.concat(filter.expressions[0].expressions);
|
|
88
|
-
});
|
|
89
|
-
return _expressions;
|
|
90
|
-
}, []);
|
|
65
|
+
/**
|
|
66
|
+
* Finds the index of a summary that matches the given filter expression based on question ID and Qrvey ID.
|
|
67
|
+
* @param expression The filter expression to match
|
|
68
|
+
* @param summaries The list of summaries to search
|
|
69
|
+
* @returns The index of the matching summary, or -1 if not found
|
|
70
|
+
*/
|
|
71
|
+
function getIndexByExpression(expression, summaries = []) {
|
|
72
|
+
return summaries.findIndex((summary) => expression.questionid === summary.questionid &&
|
|
73
|
+
expression.qrveyid === summary.qrveyid);
|
|
91
74
|
}
|
|
@@ -77,33 +77,33 @@ const isTextColumn = (column) => exports.textFields.includes(column.type) ||
|
|
|
77
77
|
column.formulaType === "boolean";
|
|
78
78
|
exports.isTextColumn = isTextColumn;
|
|
79
79
|
exports.currencyISO = [
|
|
80
|
-
{ text: "Default", label: "USD" },
|
|
81
|
-
{ text: "$ (USD)", label: "USD" },
|
|
82
|
-
{ text: "€ (EUR)", label: "EUR" },
|
|
83
|
-
{ text: "¥ (JPY)", label: "JPY" },
|
|
84
|
-
{ text: "£ (GBP)", label: "GBP" },
|
|
85
|
-
{ text:
|
|
86
|
-
{ text: "$ (AUD)", label: "AUD" },
|
|
87
|
-
{ text: "$ (CAD)", label: "CAD" },
|
|
88
|
-
{ text: "CHF (CHF)", label: "CHF" },
|
|
89
|
-
{ text: "¥ (CNY)", label: "CNY" },
|
|
90
|
-
{ text: "kr (SEK)", label: "SEK" },
|
|
91
|
-
{ text: "$ (MXN)", label: "MXN" },
|
|
92
|
-
{ text: "$ (NZD)", label: "NZD" },
|
|
93
|
-
{ text: "$ (SGD)", label: "SGD" },
|
|
94
|
-
{ text: "$ (HKD)", label: "HKD" },
|
|
95
|
-
{ text: "kr (NOK)", label: "NOK" },
|
|
96
|
-
{ text: "₩ (KRW)", label: "KRW" },
|
|
97
|
-
{ text: "₺ (TRY)", label: "TRY" },
|
|
98
|
-
{ text: "₹ (INR)", label: "INR" },
|
|
99
|
-
{ text: "₽ (RUB)", label: "RUB" },
|
|
100
|
-
{ text: "R$ (BRL)", label: "BRL" },
|
|
101
|
-
{ text: "R (ZAR)", label: "ZAR" },
|
|
102
|
-
{ text: "kr (DKK)", label: "DKK" },
|
|
103
|
-
{ text: "zł (PLN)", label: "PLN" },
|
|
104
|
-
{ text: "NT$ (TWD)", label: "TWD" },
|
|
105
|
-
{ text: "฿ (THB)", label: "THB" },
|
|
106
|
-
{ text: "RM (MYR)", label: "MYR" },
|
|
80
|
+
{ text: "Default", label: "USD", key: "default" },
|
|
81
|
+
{ text: "$ (USD)", label: "USD", key: 'usd' },
|
|
82
|
+
{ text: "€ (EUR)", label: "EUR", key: 'eur' },
|
|
83
|
+
{ text: "¥ (JPY)", label: "JPY", key: 'jpy' },
|
|
84
|
+
{ text: "£ (GBP)", label: "GBP", key: 'gbp' },
|
|
85
|
+
{ text: '₩ (KPW)', label: "KPW", key: 'won' },
|
|
86
|
+
{ text: "$ (AUD)", label: "AUD", key: 'aud' },
|
|
87
|
+
{ text: "$ (CAD)", label: "CAD", key: 'cad' },
|
|
88
|
+
{ text: "CHF (CHF)", label: "CHF", key: 'chf' },
|
|
89
|
+
{ text: "¥ (CNY)", label: "CNY", key: 'cny' },
|
|
90
|
+
{ text: "kr (SEK)", label: "SEK", key: 'sek' },
|
|
91
|
+
{ text: "$ (MXN)", label: "MXN", key: 'mxn' },
|
|
92
|
+
{ text: "$ (NZD)", label: "NZD", key: 'nzd' },
|
|
93
|
+
{ text: "$ (SGD)", label: "SGD", key: 'sgd' },
|
|
94
|
+
{ text: "$ (HKD)", label: "HKD", key: 'hkd' },
|
|
95
|
+
{ text: "kr (NOK)", label: "NOK", key: 'nok' },
|
|
96
|
+
{ text: "₩ (KRW)", label: "KRW", key: 'krw' },
|
|
97
|
+
{ text: "₺ (TRY)", label: "TRY", key: 'try' },
|
|
98
|
+
{ text: "₹ (INR)", label: "INR", key: 'inr' },
|
|
99
|
+
{ text: "₽ (RUB)", label: "RUB", key: 'rub' },
|
|
100
|
+
{ text: "R$ (BRL)", label: "BRL", key: 'brl' },
|
|
101
|
+
{ text: "R (ZAR)", label: "ZAR", key: 'zar' },
|
|
102
|
+
{ text: "kr (DKK)", label: "DKK", key: 'dkk' },
|
|
103
|
+
{ text: "zł (PLN)", label: "PLN", key: 'pln' },
|
|
104
|
+
{ text: "NT$ (TWD)", label: "TWD", key: 'twd' },
|
|
105
|
+
{ text: "฿ (THB)", label: "THB", key: 'thb' },
|
|
106
|
+
{ text: "RM (MYR)", label: "MYR", key: 'myr' },
|
|
107
107
|
];
|
|
108
108
|
exports.STANDARD_NUMERIC_FORMATS = [
|
|
109
109
|
"Decimal",
|
|
@@ -19,6 +19,6 @@ export declare function isValidTimeString(timeString?: string): boolean;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function formatTime(timeString: any, format: string): any;
|
|
21
21
|
export declare const addFormat: (value: any, outputFormat?: any, config?: IFormatConfig) => any;
|
|
22
|
-
export declare const parseFormulaType: (type: string) => "
|
|
22
|
+
export declare const parseFormulaType: (type: string) => "NUMERIC" | "DATE" | "TEXT_LABEL";
|
|
23
23
|
export declare const validateColumnType: (column: any) => any;
|
|
24
24
|
export declare const defineFormat: (column?: any, isSimpleTable?: boolean, isCategoryDimension?: boolean) => any;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCurrencySymbolByCode = void 0;
|
|
3
|
+
exports.getCurrencySymbolByCode = exports.fixCurrencyFormatOverride = void 0;
|
|
4
4
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
5
|
+
const fixCurrencyFormatOverride = (currencyFormatOverride) => {
|
|
6
|
+
if (currencyFormatOverride === "WON") {
|
|
7
|
+
return "KPW";
|
|
8
|
+
}
|
|
9
|
+
return currencyFormatOverride;
|
|
10
|
+
};
|
|
11
|
+
exports.fixCurrencyFormatOverride = fixCurrencyFormatOverride;
|
|
5
12
|
/**
|
|
6
13
|
* Gets the currency symbol for a given currency code.
|
|
7
14
|
* @param currencyCode The ISO 4217 currency code (e.g., "USD", "EUR").
|
|
@@ -10,10 +17,11 @@ const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
|
10
17
|
function getCurrencySymbolByCode(currencyCode) {
|
|
11
18
|
if ((0, isEmpty_1.isEmpty)(currencyCode))
|
|
12
19
|
return null;
|
|
20
|
+
const fixedCurrencyCode = (0, exports.fixCurrencyFormatOverride)(currencyCode);
|
|
13
21
|
try {
|
|
14
22
|
const parts = new Intl.NumberFormat("en-US", {
|
|
15
23
|
style: "currency",
|
|
16
|
-
currency:
|
|
24
|
+
currency: fixedCurrencyCode,
|
|
17
25
|
currencyDisplay: "narrowSymbol",
|
|
18
26
|
}).formatToParts(1);
|
|
19
27
|
const symbolPart = parts.find((p) => p.type === "currency");
|
|
@@ -7,7 +7,6 @@ exports.isDefaultCurrent = void 0;
|
|
|
7
7
|
* @returns true if the currency is the default currency, false otherwise
|
|
8
8
|
*/
|
|
9
9
|
function isDefaultCurrent(currency) {
|
|
10
|
-
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default")
|
|
11
|
-
((currency === null || currency === void 0 ? void 0 : currency.text) == null || (currency === null || currency === void 0 ? void 0 : currency.text) === "Default"));
|
|
10
|
+
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default"));
|
|
12
11
|
}
|
|
13
12
|
exports.isDefaultCurrent = isDefaultCurrent;
|
|
@@ -70,10 +70,10 @@ function formatLocaleNumber(value, outputFormat, config) {
|
|
|
70
70
|
let langOpts = options || getLocaleOptions(outputFormat);
|
|
71
71
|
const valueToFormat = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Percentage" /* LOCALE_FORMATS.PERCENTAGE */ ? value / 100 : value;
|
|
72
72
|
try {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
langOpts = Object.assign(Object.assign({}, langOpts), { currency:
|
|
73
|
+
const fixedCurrencyCode = (0, helpers_1.fixCurrencyFormatOverride)(config.currencyFormatOverride);
|
|
74
|
+
if ((0, isDefaultCurrent_1.isDefaultCurrent)(outputFormat.currency) &&
|
|
75
|
+
!!fixedCurrencyCode) {
|
|
76
|
+
langOpts = Object.assign(Object.assign({}, langOpts), { currency: fixedCurrencyCode });
|
|
77
77
|
}
|
|
78
78
|
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|
|
79
79
|
lang +
|
|
@@ -103,7 +103,7 @@ function getLocaleOptions(outputFormat) {
|
|
|
103
103
|
case "Currency" /* LOCALE_FORMATS.CURRENCY */: {
|
|
104
104
|
let iso = (0, isEmpty_1.isEmpty)(currency)
|
|
105
105
|
? definition_1.CURRENCY_DEFAULT
|
|
106
|
-
: definition_1.currencyISO.find((item) => item.
|
|
106
|
+
: definition_1.currencyISO.find((item) => item.label === currency.label);
|
|
107
107
|
if ((0, isEmpty_1.isEmpty)(iso)) {
|
|
108
108
|
iso = definition_1.currencyISO.find((item) => {
|
|
109
109
|
const symbol = item.text.split(" ")[0];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traverses a tree structure and allows modification of nodes and leaves via callback functions.
|
|
3
|
+
* @param options The options for traversing and modifying the tree.
|
|
4
|
+
* @param options.root The root node of the tree.
|
|
5
|
+
* @param options.getChildren Function to get the children of a node.
|
|
6
|
+
* @param options.isLeaf Function to determine if a node is a leaf.
|
|
7
|
+
* @param options.onLeaf Callback function to be called on each leaf node.
|
|
8
|
+
* @param options.onNode Callback function to be called on each non-leaf node.
|
|
9
|
+
*/
|
|
10
|
+
export declare function traverseTree<TNode, TLeaf extends TNode = TNode>(options: {
|
|
11
|
+
root: TNode | readonly TNode[];
|
|
12
|
+
getChildren: (node: TNode) => readonly TNode[] | undefined;
|
|
13
|
+
isLeaf?: (node: TNode) => node is TLeaf;
|
|
14
|
+
onLeaf?: (leaf: TLeaf, parent: TNode | null) => void;
|
|
15
|
+
onNode?: (node: TNode, parent: TNode | null) => void;
|
|
16
|
+
}): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.traverseTree = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Traverses a tree structure and allows modification of nodes and leaves via callback functions.
|
|
6
|
+
* @param options The options for traversing and modifying the tree.
|
|
7
|
+
* @param options.root The root node of the tree.
|
|
8
|
+
* @param options.getChildren Function to get the children of a node.
|
|
9
|
+
* @param options.isLeaf Function to determine if a node is a leaf.
|
|
10
|
+
* @param options.onLeaf Callback function to be called on each leaf node.
|
|
11
|
+
* @param options.onNode Callback function to be called on each non-leaf node.
|
|
12
|
+
*/
|
|
13
|
+
function traverseTree(options) {
|
|
14
|
+
const { root, getChildren, isLeaf, onLeaf, onNode } = options;
|
|
15
|
+
/**
|
|
16
|
+
* Recursively walks the tree, calling the appropriate callbacks for nodes and leaves.
|
|
17
|
+
* @param node The current node being processed.
|
|
18
|
+
* @param parent The parent of the current node, or null if it's the root.
|
|
19
|
+
*/
|
|
20
|
+
function walk(node, parent) {
|
|
21
|
+
onNode === null || onNode === void 0 ? void 0 : onNode(node, parent);
|
|
22
|
+
if (isLeaf === null || isLeaf === void 0 ? void 0 : isLeaf(node)) {
|
|
23
|
+
onLeaf === null || onLeaf === void 0 ? void 0 : onLeaf(node, parent);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const children = getChildren(node);
|
|
27
|
+
if (!children)
|
|
28
|
+
return;
|
|
29
|
+
for (const child of children) {
|
|
30
|
+
walk(child, node);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const roots = Array.isArray(root) ? root : [root];
|
|
34
|
+
for (const r of roots)
|
|
35
|
+
walk(r, null);
|
|
36
|
+
}
|
|
37
|
+
exports.traverseTree = traverseTree;
|
|
@@ -8,6 +8,11 @@ export interface II18nTableCharts {
|
|
|
8
8
|
inner_charts: II18nTableChartsInnerCharts;
|
|
9
9
|
pagination: II18nTableChartsPagination;
|
|
10
10
|
sort: II18nTableChartsSort;
|
|
11
|
+
group: {
|
|
12
|
+
level: string;
|
|
13
|
+
select_column: string;
|
|
14
|
+
no_grouping_applied: string;
|
|
15
|
+
};
|
|
11
16
|
sort_tooltip: II18nTableChartsSortTooltip;
|
|
12
17
|
total: string;
|
|
13
18
|
visualization: string;
|