@qrvey/utils 1.3.0-14 → 1.3.0-15
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/cjs/filters/helpers/common/getFiltersByDatasetsColumns.js +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +10 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +10 -0
- package/dist/cjs/services/adapters/BColumnsToUIColumns.adapter.js +5 -4
- package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +3 -2
- package/dist/filters/helpers/common/getFiltersByDatasetsColumns.js +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +10 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +10 -0
- package/dist/services/adapters/BColumnsToUIColumns.adapter.js +5 -4
- package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +3 -2
- package/package.json +1 -1
- package/src/filters/helpers/common/getFiltersByDatasetsColumns.ts +1 -0
- package/src/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.ts +10 -0
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +10 -0
- package/src/services/adapters/BColumnsToUIColumns.adapter.ts +5 -4
- package/src/services/adapters/BDatasetsToUIDatasets.adapter.ts +3 -2
|
@@ -12,6 +12,8 @@ const isEmpty_1 = require("../../../general/mix/isEmpty");
|
|
|
12
12
|
function getFiltersByDatasetsColumns(data, datasets = []) {
|
|
13
13
|
if ((0, isEmpty_1.isEmpty)(data) || (0, isEmpty_1.isEmpty)(data.scopes))
|
|
14
14
|
return;
|
|
15
|
+
if ((0, isEmpty_1.isEmpty)(datasets))
|
|
16
|
+
return data;
|
|
15
17
|
return Object.assign(Object.assign({}, data), { scopes: data.scopes.map(scope => (Object.assign(Object.assign({}, scope), { datasets: scope.datasets.map(filterDataset => {
|
|
16
18
|
const dataset = datasets.find(data => data.qrveyid === filterDataset.qrveyid);
|
|
17
19
|
if (!(0, isEmpty_1.isEmpty)(dataset)) {
|
|
@@ -11,6 +11,16 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
11
11
|
chart_type_disabled_message: string;
|
|
12
12
|
comparision_color: string;
|
|
13
13
|
data_labels_check: string;
|
|
14
|
+
data_labels_clustering: string;
|
|
15
|
+
data_labels_format: string;
|
|
16
|
+
data_labels_position: string;
|
|
17
|
+
data_labels_position_inside: string;
|
|
18
|
+
data_labels_position_outside: string;
|
|
19
|
+
data_labels_show_as: string;
|
|
20
|
+
data_labels_show_as_category: string;
|
|
21
|
+
data_labels_show_as_percentage: string;
|
|
22
|
+
data_labels_show_as_placeholder: string;
|
|
23
|
+
data_labels_show_as_value: string;
|
|
14
24
|
default_format_title: string;
|
|
15
25
|
display_outliers_check: string;
|
|
16
26
|
line_opacity: string;
|
|
@@ -15,6 +15,16 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
15
15
|
chart_type_disabled_message: '<i>Type</i> selection is disabled because stacked type configuration is in use.',
|
|
16
16
|
comparision_color: 'Comparision Color',
|
|
17
17
|
data_labels_check: 'Data Labels',
|
|
18
|
+
data_labels_clustering: '<i>Clustering</i> is inactive, enable it to use <i>{{text}}</i>.',
|
|
19
|
+
data_labels_format: '<i>% Difference</i> is active, disable it to set a different formatting.',
|
|
20
|
+
data_labels_position: 'Label Position',
|
|
21
|
+
data_labels_position_inside: 'Inside',
|
|
22
|
+
data_labels_position_outside: 'Outside',
|
|
23
|
+
data_labels_show_as: 'Show as',
|
|
24
|
+
data_labels_show_as_category: 'Category',
|
|
25
|
+
data_labels_show_as_percentage: 'Percentage',
|
|
26
|
+
data_labels_show_as_placeholder: 'Select Option',
|
|
27
|
+
data_labels_show_as_value: 'Value',
|
|
18
28
|
default_format_title: 'Format',
|
|
19
29
|
display_outliers_check: 'Display Outliers',
|
|
20
30
|
line_opacity: 'Line Opacity',
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BColumnsToUIColumns = void 0;
|
|
4
|
+
const getAttribute_1 = require("../../general/object/getAttribute");
|
|
4
5
|
function BColumnsToUIColumns(columns = [], dataset) {
|
|
5
6
|
return columns.map(column => ({
|
|
6
7
|
answers: column.answers,
|
|
7
|
-
bucketid: column
|
|
8
|
+
bucketid: (0, getAttribute_1.getAttribute)(column, 'bucket_id'),
|
|
8
9
|
expressionCategory: column.activeCat,
|
|
9
10
|
expressionNegative: column.negative,
|
|
10
11
|
expressionPositive: column.positive,
|
|
11
12
|
expressionWords: column.words,
|
|
12
|
-
formulaid: column
|
|
13
|
+
formulaid: (0, getAttribute_1.getAttribute)(column, 'formula_id'),
|
|
13
14
|
formulaType: column.formulaType,
|
|
14
15
|
geogroup: column.geogroup,
|
|
15
16
|
id: column.id,
|
|
16
17
|
imageUploadOption: column.imageUploadOption,
|
|
17
18
|
label: column.text,
|
|
18
19
|
linked: column.linked,
|
|
19
|
-
linkid: (dataset
|
|
20
|
+
linkid: (0, getAttribute_1.getAttribute)(dataset, 'link_id') || (0, getAttribute_1.getAttribute)(column, 'link_id'),
|
|
20
21
|
outputFormat: column.outputFormat,
|
|
21
22
|
property: column.property,
|
|
22
|
-
qrveyid: (dataset
|
|
23
|
+
qrveyid: (0, getAttribute_1.getAttribute)(dataset, 'qrvey_id') || (0, getAttribute_1.getAttribute)(column, 'qrvey_id'),
|
|
23
24
|
slidebarValue: column.sliderVal,
|
|
24
25
|
lookupValue: column.value,
|
|
25
26
|
type: column.type,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BDatasetsToUIDatasets = void 0;
|
|
4
|
+
const getAttribute_1 = require("../../general/object/getAttribute");
|
|
4
5
|
const BColumnsToUIColumns_adapter_1 = require("./BColumnsToUIColumns.adapter");
|
|
5
6
|
function BDatasetsToUIDatasets(datasets = []) {
|
|
6
7
|
return datasets.map(dataset => ({
|
|
7
|
-
qrveyid: dataset
|
|
8
|
+
qrveyid: (0, getAttribute_1.getAttribute)(dataset, 'qrvey_id'),
|
|
8
9
|
label: dataset.name,
|
|
9
|
-
linkid: dataset
|
|
10
|
+
linkid: (0, getAttribute_1.getAttribute)(dataset, 'link_id'),
|
|
10
11
|
options: (0, BColumnsToUIColumns_adapter_1.BColumnsToUIColumns)(dataset.options, dataset),
|
|
11
12
|
}));
|
|
12
13
|
}
|
|
@@ -9,6 +9,8 @@ import { isEmpty } from "../../../general/mix/isEmpty";
|
|
|
9
9
|
export function getFiltersByDatasetsColumns(data, datasets = []) {
|
|
10
10
|
if (isEmpty(data) || isEmpty(data.scopes))
|
|
11
11
|
return;
|
|
12
|
+
if (isEmpty(datasets))
|
|
13
|
+
return data;
|
|
12
14
|
return Object.assign(Object.assign({}, data), { scopes: data.scopes.map(scope => (Object.assign(Object.assign({}, scope), { datasets: scope.datasets.map(filterDataset => {
|
|
13
15
|
const dataset = datasets.find(data => data.qrveyid === filterDataset.qrveyid);
|
|
14
16
|
if (!isEmpty(dataset)) {
|
|
@@ -11,6 +11,16 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
11
11
|
chart_type_disabled_message: string;
|
|
12
12
|
comparision_color: string;
|
|
13
13
|
data_labels_check: string;
|
|
14
|
+
data_labels_clustering: string;
|
|
15
|
+
data_labels_format: string;
|
|
16
|
+
data_labels_position: string;
|
|
17
|
+
data_labels_position_inside: string;
|
|
18
|
+
data_labels_position_outside: string;
|
|
19
|
+
data_labels_show_as: string;
|
|
20
|
+
data_labels_show_as_category: string;
|
|
21
|
+
data_labels_show_as_percentage: string;
|
|
22
|
+
data_labels_show_as_placeholder: string;
|
|
23
|
+
data_labels_show_as_value: string;
|
|
14
24
|
default_format_title: string;
|
|
15
25
|
display_outliers_check: string;
|
|
16
26
|
line_opacity: string;
|
|
@@ -12,6 +12,16 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
12
12
|
chart_type_disabled_message: '<i>Type</i> selection is disabled because stacked type configuration is in use.',
|
|
13
13
|
comparision_color: 'Comparision Color',
|
|
14
14
|
data_labels_check: 'Data Labels',
|
|
15
|
+
data_labels_clustering: '<i>Clustering</i> is inactive, enable it to use <i>{{text}}</i>.',
|
|
16
|
+
data_labels_format: '<i>% Difference</i> is active, disable it to set a different formatting.',
|
|
17
|
+
data_labels_position: 'Label Position',
|
|
18
|
+
data_labels_position_inside: 'Inside',
|
|
19
|
+
data_labels_position_outside: 'Outside',
|
|
20
|
+
data_labels_show_as: 'Show as',
|
|
21
|
+
data_labels_show_as_category: 'Category',
|
|
22
|
+
data_labels_show_as_percentage: 'Percentage',
|
|
23
|
+
data_labels_show_as_placeholder: 'Select Option',
|
|
24
|
+
data_labels_show_as_value: 'Value',
|
|
15
25
|
default_format_title: 'Format',
|
|
16
26
|
display_outliers_check: 'Display Outliers',
|
|
17
27
|
line_opacity: 'Line Opacity',
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import { getAttribute } from "../../general/object/getAttribute";
|
|
1
2
|
export function BColumnsToUIColumns(columns = [], dataset) {
|
|
2
3
|
return columns.map(column => ({
|
|
3
4
|
answers: column.answers,
|
|
4
|
-
bucketid: column
|
|
5
|
+
bucketid: getAttribute(column, 'bucket_id'),
|
|
5
6
|
expressionCategory: column.activeCat,
|
|
6
7
|
expressionNegative: column.negative,
|
|
7
8
|
expressionPositive: column.positive,
|
|
8
9
|
expressionWords: column.words,
|
|
9
|
-
formulaid: column
|
|
10
|
+
formulaid: getAttribute(column, 'formula_id'),
|
|
10
11
|
formulaType: column.formulaType,
|
|
11
12
|
geogroup: column.geogroup,
|
|
12
13
|
id: column.id,
|
|
13
14
|
imageUploadOption: column.imageUploadOption,
|
|
14
15
|
label: column.text,
|
|
15
16
|
linked: column.linked,
|
|
16
|
-
linkid: (dataset
|
|
17
|
+
linkid: getAttribute(dataset, 'link_id') || getAttribute(column, 'link_id'),
|
|
17
18
|
outputFormat: column.outputFormat,
|
|
18
19
|
property: column.property,
|
|
19
|
-
qrveyid: (dataset
|
|
20
|
+
qrveyid: getAttribute(dataset, 'qrvey_id') || getAttribute(column, 'qrvey_id'),
|
|
20
21
|
slidebarValue: column.sliderVal,
|
|
21
22
|
lookupValue: column.value,
|
|
22
23
|
type: column.type,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { getAttribute } from "../../general/object/getAttribute";
|
|
1
2
|
import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
|
|
2
3
|
export function BDatasetsToUIDatasets(datasets = []) {
|
|
3
4
|
return datasets.map(dataset => ({
|
|
4
|
-
qrveyid: dataset
|
|
5
|
+
qrveyid: getAttribute(dataset, 'qrvey_id'),
|
|
5
6
|
label: dataset.name,
|
|
6
|
-
linkid: dataset
|
|
7
|
+
linkid: getAttribute(dataset, 'link_id'),
|
|
7
8
|
options: BColumnsToUIColumns(dataset.options, dataset),
|
|
8
9
|
}));
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { IFUData } from "../../interfaces/ui/IFUData";
|
|
|
11
11
|
*/
|
|
12
12
|
export function getFiltersByDatasetsColumns(data: IFUData, datasets: IDataset[] = []): IFUData {
|
|
13
13
|
if (isEmpty(data) || isEmpty(data.scopes)) return;
|
|
14
|
+
if (isEmpty(datasets)) return data;
|
|
14
15
|
|
|
15
16
|
return {
|
|
16
17
|
...data,
|
|
@@ -11,6 +11,16 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
11
11
|
chart_type_disabled_message: string;
|
|
12
12
|
comparision_color: string;
|
|
13
13
|
data_labels_check: string;
|
|
14
|
+
data_labels_clustering: string;
|
|
15
|
+
data_labels_format: string;
|
|
16
|
+
data_labels_position: string;
|
|
17
|
+
data_labels_position_inside: string;
|
|
18
|
+
data_labels_position_outside: string;
|
|
19
|
+
data_labels_show_as: string;
|
|
20
|
+
data_labels_show_as_category: string;
|
|
21
|
+
data_labels_show_as_percentage: string;
|
|
22
|
+
data_labels_show_as_placeholder: string;
|
|
23
|
+
data_labels_show_as_value: string;
|
|
14
24
|
default_format_title: string;
|
|
15
25
|
display_outliers_check: string;
|
|
16
26
|
line_opacity: string;
|
|
@@ -18,6 +18,16 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOpti
|
|
|
18
18
|
chart_type_disabled_message: '<i>Type</i> selection is disabled because stacked type configuration is in use.',
|
|
19
19
|
comparision_color: 'Comparision Color',
|
|
20
20
|
data_labels_check: 'Data Labels',
|
|
21
|
+
data_labels_clustering: '<i>Clustering</i> is inactive, enable it to use <i>{{text}}</i>.',
|
|
22
|
+
data_labels_format: '<i>% Difference</i> is active, disable it to set a different formatting.',
|
|
23
|
+
data_labels_position: 'Label Position',
|
|
24
|
+
data_labels_position_inside: 'Inside',
|
|
25
|
+
data_labels_position_outside: 'Outside',
|
|
26
|
+
data_labels_show_as: 'Show as',
|
|
27
|
+
data_labels_show_as_category: 'Category',
|
|
28
|
+
data_labels_show_as_percentage: 'Percentage',
|
|
29
|
+
data_labels_show_as_placeholder: 'Select Option',
|
|
30
|
+
data_labels_show_as_value: 'Value',
|
|
21
31
|
default_format_title: 'Format',
|
|
22
32
|
display_outliers_check: 'Display Outliers',
|
|
23
33
|
line_opacity: 'Line Opacity',
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { IBColumn } from "../../columns/interfaces/IBColumn";
|
|
2
2
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
3
|
+
import { getAttribute } from "../../general/object/getAttribute";
|
|
3
4
|
import { IBDataset } from "../../qrvey/interfaces/IBDataset";
|
|
4
5
|
|
|
5
6
|
export function BColumnsToUIColumns(columns: IBColumn[] = [], dataset?: IBDataset): IColumn[] {
|
|
6
7
|
return columns.map<IColumn>(column => ({
|
|
7
8
|
answers: column.answers,
|
|
8
|
-
bucketid: column
|
|
9
|
+
bucketid: getAttribute(column, 'bucket_id'),
|
|
9
10
|
expressionCategory: column.activeCat,
|
|
10
11
|
expressionNegative: column.negative,
|
|
11
12
|
expressionPositive: column.positive,
|
|
12
13
|
expressionWords: column.words,
|
|
13
|
-
formulaid: column
|
|
14
|
+
formulaid: getAttribute(column, 'formula_id'),
|
|
14
15
|
formulaType: column.formulaType,
|
|
15
16
|
geogroup: column.geogroup,
|
|
16
17
|
id: column.id,
|
|
17
18
|
imageUploadOption: column.imageUploadOption,
|
|
18
19
|
label: column.text,
|
|
19
20
|
linked: column.linked,
|
|
20
|
-
linkid: dataset
|
|
21
|
+
linkid: getAttribute(dataset, 'link_id') || getAttribute(column, 'link_id'),
|
|
21
22
|
outputFormat: column.outputFormat,
|
|
22
23
|
property: column.property,
|
|
23
|
-
qrveyid: dataset
|
|
24
|
+
qrveyid: getAttribute(dataset, 'qrvey_id') || getAttribute(column, 'qrvey_id'),
|
|
24
25
|
slidebarValue: column.sliderVal,
|
|
25
26
|
lookupValue: column.value,
|
|
26
27
|
type: column.type,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { getAttribute } from "../../general/object/getAttribute";
|
|
1
2
|
import { IBDataset } from "../../qrvey/interfaces/IBDataset";
|
|
2
3
|
import { IDataset } from "../../qrvey/interfaces/IDataset";
|
|
3
4
|
import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
|
|
4
5
|
|
|
5
6
|
export function BDatasetsToUIDatasets(datasets: IBDataset[] = []): IDataset[] {
|
|
6
7
|
return datasets.map(dataset => ({
|
|
7
|
-
qrveyid: dataset
|
|
8
|
+
qrveyid: getAttribute(dataset, 'qrvey_id'),
|
|
8
9
|
label: dataset.name,
|
|
9
|
-
linkid: dataset
|
|
10
|
+
linkid: getAttribute(dataset, 'link_id'),
|
|
10
11
|
options: BColumnsToUIColumns(dataset.options, dataset),
|
|
11
12
|
}));
|
|
12
13
|
}
|