@qrvey/utils 1.16.0-3 → 1.16.0-31

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.
Files changed (189) hide show
  1. package/dist/cache-managers/cache-model-manager.js +6 -1
  2. package/dist/charts/adapters/RequestAdapterMetric.d.ts +2 -1
  3. package/dist/charts/adapters/RequestAdapterMetric.js +22 -5
  4. package/dist/charts/adapters/convertChartObjectFromV2toV1.d.ts +2 -0
  5. package/dist/charts/adapters/convertChartObjectFromV2toV1.js +63 -0
  6. package/dist/charts/adapters/getPanelBodyByChart.d.ts +2 -0
  7. package/dist/charts/adapters/getPanelBodyByChart.js +289 -0
  8. package/dist/charts/adapters/index.d.ts +2 -0
  9. package/dist/charts/adapters/index.js +2 -0
  10. package/dist/charts/constants/AGGREGATE.d.ts +3 -1
  11. package/dist/charts/constants/AGGREGATE.js +2 -0
  12. package/dist/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
  13. package/dist/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
  14. package/dist/charts/constants/AGGREGATE_INFO.js +16 -0
  15. package/dist/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
  16. package/dist/charts/constants/AGGREGATE_LABEL.js +2 -0
  17. package/dist/charts/constants/CHART_OBJECT.d.ts +564 -0
  18. package/dist/charts/constants/CHART_OBJECT.js +53 -0
  19. package/dist/charts/constants/QUESTION_TYPES.d.ts +241 -0
  20. package/dist/charts/constants/QUESTION_TYPES.js +410 -0
  21. package/dist/charts/constants/TIME_PERIOD.d.ts +10 -0
  22. package/dist/charts/constants/TIME_PERIOD.js +25 -0
  23. package/dist/charts/constants/index.d.ts +3 -0
  24. package/dist/charts/constants/index.js +3 -0
  25. package/dist/charts/helpers/chartTypes.d.ts +24 -0
  26. package/dist/charts/helpers/chartTypes.js +118 -0
  27. package/dist/charts/helpers/defaultColumnBuilder.d.ts +56 -0
  28. package/dist/charts/helpers/defaultColumnBuilder.js +322 -0
  29. package/dist/charts/helpers/getChartDimensions.d.ts +2 -0
  30. package/dist/charts/helpers/getChartDimensions.js +263 -0
  31. package/dist/charts/helpers/index.d.ts +4 -0
  32. package/dist/charts/helpers/index.js +4 -0
  33. package/dist/charts/helpers/styleSettingsByChartType.d.ts +60 -0
  34. package/dist/charts/helpers/styleSettingsByChartType.js +532 -0
  35. package/dist/charts/interfaces/IChartV2.d.ts +537 -0
  36. package/dist/charts/interfaces/IChartV2.js +33 -0
  37. package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +5 -2
  38. package/dist/charts/interfaces/index.d.ts +1 -0
  39. package/dist/charts/interfaces/index.js +1 -0
  40. package/dist/cjs/cache-managers/cache-model-manager.js +6 -1
  41. package/dist/cjs/charts/adapters/RequestAdapterMetric.d.ts +2 -1
  42. package/dist/cjs/charts/adapters/RequestAdapterMetric.js +24 -6
  43. package/dist/cjs/charts/adapters/convertChartObjectFromV2toV1.d.ts +2 -0
  44. package/dist/cjs/charts/adapters/convertChartObjectFromV2toV1.js +67 -0
  45. package/dist/cjs/charts/adapters/getPanelBodyByChart.d.ts +2 -0
  46. package/dist/cjs/charts/adapters/getPanelBodyByChart.js +294 -0
  47. package/dist/cjs/charts/adapters/index.d.ts +2 -0
  48. package/dist/cjs/charts/adapters/index.js +2 -0
  49. package/dist/cjs/charts/constants/AGGREGATE.d.ts +3 -1
  50. package/dist/cjs/charts/constants/AGGREGATE.js +2 -0
  51. package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
  52. package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
  53. package/dist/cjs/charts/constants/AGGREGATE_INFO.js +16 -0
  54. package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
  55. package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +2 -0
  56. package/dist/cjs/charts/constants/CHART_OBJECT.d.ts +564 -0
  57. package/dist/cjs/charts/constants/CHART_OBJECT.js +56 -0
  58. package/dist/cjs/charts/constants/QUESTION_TYPES.d.ts +241 -0
  59. package/dist/cjs/charts/constants/QUESTION_TYPES.js +413 -0
  60. package/dist/cjs/charts/constants/TIME_PERIOD.d.ts +10 -0
  61. package/dist/cjs/charts/constants/TIME_PERIOD.js +28 -0
  62. package/dist/cjs/charts/constants/index.d.ts +3 -0
  63. package/dist/cjs/charts/constants/index.js +3 -0
  64. package/dist/cjs/charts/helpers/chartTypes.d.ts +24 -0
  65. package/dist/cjs/charts/helpers/chartTypes.js +138 -0
  66. package/dist/cjs/charts/helpers/defaultColumnBuilder.d.ts +56 -0
  67. package/dist/cjs/charts/helpers/defaultColumnBuilder.js +326 -0
  68. package/dist/cjs/charts/helpers/getChartDimensions.d.ts +2 -0
  69. package/dist/cjs/charts/helpers/getChartDimensions.js +267 -0
  70. package/dist/cjs/charts/helpers/index.d.ts +4 -0
  71. package/dist/cjs/charts/helpers/index.js +4 -0
  72. package/dist/cjs/charts/helpers/styleSettingsByChartType.d.ts +60 -0
  73. package/dist/cjs/charts/helpers/styleSettingsByChartType.js +541 -0
  74. package/dist/cjs/charts/interfaces/IChartV2.d.ts +537 -0
  75. package/dist/cjs/charts/interfaces/IChartV2.js +36 -0
  76. package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +5 -2
  77. package/dist/cjs/charts/interfaces/index.d.ts +1 -0
  78. package/dist/cjs/charts/interfaces/index.js +1 -0
  79. package/dist/cjs/column_format/helpers/columnTypeByChart.js +3 -1
  80. package/dist/cjs/columns/interfaces/IColumn.d.ts +1 -0
  81. package/dist/cjs/columns/interfaces/IColunmCalculation.d.ts +5 -0
  82. package/dist/cjs/constants/Charts.Const.d.ts +2 -1
  83. package/dist/cjs/constants/Charts.Const.js +1 -0
  84. package/dist/cjs/elements/helpers/fixed.d.ts +12 -1
  85. package/dist/cjs/elements/helpers/fixed.js +33 -8
  86. package/dist/cjs/elements/helpers/gridStrategy.d.ts +13 -0
  87. package/dist/cjs/elements/helpers/gridStrategy.js +31 -3
  88. package/dist/cjs/elements/helpers/index.d.ts +1 -1
  89. package/dist/cjs/elements/helpers/index.js +2 -1
  90. package/dist/cjs/elements/helpers/responsive.d.ts +11 -1
  91. package/dist/cjs/elements/helpers/responsive.js +31 -1
  92. package/dist/cjs/elements/utils/fixed.position.d.ts +1 -0
  93. package/dist/cjs/elements/utils/fixed.position.js +8 -1
  94. package/dist/cjs/filters/constants/common/FILTER_SCOPE.d.ts +1 -0
  95. package/dist/cjs/filters/constants/common/FILTER_SCOPE.js +1 -0
  96. package/dist/cjs/filters/constants/common/FILTER_SCOPES.js +1 -0
  97. package/dist/cjs/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
  98. package/dist/cjs/filters/constants/common/FILTER_SCOPE_LABEL.d.ts +1 -0
  99. package/dist/cjs/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
  100. package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +29 -6
  101. package/dist/cjs/filters/helpers/common/excludeFiltersByDatasetsColumns.d.ts +10 -0
  102. package/dist/cjs/filters/helpers/common/excludeFiltersByDatasetsColumns.js +64 -0
  103. package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
  104. package/dist/cjs/filters/helpers/common/index.js +1 -0
  105. package/dist/cjs/format/duration/durationFormatter.js +18 -9
  106. package/dist/cjs/formulas/constants/FORMULA.d.ts +1 -0
  107. package/dist/cjs/formulas/constants/FORMULA.js +2 -1
  108. package/dist/cjs/general/string/strategies/XSSEstrictedSanitizer.js +6 -1
  109. package/dist/cjs/general/string/strategies/XSSSanitizer.js +1 -1
  110. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderGeneralOptions.d.ts +4 -0
  111. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderMessagesDefault.d.ts +1 -0
  112. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderMessagesGeneral.d.ts +1 -0
  113. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
  114. package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
  115. package/dist/cjs/globalization/interfaces/export/II18nExportingModal.d.ts +2 -0
  116. package/dist/cjs/globalization/interfaces/filters/II18nFilterPanel.d.ts +2 -0
  117. package/dist/cjs/globalization/interfaces/filters/II18nFilterPanelScopeTitle.d.ts +1 -0
  118. package/dist/cjs/globalization/interfaces/filters/II18nFilterScopes.d.ts +1 -0
  119. package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +2 -0
  120. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +2 -0
  121. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +4 -0
  122. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
  123. package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
  124. package/dist/cjs/globalization/labels/export/I18N_EXPORT_MODAL.d.ts +1 -1
  125. package/dist/cjs/globalization/labels/export/I18N_EXPORT_MODAL.js +76 -43
  126. package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +1 -0
  127. package/dist/cjs/globalization/labels/filters/I18N_FILTER_PANEL.js +2 -0
  128. package/dist/cjs/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
  129. package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +2 -0
  130. package/dist/cjs/themes/helpers/index.d.ts +1 -0
  131. package/dist/cjs/themes/helpers/index.js +1 -0
  132. package/dist/cjs/themes/helpers/loadDefaultQrveyFonts.d.ts +11 -0
  133. package/dist/cjs/themes/helpers/loadDefaultQrveyFonts.js +32 -0
  134. package/dist/column_format/helpers/columnTypeByChart.js +4 -2
  135. package/dist/columns/interfaces/IColumn.d.ts +1 -0
  136. package/dist/columns/interfaces/IColunmCalculation.d.ts +5 -0
  137. package/dist/constants/Charts.Const.d.ts +2 -1
  138. package/dist/constants/Charts.Const.js +1 -0
  139. package/dist/elements/helpers/fixed.d.ts +12 -1
  140. package/dist/elements/helpers/fixed.js +30 -6
  141. package/dist/elements/helpers/gridStrategy.d.ts +13 -0
  142. package/dist/elements/helpers/gridStrategy.js +31 -4
  143. package/dist/elements/helpers/index.d.ts +1 -1
  144. package/dist/elements/helpers/index.js +1 -1
  145. package/dist/elements/helpers/responsive.d.ts +11 -1
  146. package/dist/elements/helpers/responsive.js +29 -0
  147. package/dist/elements/utils/fixed.position.d.ts +1 -0
  148. package/dist/elements/utils/fixed.position.js +6 -0
  149. package/dist/filters/constants/common/FILTER_SCOPE.d.ts +1 -0
  150. package/dist/filters/constants/common/FILTER_SCOPE.js +1 -0
  151. package/dist/filters/constants/common/FILTER_SCOPES.js +1 -0
  152. package/dist/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
  153. package/dist/filters/constants/common/FILTER_SCOPE_LABEL.d.ts +1 -0
  154. package/dist/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
  155. package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +29 -6
  156. package/dist/filters/helpers/common/excludeFiltersByDatasetsColumns.d.ts +10 -0
  157. package/dist/filters/helpers/common/excludeFiltersByDatasetsColumns.js +60 -0
  158. package/dist/filters/helpers/common/index.d.ts +1 -0
  159. package/dist/filters/helpers/common/index.js +1 -0
  160. package/dist/format/duration/durationFormatter.js +18 -9
  161. package/dist/formulas/constants/FORMULA.d.ts +1 -0
  162. package/dist/formulas/constants/FORMULA.js +1 -0
  163. package/dist/general/string/strategies/XSSEstrictedSanitizer.js +6 -1
  164. package/dist/general/string/strategies/XSSSanitizer.js +1 -1
  165. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderGeneralOptions.d.ts +4 -0
  166. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderMessagesDefault.d.ts +1 -0
  167. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderMessagesGeneral.d.ts +1 -0
  168. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
  169. package/dist/globalization/interfaces/dashboard/II18nDashboardAddChart.d.ts +1 -0
  170. package/dist/globalization/interfaces/export/II18nExportingModal.d.ts +2 -0
  171. package/dist/globalization/interfaces/filters/II18nFilterPanel.d.ts +2 -0
  172. package/dist/globalization/interfaces/filters/II18nFilterPanelScopeTitle.d.ts +1 -0
  173. package/dist/globalization/interfaces/filters/II18nFilterScopes.d.ts +1 -0
  174. package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderCreateModal.d.ts +2 -0
  175. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +2 -0
  176. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.js +4 -0
  177. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
  178. package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
  179. package/dist/globalization/labels/export/I18N_EXPORT_MODAL.d.ts +1 -1
  180. package/dist/globalization/labels/export/I18N_EXPORT_MODAL.js +76 -43
  181. package/dist/globalization/labels/filters/I18N_FILTER.js +1 -0
  182. package/dist/globalization/labels/filters/I18N_FILTER_PANEL.js +2 -0
  183. package/dist/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
  184. package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +2 -0
  185. package/dist/themes/helpers/index.d.ts +1 -0
  186. package/dist/themes/helpers/index.js +1 -0
  187. package/dist/themes/helpers/loadDefaultQrveyFonts.d.ts +11 -0
  188. package/dist/themes/helpers/loadDefaultQrveyFonts.js +28 -0
  189. package/package.json +3 -3
