@qrvey/utils 1.16.0-2 → 1.16.0-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/dist/cache-managers/cache-model-manager.js +6 -1
- package/dist/charts/adapters/RequestAdapterMetric.d.ts +2 -1
- package/dist/charts/adapters/RequestAdapterMetric.js +22 -5
- package/dist/charts/adapters/convertChartObjectFromV2toV1.d.ts +2 -0
- package/dist/charts/adapters/convertChartObjectFromV2toV1.js +63 -0
- package/dist/charts/adapters/getPanelBodyByChart.d.ts +2 -0
- package/dist/charts/adapters/getPanelBodyByChart.js +289 -0
- package/dist/charts/adapters/index.d.ts +2 -0
- package/dist/charts/adapters/index.js +2 -0
- package/dist/charts/constants/AGGREGATE.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE.js +2 -0
- package/dist/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
- package/dist/charts/constants/AGGREGATE_INFO.js +16 -0
- package/dist/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE_LABEL.js +2 -0
- package/dist/charts/constants/CHART_OBJECT.d.ts +564 -0
- package/dist/charts/constants/CHART_OBJECT.js +53 -0
- package/dist/charts/constants/QUESTION_TYPES.d.ts +241 -0
- package/dist/charts/constants/QUESTION_TYPES.js +410 -0
- package/dist/charts/constants/TIME_PERIOD.d.ts +10 -0
- package/dist/charts/constants/TIME_PERIOD.js +25 -0
- package/dist/charts/constants/index.d.ts +3 -0
- package/dist/charts/constants/index.js +3 -0
- package/dist/charts/helpers/chartTypes.d.ts +24 -0
- package/dist/charts/helpers/chartTypes.js +118 -0
- package/dist/charts/helpers/defaultColumnBuilder.d.ts +56 -0
- package/dist/charts/helpers/defaultColumnBuilder.js +322 -0
- package/dist/charts/helpers/getChartDimensions.d.ts +2 -0
- package/dist/charts/helpers/getChartDimensions.js +263 -0
- package/dist/charts/helpers/index.d.ts +4 -0
- package/dist/charts/helpers/index.js +4 -0
- package/dist/charts/helpers/styleSettingsByChartType.d.ts +60 -0
- package/dist/charts/helpers/styleSettingsByChartType.js +532 -0
- package/dist/charts/interfaces/IChartV2.d.ts +537 -0
- package/dist/charts/interfaces/IChartV2.js +33 -0
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +5 -2
- package/dist/charts/interfaces/index.d.ts +1 -0
- package/dist/charts/interfaces/index.js +1 -0
- package/dist/cjs/cache-managers/cache-model-manager.js +6 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.d.ts +2 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.js +24 -6
- package/dist/cjs/charts/adapters/convertChartObjectFromV2toV1.d.ts +2 -0
- package/dist/cjs/charts/adapters/convertChartObjectFromV2toV1.js +67 -0
- package/dist/cjs/charts/adapters/getPanelBodyByChart.d.ts +2 -0
- package/dist/cjs/charts/adapters/getPanelBodyByChart.js +294 -0
- package/dist/cjs/charts/adapters/index.d.ts +2 -0
- package/dist/cjs/charts/adapters/index.js +2 -0
- package/dist/cjs/charts/constants/AGGREGATE.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE.js +2 -0
- package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
- package/dist/cjs/charts/constants/AGGREGATE_INFO.js +16 -0
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +2 -0
- package/dist/cjs/charts/constants/CHART_OBJECT.d.ts +564 -0
- package/dist/cjs/charts/constants/CHART_OBJECT.js +56 -0
- package/dist/cjs/charts/constants/QUESTION_TYPES.d.ts +241 -0
- package/dist/cjs/charts/constants/QUESTION_TYPES.js +413 -0
- package/dist/cjs/charts/constants/TIME_PERIOD.d.ts +10 -0
- package/dist/cjs/charts/constants/TIME_PERIOD.js +28 -0
- package/dist/cjs/charts/constants/index.d.ts +3 -0
- package/dist/cjs/charts/constants/index.js +3 -0
- package/dist/cjs/charts/helpers/chartTypes.d.ts +24 -0
- package/dist/cjs/charts/helpers/chartTypes.js +138 -0
- package/dist/cjs/charts/helpers/defaultColumnBuilder.d.ts +56 -0
- package/dist/cjs/charts/helpers/defaultColumnBuilder.js +326 -0
- package/dist/cjs/charts/helpers/getChartDimensions.d.ts +2 -0
- package/dist/cjs/charts/helpers/getChartDimensions.js +267 -0
- package/dist/cjs/charts/helpers/index.d.ts +4 -0
- package/dist/cjs/charts/helpers/index.js +4 -0
- package/dist/cjs/charts/helpers/styleSettingsByChartType.d.ts +60 -0
- package/dist/cjs/charts/helpers/styleSettingsByChartType.js +541 -0
- package/dist/cjs/charts/interfaces/IChartV2.d.ts +537 -0
- package/dist/cjs/charts/interfaces/IChartV2.js +36 -0
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +5 -2
- package/dist/cjs/charts/interfaces/index.d.ts +1 -0
- package/dist/cjs/charts/interfaces/index.js +1 -0
- package/dist/cjs/column_format/helpers/columnTypeByChart.js +3 -1
- package/dist/cjs/columns/interfaces/IColumn.d.ts +1 -0
- package/dist/cjs/columns/interfaces/IColunmCalculation.d.ts +5 -0
- package/dist/cjs/constants/Charts.Const.d.ts +2 -1
- package/dist/cjs/constants/Charts.Const.js +1 -0
- package/dist/cjs/elements/helpers/fixed.d.ts +12 -1
- package/dist/cjs/elements/helpers/fixed.js +33 -8
- package/dist/cjs/elements/helpers/gridStrategy.d.ts +13 -0
- package/dist/cjs/elements/helpers/gridStrategy.js +31 -3
- package/dist/cjs/elements/helpers/responsive.d.ts +11 -1
- package/dist/cjs/elements/helpers/responsive.js +31 -1
- package/dist/cjs/elements/utils/fixed.position.d.ts +1 -0
- package/dist/cjs/elements/utils/fixed.position.js +8 -1
- package/dist/cjs/filters/constants/common/FILTER_SCOPE.d.ts +1 -0
- package/dist/cjs/filters/constants/common/FILTER_SCOPE.js +1 -0
- package/dist/cjs/filters/constants/common/FILTER_SCOPES.js +1 -0
- package/dist/cjs/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
- package/dist/cjs/filters/constants/common/FILTER_SCOPE_LABEL.d.ts +1 -0
- package/dist/cjs/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
- package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +29 -6
- package/dist/cjs/filters/helpers/common/excludeFiltersByDatasetsColumns.d.ts +10 -0
- package/dist/cjs/filters/helpers/common/excludeFiltersByDatasetsColumns.js +64 -0
- package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/common/index.js +1 -0
- 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/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/filters/II18nFilterPanelScopeTitle.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/filters/II18nFilterScopes.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +7 -7
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
- package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +1 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
- package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +16 -14
- package/dist/column_format/helpers/columnTypeByChart.js +4 -2
- package/dist/columns/interfaces/IColumn.d.ts +1 -0
- package/dist/columns/interfaces/IColunmCalculation.d.ts +5 -0
- package/dist/constants/Charts.Const.d.ts +2 -1
- package/dist/constants/Charts.Const.js +1 -0
- package/dist/elements/helpers/fixed.d.ts +12 -1
- package/dist/elements/helpers/fixed.js +30 -6
- package/dist/elements/helpers/gridStrategy.d.ts +13 -0
- package/dist/elements/helpers/gridStrategy.js +31 -4
- package/dist/elements/helpers/responsive.d.ts +11 -1
- package/dist/elements/helpers/responsive.js +29 -0
- package/dist/elements/utils/fixed.position.d.ts +1 -0
- package/dist/elements/utils/fixed.position.js +6 -0
- package/dist/filters/constants/common/FILTER_SCOPE.d.ts +1 -0
- package/dist/filters/constants/common/FILTER_SCOPE.js +1 -0
- package/dist/filters/constants/common/FILTER_SCOPES.js +1 -0
- package/dist/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
- package/dist/filters/constants/common/FILTER_SCOPE_LABEL.d.ts +1 -0
- package/dist/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
- package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +29 -6
- package/dist/filters/helpers/common/excludeFiltersByDatasetsColumns.d.ts +10 -0
- package/dist/filters/helpers/common/excludeFiltersByDatasetsColumns.js +60 -0
- package/dist/filters/helpers/common/index.d.ts +1 -0
- package/dist/filters/helpers/common/index.js +1 -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/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
- package/dist/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
- package/dist/globalization/interfaces/filters/II18nFilterPanelScopeTitle.d.ts +1 -0
- package/dist/globalization/interfaces/filters/II18nFilterScopes.d.ts +1 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +2 -0
- package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts +7 -7
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
- package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
- package/dist/globalization/labels/filters/I18N_FILTER.js +1 -0
- package/dist/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
- package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +16 -14
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import { CanvasDevice } from "../interfaces/ICanvasGrid";
|
|
|
2
2
|
import { FindAvailablePositionOptions } from "../interfaces/IFixedPosition";
|
|
3
3
|
import { VemFixed } from "../interfaces/IVemCore";
|
|
4
4
|
import { VemPositionFixed } from "../interfaces/IVemPosition";
|
|
5
|
+
export declare const CANVAS_EXTRA_HEIGHT = 10;
|
|
5
6
|
/**
|
|
6
7
|
* update the position for a specific device
|
|
7
8
|
* @param element element to be updated
|
|
@@ -45,12 +46,13 @@ export declare function findFixedAvailablePositions(canvasWidth: number, newElem
|
|
|
45
46
|
* that meet certain conditions (no overflow or overlap). Elements that do not meet these
|
|
46
47
|
* conditions are recalculated to find a new valid position.
|
|
47
48
|
* @param elements - List of elements to recalculate.
|
|
49
|
+
* @param scopeElements - scope Elements
|
|
48
50
|
* @param device - The device on which the canvas is being rendered.
|
|
49
51
|
* @param resolution - The resolution of the canvas.
|
|
50
52
|
* @param [canvasHeight] - Optional height of the canvas.
|
|
51
53
|
* @returns - List of elements with their recalculated positions.
|
|
52
54
|
*/
|
|
53
|
-
export declare const recalculatePreservingPositions: (elements: VemFixed[], device: CanvasDevice, resolution: number, canvasHeight?: number) => VemFixed[];
|
|
55
|
+
export declare const recalculatePreservingPositions: (elements: VemFixed[], scopeElements: VemFixed[], device: CanvasDevice, resolution: number, canvasHeight?: number) => VemFixed[];
|
|
54
56
|
/**
|
|
55
57
|
* Adjusts the `width` of a fixed element to fit within the specified canvas width and updates its position.
|
|
56
58
|
* @param element - The fixed element to adjust.
|
|
@@ -94,3 +96,12 @@ export declare const sortElementsFromReferencePoint: (elements: VemFixed<unknown
|
|
|
94
96
|
x: number;
|
|
95
97
|
y: number;
|
|
96
98
|
}) => VemFixed<unknown>[];
|
|
99
|
+
/**
|
|
100
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
101
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
102
|
+
* @param containerItem - The element to update.
|
|
103
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
104
|
+
* @param scopeElements
|
|
105
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
106
|
+
*/
|
|
107
|
+
export declare const updateFixedElementDimensions: (containerItem: VemFixed<unknown>, device: CanvasDevice, scopeElements: VemFixed<unknown>[]) => VemFixed<unknown>;
|
|
@@ -1,14 +1,16 @@
|
|
|
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 = exports.CANVAS_EXTRA_HEIGHT = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
5
|
+
const general_1 = require("../../general");
|
|
5
6
|
const ICanvasGrid_1 = require("../interfaces/ICanvasGrid");
|
|
6
7
|
const IVemPosition_1 = require("../interfaces/IVemPosition");
|
|
7
8
|
const fixed_position_1 = require("../utils/fixed.position");
|
|
8
|
-
const
|
|
9
|
+
const general_2 = require("../utils/general");
|
|
9
10
|
const overlap_1 = require("../utils/overlap");
|
|
10
11
|
const position_1 = require("../utils/position");
|
|
11
12
|
const SPACE_DELTA = 10;
|
|
13
|
+
exports.CANVAS_EXTRA_HEIGHT = 10;
|
|
12
14
|
/**
|
|
13
15
|
* update the position for a specific device
|
|
14
16
|
* @param element element to be updated
|
|
@@ -116,19 +118,20 @@ exports.findFixedAvailablePositions = findFixedAvailablePositions;
|
|
|
116
118
|
* that meet certain conditions (no overflow or overlap). Elements that do not meet these
|
|
117
119
|
* conditions are recalculated to find a new valid position.
|
|
118
120
|
* @param elements - List of elements to recalculate.
|
|
121
|
+
* @param scopeElements - scope Elements
|
|
119
122
|
* @param device - The device on which the canvas is being rendered.
|
|
120
123
|
* @param resolution - The resolution of the canvas.
|
|
121
124
|
* @param [canvasHeight] - Optional height of the canvas.
|
|
122
125
|
* @returns - List of elements with their recalculated positions.
|
|
123
126
|
*/
|
|
124
|
-
const recalculatePreservingPositions = (elements, device, resolution, canvasHeight) => {
|
|
125
|
-
const keepElementPositions = getElementsWithKeepPosition([...elements], device, resolution, canvasHeight);
|
|
127
|
+
const recalculatePreservingPositions = (elements, scopeElements, device, resolution, canvasHeight) => {
|
|
128
|
+
const keepElementPositions = getElementsWithKeepPosition([...elements], scopeElements, device, resolution, canvasHeight);
|
|
126
129
|
const elementIds = keepElementPositions.map((element) => element.elementId);
|
|
127
130
|
const elementsToCalculate = elements.filter((cElement) => !elementIds.includes(cElement.elementId));
|
|
128
131
|
const defaultElements = keepElementPositions.length
|
|
129
132
|
? keepElementPositions
|
|
130
133
|
: [];
|
|
131
|
-
const currentElements =
|
|
134
|
+
const currentElements = [...scopeElements, ...defaultElements];
|
|
132
135
|
const newElements = findFixedAvailablePositions(resolution, elementsToCalculate, currentElements, device, false, false, canvasHeight);
|
|
133
136
|
return [...keepElementPositions, ...newElements];
|
|
134
137
|
};
|
|
@@ -137,18 +140,19 @@ exports.recalculatePreservingPositions = recalculatePreservingPositions;
|
|
|
137
140
|
* Filters elements that should retain their current position on the canvas by checking
|
|
138
141
|
* that they do not have overflow (spilling outside the canvas) or overlap (colliding with other elements).
|
|
139
142
|
* @param elements - List of elements to check.
|
|
143
|
+
* @param scopeElements - List of elements to check.
|
|
140
144
|
* @param device - The device on which the canvas is being rendered.
|
|
141
145
|
* @param resolution - The resolution of the canvas.
|
|
142
146
|
* @param [canvasHeight] - Optional height of the canvas.
|
|
143
147
|
* @returns - List of elements that can retain their current position.
|
|
144
148
|
*/
|
|
145
|
-
const getElementsWithKeepPosition = (elements, device, resolution, canvasHeight) => {
|
|
149
|
+
const getElementsWithKeepPosition = (elements, scopeElements, device, resolution, canvasHeight) => {
|
|
146
150
|
const calculatedElements = elements.map((mElement) => {
|
|
147
151
|
const desktopPosition = (0, fixed_position_1.dxGetFixedGridItemDevice)(mElement, ICanvasGrid_1.CanvasDevice.DESKTOP);
|
|
148
152
|
return updateFixedPosition(mElement, desktopPosition, device);
|
|
149
153
|
});
|
|
150
154
|
return calculatedElements.filter((cElement) => {
|
|
151
|
-
const currentElements =
|
|
155
|
+
const currentElements = scopeElements.filter((fElement) => fElement.elementId !== cElement.elementId);
|
|
152
156
|
const overflow = (0, fixed_position_1.hasOverflow)(cElement, device, resolution, canvasHeight);
|
|
153
157
|
const overlap = (0, fixed_position_1.hasOverlap)(cElement, currentElements, device);
|
|
154
158
|
return !overflow && !overlap;
|
|
@@ -242,7 +246,28 @@ exports.calculateDistancesToReferencePoint = calculateDistancesToReferencePoint;
|
|
|
242
246
|
*/
|
|
243
247
|
const sortElementsFromReferencePoint = (elements, device, referencePoint) => {
|
|
244
248
|
const calculatedElements = (0, exports.calculateDistancesToReferencePoint)(elements, device, referencePoint);
|
|
245
|
-
const sortedElements = [...calculatedElements].sort(
|
|
249
|
+
const sortedElements = [...calculatedElements].sort(general_2.sortByDistanceFunction);
|
|
246
250
|
return sortedElements.map((element) => element.element);
|
|
247
251
|
};
|
|
248
252
|
exports.sortElementsFromReferencePoint = sortElementsFromReferencePoint;
|
|
253
|
+
/**
|
|
254
|
+
* Updates the height of a given container element based on the bottom limit of other scoped elements.
|
|
255
|
+
* It ensures the container has at least the height required to encompass all scoped elements.
|
|
256
|
+
* @param containerItem - The element to update.
|
|
257
|
+
* @param device - The target device context (used to access device-specific dimensions).
|
|
258
|
+
* @param scopeElements
|
|
259
|
+
* @returns - A new version of the container element with updated height if needed.
|
|
260
|
+
*/
|
|
261
|
+
const updateFixedElementDimensions = (containerItem, device, scopeElements) => {
|
|
262
|
+
let currentElement = (0, general_1.objectCopy)(containerItem);
|
|
263
|
+
const calculatedHeight = (0, fixed_position_1.dxGetFixedGridItemsBottomLimit)(scopeElements, device);
|
|
264
|
+
const currentHeight = currentElement.position.fixed[device].height;
|
|
265
|
+
const newHeight = calculatedHeight > currentHeight
|
|
266
|
+
? calculatedHeight + exports.CANVAS_EXTRA_HEIGHT
|
|
267
|
+
: currentHeight;
|
|
268
|
+
currentElement = updateFixedPosition(currentElement, {
|
|
269
|
+
height: newHeight,
|
|
270
|
+
}, device);
|
|
271
|
+
return Object.assign({}, currentElement);
|
|
272
|
+
};
|
|
273
|
+
exports.updateFixedElementDimensions = updateFixedElementDimensions;
|
|
@@ -17,6 +17,19 @@ 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
|
+
* @param gap The type of canvas that determines which strategy to use.
|
|
30
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
31
|
+
*/
|
|
32
|
+
export declare function applyDynamicSize(containerItem: Vem, scopeElements: Vem[], device: CanvasDevice, canvasType: string, gap?: number): Vem | undefined;
|
|
20
33
|
/**
|
|
21
34
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
22
35
|
* @param elements - The list of elements in the canvas.
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateCanvasHeight = exports.recalculateElements = void 0;
|
|
3
|
+
exports.calculateCanvasHeight = exports.applyDynamicSize = 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 applyDynamicSizeStrategies = {
|
|
9
|
+
fixed: (containerItem, scopeElements, device) => {
|
|
10
|
+
return (0, fixed_1.updateFixedElementDimensions)(containerItem, device, scopeElements);
|
|
11
|
+
},
|
|
12
|
+
responsive: (containerItem, scopeElements, device, gap) => {
|
|
13
|
+
return (0, responsive_1.updateResponsiveElementDimensions)(containerItem, device, scopeElements, gap);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
8
16
|
const recalculateStrategies = {
|
|
9
17
|
fixed: (elements, currentElements, canvasWidth, device, options) => {
|
|
10
18
|
const isSorted = !currentElements.length;
|
|
@@ -18,8 +26,8 @@ const recalculateStrategies = {
|
|
|
18
26
|
y: 0,
|
|
19
27
|
})
|
|
20
28
|
: changedElements;
|
|
21
|
-
return options.
|
|
22
|
-
? (0, fixed_1.recalculatePreservingPositions)(orderedElements, device, canvasWidth, options.canvasHeight)
|
|
29
|
+
return options.keepPosition
|
|
30
|
+
? (0, fixed_1.recalculatePreservingPositions)(orderedElements, currentElements, device, canvasWidth, options.canvasHeight)
|
|
23
31
|
: (0, fixed_1.findFixedAvailablePositions)(canvasWidth, orderedElements, currentElements, device, false, false, options === null || options === void 0 ? void 0 : options.canvasHeight);
|
|
24
32
|
},
|
|
25
33
|
responsive: (elements, currentElements, canvasWidth, device, options) => {
|
|
@@ -65,6 +73,26 @@ function recalculateElements(newElements, currentElements, canvasWidth, canvasTy
|
|
|
65
73
|
return strategy(newElements, currentElements, canvasWidth, device, calculatedOptions);
|
|
66
74
|
}
|
|
67
75
|
exports.recalculateElements = recalculateElements;
|
|
76
|
+
/**
|
|
77
|
+
* Updates the dimensions of a container element using a strategy based on the given canvas type.
|
|
78
|
+
*
|
|
79
|
+
* Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
|
|
80
|
+
* using the provided `canvasType` key.
|
|
81
|
+
* @param containerItem The element whose dimensions need to be updated
|
|
82
|
+
* @param scopeElements A list of elements to consider in the update strategy
|
|
83
|
+
* @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
|
|
84
|
+
* @param canvasType The type of canvas that determines which strategy to use.
|
|
85
|
+
* @param gap The type of canvas that determines which strategy to use.
|
|
86
|
+
* @returns - The updated element with modified dimensions, or `undefined` if no strategy is found.
|
|
87
|
+
*/
|
|
88
|
+
function applyDynamicSize(containerItem, scopeElements, device, canvasType, gap = 0) {
|
|
89
|
+
const strategy = applyDynamicSizeStrategies[canvasType];
|
|
90
|
+
if (!strategy) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
return strategy(containerItem, scopeElements, device, gap);
|
|
94
|
+
}
|
|
95
|
+
exports.applyDynamicSize = applyDynamicSize;
|
|
68
96
|
/**
|
|
69
97
|
* The calculation is delegated to a specific strategy based on the `canvasType`.
|
|
70
98
|
* @param elements - The list of elements in the canvas.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CanvasDevice } from "../interfaces/ICanvasGrid";
|
|
2
|
-
import { VemResponsive } from "../interfaces/IVemCore";
|
|
2
|
+
import { VemFixed, VemResponsive } from "../interfaces/IVemCore";
|
|
3
3
|
import { VemPositionResponsive } from "../interfaces/IVemPosition";
|
|
4
4
|
/**
|
|
5
5
|
* Finds the first available position for a new responsive element within a canvas.
|
|
@@ -85,3 +85,13 @@ export declare const sortByDistanceInResponsiveFunction: (a: {
|
|
|
85
85
|
element: VemResponsive;
|
|
86
86
|
}, _device: CanvasDevice) => number;
|
|
87
87
|
export declare const sortResponsiveElements: (elements: VemResponsive<unknown>[], sortByDevice?: CanvasDevice) => VemResponsive<unknown>[];
|
|
88
|
+
/**
|
|
89
|
+
* Updates the height (`rowSpan`) of a fixed container element based on the positions.
|
|
90
|
+
* of the fixed elements it contains, ensuring it is tall enough to encompass all child elements.
|
|
91
|
+
* @param containerItem - The container element whose height needs to be updated.
|
|
92
|
+
* @param device - The target device (used to retrieve responsive dimensions).
|
|
93
|
+
* @param scopeElements - The list of fixed elements that are scoped to the container.
|
|
94
|
+
* @param rowGapSize - row gap
|
|
95
|
+
* @returns A new container element with the updated responsive `rowSpan` height for the given device.
|
|
96
|
+
*/
|
|
97
|
+
export declare const updateResponsiveElementDimensions: (containerItem: VemResponsive<unknown>, device: CanvasDevice, scopeElements: VemFixed<unknown>[], rowGapSize: number) => VemResponsive<unknown>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortResponsiveElements = exports.sortByDistanceInResponsiveFunction = exports.calculateDistancesToReferencePoint = exports.getResponsiveGridElementsBottomLimit = exports.updateResponsiveElementColSpan = exports.findResponsiveAvailablePositions = exports.updateResponsivePosition = exports.findAvailablePosition = void 0;
|
|
3
|
+
exports.updateResponsiveElementDimensions = exports.sortResponsiveElements = exports.sortByDistanceInResponsiveFunction = exports.calculateDistancesToReferencePoint = exports.getResponsiveGridElementsBottomLimit = exports.updateResponsiveElementColSpan = exports.findResponsiveAvailablePositions = exports.updateResponsivePosition = exports.findAvailablePosition = void 0;
|
|
4
|
+
const general_1 = require("../../general");
|
|
4
5
|
const ICanvasGrid_1 = require("../interfaces/ICanvasGrid");
|
|
5
6
|
const IVemPosition_1 = require("../interfaces/IVemPosition");
|
|
7
|
+
const fixed_position_1 = require("../utils/fixed.position");
|
|
6
8
|
const overlap_1 = require("../utils/overlap");
|
|
7
9
|
const position_1 = require("../utils/position");
|
|
8
10
|
const SPACE_DELTA = 1;
|
|
9
11
|
const HEIGHT_DELTA = 32;
|
|
12
|
+
const CANVAS_EXTRA_ROW = 1;
|
|
10
13
|
/**
|
|
11
14
|
* Finds the first available position for a new responsive element within a canvas.
|
|
12
15
|
* @param canvasWidth - The width of the canvas in terms of columns.
|
|
@@ -164,3 +167,30 @@ const sortResponsiveElements = (elements, sortByDevice) => {
|
|
|
164
167
|
return sortedElements.map((element) => element.element);
|
|
165
168
|
};
|
|
166
169
|
exports.sortResponsiveElements = sortResponsiveElements;
|
|
170
|
+
/**
|
|
171
|
+
* Updates the height (`rowSpan`) of a fixed container element based on the positions.
|
|
172
|
+
* of the fixed elements it contains, ensuring it is tall enough to encompass all child elements.
|
|
173
|
+
* @param containerItem - The container element whose height needs to be updated.
|
|
174
|
+
* @param device - The target device (used to retrieve responsive dimensions).
|
|
175
|
+
* @param scopeElements - The list of fixed elements that are scoped to the container.
|
|
176
|
+
* @param rowGapSize - row gap
|
|
177
|
+
* @returns A new container element with the updated responsive `rowSpan` height for the given device.
|
|
178
|
+
*/
|
|
179
|
+
const updateResponsiveElementDimensions = (containerItem, device, scopeElements, rowGapSize) => {
|
|
180
|
+
let currentElement = (0, general_1.objectCopy)(containerItem);
|
|
181
|
+
const currentHeight = currentElement.position.responsive[device].rowSpan;
|
|
182
|
+
const delta = HEIGHT_DELTA + rowGapSize;
|
|
183
|
+
// height in px
|
|
184
|
+
const calculatedHeight = (0, fixed_position_1.dxGetFixedGridItemsBottomLimit)(scopeElements, device);
|
|
185
|
+
// convert to rows
|
|
186
|
+
const transformToRows = Math.round(calculatedHeight / delta);
|
|
187
|
+
const baseRowSpan = Math.max(currentHeight, transformToRows);
|
|
188
|
+
const newRowSpan = baseRowSpan > currentHeight
|
|
189
|
+
? baseRowSpan + CANVAS_EXTRA_ROW
|
|
190
|
+
: currentHeight;
|
|
191
|
+
currentElement = updateResponsivePosition(currentElement, {
|
|
192
|
+
rowSpan: newRowSpan,
|
|
193
|
+
}, device);
|
|
194
|
+
return Object.assign({}, currentElement);
|
|
195
|
+
};
|
|
196
|
+
exports.updateResponsiveElementDimensions = updateResponsiveElementDimensions;
|
|
@@ -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;
|
|
@@ -4,6 +4,7 @@ export declare enum FILTER_SCOPE {
|
|
|
4
4
|
GLOBAL = "GLOBAL",// Analyze Filters | Filters for all pages on PB/EU
|
|
5
5
|
PAGE = "PAGE",// PB/EU Filters for a single page
|
|
6
6
|
TAB = "TAB",// PB/EU Filters for a single tab
|
|
7
|
+
CONTAINER = "CONTAINER",
|
|
7
8
|
DEFAULT = "DEFAULT",// Filters created on Chart Builder
|
|
8
9
|
CHART = "CHART",// PB/EU Filters for panels inside a page/tab
|
|
9
10
|
ACTION = "ACTION",// Filters created with FilterBY or other actions
|
|
@@ -8,6 +8,7 @@ var FILTER_SCOPE;
|
|
|
8
8
|
FILTER_SCOPE["GLOBAL"] = "GLOBAL";
|
|
9
9
|
FILTER_SCOPE["PAGE"] = "PAGE";
|
|
10
10
|
FILTER_SCOPE["TAB"] = "TAB";
|
|
11
|
+
FILTER_SCOPE["CONTAINER"] = "CONTAINER";
|
|
11
12
|
FILTER_SCOPE["DEFAULT"] = "DEFAULT";
|
|
12
13
|
FILTER_SCOPE["CHART"] = "CHART";
|
|
13
14
|
FILTER_SCOPE["ACTION"] = "ACTION";
|
|
@@ -8,6 +8,7 @@ exports.FILTER_SCOPES = [
|
|
|
8
8
|
FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL,
|
|
9
9
|
FILTER_SCOPE_1.FILTER_SCOPE.PAGE,
|
|
10
10
|
FILTER_SCOPE_1.FILTER_SCOPE.TAB,
|
|
11
|
+
FILTER_SCOPE_1.FILTER_SCOPE.CONTAINER,
|
|
11
12
|
FILTER_SCOPE_1.FILTER_SCOPE.DEFAULT,
|
|
12
13
|
FILTER_SCOPE_1.FILTER_SCOPE.CHART,
|
|
13
14
|
FILTER_SCOPE_1.FILTER_SCOPE.ACTION,
|
|
@@ -44,6 +44,14 @@ exports.FILTER_SCOPE_INFO = [
|
|
|
44
44
|
displayed: true,
|
|
45
45
|
i18nLabelPath: "filter.scopes.tab",
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
label: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.CONTAINER,
|
|
49
|
+
shortLabel: "Container",
|
|
50
|
+
abbrLabel: "CONT",
|
|
51
|
+
value: FILTER_SCOPE_1.FILTER_SCOPE.CONTAINER,
|
|
52
|
+
displayed: true,
|
|
53
|
+
i18nLabelPath: "filter.scopes.container",
|
|
54
|
+
},
|
|
47
55
|
{
|
|
48
56
|
label: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.DEFAULT,
|
|
49
57
|
shortLabel: "Default",
|
|
@@ -8,6 +8,7 @@ var FILTER_SCOPE_LABEL;
|
|
|
8
8
|
FILTER_SCOPE_LABEL["GLOBAL"] = "Global";
|
|
9
9
|
FILTER_SCOPE_LABEL["PAGE"] = "Dashboard";
|
|
10
10
|
FILTER_SCOPE_LABEL["TAB"] = "Tab";
|
|
11
|
+
FILTER_SCOPE_LABEL["CONTAINER"] = "Container";
|
|
11
12
|
FILTER_SCOPE_LABEL["DEFAULT"] = "Default";
|
|
12
13
|
FILTER_SCOPE_LABEL["CHART"] = "Panel";
|
|
13
14
|
FILTER_SCOPE_LABEL["ACTION"] = "Action";
|
|
@@ -130,7 +130,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
130
130
|
colorPickerDisplayed: true,
|
|
131
131
|
displayed: true,
|
|
132
132
|
enabled: true,
|
|
133
|
-
icon: "fp-global",
|
|
133
|
+
icon: "q-icon-fp-global",
|
|
134
134
|
iconsDisplayed: true,
|
|
135
135
|
interaction: {
|
|
136
136
|
createDisplayed: true,
|
|
@@ -153,7 +153,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
153
153
|
colorPickerDisplayed: true,
|
|
154
154
|
displayed: true,
|
|
155
155
|
enabled: true,
|
|
156
|
-
icon: "fp-page",
|
|
156
|
+
icon: "q-icon-fp-page",
|
|
157
157
|
iconsDisplayed: true,
|
|
158
158
|
interaction: {
|
|
159
159
|
createDisplayed: true,
|
|
@@ -176,7 +176,30 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
176
176
|
colorPickerDisplayed: true,
|
|
177
177
|
displayed: true,
|
|
178
178
|
enabled: true,
|
|
179
|
-
icon: "fp-tab",
|
|
179
|
+
icon: "q-icon-fp-tab",
|
|
180
|
+
iconsDisplayed: true,
|
|
181
|
+
interaction: {
|
|
182
|
+
createDisplayed: true,
|
|
183
|
+
createEnabled: true,
|
|
184
|
+
deleteDisplayed: true,
|
|
185
|
+
deleteEnabled: true,
|
|
186
|
+
editDisplayed: true,
|
|
187
|
+
editEnabled: true,
|
|
188
|
+
enableDisplayed: true,
|
|
189
|
+
enableEnabled: true,
|
|
190
|
+
},
|
|
191
|
+
label: undefined,
|
|
192
|
+
readonly: false,
|
|
193
|
+
},
|
|
194
|
+
[FILTER_SCOPE_1.FILTER_SCOPE.CONTAINER]: {
|
|
195
|
+
canCollapse: true,
|
|
196
|
+
collapsed: false,
|
|
197
|
+
color: "#F472F2",
|
|
198
|
+
colorized: true,
|
|
199
|
+
colorPickerDisplayed: true,
|
|
200
|
+
displayed: true,
|
|
201
|
+
enabled: true,
|
|
202
|
+
icon: "new-q-icon-an-rectangle",
|
|
180
203
|
iconsDisplayed: true,
|
|
181
204
|
interaction: {
|
|
182
205
|
createDisplayed: true,
|
|
@@ -199,7 +222,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
199
222
|
colorPickerDisplayed: true,
|
|
200
223
|
displayed: true,
|
|
201
224
|
enabled: true,
|
|
202
|
-
icon: "fp-chart",
|
|
225
|
+
icon: "q-icon-fp-chart",
|
|
203
226
|
iconsDisplayed: true,
|
|
204
227
|
interaction: {
|
|
205
228
|
createDisplayed: true,
|
|
@@ -222,7 +245,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
222
245
|
colorPickerDisplayed: true,
|
|
223
246
|
displayed: true,
|
|
224
247
|
enabled: true,
|
|
225
|
-
icon: "fp-global",
|
|
248
|
+
icon: "q-icon-fp-global",
|
|
226
249
|
iconsDisplayed: true,
|
|
227
250
|
interaction: {
|
|
228
251
|
createDisplayed: true,
|
|
@@ -245,7 +268,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
245
268
|
colorPickerDisplayed: true,
|
|
246
269
|
displayed: true,
|
|
247
270
|
enabled: true,
|
|
248
|
-
icon: "ico_workflows",
|
|
271
|
+
icon: "q-icon-ico_workflows",
|
|
249
272
|
iconsDisplayed: true,
|
|
250
273
|
interaction: {
|
|
251
274
|
createDisplayed: true,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDataset } from "../../../qrvey/interfaces/IDataset";
|
|
2
|
+
import { IFUData } from "../../interfaces/ui/IFUData";
|
|
3
|
+
/**
|
|
4
|
+
* Filtering the filters by the columns of datasets.
|
|
5
|
+
* Module specially for CLS.
|
|
6
|
+
* @param data the filter data
|
|
7
|
+
* @param datasets the collection of datasets and their columns
|
|
8
|
+
* @returns A new filter data with the filtered filters by columns
|
|
9
|
+
*/
|
|
10
|
+
export declare function excludeFiltersByDatasetsColumns(data: IFUData, datasets?: IDataset[]): IFUData;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.excludeFiltersByDatasetsColumns = void 0;
|
|
4
|
+
const getDatasetColumn_1 = require("../../../columns/helpers/getDatasetColumn");
|
|
5
|
+
const isEmpty_1 = require("../../../general/mix/isEmpty");
|
|
6
|
+
const getDatasetByColumn_1 = require("../../../qrvey/helpers/getDatasetByColumn");
|
|
7
|
+
/**
|
|
8
|
+
* Filtering the filters by the columns of datasets.
|
|
9
|
+
* Module specially for CLS.
|
|
10
|
+
* @param data the filter data
|
|
11
|
+
* @param datasets the collection of datasets and their columns
|
|
12
|
+
* @returns A new filter data with the filtered filters by columns
|
|
13
|
+
*/
|
|
14
|
+
function excludeFiltersByDatasetsColumns(data, datasets = []) {
|
|
15
|
+
if ((0, isEmpty_1.isEmpty)(data) || (0, isEmpty_1.isEmpty)(data.scopes))
|
|
16
|
+
return;
|
|
17
|
+
if ((0, isEmpty_1.isEmpty)(datasets))
|
|
18
|
+
return data;
|
|
19
|
+
const newData = Object.assign(Object.assign({}, data), { scopes: getExcludedScopes(data.scopes, datasets) });
|
|
20
|
+
if (!(0, isEmpty_1.isEmpty)(newData) && newData.scopes.length > 0) {
|
|
21
|
+
return newData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.excludeFiltersByDatasetsColumns = excludeFiltersByDatasetsColumns;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param scopes
|
|
28
|
+
* @param datasets
|
|
29
|
+
*/
|
|
30
|
+
function getExcludedScopes(scopes, datasets = []) {
|
|
31
|
+
return scopes
|
|
32
|
+
.map((scope) => (Object.assign(Object.assign({}, scope), { datasets: getExcludedDatasets(scope.datasets, datasets) })))
|
|
33
|
+
.filter((scope) => !(0, isEmpty_1.isEmpty)(scope) && scope.datasets.length > 0);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param scopeDatasets
|
|
38
|
+
* @param datasets
|
|
39
|
+
*/
|
|
40
|
+
function getExcludedDatasets(scopeDatasets, datasets) {
|
|
41
|
+
return scopeDatasets
|
|
42
|
+
.map((scopeDataset) => {
|
|
43
|
+
const dataset = (0, getDatasetByColumn_1.getDatasetByColumn)({ qrveyid: scopeDataset.qrveyid }, datasets);
|
|
44
|
+
if (!(0, isEmpty_1.isEmpty)(dataset)) {
|
|
45
|
+
return Object.assign(Object.assign({}, scopeDataset), { filters: getExcludedFilters(scopeDataset.filters, dataset) });
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
.filter((dataset) => !(0, isEmpty_1.isEmpty)(dataset) && dataset.filters.length > 0);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param filters
|
|
53
|
+
* @param dataset
|
|
54
|
+
*/
|
|
55
|
+
function getExcludedFilters(filters, dataset) {
|
|
56
|
+
return filters
|
|
57
|
+
.map((filter) => {
|
|
58
|
+
const column = (0, getDatasetColumn_1.getDatasetColumn)(filter.column, dataset);
|
|
59
|
+
if ((0, isEmpty_1.isEmpty)(column)) {
|
|
60
|
+
return Object.assign({}, filter);
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.filter(Boolean);
|
|
64
|
+
}
|
|
@@ -60,3 +60,4 @@ __exportStar(require("./mergeValues"), exports);
|
|
|
60
60
|
__exportStar(require("./resolveDatasetConditions"), exports);
|
|
61
61
|
__exportStar(require("./resolveFilterConditions"), exports);
|
|
62
62
|
__exportStar(require("./resolveScopeConditions"), exports);
|
|
63
|
+
__exportStar(require("./excludeFiltersByDatasetsColumns"), exports);
|
|
@@ -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";
|
|
@@ -49,4 +49,8 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
49
49
|
heatmap_pivot_axis_caption: string;
|
|
50
50
|
global_y_axis_caption: string;
|
|
51
51
|
multiseries_type: string;
|
|
52
|
+
default_format_date_title: string;
|
|
53
|
+
type_custom_format: string;
|
|
54
|
+
type_custom_format_placeholder: string;
|
|
55
|
+
type_custom_format_error: string;
|
|
52
56
|
}
|
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;
|
package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderV2Functions.d.ts
CHANGED
|
@@ -76,11 +76,11 @@ export interface II18nFormulaBuilderV2Functions {
|
|
|
76
76
|
roundup: II18nFormulaBuilderV2FunctionRound;
|
|
77
77
|
millisecond: II18nFormulaBuilderV2FunctionMillisecond;
|
|
78
78
|
text: II18nFormulaBuilderV2FunctionText;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
sum: II18nFormulaBuilderV2FunctionAggregate;
|
|
80
|
+
avg: II18nFormulaBuilderV2FunctionAggregate;
|
|
81
|
+
med: II18nFormulaBuilderV2FunctionAggregate;
|
|
82
|
+
minval: II18nFormulaBuilderV2FunctionAggregate;
|
|
83
|
+
maxval: II18nFormulaBuilderV2FunctionAggregate;
|
|
84
|
+
count: II18nFormulaBuilderV2FunctionAggregate;
|
|
85
|
+
distcount: II18nFormulaBuilderV2FunctionAggregate;
|
|
86
86
|
}
|