@qrvey/utils 1.17.0-2 → 1.17.0-4

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 (54) hide show
  1. package/README.md +28 -9849
  2. package/dist/charts/adapters/endpointData.d.ts +13 -2
  3. package/dist/charts/adapters/endpointData.js +1 -2
  4. package/dist/charts/adapters/endpointDataGet.d.ts +1 -1
  5. package/dist/charts/adapters/endpointDataGet.js +2 -2
  6. package/dist/charts/helpers/getChartDimensions.js +2 -2
  7. package/dist/cjs/charts/adapters/endpointData.js +1 -2
  8. package/dist/cjs/charts/adapters/endpointDataGet.js +2 -2
  9. package/dist/cjs/charts/helpers/getChartDimensions.js +2 -2
  10. package/dist/cjs/column_format/helpers/defineXYChartFormat.js +1 -1
  11. package/dist/cjs/dates/relative/helpers/formatStatement.js +1 -1
  12. package/dist/cjs/filters/adapters/flatUIToOldLogic.js +1 -2
  13. package/dist/cjs/filters/constants/common/FILTER_SCOPE.js +1 -0
  14. package/dist/cjs/filters/constants/common/FILTER_SCOPES.js +1 -0
  15. package/dist/cjs/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
  16. package/dist/cjs/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
  17. package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +24 -0
  18. package/dist/cjs/filters/helpers/common/getVerboseFilterValues.js +1 -1
  19. package/dist/cjs/filters/helpers/common/mergeValues.js +1 -1
  20. package/dist/cjs/filters/services/Filters.api.js +1 -0
  21. package/dist/cjs/format/definition.js +1 -1
  22. package/dist/cjs/format/localization.js +2 -1
  23. package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +1 -0
  24. package/dist/cjs/globalization/labels/filters/I18N_FILTER_PANEL.js +1 -0
  25. package/dist/cjs/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
  26. package/dist/cjs/qrvey/helpers/getImageUploadHasAnalysis.js +1 -6
  27. package/dist/cjs/themes/helpers/lightOrDark.js +1 -1
  28. package/dist/column_format/helpers/defineXYChartFormat.js +2 -2
  29. package/dist/dates/relative/helpers/formatStatement.js +1 -1
  30. package/dist/filters/adapters/flatUIToOldLogic.js +1 -2
  31. package/dist/filters/constants/common/FILTER_SCOPE.d.ts +1 -0
  32. package/dist/filters/constants/common/FILTER_SCOPE.js +1 -0
  33. package/dist/filters/constants/common/FILTER_SCOPES.js +1 -0
  34. package/dist/filters/constants/common/FILTER_SCOPE_INFO.js +8 -0
  35. package/dist/filters/constants/common/FILTER_SCOPE_LABEL.d.ts +1 -0
  36. package/dist/filters/constants/common/FILTER_SCOPE_LABEL.js +1 -0
  37. package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +24 -0
  38. package/dist/filters/helpers/common/getVerboseFilterValues.js +1 -1
  39. package/dist/filters/helpers/common/mergeValues.js +1 -1
  40. package/dist/filters/interfaces/settings/IFSettingsScope.d.ts +1 -0
  41. package/dist/filters/services/Filters.api.js +1 -0
  42. package/dist/format/definition.d.ts +1 -1
  43. package/dist/format/definition.js +1 -1
  44. package/dist/format/localization.js +3 -2
  45. package/dist/general/object/mapValues.d.ts +1 -1
  46. package/dist/globalization/interfaces/filters/II18nFilterPanelScopeTitle.d.ts +1 -0
  47. package/dist/globalization/interfaces/filters/II18nFilterPanelScopeTooltip.d.ts +1 -0
  48. package/dist/globalization/interfaces/filters/II18nFilterScopes.d.ts +1 -0
  49. package/dist/globalization/labels/filters/I18N_FILTER.js +1 -0
  50. package/dist/globalization/labels/filters/I18N_FILTER_PANEL.js +1 -0
  51. package/dist/globalization/labels/filters/I18N_FILTER_SCOPE.js +1 -0
  52. package/dist/qrvey/helpers/getImageUploadHasAnalysis.js +1 -6
  53. package/dist/themes/helpers/lightOrDark.js +1 -1
  54. package/package.json +32 -22