@@ -1,7 +1,15 @@
1
- import { findFixedAvailablePositions, getFixedGridElementsBottomLimit, recalculatePreservingPositions, sortElementsFromReferencePoint, } from "./fixed";
2
- import { findResponsiveAvailablePositions, getResponsiveGridElementsBottomLimit, sortResponsiveElements, } from "./responsive";
1
+ import { findFixedAvailablePositions, getFixedGridElementsBottomLimit, recalculatePreservingPositions, sortElementsFromReferencePoint, updateFixedElementDimensions, } from "./fixed";
2
+ import { findResponsiveAvailablePositions, getResponsiveGridElementsBottomLimit, sortResponsiveElements, updateResponsiveElementDimensions, } from "./responsive";
3
3
  import { CanvasDevice, VemPositionType, } from "../interfaces";
4
4
  import { copyDesktopPositionToDevice } from "../utils/element";
5
+ const applyDynamicSizeStrategies = {
6
+ fixed: (containerItem, scopeElements, device) => {
7
+ return updateFixedElementDimensions(containerItem, device, scopeElements);
8
+ },
9
+ responsive: (containerItem, scopeElements, device, gap) => {
10
+ return updateResponsiveElementDimensions(containerItem, device, scopeElements, gap);
11
+ },
12
+ };
5
13
  const recalculateStrategies = {
6
14
  fixed: (elements, currentElements, canvasWidth, device, options) => {
7
15
  const isSorted = !currentElements.length;
@@ -15,8 +23,8 @@ const recalculateStrategies = {
15
23
  y: 0,
16
24
  })
17
25
  : changedElements;
18
- return options.canvasHeight
19
- ? recalculatePreservingPositions(orderedElements, device, canvasWidth, options.canvasHeight)
26
+ return options.keepPosition
27
+ ? recalculatePreservingPositions(orderedElements, currentElements, device, canvasWidth, options.canvasHeight)
20
28
  : findFixedAvailablePositions(canvasWidth, orderedElements, currentElements, device, false, false, options === null || options === void 0 ? void 0 : options.canvasHeight);
21
29
  },
