@qrvey/utils 1.16.0-0 → 1.16.0-10
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-model-manager.js +6 -1
- package/dist/charts/adapters/RequestAdapterMetric.js +8 -4
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +2 -1
- package/dist/cjs/cache-managers/cache-model-manager.js +6 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.js +8 -4
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +2 -1
- package/dist/cjs/columns/interfaces/IColumn.d.ts +1 -0
- package/dist/cjs/elements/helpers/fixed.d.ts +10 -0
- package/dist/cjs/elements/helpers/fixed.js +20 -1
- package/dist/cjs/elements/helpers/gridStrategy.d.ts +12 -0
- package/dist/cjs/elements/helpers/gridStrategy.js +26 -2
- package/dist/cjs/elements/utils/fixed.position.d.ts +1 -0
- package/dist/cjs/elements/utils/fixed.position.js +8 -1
- package/dist/cjs/format/duration/durationFormatter.js +4 -1
- package/dist/cjs/formulas/constants/FORMULA.d.ts +1 -0
- package/dist/cjs/formulas/constants/FORMULA.js +2 -1
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderMessagesGeneral.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderFunctionsType.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderListModal.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionAggregate.d.ts +5 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionAggregate.js +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionNow.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionNow.js +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +10 -0
- package/dist/cjs/globalization/interfaces/formula_builder/index.d.ts +3 -0
- package/dist/cjs/globalization/interfaces/formula_builder/index.js +3 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
- package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +57 -1
- package/dist/columns/interfaces/IColumn.d.ts +1 -0
- package/dist/elements/helpers/fixed.d.ts +10 -0
- package/dist/elements/helpers/fixed.js +19 -1
- package/dist/elements/helpers/gridStrategy.d.ts +12 -0
- package/dist/elements/helpers/gridStrategy.js +25 -2
- package/dist/elements/utils/fixed.position.d.ts +1 -0
- package/dist/elements/utils/fixed.position.js +6 -0
- package/dist/format/duration/durationFormatter.js +4 -1
- package/dist/formulas/constants/FORMULA.d.ts +1 -0
- package/dist/formulas/constants/FORMULA.js +1 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderMessagesGeneral.d.ts +1 -0
- package/dist/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +4 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderFunctionsType.d.ts +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderListModal.d.ts +5 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionAggregate.d.ts +5 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionAggregate.js +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionNow.d.ts +3 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionNow.js +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +10 -0
- package/dist/globalization/interfaces/formula_builder/index.d.ts +3 -0
- package/dist/globalization/interfaces/formula_builder/index.js +3 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
- package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +57 -1
- package/package.json +1 -1
|
@@ -24,7 +24,12 @@ export class ModelCacheManager extends QrveyCacheManager {
|
|
|
24
24
|
}
|
|
25
25
|
fetchDataAndUpdateStore(state, config) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const includeInfo = [
|
|
27
|
+
const includeInfo = [
|
|
28
|
+
"bucketsInfo",
|
|
29
|
+
"formulaInfo",
|
|
30
|
+
"colorByValueInfo",
|
|
31
|
+
"formulaAggregate",
|
|
32
|
+
];
|
|
28
33
|
return getModel(config, { includeInfo })
|
|
29
34
|
.then((model) => {
|
|
30
35
|
state.entity = model;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AGGREGATE_FORMULA } from "../../formulas";
|
|
1
2
|
import { isEmpty } from "../../general";
|
|
2
3
|
import { TIME_PERIOD, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
3
4
|
import { RELATIVE_OBJECT_BY_TIME_LABEL } from "../constants/REQUEST_ADAPTER";
|
|
@@ -30,12 +31,15 @@ const getFilterLogic = (filters) => (filters === null || filters === void 0 ? vo
|
|
|
30
31
|
* @returns A metric value object
|
|
31
32
|
*/
|
|
32
33
|
const metricMakeValue = (data) => {
|
|
33
|
-
var _a, _b, _c;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
|
+
const isAggregateFormula = ((_a = data === null || data === void 0 ? void 0 : data.value) === null || _a === void 0 ? void 0 : _a.formulaInputType) === AGGREGATE_FORMULA;
|
|
36
|
+
const metricValue = {
|
|
37
|
+
questionid: (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.id,
|
|
37
38
|
property: ((_c = data === null || data === void 0 ? void 0 : data.value) === null || _c === void 0 ? void 0 : _c.property) || null,
|
|
38
39
|
};
|
|
40
|
+
if (!isAggregateFormula)
|
|
41
|
+
metricValue.aggregate = (_d = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _d === void 0 ? void 0 : _d.label;
|
|
42
|
+
return metricValue;
|
|
39
43
|
};
|
|
40
44
|
/**
|
|
41
45
|
* If data is truthy and data.dateColumn is truthy, return true, otherwise return false.
|
|
@@ -18,7 +18,7 @@ export interface MetricRequestPayload {
|
|
|
18
18
|
* property "answered".
|
|
19
19
|
*/
|
|
20
20
|
export type MetricValue = {
|
|
21
|
-
aggregate
|
|
21
|
+
aggregate?: AGGREGATE_LABEL;
|
|
22
22
|
questionid: string;
|
|
23
23
|
property?: string | null;
|
|
24
24
|
};
|
|
@@ -109,6 +109,7 @@ export type MetricConfigData = {
|
|
|
109
109
|
value: {
|
|
110
110
|
id: string;
|
|
111
111
|
property: string;
|
|
112
|
+
formulaInputType?: string;
|
|
112
113
|
};
|
|
113
114
|
valueAggregate: {
|
|
114
115
|
label: AGGREGATE_LABEL;
|
|
@@ -27,7 +27,12 @@ class ModelCacheManager extends cache_manager_1.QrveyCacheManager {
|
|
|
27
27
|
}
|
|
28
28
|
fetchDataAndUpdateStore(state, config) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const includeInfo = [
|
|
30
|
+
const includeInfo = [
|
|
31
|
+
"bucketsInfo",
|
|
32
|
+
"formulaInfo",
|
|
33
|
+
"colorByValueInfo",
|
|
34
|
+
"formulaAggregate",
|
|
35
|
+
];
|
|
31
36
|
return (0, getModel_api_1.getModel)(config, { includeInfo })
|
|
32
37
|
.then((model) => {
|
|
33
38
|
state.entity = model;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.metricMakeTimeData = exports.makeBodyRequestMetrics = void 0;
|
|
4
|
+
const formulas_1 = require("../../formulas");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const interfaces_1 = require("../../interfaces");
|
|
6
7
|
const REQUEST_ADAPTER_1 = require("../constants/REQUEST_ADAPTER");
|
|
@@ -34,12 +35,15 @@ const getFilterLogic = (filters) => (filters === null || filters === void 0 ? vo
|
|
|
34
35
|
* @returns A metric value object
|
|
35
36
|
*/
|
|
36
37
|
const metricMakeValue = (data) => {
|
|
37
|
-
var _a, _b, _c;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
|
+
const isAggregateFormula = ((_a = data === null || data === void 0 ? void 0 : data.value) === null || _a === void 0 ? void 0 : _a.formulaInputType) === formulas_1.AGGREGATE_FORMULA;
|
|
40
|
+
const metricValue = {
|
|
41
|
+
questionid: (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.id,
|
|
41
42
|
property: ((_c = data === null || data === void 0 ? void 0 : data.value) === null || _c === void 0 ? void 0 : _c.property) || null,
|
|
42
43
|
};
|
|
44
|
+
if (!isAggregateFormula)
|
|
45
|
+
metricValue.aggregate = (_d = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _d === void 0 ? void 0 : _d.label;
|
|
46
|
+
return metricValue;
|
|
43
47
|
};
|
|
44
48
|
/**
|
|
45
49
|
* If data is truthy and data.dateColumn is truthy, return true, otherwise return false.
|
|
@@ -18,7 +18,7 @@ export interface MetricRequestPayload {
|
|
|
18
18
|
* property "answered".
|
|
19
19
|
*/
|
|
20
20
|
export type MetricValue = {
|
|
21
|
-
aggregate
|
|
21
|
+
aggregate?: AGGREGATE_LABEL;
|
|
22
22
|
questionid: string;
|
|
23
23
|
property?: string | null;
|
|
24
24
|
};
|
|
@@ -109,6 +109,7 @@ export type MetricConfigData = {
|
|
|
109
109
|
value: {
|
|
110
110
|
id: string;
|
|
111
111
|
property: string;
|
|
112
|
+
formulaInputType?: string;
|
|
112
113
|
};
|
|
113
114
|
valueAggregate: {
|
|
114
115
|
label: AGGREGATE_LABEL;
|
|
@@ -94,3 +94,13 @@ export declare const sortElementsFromReferencePoint: (elements: VemFixed<unknown
|
|
|
94
94
|
x: number;
|
|
95
95
|
y: number;
|
|
96
96
|
}) => VemFixed<unknown>[];
|
|
97
|
+
/**
|
|
98
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
99
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
100
|
+
*
|
|
101
|
+
* @param containerItem - The element to update.
|
|
102
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
103
|
+
* @param scopeElements
|
|
104
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
105
|
+
*/
|
|
106
|
+
export declare const updateFixedElementDimensions: (containerItem: VemFixed<unknown>, device: CanvasDevice, scopeElements: VemFixed<unknown>[]) => VemFixed<unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortElementsFromReferencePoint = exports.calculateDistancesToReferencePoint = exports.getFixedGridElementsBottomLimit = exports.updateFixedElementWidth = exports.recalculatePreservingPositions = exports.findFixedAvailablePositions = exports.getFixedPositionByDevice = exports.findAvailablePosition = exports.updateFixedPosition = void 0;
|
|
3
|
+
exports.updateFixedElementDimensions = exports.sortElementsFromReferencePoint = exports.calculateDistancesToReferencePoint = exports.getFixedGridElementsBottomLimit = exports.updateFixedElementWidth = exports.recalculatePreservingPositions = exports.findFixedAvailablePositions = exports.getFixedPositionByDevice = exports.findAvailablePosition = exports.updateFixedPosition = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
5
5
|
const ICanvasGrid_1 = require("../interfaces/ICanvasGrid");
|
|
6
6
|
const IVemPosition_1 = require("../interfaces/IVemPosition");
|
|
@@ -246,3 +246,22 @@ const sortElementsFromReferencePoint = (elements, device, referencePoint) => {
|
|
|
246
246
|
return sortedElements.map((element) => element.element);
|
|
247
247
|
};
|
|
248
248
|
exports.sortElementsFromReferencePoint = sortElementsFromReferencePoint;
|
|
249
|
+
/**
|
|
250
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
251
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
252
|
+
*
|
|
253
|
+
* @param containerItem - The element to update.
|
|
254
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
255
|
+
* @param scopeElements
|
|
256
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
257
|
+
*/
|
|
258
|
+
const updateFixedElementDimensions = (containerItem, device, scopeElements) => {
|
|
259
|
+
let currentElement = containerItem;
|
|
260
|
+
const calculatedHeight = (0, fixed_position_1.dxGetFixedGridItemsBottomLimit)(scopeElements, device);
|
|
261
|
+
const currentHeight = currentElement.position.fixed[device].height;
|
|
262
|
+
currentElement = updateFixedPosition(currentElement, {
|
|
263
|
+
height: Math.max(currentHeight, calculatedHeight),
|
|
264
|
+
}, device);
|
|
265
|
+
return currentElement;
|
|
266
|
+
};
|
|
267
|
+
exports.updateFixedElementDimensions = updateFixedElementDimensions;
|
|
@@ -17,6 +17,18 @@ interface RecalculateOptions {
|
|
|
17
17
|
* @returns - A list of elements with updated positions if the canvas type is "fixed" or "responsive".
|
|
18
18
|
*/
|
|
19
19
|
export declare function recalculateElements(newElements: Vem[], currentElements: Vem[], canvasWidth: number, canvasType: string, device: CanvasDevice, options?: RecalculateOptions): Vem[];
|
|
20
|
+
/**
|
|
21
|
+
* Updates the dimensions of a container element using a strategy based on the given canvas type.
|
|
22
|
+
*
|
|
23
|
+
* Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
|
|
24
|
+
* using the provided `canvasType` key.
|
|
25
|
+
* @param containerItem The element whose dimensions need to be updated
|
|
26
|
+
* @param scopeElements A list of elements to consider in the update strategy
|
|
27
|
+
* @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
|
|
28
|
+
* @param canvasType The type of canvas that determines which strategy to use.
|
|
29
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
30
|
+
*/
|
|
31
|
+
export declare function updateElementDimensions(containerItem: Vem, scopeElements: Vem[], device: CanvasDevice, canvasType: string): Vem | undefined;
|
|
20
32
|
/**
|
|
21
33
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
22
34
|
* @param elements - The list of elements in the canvas.
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateCanvasHeight = exports.recalculateElements = void 0;
|
|
3
|
+
exports.calculateCanvasHeight = exports.updateElementDimensions = exports.recalculateElements = void 0;
|
|
4
4
|
const fixed_1 = require("./fixed");
|
|
5
5
|
const responsive_1 = require("./responsive");
|
|
6
6
|
const interfaces_1 = require("../interfaces");
|
|
7
7
|
const element_1 = require("../utils/element");
|
|
8
|
+
const updateDimensionStrategies = {
|
|
9
|
+
fixed: (containerItem, scopeElements, device) => {
|
|
10
|
+
return (0, fixed_1.updateFixedElementDimensions)(containerItem, device, scopeElements);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
8
13
|
const recalculateStrategies = {
|
|
9
14
|
fixed: (elements, currentElements, canvasWidth, device, options) => {
|
|
10
15
|
const isSorted = !currentElements.length;
|
|
@@ -18,7 +23,7 @@ const recalculateStrategies = {
|
|
|
18
23
|
y: 0,
|
|
19
24
|
})
|
|
20
25
|
: changedElements;
|
|
21
|
-
return options.
|
|
26
|
+
return options.keepPosition
|
|
22
27
|
? (0, fixed_1.recalculatePreservingPositions)(orderedElements, device, canvasWidth, options.canvasHeight)
|
|
23
28
|
: (0, fixed_1.findFixedAvailablePositions)(canvasWidth, orderedElements, currentElements, device, false, false, options === null || options === void 0 ? void 0 : options.canvasHeight);
|
|
24
29
|
},
|
|
@@ -65,6 +70,25 @@ function recalculateElements(newElements, currentElements, canvasWidth, canvasTy
|
|
|
65
70
|
return strategy(newElements, currentElements, canvasWidth, device, calculatedOptions);
|
|
66
71
|
}
|
|
67
72
|
exports.recalculateElements = recalculateElements;
|
|
73
|
+
/**
|
|
74
|
+
* Updates the dimensions of a container element using a strategy based on the given canvas type.
|
|
75
|
+
*
|
|
76
|
+
* Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
|
|
77
|
+
* using the provided `canvasType` key.
|
|
78
|
+
* @param containerItem The element whose dimensions need to be updated
|
|
79
|
+
* @param scopeElements A list of elements to consider in the update strategy
|
|
80
|
+
* @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
|
|
81
|
+
* @param canvasType The type of canvas that determines which strategy to use.
|
|
82
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
83
|
+
*/
|
|
84
|
+
function updateElementDimensions(containerItem, scopeElements, device, canvasType) {
|
|
85
|
+
const strategy = updateDimensionStrategies[canvasType];
|
|
86
|
+
if (!strategy) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
return strategy(containerItem, scopeElements, device);
|
|
90
|
+
}
|
|
91
|
+
exports.updateElementDimensions = updateElementDimensions;
|
|
68
92
|
/**
|
|
69
93
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
70
94
|
* @param elements - The list of elements in the canvas.
|
|
@@ -10,3 +10,4 @@ export declare const dxGetFixedGridItemY: (element: VemFixed, device: CanvasDevi
|
|
|
10
10
|
export declare const dxGetFixedGridItemZ: (element: VemFixed, device: CanvasDevice) => number;
|
|
11
11
|
export declare const dxGetFixedGridItemHeight: (element: VemFixed, device: CanvasDevice) => number;
|
|
12
12
|
export declare const dxGetFixedGridItemWidth: (element: VemFixed, device: CanvasDevice) => number;
|
|
13
|
+
export declare const dxGetFixedGridItemsBottomLimit: (items: VemFixed[], device: CanvasDevice, allowNegative?: boolean) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dxGetFixedGridItemWidth = exports.dxGetFixedGridItemHeight = exports.dxGetFixedGridItemZ = exports.dxGetFixedGridItemY = exports.dxGetFixedGridItemX = exports.dxGetFixedGridItemDevice = exports.checkFixedGridItemsOverlap = exports.itemYOverflow = exports.itemXOverflow = exports.hasOverlap = exports.hasOverflow = void 0;
|
|
3
|
+
exports.dxGetFixedGridItemsBottomLimit = exports.dxGetFixedGridItemWidth = exports.dxGetFixedGridItemHeight = exports.dxGetFixedGridItemZ = exports.dxGetFixedGridItemY = exports.dxGetFixedGridItemX = exports.dxGetFixedGridItemDevice = exports.checkFixedGridItemsOverlap = exports.itemYOverflow = exports.itemXOverflow = exports.hasOverlap = exports.hasOverflow = void 0;
|
|
4
4
|
const hasOverflow = (element, device, resolution, canvasHeight) => {
|
|
5
5
|
const hasXOverflow = (0, exports.itemXOverflow)(element, device, resolution);
|
|
6
6
|
const hasYOverflow = canvasHeight
|
|
@@ -84,3 +84,10 @@ const dxGetFixedGridItemWidth = (element, device) => {
|
|
|
84
84
|
return (_a = position === null || position === void 0 ? void 0 : position.width) !== null && _a !== void 0 ? _a : 400;
|
|
85
85
|
};
|
|
86
86
|
exports.dxGetFixedGridItemWidth = dxGetFixedGridItemWidth;
|
|
87
|
+
const dxGetFixedGridItemsBottomLimit = (items, device, allowNegative = false) => {
|
|
88
|
+
return items.length === 0
|
|
89
|
+
? 0
|
|
90
|
+
: Math.max(...items.map((gridItem) => (0, exports.dxGetFixedGridItemY)(gridItem, device, allowNegative) +
|
|
91
|
+
(0, exports.dxGetFixedGridItemHeight)(gridItem, device)));
|
|
92
|
+
};
|
|
93
|
+
exports.dxGetFixedGridItemsBottomLimit = dxGetFixedGridItemsBottomLimit;
|
|
@@ -131,7 +131,10 @@ class DurationFormatter {
|
|
|
131
131
|
let _number = number;
|
|
132
132
|
_number *= this.numberFactor;
|
|
133
133
|
const durationParts = this.parts.reduce((store, part) => {
|
|
134
|
-
|
|
134
|
+
const roundDuration = Math.floor(Math.abs(_number / part.ms));
|
|
135
|
+
const durationValid = roundDuration * (_number < 0 ? -1 : 1);
|
|
136
|
+
store[part.symbol] =
|
|
137
|
+
durationValid === 0 ? Math.abs(durationValid) : durationValid;
|
|
135
138
|
_number %= part.ms;
|
|
136
139
|
return store;
|
|
137
140
|
}, {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COLUMN_BY_FORMULA = exports.FORMULA = void 0;
|
|
3
|
+
exports.AGGREGATE_FORMULA = exports.COLUMN_BY_FORMULA = exports.FORMULA = void 0;
|
|
4
4
|
const COLUMN_1 = require("../../columns/constants/COLUMN");
|
|
5
5
|
var FORMULA;
|
|
6
6
|
(function (FORMULA) {
|
|
@@ -15,3 +15,4 @@ exports.COLUMN_BY_FORMULA = {
|
|
|
15
15
|
[FORMULA.TEXT]: COLUMN_1.COLUMN.TEXT_FORMULA,
|
|
16
16
|
[FORMULA.BOOLEAN]: COLUMN_1.COLUMN.TEXT_FORMULA,
|
|
17
17
|
};
|
|
18
|
+
exports.AGGREGATE_FORMULA = "AGGREGATE";
|
package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { II18nFormulaBuilderErrorMessage } from "./II18nFormulaBuilderErrorMessa
|
|
|
2
2
|
import { II18nFormulaBuilderV2Functions } from "./II18nFormulaBuilderV2Functions";
|
|
3
3
|
export interface II18nFormulaBuilderCreateModal {
|
|
4
4
|
title_header_create: string;
|
|
5
|
+
title_header_create_aggregate: string;
|
|
5
6
|
title_header_edit: string;
|
|
7
|
+
title_header_edit_aggregate: string;
|
|
6
8
|
title_header_table: string;
|
|
7
9
|
name: string;
|
|
8
10
|
placeholder_name: string;
|
|
@@ -36,12 +38,14 @@ export interface II18nFormulaBuilderCreateModal {
|
|
|
36
38
|
formula_name_error_reserved_word: string;
|
|
37
39
|
formula_type: string;
|
|
38
40
|
formula_custom_script_mode: string;
|
|
41
|
+
formula_custom_script_mode_soon: string;
|
|
39
42
|
formula_mode: {
|
|
40
43
|
title: string;
|
|
41
44
|
info: string;
|
|
42
45
|
tab_formula: string;
|
|
43
46
|
tab_testing: string;
|
|
44
47
|
tab_testing_tooltip: string;
|
|
48
|
+
tab_testing_tooltip_not_available: string;
|
|
45
49
|
tab_testing_tooltip_empty: string;
|
|
46
50
|
show_columns: string;
|
|
47
51
|
hide_columns: string;
|
|
@@ -6,4 +6,9 @@ export interface II18nFormulaBuilderListModal {
|
|
|
6
6
|
information_text_text: string;
|
|
7
7
|
title_header: string;
|
|
8
8
|
column_editor_type: string;
|
|
9
|
+
loading: string;
|
|
10
|
+
formulas: string;
|
|
11
|
+
aggregate_formulas: string;
|
|
12
|
+
new_formula: string;
|
|
13
|
+
new_aggregate_formula: string;
|
|
9
14
|
}
|
package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { II18nFormulaBuilderFunction } from "./II18nFormulaBuilderFunction";
|
|
2
2
|
import { II18nFormulaBuilderV2FunctionAbs } from "./II18nFormulaBuilderV2FunctionAbs";
|
|
3
|
+
import { II18nFormulaBuilderV2FunctionAggregate } from "./II18nFormulaBuilderV2FunctionAggregate";
|
|
3
4
|
import { II18nFormulaBuilderV2FunctionAnd } from "./II18nFormulaBuilderV2FunctionAnd";
|
|
4
5
|
import { II18nFormulaBuilderV2FunctionConcantenate } from "./II18nFormulaBuilderV2FunctionConcatenate";
|
|
5
6
|
import { II18nFormulaBuilderV2FunctionDateadd } from "./II18nFormulaBuilderV2FunctionDateadd";
|
|
@@ -21,6 +22,7 @@ import { II18nFormulaBuilderV2FunctionMid } from "./II18nFormulaBuilderV2Functio
|
|
|
21
22
|
import { II18nFormulaBuilderV2FunctionMillisecond } from "./II18nFormulaBuilderV2FunctionMillisecond";
|
|
22
23
|
import { II18nFormulaBuilderV2FunctionMinute } from "./II18nFormulaBuilderV2FunctionMinute";
|
|
23
24
|
import { II18nFormulaBuilderV2FunctionMonth } from "./II18nFormulaBuilderV2FunctionMonth";
|
|
25
|
+
import { II18nFormulaBuilderV2FunctionNow } from "./II18nFormulaBuilderV2FunctionNow";
|
|
24
26
|
import { II18nFormulaBuilderV2FunctionOdd } from "./II18nFormulaBuilderV2FunctionOdd";
|
|
25
27
|
import { II18nFormulaBuilderV2FunctionPower } from "./II18nFormulaBuilderV2FunctionPower";
|
|
26
28
|
import { II18nFormulaBuilderV2FunctionReplace } from "./II18nFormulaBuilderV2FunctionReplace";
|
|
@@ -34,6 +36,7 @@ import { II18nFormulaBuilderV2FunctionYear } from "./II18nFormulaBuilderV2Functi
|
|
|
34
36
|
export interface II18nFormulaBuilderV2Functions {
|
|
35
37
|
abs: II18nFormulaBuilderV2FunctionAbs;
|
|
36
38
|
datedif: II18nFormulaBuilderV2FunctionDatedif;
|
|
39
|
+
now: II18nFormulaBuilderV2FunctionNow;
|
|
37
40
|
day: II18nFormulaBuilderV2FunctionDay;
|
|
38
41
|
hour: II18nFormulaBuilderV2FunctionHour;
|
|
39
42
|
minute: II18nFormulaBuilderV2FunctionMinute;
|
|
@@ -73,4 +76,11 @@ export interface II18nFormulaBuilderV2Functions {
|
|
|
73
76
|
roundup: II18nFormulaBuilderV2FunctionRound;
|
|
74
77
|
millisecond: II18nFormulaBuilderV2FunctionMillisecond;
|
|
75
78
|
text: II18nFormulaBuilderV2FunctionText;
|
|
79
|
+
sum: II18nFormulaBuilderV2FunctionAggregate;
|
|
80
|
+
avg: II18nFormulaBuilderV2FunctionAggregate;
|
|
81
|
+
med: II18nFormulaBuilderV2FunctionAggregate;
|
|
82
|
+
minval: II18nFormulaBuilderV2FunctionAggregate;
|
|
83
|
+
maxval: II18nFormulaBuilderV2FunctionAggregate;
|
|
84
|
+
count: II18nFormulaBuilderV2FunctionAggregate;
|
|
85
|
+
distcount: II18nFormulaBuilderV2FunctionAggregate;
|
|
76
86
|
}
|
|
@@ -88,3 +88,6 @@ export * from "./II18nFormulaBuilderV2FunctionLog";
|
|
|
88
88
|
export * from "./II18nFormulaBuilderV2FunctionOdd";
|
|
89
89
|
export * from "./II18nFormulaBuilderV2FunctionPower";
|
|
90
90
|
export * from "./II18nFormulaBuilderV2FunctionRound";
|
|
91
|
+
export * from "./II18nFormulaBuilderV2FunctionMillisecond";
|
|
92
|
+
export * from "./II18nFormulaBuilderV2FunctionText";
|
|
93
|
+
export * from "./II18nFormulaBuilderV2FunctionAggregate";
|
|
@@ -104,3 +104,6 @@ __exportStar(require("./II18nFormulaBuilderV2FunctionLog"), exports);
|
|
|
104
104
|
__exportStar(require("./II18nFormulaBuilderV2FunctionOdd"), exports);
|
|
105
105
|
__exportStar(require("./II18nFormulaBuilderV2FunctionPower"), exports);
|
|
106
106
|
__exportStar(require("./II18nFormulaBuilderV2FunctionRound"), exports);
|
|
107
|
+
__exportStar(require("./II18nFormulaBuilderV2FunctionMillisecond"), exports);
|
|
108
|
+
__exportStar(require("./II18nFormulaBuilderV2FunctionText"), exports);
|
|
109
|
+
__exportStar(require("./II18nFormulaBuilderV2FunctionAggregate"), exports);
|
|
@@ -194,6 +194,7 @@ exports.I18N_CHART_BUILDER_GENERAL = {
|
|
|
194
194
|
},
|
|
195
195
|
messages_general: {
|
|
196
196
|
chart_saved: "was saved successfully.",
|
|
197
|
+
chart_saved_ai: "Chart added to the Dataset",
|
|
197
198
|
},
|
|
198
199
|
messages_default: {
|
|
199
200
|
max_data: "Chart shows a maximum number of data points by default. To see more, go to <i>General</i> chart options and increase the <i>Max Data</i> Points to display.",
|
|
@@ -15,6 +15,11 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
15
15
|
information_text_text: "create and work with formulas",
|
|
16
16
|
title_header: "Formulas",
|
|
17
17
|
column_editor_type: "Editor Type",
|
|
18
|
+
loading: "Loading dependencies...",
|
|
19
|
+
formulas: "Formulas",
|
|
20
|
+
aggregate_formulas: "Aggregate Formulas",
|
|
21
|
+
new_formula: "New Formula",
|
|
22
|
+
new_aggregate_formula: "New Aggregate Formula",
|
|
18
23
|
},
|
|
19
24
|
list_table: {
|
|
20
25
|
duplicate_copy: "Copy",
|
|
@@ -34,7 +39,9 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
34
39
|
},
|
|
35
40
|
create_modal: {
|
|
36
41
|
title_header_create: "Create Formula",
|
|
42
|
+
title_header_create_aggregate: "Create Aggregate Formula",
|
|
37
43
|
title_header_edit: "Edit Formula",
|
|
44
|
+
title_header_edit_aggregate: "Edit Aggregate Formula",
|
|
38
45
|
title_header_table: "Create Table Formula",
|
|
39
46
|
name: "Formula Name",
|
|
40
47
|
placeholder_name: "Type Formula Name",
|
|
@@ -68,12 +75,14 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
68
75
|
formula_name_error_reserved_word: "The formula name cannot be a reserved word: null, true or false.",
|
|
69
76
|
formula_type: "Formula Mode",
|
|
70
77
|
formula_custom_script_mode: "Data Engine Syntax (legacy)",
|
|
78
|
+
formula_custom_script_mode_soon: "Data Engine Syntax (legacy) - Coming Soon",
|
|
71
79
|
formula_mode: {
|
|
72
80
|
title: "Standardized Syntax",
|
|
73
81
|
info: 'Allows mathematical and logical operators including +, -, *, /, (), =, >, <, >=, <=, <>. Numbers must be entered in en-US format. Date time values should be entered with format: "MM/DD/YYYY" or "MM/DD/YYYY HH:MM:SS"',
|
|
74
82
|
tab_formula: "Formula",
|
|
75
83
|
tab_testing: "Testing",
|
|
76
84
|
tab_testing_tooltip: "This formula contains errors or is not finished.",
|
|
85
|
+
tab_testing_tooltip_not_available: "Testing not available for this formula type.",
|
|
77
86
|
tab_testing_tooltip_empty: "No formula to test.",
|
|
78
87
|
show_columns: "Show Columns and Functions",
|
|
79
88
|
hide_columns: "Hide Columns and Functions",
|
|
@@ -108,7 +117,11 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
108
117
|
param_date_value2_name: "date_value2",
|
|
109
118
|
param_date_value2_description: 'The second date value. It can be a column or a datetime value entered with a format of either "MM/DD/YYYY" or "MM/DD/YYYY HH:MM:SS". This date should always be equal or greater than date_value1.',
|
|
110
119
|
param_date_part_name: "date_part",
|
|
111
|
-
param_date_part_description: 'Date part allows: "Y" the number of complete years in the period, "M" the number of complete months in the period, "D" the number of days in the period.',
|
|
120
|
+
param_date_part_description: 'Date part allows: "Y" the number of complete years in the period, "M" the number of complete months in the period, "D" the number of days in the period., “H“ the number of hours in the period, “MI“ the number of minutes in the period, “S“ the number of seconds in the period.',
|
|
121
|
+
},
|
|
122
|
+
now: {
|
|
123
|
+
description: "Returns a date with the current time in the current timezone with the following format: yyyy-MM-ddTHH:mm:ss.",
|
|
124
|
+
function_placeholder: "NOW()",
|
|
112
125
|
},
|
|
113
126
|
day: {
|
|
114
127
|
description: "Returns the day of a date. The day is given as an integer ranging from 1 to 31.",
|
|
@@ -374,6 +387,48 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
374
387
|
param_num1_name: "num1",
|
|
375
388
|
param_num1_description: "The number that you want to convert to text.",
|
|
376
389
|
},
|
|
390
|
+
sum: {
|
|
391
|
+
description: "Returns the aggregated sum of the numeric values of a column.",
|
|
392
|
+
function_placeholder: "SUM(column)",
|
|
393
|
+
param_column_name: "column",
|
|
394
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
395
|
+
},
|
|
396
|
+
avg: {
|
|
397
|
+
description: "Returns the average value for all the numeric values of a column.",
|
|
398
|
+
function_placeholder: "AVG(column)",
|
|
399
|
+
param_column_name: "column",
|
|
400
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
401
|
+
},
|
|
402
|
+
med: {
|
|
403
|
+
description: "Returns the median value for all the numeric values of a column.",
|
|
404
|
+
function_placeholder: "MED(column)",
|
|
405
|
+
param_column_name: "column",
|
|
406
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
407
|
+
},
|
|
408
|
+
minval: {
|
|
409
|
+
description: "Returns the minimum value among all the numeric values of a column.",
|
|
410
|
+
function_placeholder: "MINVAL(column)",
|
|
411
|
+
param_column_name: "column",
|
|
412
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
413
|
+
},
|
|
414
|
+
maxval: {
|
|
415
|
+
description: "Returns the maximum value among all the numeric values of a column.",
|
|
416
|
+
function_placeholder: "MAXVAL(column)",
|
|
417
|
+
param_column_name: "column",
|
|
418
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
419
|
+
},
|
|
420
|
+
count: {
|
|
421
|
+
description: "Returns the count of all the values of a column.",
|
|
422
|
+
function_placeholder: "COUNT(column)",
|
|
423
|
+
param_column_name: "column",
|
|
424
|
+
param_column_description: "The column that will be aggregated.",
|
|
425
|
+
},
|
|
426
|
+
distcount: {
|
|
427
|
+
description: "Returns the count of all the distinct values of a column.",
|
|
428
|
+
function_placeholder: "DISTCOUNT(column)",
|
|
429
|
+
param_column_name: "column",
|
|
430
|
+
param_column_description: "The column that will be aggregated.",
|
|
431
|
+
},
|
|
377
432
|
},
|
|
378
433
|
editor: {
|
|
379
434
|
error_messages: {
|
|
@@ -427,6 +482,7 @@ exports.I18N_FORMULA_BUILDER = {
|
|
|
427
482
|
date: "Date/Time",
|
|
428
483
|
aggregate: "Aggregates",
|
|
429
484
|
logical: "Logical",
|
|
485
|
+
aggregated: "Aggregate",
|
|
430
486
|
},
|
|
431
487
|
function_is_null: {
|
|
432
488
|
description: "Replaces NULL with the specified replacement value.",
|
|
@@ -94,3 +94,13 @@ export declare const sortElementsFromReferencePoint: (elements: VemFixed<unknown
|
|
|
94
94
|
x: number;
|
|
95
95
|
y: number;
|
|
96
96
|
}) => VemFixed<unknown>[];
|
|
97
|
+
/**
|
|
98
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
99
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
100
|
+
*
|
|
101
|
+
* @param containerItem - The element to update.
|
|
102
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
103
|
+
* @param scopeElements
|
|
104
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
105
|
+
*/
|
|
106
|
+
export declare const updateFixedElementDimensions: (containerItem: VemFixed<unknown>, device: CanvasDevice, scopeElements: VemFixed<unknown>[]) => VemFixed<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
2
|
import { CanvasDevice } from "../interfaces/ICanvasGrid";
|
|
3
3
|
import { VemPositionType } from "../interfaces/IVemPosition";
|
|
4
|
-
import { dxGetFixedGridItemDevice, hasOverflow, hasOverlap, } from "../utils/fixed.position";
|
|
4
|
+
import { dxGetFixedGridItemDevice, dxGetFixedGridItemsBottomLimit, hasOverflow, hasOverlap, } from "../utils/fixed.position";
|
|
5
5
|
import { sortByDistanceFunction } from "../utils/general";
|
|
6
6
|
import { OverlapIntervalTree } from "../utils/overlap";
|
|
7
7
|
import { setElementPosition } from "../utils/position";
|
|
@@ -234,3 +234,21 @@ export const sortElementsFromReferencePoint = (elements, device, referencePoint)
|
|
|
234
234
|
const sortedElements = [...calculatedElements].sort(sortByDistanceFunction);
|
|
235
235
|
return sortedElements.map((element) => element.element);
|
|
236
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
239
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
240
|
+
*
|
|
241
|
+
* @param containerItem - The element to update.
|
|
242
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
243
|
+
* @param scopeElements
|
|
244
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
245
|
+
*/
|
|
246
|
+
export const updateFixedElementDimensions = (containerItem, device, scopeElements) => {
|
|
247
|
+
let currentElement = containerItem;
|
|
248
|
+
const calculatedHeight = dxGetFixedGridItemsBottomLimit(scopeElements, device);
|
|
249
|
+
const currentHeight = currentElement.position.fixed[device].height;
|
|
250
|
+
currentElement = updateFixedPosition(currentElement, {
|
|
251
|
+
height: Math.max(currentHeight, calculatedHeight),
|
|
252
|
+
}, device);
|
|
253
|
+
return currentElement;
|
|
254
|
+
};
|
|
@@ -17,6 +17,18 @@ interface RecalculateOptions {
|
|
|
17
17
|
* @returns - A list of elements with updated positions if the canvas type is "fixed" or "responsive".
|
|
18
18
|
*/
|
|
19
19
|
export declare function recalculateElements(newElements: Vem[], currentElements: Vem[], canvasWidth: number, canvasType: string, device: CanvasDevice, options?: RecalculateOptions): Vem[];
|
|
20
|
+
/**
|
|
21
|
+
* Updates the dimensions of a container element using a strategy based on the given canvas type.
|
|
22
|
+
*
|
|
23
|
+
* Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
|
|
24
|
+
* using the provided `canvasType` key.
|
|
25
|
+
* @param containerItem The element whose dimensions need to be updated
|
|
26
|
+
* @param scopeElements A list of elements to consider in the update strategy
|
|
27
|
+
* @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
|
|
28
|
+
* @param canvasType The type of canvas that determines which strategy to use.
|
|
29
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
30
|
+
*/
|
|
31
|
+
export declare function updateElementDimensions(containerItem: Vem, scopeElements: Vem[], device: CanvasDevice, canvasType: string): Vem | undefined;
|
|
20
32
|
/**
|
|
21
33
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
22
34
|
* @param elements - The list of elements in the canvas.
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { findFixedAvailablePositions, getFixedGridElementsBottomLimit, recalculatePreservingPositions, sortElementsFromReferencePoint, } from "./fixed";
|
|
1
|
+
import { findFixedAvailablePositions, getFixedGridElementsBottomLimit, recalculatePreservingPositions, sortElementsFromReferencePoint, updateFixedElementDimensions, } from "./fixed";
|
|
2
2
|
import { findResponsiveAvailablePositions, getResponsiveGridElementsBottomLimit, sortResponsiveElements, } from "./responsive";
|
|
3
3
|
import { CanvasDevice, VemPositionType, } from "../interfaces";
|
|
4
4
|
import { copyDesktopPositionToDevice } from "../utils/element";
|
|
5
|
+
const updateDimensionStrategies = {
|
|
6
|
+
fixed: (containerItem, scopeElements, device) => {
|
|
7
|
+
return updateFixedElementDimensions(containerItem, device, scopeElements);
|
|
8
|
+
},
|
|
9
|
+
};
|
|
5
10
|
const recalculateStrategies = {
|
|
6
11
|
fixed: (elements, currentElements, canvasWidth, device, options) => {
|
|
7
12
|
const isSorted = !currentElements.length;
|
|
@@ -15,7 +20,7 @@ const recalculateStrategies = {
|
|
|
15
20
|
y: 0,
|
|
16
21
|
})
|
|
17
22
|
: changedElements;
|
|
18
|
-
return options.
|
|
23
|
+
return options.keepPosition
|
|
19
24
|
? recalculatePreservingPositions(orderedElements, device, canvasWidth, options.canvasHeight)
|
|
20
25
|
: findFixedAvailablePositions(canvasWidth, orderedElements, currentElements, device, false, false, options === null || options === void 0 ? void 0 : options.canvasHeight);
|
|
21
26
|
},
|
|
@@ -61,6 +66,24 @@ export function recalculateElements(newElements, currentElements, canvasWidth, c
|
|
|
61
66
|
const calculatedOptions = Object.assign(Object.assign({}, defaultOptions), options);
|
|
62
67
|
return strategy(newElements, currentElements, canvasWidth, device, calculatedOptions);
|
|
63
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Updates the dimensions of a container element using a strategy based on the given canvas type.
|
|
71
|
+
*
|
|
72
|
+
* Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
|
|
73
|
+
* using the provided `canvasType` key.
|
|
74
|
+
* @param containerItem The element whose dimensions need to be updated
|
|
75
|
+
* @param scopeElements A list of elements to consider in the update strategy
|
|
76
|
+
* @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
|
|
77
|
+
* @param canvasType The type of canvas that determines which strategy to use.
|
|
78
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
79
|
+
*/
|
|
80
|
+
export function updateElementDimensions(containerItem, scopeElements, device, canvasType) {
|
|
81
|
+
const strategy = updateDimensionStrategies[canvasType];
|
|
82
|
+
if (!strategy) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
return strategy(containerItem, scopeElements, device);
|
|
86
|
+
}
|
|
64
87
|
/**
|
|
65
88
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
66
89
|
* @param elements - The list of elements in the canvas.
|
|
@@ -10,3 +10,4 @@ export declare const dxGetFixedGridItemY: (element: VemFixed, device: CanvasDevi
|
|
|
10
10
|
export declare const dxGetFixedGridItemZ: (element: VemFixed, device: CanvasDevice) => number;
|
|
11
11
|
export declare const dxGetFixedGridItemHeight: (element: VemFixed, device: CanvasDevice) => number;
|
|
12
12
|
export declare const dxGetFixedGridItemWidth: (element: VemFixed, device: CanvasDevice) => number;
|
|
13
|
+
export declare const dxGetFixedGridItemsBottomLimit: (items: VemFixed[], device: CanvasDevice, allowNegative?: boolean) => number;
|
|
@@ -70,3 +70,9 @@ export const dxGetFixedGridItemWidth = (element, device) => {
|
|
|
70
70
|
const position = element.position.fixed[device];
|
|
71
71
|
return (_a = position === null || position === void 0 ? void 0 : position.width) !== null && _a !== void 0 ? _a : 400;
|
|
72
72
|
};
|
|
73
|
+
export const dxGetFixedGridItemsBottomLimit = (items, device, allowNegative = false) => {
|
|
74
|
+
return items.length === 0
|
|
75
|
+
? 0
|
|
76
|
+
: Math.max(...items.map((gridItem) => dxGetFixedGridItemY(gridItem, device, allowNegative) +
|
|
77
|
+
dxGetFixedGridItemHeight(gridItem, device)));
|
|
78
|
+
};
|
|
@@ -128,7 +128,10 @@ export class DurationFormatter {
|
|
|
128
128
|
let _number = number;
|
|
129
129
|
_number *= this.numberFactor;
|
|
130
130
|
const durationParts = this.parts.reduce((store, part) => {
|
|
131
|
-
|
|
131
|
+
const roundDuration = Math.floor(Math.abs(_number / part.ms));
|
|
132
|
+
const durationValid = roundDuration * (_number < 0 ? -1 : 1);
|
|
133
|
+
store[part.symbol] =
|
|
134
|
+
durationValid === 0 ? Math.abs(durationValid) : durationValid;
|
|
132
135
|
_number %= part.ms;
|
|
133
136
|
return store;
|
|
134
137
|
}, {});
|
|
@@ -2,7 +2,9 @@ import { II18nFormulaBuilderErrorMessage } from "./II18nFormulaBuilderErrorMessa
|
|
|
2
2
|
import { II18nFormulaBuilderV2Functions } from "./II18nFormulaBuilderV2Functions";
|
|
3
3
|
export interface II18nFormulaBuilderCreateModal {
|
|
4
4
|
title_header_create: string;
|
|
5
|
+
title_header_create_aggregate: string;
|
|
5
6
|
title_header_edit: string;
|
|
7
|
+
title_header_edit_aggregate: string;
|
|
6
8
|
title_header_table: string;
|
|
7
9
|
name: string;
|
|
8
10
|
placeholder_name: string;
|
|
@@ -36,12 +38,14 @@ export interface II18nFormulaBuilderCreateModal {
|
|
|
36
38
|
formula_name_error_reserved_word: string;
|
|
37
39
|
formula_type: string;
|
|
38
40
|
formula_custom_script_mode: string;
|
|
41
|
+
formula_custom_script_mode_soon: string;
|
|
39
42
|
formula_mode: {
|
|
40
43
|
title: string;
|
|
41
44
|
info: string;
|
|
42
45
|
tab_formula: string;
|
|
43
46
|
tab_testing: string;
|
|
44
47
|
tab_testing_tooltip: string;
|
|
48
|
+
tab_testing_tooltip_not_available: string;
|
|
45
49
|
tab_testing_tooltip_empty: string;
|
|
46
50
|
show_columns: string;
|
|
47
51
|
hide_columns: string;
|
|
@@ -6,4 +6,9 @@ export interface II18nFormulaBuilderListModal {
|
|
|
6
6
|
information_text_text: string;
|
|
7
7
|
title_header: string;
|
|
8
8
|
column_editor_type: string;
|
|
9
|
+
loading: string;
|
|
10
|
+
formulas: string;
|
|
11
|
+
aggregate_formulas: string;
|
|
12
|
+
new_formula: string;
|
|
13
|
+
new_aggregate_formula: string;
|
|
9
14
|
}
|
package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2FunctionAggregate.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { II18nFormulaBuilderFunction } from "./II18nFormulaBuilderFunction";
|
|
2
2
|
import { II18nFormulaBuilderV2FunctionAbs } from "./II18nFormulaBuilderV2FunctionAbs";
|
|
3
|
+
import { II18nFormulaBuilderV2FunctionAggregate } from "./II18nFormulaBuilderV2FunctionAggregate";
|
|
3
4
|
import { II18nFormulaBuilderV2FunctionAnd } from "./II18nFormulaBuilderV2FunctionAnd";
|
|
4
5
|
import { II18nFormulaBuilderV2FunctionConcantenate } from "./II18nFormulaBuilderV2FunctionConcatenate";
|
|
5
6
|
import { II18nFormulaBuilderV2FunctionDateadd } from "./II18nFormulaBuilderV2FunctionDateadd";
|
|
@@ -21,6 +22,7 @@ import { II18nFormulaBuilderV2FunctionMid } from "./II18nFormulaBuilderV2Functio
|
|
|
21
22
|
import { II18nFormulaBuilderV2FunctionMillisecond } from "./II18nFormulaBuilderV2FunctionMillisecond";
|
|
22
23
|
import { II18nFormulaBuilderV2FunctionMinute } from "./II18nFormulaBuilderV2FunctionMinute";
|
|
23
24
|
import { II18nFormulaBuilderV2FunctionMonth } from "./II18nFormulaBuilderV2FunctionMonth";
|
|
25
|
+
import { II18nFormulaBuilderV2FunctionNow } from "./II18nFormulaBuilderV2FunctionNow";
|
|
24
26
|
import { II18nFormulaBuilderV2FunctionOdd } from "./II18nFormulaBuilderV2FunctionOdd";
|
|
25
27
|
import { II18nFormulaBuilderV2FunctionPower } from "./II18nFormulaBuilderV2FunctionPower";
|
|
26
28
|
import { II18nFormulaBuilderV2FunctionReplace } from "./II18nFormulaBuilderV2FunctionReplace";
|
|
@@ -34,6 +36,7 @@ import { II18nFormulaBuilderV2FunctionYear } from "./II18nFormulaBuilderV2Functi
|
|
|
34
36
|
export interface II18nFormulaBuilderV2Functions {
|
|
35
37
|
abs: II18nFormulaBuilderV2FunctionAbs;
|
|
36
38
|
datedif: II18nFormulaBuilderV2FunctionDatedif;
|
|
39
|
+
now: II18nFormulaBuilderV2FunctionNow;
|
|
37
40
|
day: II18nFormulaBuilderV2FunctionDay;
|
|
38
41
|
hour: II18nFormulaBuilderV2FunctionHour;
|
|
39
42
|
minute: II18nFormulaBuilderV2FunctionMinute;
|
|
@@ -73,4 +76,11 @@ export interface II18nFormulaBuilderV2Functions {
|
|
|
73
76
|
roundup: II18nFormulaBuilderV2FunctionRound;
|
|
74
77
|
millisecond: II18nFormulaBuilderV2FunctionMillisecond;
|
|
75
78
|
text: II18nFormulaBuilderV2FunctionText;
|
|
79
|
+
sum: II18nFormulaBuilderV2FunctionAggregate;
|
|
80
|
+
avg: II18nFormulaBuilderV2FunctionAggregate;
|
|
81
|
+
med: II18nFormulaBuilderV2FunctionAggregate;
|
|
82
|
+
minval: II18nFormulaBuilderV2FunctionAggregate;
|
|
83
|
+
maxval: II18nFormulaBuilderV2FunctionAggregate;
|
|
84
|
+
count: II18nFormulaBuilderV2FunctionAggregate;
|
|
85
|
+
distcount: II18nFormulaBuilderV2FunctionAggregate;
|
|
76
86
|
}
|
|
@@ -88,3 +88,6 @@ export * from "./II18nFormulaBuilderV2FunctionLog";
|
|
|
88
88
|
export * from "./II18nFormulaBuilderV2FunctionOdd";
|
|
89
89
|
export * from "./II18nFormulaBuilderV2FunctionPower";
|
|
90
90
|
export * from "./II18nFormulaBuilderV2FunctionRound";
|
|
91
|
+
export * from "./II18nFormulaBuilderV2FunctionMillisecond";
|
|
92
|
+
export * from "./II18nFormulaBuilderV2FunctionText";
|
|
93
|
+
export * from "./II18nFormulaBuilderV2FunctionAggregate";
|
|
@@ -88,3 +88,6 @@ export * from "./II18nFormulaBuilderV2FunctionLog";
|
|
|
88
88
|
export * from "./II18nFormulaBuilderV2FunctionOdd";
|
|
89
89
|
export * from "./II18nFormulaBuilderV2FunctionPower";
|
|
90
90
|
export * from "./II18nFormulaBuilderV2FunctionRound";
|
|
91
|
+
export * from "./II18nFormulaBuilderV2FunctionMillisecond";
|
|
92
|
+
export * from "./II18nFormulaBuilderV2FunctionText";
|
|
93
|
+
export * from "./II18nFormulaBuilderV2FunctionAggregate";
|
|
@@ -191,6 +191,7 @@ export const I18N_CHART_BUILDER_GENERAL = {
|
|
|
191
191
|
},
|
|
192
192
|
messages_general: {
|
|
193
193
|
chart_saved: "was saved successfully.",
|
|
194
|
+
chart_saved_ai: "Chart added to the Dataset",
|
|
194
195
|
},
|
|
195
196
|
messages_default: {
|
|
196
197
|
max_data: "Chart shows a maximum number of data points by default. To see more, go to <i>General</i> chart options and increase the <i>Max Data</i> Points to display.",
|
|
@@ -12,6 +12,11 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
12
12
|
information_text_text: "create and work with formulas",
|
|
13
13
|
title_header: "Formulas",
|
|
14
14
|
column_editor_type: "Editor Type",
|
|
15
|
+
loading: "Loading dependencies...",
|
|
16
|
+
formulas: "Formulas",
|
|
17
|
+
aggregate_formulas: "Aggregate Formulas",
|
|
18
|
+
new_formula: "New Formula",
|
|
19
|
+
new_aggregate_formula: "New Aggregate Formula",
|
|
15
20
|
},
|
|
16
21
|
list_table: {
|
|
17
22
|
duplicate_copy: "Copy",
|
|
@@ -31,7 +36,9 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
31
36
|
},
|
|
32
37
|
create_modal: {
|
|
33
38
|
title_header_create: "Create Formula",
|
|
39
|
+
title_header_create_aggregate: "Create Aggregate Formula",
|
|
34
40
|
title_header_edit: "Edit Formula",
|
|
41
|
+
title_header_edit_aggregate: "Edit Aggregate Formula",
|
|
35
42
|
title_header_table: "Create Table Formula",
|
|
36
43
|
name: "Formula Name",
|
|
37
44
|
placeholder_name: "Type Formula Name",
|
|
@@ -65,12 +72,14 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
65
72
|
formula_name_error_reserved_word: "The formula name cannot be a reserved word: null, true or false.",
|
|
66
73
|
formula_type: "Formula Mode",
|
|
67
74
|
formula_custom_script_mode: "Data Engine Syntax (legacy)",
|
|
75
|
+
formula_custom_script_mode_soon: "Data Engine Syntax (legacy) - Coming Soon",
|
|
68
76
|
formula_mode: {
|
|
69
77
|
title: "Standardized Syntax",
|
|
70
78
|
info: 'Allows mathematical and logical operators including +, -, *, /, (), =, >, <, >=, <=, <>. Numbers must be entered in en-US format. Date time values should be entered with format: "MM/DD/YYYY" or "MM/DD/YYYY HH:MM:SS"',
|
|
71
79
|
tab_formula: "Formula",
|
|
72
80
|
tab_testing: "Testing",
|
|
73
81
|
tab_testing_tooltip: "This formula contains errors or is not finished.",
|
|
82
|
+
tab_testing_tooltip_not_available: "Testing not available for this formula type.",
|
|
74
83
|
tab_testing_tooltip_empty: "No formula to test.",
|
|
75
84
|
show_columns: "Show Columns and Functions",
|
|
76
85
|
hide_columns: "Hide Columns and Functions",
|
|
@@ -105,7 +114,11 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
105
114
|
param_date_value2_name: "date_value2",
|
|
106
115
|
param_date_value2_description: 'The second date value. It can be a column or a datetime value entered with a format of either "MM/DD/YYYY" or "MM/DD/YYYY HH:MM:SS". This date should always be equal or greater than date_value1.',
|
|
107
116
|
param_date_part_name: "date_part",
|
|
108
|
-
param_date_part_description: 'Date part allows: "Y" the number of complete years in the period, "M" the number of complete months in the period, "D" the number of days in the period.',
|
|
117
|
+
param_date_part_description: 'Date part allows: "Y" the number of complete years in the period, "M" the number of complete months in the period, "D" the number of days in the period., “H“ the number of hours in the period, “MI“ the number of minutes in the period, “S“ the number of seconds in the period.',
|
|
118
|
+
},
|
|
119
|
+
now: {
|
|
120
|
+
description: "Returns a date with the current time in the current timezone with the following format: yyyy-MM-ddTHH:mm:ss.",
|
|
121
|
+
function_placeholder: "NOW()",
|
|
109
122
|
},
|
|
110
123
|
day: {
|
|
111
124
|
description: "Returns the day of a date. The day is given as an integer ranging from 1 to 31.",
|
|
@@ -371,6 +384,48 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
371
384
|
param_num1_name: "num1",
|
|
372
385
|
param_num1_description: "The number that you want to convert to text.",
|
|
373
386
|
},
|
|
387
|
+
sum: {
|
|
388
|
+
description: "Returns the aggregated sum of the numeric values of a column.",
|
|
389
|
+
function_placeholder: "SUM(column)",
|
|
390
|
+
param_column_name: "column",
|
|
391
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
392
|
+
},
|
|
393
|
+
avg: {
|
|
394
|
+
description: "Returns the average value for all the numeric values of a column.",
|
|
395
|
+
function_placeholder: "AVG(column)",
|
|
396
|
+
param_column_name: "column",
|
|
397
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
398
|
+
},
|
|
399
|
+
med: {
|
|
400
|
+
description: "Returns the median value for all the numeric values of a column.",
|
|
401
|
+
function_placeholder: "MED(column)",
|
|
402
|
+
param_column_name: "column",
|
|
403
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
404
|
+
},
|
|
405
|
+
minval: {
|
|
406
|
+
description: "Returns the minimum value among all the numeric values of a column.",
|
|
407
|
+
function_placeholder: "MINVAL(column)",
|
|
408
|
+
param_column_name: "column",
|
|
409
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
410
|
+
},
|
|
411
|
+
maxval: {
|
|
412
|
+
description: "Returns the maximum value among all the numeric values of a column.",
|
|
413
|
+
function_placeholder: "MAXVAL(column)",
|
|
414
|
+
param_column_name: "column",
|
|
415
|
+
param_column_description: "The numeric column that will be aggregated.",
|
|
416
|
+
},
|
|
417
|
+
count: {
|
|
418
|
+
description: "Returns the count of all the values of a column.",
|
|
419
|
+
function_placeholder: "COUNT(column)",
|
|
420
|
+
param_column_name: "column",
|
|
421
|
+
param_column_description: "The column that will be aggregated.",
|
|
422
|
+
},
|
|
423
|
+
distcount: {
|
|
424
|
+
description: "Returns the count of all the distinct values of a column.",
|
|
425
|
+
function_placeholder: "DISTCOUNT(column)",
|
|
426
|
+
param_column_name: "column",
|
|
427
|
+
param_column_description: "The column that will be aggregated.",
|
|
428
|
+
},
|
|
374
429
|
},
|
|
375
430
|
editor: {
|
|
376
431
|
error_messages: {
|
|
@@ -424,6 +479,7 @@ export const I18N_FORMULA_BUILDER = {
|
|
|
424
479
|
date: "Date/Time",
|
|
425
480
|
aggregate: "Aggregates",
|
|
426
481
|
logical: "Logical",
|
|
482
|
+
aggregated: "Aggregate",
|
|
427
483
|
},
|
|
428
484
|
function_is_null: {
|
|
429
485
|
description: "Replaces NULL with the specified replacement value.",
|