@@ -46,7 +46,18 @@ export declare function configSetup(config?: any): {
46
46
  panel: {
47
47
  header: {
48
48
  menu: any;
49
- filter: any;
49
+ filter: {
50
+ button: {
51
+ display: any;
52
+ disable: any;
53
+ };
54
+ card: {
55
+ display: any;
56
+ addFilter: any;
57
+ editFilter: any;
58
+ removeFilter: any;
59
+ };
60
+ };
50
61
  draggable: any;
51
62
  title_prefix: any;
52
63
  fit_panel: any;
@@ -86,5 +97,5 @@ export declare function configSetup(config?: any): {
86
97
  export declare function configMetricData(metricObj?: any): any;
87
98
  export declare function configChartData(chartData: any, model: any, setup?: any): {
88
99
  charts: any;
89
- logic: import("../../filters").IFBLogic[];
100
+ logic: import("../..").IFBLogic[];
90
101
  };
@@ -196,8 +196,7 @@ export function configSetup(config) {
196
196
  const body = getAttribute(cfg.panel, "body") || {};
197
197
  const header = getAttribute(cfg.panel, "header") || {};
198
198
  const footer = getAttribute(cfg.panel, "footer") || {};
199
- let filterSettings = header.filter;
200
- filterSettings = {
199
+ const filterSettings = {
201
200
  button: {
202
201
  display: _get(header.filter, "button.display", _get(header, "filter", false)),
203
202
  disable: _get(header.filter, "button.disable", false),
@@ -10,5 +10,5 @@ export declare function getRefenceBody(layer: any): any;
10
10
  export declare function getTrendBody(layer: any): any;
11
11
  export declare function getRefenceBodyU(layer: any, body: any): any;
12
12
  export declare function getLayerBody(layer: any, dateGroup: any, qrveyid: any): any;
13
- export declare function setDateGroup(column: any, body: any, obj: any): void;
13
+ export declare function setDateGroup(column: any, body: any, obj: any, defaultMaxDataPoints?: number): void;
14
14
  export declare function getSummariesBody(layer: any, body: any): any;
@@ -368,12 +368,12 @@ function getSortOrder(sorting = {}, category = {}, body = {}) {
368
368
  },
369
369
  ];
370
370
  }
371
- export function setDateGroup(column, body, obj) {
371
+ export function setDateGroup(column, body, obj, defaultMaxDataPoints = 61) {
372
372
  if (isColumnDate(column) && !isEmpty(_get(body, "dateGroup.label"))) {
373
373
  obj["groupType"] = COLUMN.DATE;
374
374
  obj["groupValue"] = body.dateGroup.label;
375
375
  if (_get(body, "dateGroup.datePart", false)) {
376
- obj["maxDataPoints"] = obj["maxDataPoints"] || 60;
376
+ obj["maxDataPoints"] = obj["maxDataPoints"] || defaultMaxDataPoints;
377
377
  }
378
378
  }
379
379
  }
@@ -70,7 +70,7 @@ const parsePropertyComplexData = (column) => {
70
70
  const parseLayer = (category, value, index, chart) => {
71
71
  const isCombinedMainLayer = chart.type === CHART_TYPE.COMBINED_CHART && index === 0;
72
72
  const isCombinedOtherLayer = chart.type === CHART_TYPE.COMBINED_CHART && index > 0;
73
- let layerType = "";
73
+ let layerType;
74
74
  let visualizationType;
75
75
  if (isCombinedMainLayer) {
76
76
  layerType = _get(chart, "stylesSettings.combined_type");
@@ -195,7 +195,7 @@ export const getChartLayerList = (chart) => {
195
195
  return;
196
196
  }
197
197
  const dimensions = objectCopy(chart.dimensions);
198
- let list = [];
198
+ let list;
199
199
  const category = getCategory(dimensions, chart);
200
200
  const valueColumn = getValue(category, dimensions, chart);
201
201
  const dateGroup = category && isDateColumn(category) && category.dateGroup
@@ -201,8 +201,7 @@ function configSetup(config) {
201
201
  const body = (0, general_1.getAttribute)(cfg.panel, "body") || {};
202
202
  const header = (0, general_1.getAttribute)(cfg.panel, "header") || {};
203
203
  const footer = (0, general_1.getAttribute)(cfg.panel, "footer") || {};
204
- let filterSettings = header.filter;
205
- filterSettings = {
204
+ const filterSettings = {
206
205
  button: {
207
206
  display: (0, general_1._get)(header.filter, "button.display", (0, general_1._get)(header, "filter", false)),
208
207
  disable: (0, general_1._get)(header.filter, "button.disable", false),
@@ -383,12 +383,12 @@ function getSortOrder(sorting = {}, category = {}, body = {}) {
383
383
  },
384
384
  ];
385
385
  }
386
- function setDateGroup(column, body, obj) {
386
+ function setDateGroup(column, body, obj, defaultMaxDataPoints = 61) {
387
387
  if ((0, endpointDataValidators_1.isColumnDate)(column) && !(0, general_1.isEmpty)((0, general_1._get)(body, "dateGroup.label"))) {
388
388
  obj["groupType"] = columns_1.COLUMN.DATE;
389
389
  obj["groupValue"] = body.dateGroup.label;
390
390
  if ((0, general_1._get)(body, "dateGroup.datePart", false)) {
391
- obj["maxDataPoints"] = obj["maxDataPoints"] || 60;
391
+ obj["maxDataPoints"] = obj["maxDataPoints"] || defaultMaxDataPoints;
392
392
  }
393
393
  }
394
394
  }
@@ -73,7 +73,7 @@ const parsePropertyComplexData = (column) => {
73
73
  const parseLayer = (category, value, index, chart) => {
74
74
  const isCombinedMainLayer = chart.type === constants_1.CHART_TYPE.COMBINED_CHART && index === 0;
75
75
  const isCombinedOtherLayer = chart.type === constants_1.CHART_TYPE.COMBINED_CHART && index > 0;
76
- let layerType = "";
76
+ let layerType;
77
77
  let visualizationType;
78
78
  if (isCombinedMainLayer) {
79
79
  layerType = (0, general_1._get)(chart, "stylesSettings.combined_type");
@@ -198,7 +198,7 @@ const getChartLayerList = (chart) => {
198
198
  return;
199
199
  }
200
200
  const dimensions = (0, general_1.objectCopy)(chart.dimensions);
201
- let list = [];
201
+ let list;
202
202
  const category = getCategory(dimensions, chart);
203
203
  const valueColumn = getValue(category, dimensions, chart);
204
204
  const dateGroup = category && isDateColumn(category) && category.dateGroup
@@ -91,7 +91,7 @@ const defineXYChartFormat = (column, settings) => {
91
91
  else if (hasDefaultFormat) {
92
92
  if (!outputFormat?.format)
93
93
  return defaultDecimal;
94
- if (!definition_1.STANDARD_NUMERIC_FORMATS.includes(outputFormat?.format)) {
94
+ if (!definition_1.STANDARD_NUMERIC_FORMATS.includes(outputFormat?.format) || constants_1.DURATION_PARTS_LIST.includes(outputFormat?.format)) {
95
95
  return {
96
96
  ...outputFormat,
97
97
  template: outputFormat?.format,
@@ -7,7 +7,7 @@ const mapValues_1 = require("../../../general/object/mapValues");
7
7
  const DATE_GROUPING_PROPERTY_1 = require("../../constants/DATE_GROUPING_PROPERTY");
8
8
  const COMMON_1 = require("../constants/COMMON");
9
9
  function formatStatement(statement) {
10
- const loweredStatement = (0, mapValues_1.mapValues)(statement, (s) => typeof s === "string" ? s.toLowerCase() : s);
10
+ const loweredStatement = (0, mapValues_1.mapValues)(statement, (s) => (typeof s === "string" ? s.toLowerCase() : s));
11
11
  return {
12
12
  cursor: (0, get_1._get)(loweredStatement, "cursor", RELATIVE_CURSOR_1.RELATIVE_CURSOR.THIS),
13
13
  unit: (0, get_1._get)(loweredStatement, "unit", DATE_GROUPING_PROPERTY_1.DATE_GROUPING_PROPERTY.DAY),
@@ -21,9 +21,8 @@ const getBackendGroupValue_1 = require("../helpers/backend/getBackendGroupValue"
21
21
  const getBackendProperty_1 = require("../helpers/backend/getBackendProperty");
22
22
  const isRankingFilter_1 = require("../helpers/common/isRankingFilter");
23
23
  function flatUIToOldLogic(uFilters, section = FILTER_SECTION_1.FILTER_SECTION.ANYWHERE) {
24
- let oldFilterData;
25
24
  if ((0, isEmpty_1.isEmpty)(uFilters))
26
- return oldFilterData;
25
+ return undefined;
27
26
  const uFilterss = (0, objectCopy_1.objectCopy)(uFilters);
28
27
  const filterDetails = flatUIToOldFilterDetail(uFilterss);
29
28
  return {
@@ -6,6 +6,7 @@ var FILTER_SCOPE;
6
6
  FILTER_SCOPE["ADMIN"] = "ADMIN";
7
7
  FILTER_SCOPE["DATA"] = "DATA";
8
8
  FILTER_SCOPE["GLOBAL"] = "GLOBAL";
9
+ FILTER_SCOPE["VIEW_ONLY"] = "VIEW_ONLY";
9
10
  FILTER_SCOPE["PAGE"] = "PAGE";
10
11
  FILTER_SCOPE["TAB"] = "TAB";
11
12
  FILTER_SCOPE["CONTAINER"] = "CONTAINER";
@@ -6,6 +6,7 @@ exports.FILTER_SCOPES = [
6
6
  FILTER_SCOPE_1.FILTER_SCOPE.ADMIN,
7
7
  FILTER_SCOPE_1.FILTER_SCOPE.DATA,
8
8
  FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL,
9
+ FILTER_SCOPE_1.FILTER_SCOPE.VIEW_ONLY,
9
10
  FILTER_SCOPE_1.FILTER_SCOPE.PAGE,
10
11
  FILTER_SCOPE_1.FILTER_SCOPE.TAB,
11
12
  FILTER_SCOPE_1.FILTER_SCOPE.CONTAINER,
@@ -28,6 +28,14 @@ exports.FILTER_SCOPE_INFO = [
28
28
  displayed: true,
29
29
  i18nLabelPath: "filter.scopes.global",
30
30
  },
31
+ {
32
+ label: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.VIEW_ONLY,
33
+ shortLabel: "View Only",
34
+ abbrLabel: "VO",
35
+ value: FILTER_SCOPE_1.FILTER_SCOPE.VIEW_ONLY,
36
+ displayed: true,
37
+ i18nLabelPath: "filter.scopes.view_only",
38
+ },
31
39
  {
32
40
  label: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.PAGE,
33
41
  shortLabel: "Page",
@@ -6,6 +6,7 @@ var FILTER_SCOPE_LABEL;
6
6
  FILTER_SCOPE_LABEL["ADMIN"] = "Admin";
7
7
  FILTER_SCOPE_LABEL["DATA"] = "Data";
8
8
  FILTER_SCOPE_LABEL["GLOBAL"] = "Global";
9
+ FILTER_SCOPE_LABEL["VIEW_ONLY"] = "View Only";
9
10
  FILTER_SCOPE_LABEL["PAGE"] = "Dashboard";
10
11
  FILTER_SCOPE_LABEL["TAB"] = "Tab";
11
12
  FILTER_SCOPE_LABEL["CONTAINER"] = "Container";
@@ -145,6 +145,30 @@ exports.FILTER_SETTINGS_DEFAULT = {
145
145
  label: undefined,
146
146
  readonly: false,
147
147
  },
148
+ [FILTER_SCOPE_1.FILTER_SCOPE.VIEW_ONLY]: {
149
+ canCollapse: false,
150
+ collapsed: false,
151
+ color: "#a8b0fd",
152
+ colorized: true,
153
+ colorPickerDisplayed: true,
154
+ displayed: true,
155
+ enabled: true,
156
+ icon: "qv-show",
157
+ iconsDisplayed: true,
158
+ interaction: {
159
+ createDisplayed: false,
160
+ createEnabled: false,
161
+ deleteDisplayed: false,
162
+ deleteEnabled: false,
163
+ editDisplayed: false,
164
+ editEnabled: false,
165
+ enableDisplayed: false,
166
+ enableEnabled: false,
167
+ },
168
+ label: undefined,
169
+ readonly: false,
170
+ readOnlyValues: true,
171
+ },
148
172
  [FILTER_SCOPE_1.FILTER_SCOPE.PAGE]: {
149
173
  canCollapse: true,
150
174
  collapsed: false,
@@ -49,7 +49,7 @@ function getValues(filter, settings) {
49
49
  .filter(Boolean);
50
50
  }
51
51
  function getSeparator(settings) {
52
- let newLine = "";
52
+ let newLine;
53
53
  if (settings.valueNewLine) {
54
54
  newLine = "\n";
55
55
  }
@@ -11,7 +11,7 @@ function mergeValues(filter1, filter2, settings) {
11
11
  if ((0, isEmpty_1.isEmpty)(filter1) && (0, isEmpty_1.isEmpty)(filter2))
12
12
  return [];
13
13
  const defaultSettings = (0, getMergeValuesSettings_1.getMergeValuesSettings)(settings);
14
- let newValues = [];
14
+ let newValues;
15
15
  let filter1Values = filter1.values || [];
16
16
  const filter2Values = filter2.values || [];
17
17
  if (defaultSettings.overwriteValues) {
@@ -114,6 +114,7 @@ class FiltersApi {
114
114
  scope: undefined,
115
115
  predefinedScopes: [
116
116
  { label: FILTER_SCOPE_1.FILTER_SCOPE.DATA, id: config.filter?.column?.qrveyid },
117
+ { label: FILTER_SCOPE_1.FILTER_SCOPE.VIEW_ONLY, id: undefined },
117
118
  ],
118
119
  });
119
120
  }
@@ -113,7 +113,7 @@ exports.STANDARD_NUMERIC_FORMATS = [
113
113
  "Abbreviated",
114
114
  "Duration",
115
115
  ];
116
- exports.LANG_DEFAULT = "en-US";
116
+ exports.LANG_DEFAULT = "en";
117
117
  exports.CURRENCY_DEFAULT = { text: "$ (USD)", label: "USD" };
118
118
  exports.DATETIME_OPTIONS = {
119
119
  year: "numeric",
@@ -70,7 +70,8 @@ function formatLocaleNumber(value, outputFormat, config) {
70
70
  const valueToFormat = outputFormat?.format === "Percentage" ? value / 100 : value;
71
71
  try {
72
72
  const fixedCurrencyCode = (0, helpers_1.fixCurrencyFormatOverride)(config.currencyFormatOverride);
73
- if ((0, isDefaultCurrent_1.isDefaultCurrent)(outputFormat.currency) && !!fixedCurrencyCode) {
73
+ if ((0, isDefaultCurrent_1.isDefaultCurrent)(outputFormat.currency) &&
74
+ (0, helpers_1.getCurrencySymbolByCode)(fixedCurrencyCode)) {
74
75
  langOpts = { ...langOpts, currency: fixedCurrencyCode };
75
76
  }
76
77
  const key = outputFormat?.format +
@@ -25,6 +25,7 @@ exports.I18N_FILTER = {
25
25
  admin: "Admin Filters",
26
26
  data: "Data Filters",
27
27
  global: "Global Filters",
28
+ view_only: "View Only Filters",
28
29
  page: "Dashboard Filters",
29
30
  tab: "Tab Filters",
30
31
  container: "Container Filters",
@@ -30,6 +30,7 @@ exports.I18N_FILTER_PANEL = {
30
30
  },
31
31
  scope_tooltip: {
32
32
  global: "Filters applied to all dashboards",
33
+ view_only: "Filters applied temporarily to the current dashboard.",
33
34
  page: "Filters applied to the current dashboard",
34
35
  chart: "Filters applied to selected chart",
35
36
  tab: "Filters applied to the current tab",
@@ -6,6 +6,7 @@ exports.I18N_FILTER_SCOPE = {
6
6
  admin: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.ADMIN,
7
7
  data: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.DATA,
8
8
  global: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.GLOBAL,
9
+ view_only: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.VIEW_ONLY,
9
10
  page: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.PAGE,
10
11
  tab: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.TAB,
11
12
  container: FILTER_SCOPE_LABEL_1.FILTER_SCOPE_LABEL.CONTAINER,
@@ -3,14 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getImageUploadHasAnalysis = getImageUploadHasAnalysis;
4
4
  const COLUMN_IMAGE_UPLOAD_OPTION_1 = require("../../columns/constants/COLUMN_IMAGE_UPLOAD_OPTION");
5
5
  const getDatasetColumn_1 = require("../../columns/helpers/getDatasetColumn");
6
- const hasProperty_1 = require("../../general/object/hasProperty");
7
6
  function getImageUploadHasAnalysis(column, dataset) {
8
- let imageUploadOption;
9
- if ((0, hasProperty_1._hasProperty)(column, "imageUploadOption")) {
10
- imageUploadOption = column.imageUploadOption;
11
- }
12
7
  const datasetColumn = (0, getDatasetColumn_1.getDatasetColumn)(column, dataset);
13
- imageUploadOption = datasetColumn?.imageUploadOption;
8
+ const imageUploadOption = datasetColumn?.imageUploadOption;
14
9
  return (imageUploadOption === COLUMN_IMAGE_UPLOAD_OPTION_1.COLUMN_IMAGE_UPLOAD_OPTION.OBJECT ||
15
10
  imageUploadOption === COLUMN_IMAGE_UPLOAD_OPTION_1.COLUMN_IMAGE_UPLOAD_OPTION.TEXT);
16
11
  }
@@ -12,7 +12,7 @@ const isRGBAColor_1 = require("./isRGBAColor");
12
12
  function lightOrDark(color, brightnessThreshold = 127.5, opacityThreshold = 0.5) {
13
13
  if ((0, isEmpty_1.isEmpty)(color) || typeof color !== "string")
14
14
  return COLOR_TYPE_1.COLOR_TYPE.LIGHT;
15
- let rgbaChannel = { r: 0, g: 0, b: 0, a: 1 };
15
+ let rgbaChannel;
16
16
  const rgbaColor = (0, isRGBAColor_1.isRGBAColor)(color);
17
17
  const hexadecimalColor = (0, isHexadecimalColor_1.isHexadecimalColor)(color);
18
18
  if (rgbaColor) {
@@ -3,7 +3,7 @@ import { COLUMN } from "../../columns/constants/COLUMN";
3
3
  import { STANDARD_NUMERIC_FORMATS, } from "../../format/definition";
4
4
  import { isEmpty } from "../../general/mix/isEmpty";
5
5
  import { CALCULATION_LABEL } from "../../qrvey/constants/CALCULATION_LABEL";
6
- import { SHELF_TYPE } from "../constants";
6
+ import { DURATION_PARTS_LIST, SHELF_TYPE } from "../constants";
7
7
  import { CHART_GROUPS } from "../constants/CHART_GROUP";
8
8
  import { DATEGROUP_UNSUPPORT_FORMAT } from "../constants/DATEGROUP_UNSUPPORT_FORMAT";
9
9
  import { STRING_FORMAT } from "../constants/STRING_FORMAT";
@@ -88,7 +88,7 @@ export const defineXYChartFormat = (column, settings) => {
88
88
  else if (hasDefaultFormat) {
89
89
  if (!outputFormat?.format)
90
90
  return defaultDecimal;
91
- if (!STANDARD_NUMERIC_FORMATS.includes(outputFormat?.format)) {
91
+ if (!STANDARD_NUMERIC_FORMATS.includes(outputFormat?.format) || DURATION_PARTS_LIST.includes(outputFormat?.format)) {
92
92
  return {
93
93
  ...outputFormat,
94
94
  template: outputFormat?.format,
@@ -4,7 +4,7 @@ import { mapValues } from "../../../general/object/mapValues";
4
4
  import { DATE_GROUPING_PROPERTY } from "../../constants/DATE_GROUPING_PROPERTY";
5
5
  import { COMMON_CONSTANTS } from "../constants/COMMON";
6
6
  export function formatStatement(statement) {
7
- const loweredStatement = mapValues(statement, (s) => typeof s === "string" ? s.toLowerCase() : s);
7
+ const loweredStatement = mapValues(statement, (s) => (typeof s === "string" ? s.toLowerCase() : s));
8
8
  return {
9
9
  cursor: _get(loweredStatement, "cursor", RELATIVE_CURSOR.THIS),
10
10
  unit: _get(loweredStatement, "unit", DATE_GROUPING_PROPERTY.DAY),
@@ -16,9 +16,8 @@ import { getBackendGroupValue } from "../helpers/backend/getBackendGroupValue";
16
16
  import { getBackendProperty } from "../helpers/backend/getBackendProperty";
17
17
  import { isRankingFilter } from "../helpers/common/isRankingFilter";
18
18
  export function flatUIToOldLogic(uFilters, section = FILTER_SECTION.ANYWHERE) {
19
- let oldFilterData;
20
19
  if (isEmpty(uFilters))
21
- return oldFilterData;
20
+ return undefined;
22
21
  const uFilterss = objectCopy(uFilters);
23
22
  const filterDetails = flatUIToOldFilterDetail(uFilterss);
24
23
  return {
@@ -2,6 +2,7 @@ export declare enum FILTER_SCOPE {
2
2
  ADMIN = "ADMIN",
3
3
  DATA = "DATA",
4
4
  GLOBAL = "GLOBAL",
5
+ VIEW_ONLY = "VIEW_ONLY",
5
6
  PAGE = "PAGE",
6
7
  TAB = "TAB",
7
8
  CONTAINER = "CONTAINER",
@@ -3,6 +3,7 @@ export var FILTER_SCOPE;
3
3
  FILTER_SCOPE["ADMIN"] = "ADMIN";
4
4
  FILTER_SCOPE["DATA"] = "DATA";
5
5
  FILTER_SCOPE["GLOBAL"] = "GLOBAL";
6
+ FILTER_SCOPE["VIEW_ONLY"] = "VIEW_ONLY";
6
7
  FILTER_SCOPE["PAGE"] = "PAGE";
7
8
  FILTER_SCOPE["TAB"] = "TAB";
8
9
  FILTER_SCOPE["CONTAINER"] = "CONTAINER";
@@ -3,6 +3,7 @@ export const FILTER_SCOPES = [
3
3
  FILTER_SCOPE.ADMIN,
4
4
  FILTER_SCOPE.DATA,
5
5
  FILTER_SCOPE.GLOBAL,
6
+ FILTER_SCOPE.VIEW_ONLY,
6
7
  FILTER_SCOPE.PAGE,
7
8
  FILTER_SCOPE.TAB,
8
9
  FILTER_SCOPE.CONTAINER,
@@ -25,6 +25,14 @@ export const FILTER_SCOPE_INFO = [
25
25
  displayed: true,
26
26
  i18nLabelPath: "filter.scopes.global",
27
27
  },
28
+ {
29
+ label: FILTER_SCOPE_LABEL.VIEW_ONLY,
30
+ shortLabel: "View Only",
31
+ abbrLabel: "VO",
32
+ value: FILTER_SCOPE.VIEW_ONLY,
33
+ displayed: true,
34
+ i18nLabelPath: "filter.scopes.view_only",
35
+ },
28
36
  {
29
37
  label: FILTER_SCOPE_LABEL.PAGE,
30
38
  shortLabel: "Page",
@@ -2,6 +2,7 @@ export declare enum FILTER_SCOPE_LABEL {
2
2
  ADMIN = "Admin",
3
3
  DATA = "Data",
4
4
  GLOBAL = "Global",
5
+ VIEW_ONLY = "View Only",
5
6
  PAGE = "Dashboard",
6
7
  TAB = "Tab",
7
8
  CONTAINER = "Container",
@@ -3,6 +3,7 @@ export var FILTER_SCOPE_LABEL;
3
3
  FILTER_SCOPE_LABEL["ADMIN"] = "Admin";
4
4
  FILTER_SCOPE_LABEL["DATA"] = "Data";
5
5
  FILTER_SCOPE_LABEL["GLOBAL"] = "Global";
6
+ FILTER_SCOPE_LABEL["VIEW_ONLY"] = "View Only";
6
7
  FILTER_SCOPE_LABEL["PAGE"] = "Dashboard";
7
8
  FILTER_SCOPE_LABEL["TAB"] = "Tab";
8
9
  FILTER_SCOPE_LABEL["CONTAINER"] = "Container";
@@ -142,6 +142,30 @@ export const FILTER_SETTINGS_DEFAULT = {
142
142
  label: undefined,
143
143
  readonly: false,
144
144
  },
145
+ [FILTER_SCOPE.VIEW_ONLY]: {
146
+ canCollapse: false,
147
+ collapsed: false,
148
+ color: "#a8b0fd",
149
+ colorized: true,
150
+ colorPickerDisplayed: true,
151
+ displayed: true,
152
+ enabled: true,
153
+ icon: "qv-show",
154
+ iconsDisplayed: true,
155
+ interaction: {
156
+ createDisplayed: false,
157
+ createEnabled: false,
158
+ deleteDisplayed: false,
159
+ deleteEnabled: false,
160
+ editDisplayed: false,
161
+ editEnabled: false,
162
+ enableDisplayed: false,
163
+ enableEnabled: false,
164
+ },
165
+ label: undefined,
166
+ readonly: false,
167
+ readOnlyValues: true,
168
+ },
145
169
  [FILTER_SCOPE.PAGE]: {
146
170
  canCollapse: true,
147
171
  collapsed: false,
@@ -46,7 +46,7 @@ function getValues(filter, settings) {
46
46
  .filter(Boolean);
47
47
  }
48
48
  function getSeparator(settings) {
49
- let newLine = "";
49
+ let newLine;
50
50
  if (settings.valueNewLine) {
51
51
  newLine = "\n";
52
52
  }
@@ -8,7 +8,7 @@ export function mergeValues(filter1, filter2, settings) {
8
8
  if (isEmpty(filter1) && isEmpty(filter2))
9
9
  return [];
10
10
  const defaultSettings = getMergeValuesSettings(settings);
11
- let newValues = [];
11
+ let newValues;
12
12
  let filter1Values = filter1.values || [];
13
13
  const filter2Values = filter2.values || [];
14
14
  if (defaultSettings.overwriteValues) {
@@ -14,4 +14,5 @@ export interface IFSettingsScope {
14
14
  interaction?: IFSettingsScopeInteraction;
15
15
  label?: string;
16
16
  readonly?: boolean;
17
+ readOnlyValues?: boolean;
17
18
  }
@@ -111,6 +111,7 @@ export class FiltersApi {
111
111
  scope: undefined,
112
112
  predefinedScopes: [
113
113
  { label: FILTER_SCOPE.DATA, id: config.filter?.column?.qrveyid },
114
+ { label: FILTER_SCOPE.VIEW_ONLY, id: undefined },
114
115
  ],
115
116
  });
116
117
  }
@@ -31,7 +31,7 @@ export declare const enum LOCALE_STYLES {
31
31
  SCIENTIFIC = "scientific",
32
32
  COMPACT = "compact"
33
33
  }
34
- export declare const LANG_DEFAULT = "en-US";
34
+ export declare const LANG_DEFAULT = "en";
35
35
  export declare const CURRENCY_DEFAULT: {
36
36
  text: string;
37
37
  label: string;
@@ -106,7 +106,7 @@ export const STANDARD_NUMERIC_FORMATS = [
106
106
  "Abbreviated",
107
107
  "Duration",
108
108
  ];
109
- export const LANG_DEFAULT = "en-US";
109
+ export const LANG_DEFAULT = "en";
110
110
  export const CURRENCY_DEFAULT = { text: "$ (USD)", label: "USD" };
111
111
  export const DATETIME_OPTIONS = {
112
112
  year: "numeric",
@@ -2,7 +2,7 @@ import { ISOToNumericOffset } from "../dates";
2
2
  import { isEmpty } from "../general/mix/isEmpty";
3
3
  import { currencyISO, LANG_DEFAULT, CURRENCY_DEFAULT, DATETIME_OPTIONS, } from "./definition";
4
4
  import { DurationFormatter } from "./duration/durationFormatter";
5
- import { fixCurrencyFormatOverride } from "./helpers";
5
+ import { fixCurrencyFormatOverride, getCurrencySymbolByCode } from "./helpers";
6
6
  import { isDateTimeFormat } from "./helpers/isDateTimeFormat";
7
7
  import { isDefaultCurrent } from "./helpers/isDefaultCurrent";
8
8
  export const getLang = (locale) => {
@@ -64,7 +64,8 @@ function formatLocaleNumber(value, outputFormat, config) {
64
64
  const valueToFormat = outputFormat?.format === "Percentage" ? value / 100 : value;
65
65
  try {
66
66
  const fixedCurrencyCode = fixCurrencyFormatOverride(config.currencyFormatOverride);
67
- if (isDefaultCurrent(outputFormat.currency) && !!fixedCurrencyCode) {
67
+ if (isDefaultCurrent(outputFormat.currency) &&
68
+ getCurrencySymbolByCode(fixedCurrencyCode)) {
68
69
  langOpts = { ...langOpts, currency: fixedCurrencyCode };
69
70
  }
70
71
  const key = outputFormat?.format +
@@ -1 +1 @@
1
- export declare function mapValues(baseObject: any, iteratee: (prop: any, i: any) => any): {};
1
+ export declare function mapValues<T extends Record<string, unknown>, R = T[keyof T]>(baseObject: T, iteratee?: ((value: T[keyof T], key: string) => R) | null): Record<string, R>;
@@ -2,6 +2,7 @@ export interface II18nFilterPanelScopeTitle {
2
2
  admin: string;
3
3
  data: string;
4
4
  global: string;
5
+ view_only: string;
5
6
  page: string;
6
7
  tab: string;
7
8
  container: string;
@@ -1,5 +1,6 @@
1
1
  export interface II18nFilterPanelScopeTooltip {
2
2
  global: string;
3
+ view_only: string;
3
4
  page: string;
4
5
  chart: string;
5
6
  tab: string;
@@ -2,6 +2,7 @@ export interface II18nFilterScopes {
2
2
  admin: string;
3
3
  data: string;
4
4
  global: string;
5
+ view_only: string;
5
6
  page: string;
6
7
  tab: string;
7
8
  container: string;
@@ -22,6 +22,7 @@ export const I18N_FILTER = {
22
22
  admin: "Admin Filters",
23
23
  data: "Data Filters",
24
24
  global: "Global Filters",
25
+ view_only: "View Only Filters",
25
26
  page: "Dashboard Filters",
26
27
  tab: "Tab Filters",
27
28
  container: "Container Filters",
@@ -27,6 +27,7 @@ export const I18N_FILTER_PANEL = {
27
27
  },
28
28
  scope_tooltip: {
29
29
  global: "Filters applied to all dashboards",
30
+ view_only: "Filters applied temporarily to the current dashboard.",
30
31
  page: "Filters applied to the current dashboard",
31
32
  chart: "Filters applied to selected chart",
32
33
  tab: "Filters applied to the current tab",
@@ -3,6 +3,7 @@ export const I18N_FILTER_SCOPE = {
3
3
  admin: FILTER_SCOPE_LABEL.ADMIN,
4
4
  data: FILTER_SCOPE_LABEL.DATA,
5
5
  global: FILTER_SCOPE_LABEL.GLOBAL,
6
+ view_only: FILTER_SCOPE_LABEL.VIEW_ONLY,
6
7
  page: FILTER_SCOPE_LABEL.PAGE,
7
8
  tab: FILTER_SCOPE_LABEL.TAB,
8
9
  container: FILTER_SCOPE_LABEL.CONTAINER,
@@ -1,13 +1,8 @@
1
1
  import { COLUMN_IMAGE_UPLOAD_OPTION } from "../../columns/constants/COLUMN_IMAGE_UPLOAD_OPTION";
2
2
  import { getDatasetColumn } from "../../columns/helpers/getDatasetColumn";
3
- import { _hasProperty } from "../../general/object/hasProperty";
4
3
  export function getImageUploadHasAnalysis(column, dataset) {
5
- let imageUploadOption;
6
- if (_hasProperty(column, "imageUploadOption")) {
7
- imageUploadOption = column.imageUploadOption;
8
- }
9
4
  const datasetColumn = getDatasetColumn(column, dataset);
10
- imageUploadOption = datasetColumn?.imageUploadOption;
5
+ const imageUploadOption = datasetColumn?.imageUploadOption;
11
6
  return (imageUploadOption === COLUMN_IMAGE_UPLOAD_OPTION.OBJECT ||
12
7
  imageUploadOption === COLUMN_IMAGE_UPLOAD_OPTION.TEXT);
13
8
  }