22
30
  responsive: (elements, currentElements, canvasWidth, device, options) => {
@@ -61,6 +69,25 @@ export function recalculateElements(newElements, currentElements, canvasWidth, c
61
69
  const calculatedOptions = Object.assign(Object.assign({}, defaultOptions), options);
62
70
  return strategy(newElements, currentElements, canvasWidth, device, calculatedOptions);
63
71
  }
72
+ /**
73
+ * Updates the dimensions of a container element using a strategy based on the given canvas type.
74
+ *
75
+ * Delegates the update logic to a specific strategy found in `updateDimensionStrategies`
76
+ * using the provided `canvasType` key.
77
+ * @param containerItem The element whose dimensions need to be updated
78
+ * @param scopeElements A list of elements to consider in the update strategy
79
+ * @param device The device context (e.g., desktop, tablet, mobile) used to retrieve device-specific properties
80
+ * @param canvasType The type of canvas that determines which strategy to use.
81
+ * @param gap 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
+ export function applyDynamicSize(containerItem, scopeElements, device, canvasType, gap = 0) {
85
+ const strategy = applyDynamicSizeStrategies[canvasType];
86
+ if (!strategy) {
87
+ return;
88
+ }
89
+ return strategy(containerItem, scopeElements, device, gap);
90
+ }
64
91
  /**
65
92
  * The calculation is delegated to a specific strategy based on the `canvasType`.
66
93
  * @param elements - The list of elements in the canvas.
@@ -1,3 +1,3 @@
1
1
  export * from "./gridStrategy";
2
- export { updateFixedElementWidth } from "./fixed";
2
+ export { updateFixedElementWidth, findFixedAvailablePositions } from "./fixed";
3
3
  export { updateResponsiveElementColSpan } from "./responsive";
@@ -1,3 +1,3 @@
1
1
  export * from "./gridStrategy";
2
- export { updateFixedElementWidth } from "./fixed";
2
+ export { updateFixedElementWidth, findFixedAvailablePositions } from "./fixed";
3
3
  export { updateResponsiveElementColSpan } from "./responsive";
@@ -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,9 +1,12 @@
1
+ import { objectCopy } from "../../general";
1
2
  import { CanvasDevice } from "../interfaces/ICanvasGrid";
2
3
  import { VemPositionType, } from "../interfaces/IVemPosition";
4
+ import { dxGetFixedGridItemsBottomLimit } from "../utils/fixed.position";
3
5
  import { OverlapIntervalTree } from "../utils/overlap";
4
6
  import { setElementPosition } from "../utils/position";
5
7
  const SPACE_DELTA = 1;
6
8
  const HEIGHT_DELTA = 32;
9
+ const CANVAS_EXTRA_ROW = 1;
7
10
  /**
8
11
  * Finds the first available position for a new responsive element within a canvas.
9
12
  * @param canvasWidth - The width of the canvas in terms of columns.
@@ -153,3 +156,29 @@ export const sortResponsiveElements = (elements, sortByDevice) => {
153
156
  }).sort((a, b) => sortByDistanceInResponsiveFunction(a, b, sortByDevice));
154
157
  return sortedElements.map((element) => element.element);
155
158
  };
159
+ /**
160
+ * Updates the height (`rowSpan`) of a fixed container element based on the positions.
161
+ * of the fixed elements it contains, ensuring it is tall enough to encompass all child elements.
162
+ * @param containerItem - The container element whose height needs to be updated.
163
+ * @param device - The target device (used to retrieve responsive dimensions).
164
+ * @param scopeElements - The list of fixed elements that are scoped to the container.
165
+ * @param rowGapSize - row gap
166
+ * @returns A new container element with the updated responsive `rowSpan` height for the given device.
167
+ */
168
+ export const updateResponsiveElementDimensions = (containerItem, device, scopeElements, rowGapSize) => {
169
+ let currentElement = objectCopy(containerItem);
170
+ const currentHeight = currentElement.position.responsive[device].rowSpan;
171
+ const delta = HEIGHT_DELTA + rowGapSize;
172
+ // height in px
173
+ const calculatedHeight = dxGetFixedGridItemsBottomLimit(scopeElements, device);
174
+ // convert to rows
175
+ const transformToRows = Math.round(calculatedHeight / delta);
176
+ const baseRowSpan = Math.max(currentHeight, transformToRows);
177
+ const newRowSpan = baseRowSpan > currentHeight
178
+ ? baseRowSpan + CANVAS_EXTRA_ROW
179
+ : currentHeight;
180
+ currentElement = updateResponsivePosition(currentElement, {
181
+ rowSpan: newRowSpan,
182
+ }, device);
183
+ return Object.assign({}, currentElement);
184
+ };
@@ -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
+ };
@@ -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
@@ -5,6 +5,7 @@ export var FILTER_SCOPE;
5
5
  FILTER_SCOPE["GLOBAL"] = "GLOBAL";
6
6
  FILTER_SCOPE["PAGE"] = "PAGE";
7
7
  FILTER_SCOPE["TAB"] = "TAB";
8
+ FILTER_SCOPE["CONTAINER"] = "CONTAINER";
8
9
  FILTER_SCOPE["DEFAULT"] = "DEFAULT";
9
10
  FILTER_SCOPE["CHART"] = "CHART";
10
11
  FILTER_SCOPE["ACTION"] = "ACTION";
@@ -5,6 +5,7 @@ export const FILTER_SCOPES = [
5
5
  FILTER_SCOPE.GLOBAL,
6
6
  FILTER_SCOPE.PAGE,
7
7
  FILTER_SCOPE.TAB,
8
+ FILTER_SCOPE.CONTAINER,
8
9
  FILTER_SCOPE.DEFAULT,
9
10
  FILTER_SCOPE.CHART,
10
11
  FILTER_SCOPE.ACTION,
@@ -41,6 +41,14 @@ export const FILTER_SCOPE_INFO = [
41
41
  displayed: true,
42
42
  i18nLabelPath: "filter.scopes.tab",
43
43
  },
44
+ {
45
+ label: FILTER_SCOPE_LABEL.CONTAINER,
46
+ shortLabel: "Container",
47
+ abbrLabel: "CONT",
48
+ value: FILTER_SCOPE.CONTAINER,
49
+ displayed: true,
50
+ i18nLabelPath: "filter.scopes.container",
51
+ },
44
52
  {
45
53
  label: FILTER_SCOPE_LABEL.DEFAULT,
46
54
  shortLabel: "Default",
@@ -4,6 +4,7 @@ export declare enum FILTER_SCOPE_LABEL {
4
4
  GLOBAL = "Global",
5
5
  PAGE = "Dashboard",
6
6
  TAB = "Tab",
7
+ CONTAINER = "Container",
7
8
  DEFAULT = "Default",
8
9
  CHART = "Panel",
9
10
  ACTION = "Action",
@@ -5,6 +5,7 @@ export var FILTER_SCOPE_LABEL;
5
5
  FILTER_SCOPE_LABEL["GLOBAL"] = "Global";
6
6
  FILTER_SCOPE_LABEL["PAGE"] = "Dashboard";
7
7
  FILTER_SCOPE_LABEL["TAB"] = "Tab";
8
+ FILTER_SCOPE_LABEL["CONTAINER"] = "Container";
8
9
  FILTER_SCOPE_LABEL["DEFAULT"] = "Default";
9
10
  FILTER_SCOPE_LABEL["CHART"] = "Panel";
10
11
  FILTER_SCOPE_LABEL["ACTION"] = "Action";
@@ -127,7 +127,7 @@ export const FILTER_SETTINGS_DEFAULT = {
127
127
  colorPickerDisplayed: true,
128
128
  displayed: true,
129
129
  enabled: true,
130
- icon: "fp-global",
130
+ icon: "q-icon-fp-global",
131
131
  iconsDisplayed: true,
132
132
  interaction: {
133
133
  createDisplayed: true,
@@ -150,7 +150,7 @@ export const FILTER_SETTINGS_DEFAULT = {
150
150
  colorPickerDisplayed: true,
151
151
  displayed: true,
152
152
  enabled: true,
153
- icon: "fp-page",
153
+ icon: "q-icon-fp-page",
154
154
  iconsDisplayed: true,
155
155
  interaction: {
156
156
  createDisplayed: true,
@@ -173,7 +173,30 @@ export const FILTER_SETTINGS_DEFAULT = {
173
173
  colorPickerDisplayed: true,
174
174
  displayed: true,
175
175
  enabled: true,
176
- icon: "fp-tab",
176
+ icon: "q-icon-fp-tab",
177
+ iconsDisplayed: true,
178
+ interaction: {
179
+ createDisplayed: true,
180
+ createEnabled: true,
181
+ deleteDisplayed: true,
182
+ deleteEnabled: true,
183
+ editDisplayed: true,
184
+ editEnabled: true,
185
+ enableDisplayed: true,
186
+ enableEnabled: true,
187
+ },
188
+ label: undefined,
189
+ readonly: false,
190
+ },
191
+ [FILTER_SCOPE.CONTAINER]: {
192
+ canCollapse: true,
193
+ collapsed: false,
194
+ color: "#F472F2",
195
+ colorized: true,
196
+ colorPickerDisplayed: true,
197
+ displayed: true,
198
+ enabled: true,
199
+ icon: "new-q-icon-an-rectangle",
177
200
  iconsDisplayed: true,
178
201
  interaction: {
179
202
  createDisplayed: true,
@@ -196,7 +219,7 @@ export const FILTER_SETTINGS_DEFAULT = {
196
219
  colorPickerDisplayed: true,
197
220
  displayed: true,
198
221
  enabled: true,
199
- icon: "fp-chart",
222
+ icon: "q-icon-fp-chart",
200
223
  iconsDisplayed: true,
201
224
  interaction: {
202
225
  createDisplayed: true,
@@ -219,7 +242,7 @@ export const FILTER_SETTINGS_DEFAULT = {
219
242
  colorPickerDisplayed: true,
220
243
  displayed: true,
221
244
  enabled: true,
222
- icon: "fp-global",
245
+ icon: "q-icon-fp-global",
223
246
  iconsDisplayed: true,
224
247
  interaction: {
225
248
  createDisplayed: true,
@@ -242,7 +265,7 @@ export const FILTER_SETTINGS_DEFAULT = {
242
265
  colorPickerDisplayed: true,
243
266
  displayed: true,
244
267
  enabled: true,
245
- icon: "ico_workflows",
268
+ icon: "q-icon-ico_workflows",
246
269
  iconsDisplayed: true,
247
270
  interaction: {
248
271
  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,60 @@
1
+ import { getDatasetColumn } from "../../../columns/helpers/getDatasetColumn";
2
+ import { isEmpty } from "../../../general/mix/isEmpty";
3
+ import { getDatasetByColumn } from "../../../qrvey/helpers/getDatasetByColumn";
4
+ /**
5
+ * Filtering the filters by the columns of datasets.
6
+ * Module specially for CLS.
7
+ * @param data the filter data
8
+ * @param datasets the collection of datasets and their columns
9
+ * @returns A new filter data with the filtered filters by columns
10
+ */
11
+ export function excludeFiltersByDatasetsColumns(data, datasets = []) {
12
+ if (isEmpty(data) || isEmpty(data.scopes))
13
+ return;
14
+ if (isEmpty(datasets))
15
+ return data;
16
+ const newData = Object.assign(Object.assign({}, data), { scopes: getExcludedScopes(data.scopes, datasets) });
17
+ if (!isEmpty(newData) && newData.scopes.length > 0) {
18
+ return newData;
19
+ }
20
+ }
21
+ /**
22
+ *
23
+ * @param scopes
24
+ * @param datasets
25
+ */
26
+ function getExcludedScopes(scopes, datasets = []) {
27
+ return scopes
28
+ .map((scope) => (Object.assign(Object.assign({}, scope), { datasets: getExcludedDatasets(scope.datasets, datasets) })))
29
+ .filter((scope) => !isEmpty(scope) && scope.datasets.length > 0);
30
+ }
31
+ /**
32
+ *
33
+ * @param scopeDatasets
34
+ * @param datasets
35
+ */
36
+ function getExcludedDatasets(scopeDatasets, datasets) {
37
+ return scopeDatasets
38
+ .map((scopeDataset) => {
39
+ const dataset = getDatasetByColumn({ qrveyid: scopeDataset.qrveyid }, datasets);
40
+ if (!isEmpty(dataset)) {
41
+ return Object.assign(Object.assign({}, scopeDataset), { filters: getExcludedFilters(scopeDataset.filters, dataset) });
42
+ }
43
+ })
44
+ .filter((dataset) => !isEmpty(dataset) && dataset.filters.length > 0);
45
+ }
46
+ /**
47
+ *
48
+ * @param filters
49
+ * @param dataset
50
+ */
51
+ function getExcludedFilters(filters, dataset) {
52
+ return filters
53
+ .map((filter) => {
54
+ const column = getDatasetColumn(filter.column, dataset);
55
+ if (isEmpty(column)) {
56
+ return Object.assign({}, filter);
57
+ }
58
+ })
59
+ .filter(Boolean);
60
+ }
@@ -44,3 +44,4 @@ export * from "./mergeValues";
44
44
  export * from "./resolveDatasetConditions";
45
45
  export * from "./resolveFilterConditions";
46
46
  export * from "./resolveScopeConditions";
47
+ export * from "./excludeFiltersByDatasetsColumns";
@@ -44,3 +44,4 @@ export * from "./mergeValues";
44
44
  export * from "./resolveDatasetConditions";
45
45
  export * from "./resolveFilterConditions";
46
46
  export * from "./resolveScopeConditions";
47
+ export * from "./excludeFiltersByDatasetsColumns";
@@ -125,16 +125,20 @@ export class DurationFormatter {
125
125
  return undefined;
126
126
  if (isEmpty(number))
127
127
  return "";
128
- let _number = number;
129
- _number *= this.numberFactor;
130
- const durationParts = this.parts.reduce((store, part) => {
131
- store[part.symbol] = Math.floor(_number / part.ms);
132
- _number %= part.ms;
133
- return store;
128
+ const adjustedNumber = number * this.numberFactor;
129
+ const isNegative = adjustedNumber < 0;
130
+ let remaining = Math.abs(adjustedNumber);
131
+ const durationParts = this.parts.reduce((result, part, index) => {
132
+ const units = Math.floor(remaining / part.ms);
133
+ const value = index === 0 && isNegative ? -units : units;
134
+ result[part.symbol] =
135
+ value === 0 && index === 0 && isNegative ? -0 : value;
136
+ remaining %= part.ms;
137
+ return result;
134
138
  }, {});
135
139
  if (isEmpty(this.template))
136
140
  return this.valueFormatter
137
- .format(_number)
141
+ .format(remaining)
138
142
  .padStart(this.parts.length, "0");
139
143
  return this.template.replace(PARTS_REGEX, (match, $1) => {
140
144
  return $1 || this.formatValue(durationParts, match);
@@ -148,7 +152,12 @@ export class DurationFormatter {
148
152
  * @returns The value of the part of the date that is being formatted.
149
153
  */
150
154
  formatValue(parts, part) {
151
- const value = parts[part[0]];
152
- return this.valueFormatter.format(value).padStart(part.length, "0");
155
+ var _a;
156
+ const value = (_a = parts[part[0]]) !== null && _a !== void 0 ? _a : 0;
157
+ const formatted = this.valueFormatter.format(value);
158
+ const isNegative = formatted.startsWith("-");
159
+ const numericPart = isNegative ? formatted.slice(1) : formatted;
160
+ const padded = numericPart.padStart(part.length, "0");
161
+ return isNegative ? `-${padded}` : padded;
153
162
  }
154
163
  }
@@ -9,3 +9,4 @@ export declare enum FORMULA {
9
9
  export declare const COLUMN_BY_FORMULA: {
10
10
  [key in IFormulaType]: IColumnType;
11
11
  };
12
+ export declare const AGGREGATE_FORMULA = "AGGREGATE";
@@ -12,3 +12,4 @@ export const COLUMN_BY_FORMULA = {
12
12
  [FORMULA.TEXT]: COLUMN.TEXT_FORMULA,
13
13
  [FORMULA.BOOLEAN]: COLUMN.TEXT_FORMULA,
14
14
  };
15
+ export const AGGREGATE_FORMULA = "AGGREGATE";
@@ -1,6 +1,11 @@
1
1
  import { filterXSS } from "xss";
2
2
  export class XSSEstrictedSanitizer {
3
- constructor(options, attributesBlackList = []) {
3
+ constructor(options, attributesBlackList = [
4
+ "onclick",
5
+ "onerror",
6
+ "onmouseover",
7
+ "onload",
8
+ ]) {
4
9
  this.attributesBlackList = attributesBlackList;
5
10
  this.options = Object.assign({ css: false, onIgnoreTagAttr: (_tag, name, value) => {
6
11
  if (this.attributesBlackList.includes(name)) {
@@ -10,6 +10,6 @@ export class XSSSanitizer {
10
10
  } }, options);
11
11
  }
12
12
  sanitize(html) {
13
- return filterXSS(html, this.options);
13
+ return filterXSS(String(html), this.options);
14
14
  }
15
15
  }
@@ -22,4 +22,8 @@ export interface II18nChartBuilderGeneralOptions {
22
22
  view_sorting: string;
23
23
  view_subtotals: string;
24
24
  view_total: string;
25
+ expanded_by_default: string;
26
+ expanded_by_default_disabled: string;
27
+ freeze_headers: string;
28
+ freeze_rows: string;
25
29
  }
@@ -5,4 +5,5 @@ export interface II18nChartBuilderMessagesDefault {
5
5
  max_panels_increment: string;
6
6
  median_aggregation_results: string;
7
7
  max_limit: string;
8
+ expanded_by_default: string;
8
9
  }
@@ -1,3 +1,4 @@
1
1
  export interface II18nChartBuilderMessagesGeneral {
2
2
  chart_saved: string;
3
+ chart_saved_ai: string;
3
4
  }
@@ -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
  }
@@ -3,4 +3,5 @@ export interface II18nDashboardAddChart {
3
3
  chart: string;
4
4
  metric: string;
5
5
  summary: string;
6
+ add_ai: string;
6
7
  }
@@ -41,6 +41,8 @@ export interface I18nExportingModal {
41
41
  columns_to_export_label: string;
42
42
  columns_to_create_dataset_label: string;
43
43
  no_results_found: string;
44
+ reached_max_pivots_select_all: string;
45
+ reached_max_pivots: string;
44
46
  };
45
47
  schedule: {
46
48
  chart_download_ready: string;
@@ -18,4 +18,6 @@ export interface II18nFilterPanel {
18
18
  header_section: II18nFilterPanelHeaderSection;
19
19
  scope_tooltip: II18nFilterPanelScopeTooltip;
20
20
  settings_section: II18nFilterPanelSettingsSection;
21
+ missing_column: string;
22
+ missing_columns: string;
21
23
  }
@@ -4,6 +4,7 @@ export interface II18nFilterPanelScopeTitle {
4
4
  global: string;
5
5
  page: string;
6
6
  tab: string;
7
+ container: string;
7
8
  chart: string;
8
9
  default: string;
9
10
  action: string;
@@ -4,6 +4,7 @@ export interface II18nFilterScopes {
4
4
  global: string;
5
5
  page: string;
6
6
  tab: string;
7
+ container: string;
7
8
  default: string;
8
9
  chart: string;
9
10
  action: string;
@@ -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;
@@ -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.",
@@ -199,6 +200,7 @@ export const I18N_CHART_BUILDER_GENERAL = {
199
200
  max_panels_increment: "Increasing the amount of panels to display above {{max_data_point_values_panels}} can affect chart performance.",
200
201
  median_aggregation_results: "The numbers are not actual, they are for preview purposes only.",
201
202
  max_limit: "Only 10,000 max data points are supported.",
203
+ expanded_by_default: "The maximum supported limit for this feature (Expanded by default) is 500 rows and 50 columns.",
202
204
  },
203
205
  messages_crosstab: {
204
206
  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 Records</i> and <i>Max Columns</i> to display.",
@@ -26,6 +26,10 @@ export const I18N_CHART_BUILDER_GENERAL_OPTIONS = {
26
26
  view_sorting: "Sorting",
27
27
  view_subtotals: "Subtotals",
28
28
  view_total: "Totals",
29
+ expanded_by_default: "Expanded by default",
30
+ expanded_by_default_disabled: "This option is disabled. To enable it, limit the layout to a maximum of 2 rows and 2 columns.",
31
+ freeze_headers: "Freeze the column headers",
32
+ freeze_rows: "Freeze the row headers",
29
33
  },
30
34
  tooltip_settings: {
31
35
  name: "Tooltips",
@@ -53,6 +53,10 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
53
53
  heatmap_pivot_axis_caption: "pivot",
54
54
  global_y_axis_caption: "global",
55
55
  multiseries_type: "Multiseries Type",
56
+ default_format_date_title: "Date Format",
57
+ type_custom_format: "Custom Format",
58
+ type_custom_format_placeholder: "Type custom format",
59
+ type_custom_format_error: "Invalid format",
56
60
  },
57
61
  color_settings: {
58
62
  color_by_category: "By category",
@@ -7,6 +7,7 @@ export const I18N_DASHBOARD = {
7
7
  chart: "Chart",
8
8
  metric: "Metric",
9
9
  summary: "Summary",
10
+ add_ai: "Create Chart with AI",
10
11
  },
11
12
  empty_state: {
12
13
  about_charts: "about charts",
@@ -2,4 +2,4 @@ import { I18nExportingModal } from "../../interfaces/export";
2
2
  /**
3
3
  * @deprecated since version 1.12.0; Qrvey version 8.3. Those default poroperties will be replaced by Qrvey Globalization JSON
4
4
  */
5
- export declare const EXPORTING_MODAL: I18nExportingModal;
5
+ export declare const EXPORTING_MODAL: I18nExportingModal | any;