autoql-fe-utils 1.0.66 → 1.0.67
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/index.d.ts +7 -3
- package/dist/index.global.js +38 -14
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ declare const DEFAULT_CHART_CONFIG: {
|
|
|
160
160
|
declare const MONTH_NAMES: string[];
|
|
161
161
|
declare const DEFAULT_DATA_PAGE_SIZE = 50000;
|
|
162
162
|
declare const MAX_DATA_PAGE_SIZE = 50000;
|
|
163
|
-
declare const MAX_CHART_ELEMENTS =
|
|
163
|
+
declare const MAX_CHART_ELEMENTS = 300;
|
|
164
164
|
declare const WEEKDAY_NAMES_MON: string[];
|
|
165
165
|
declare const WEEKDAY_NAMES_SUN: string[];
|
|
166
166
|
declare const DOW_STYLES: string[];
|
|
@@ -786,8 +786,9 @@ interface DrilldownColumn {
|
|
|
786
786
|
name: string;
|
|
787
787
|
value: string | number;
|
|
788
788
|
drill_down?: string;
|
|
789
|
+
operator?: string;
|
|
789
790
|
}
|
|
790
|
-
declare const nameValueObject: (name: any, value: any, drill_down?: any) => DrilldownColumn;
|
|
791
|
+
declare const nameValueObject: (name: any, value: any, drill_down?: any, operator?: any) => DrilldownColumn;
|
|
791
792
|
declare const getKeyByValue: (object: any, value: any) => string;
|
|
792
793
|
declare const cloneObject: (from: any, to: any) => any;
|
|
793
794
|
|
|
@@ -978,6 +979,8 @@ declare const getGroupBysFromPivotTable: ({ cell, rowHeaders, columnHeaders, row
|
|
|
978
979
|
}) => {
|
|
979
980
|
name: any;
|
|
980
981
|
value: string;
|
|
982
|
+
operator: string;
|
|
983
|
+
drill_down: any;
|
|
981
984
|
}[];
|
|
982
985
|
declare const isAggregation: (columns: any) => boolean;
|
|
983
986
|
declare const getColumnTypeAmounts: (columns: any) => {
|
|
@@ -1060,7 +1063,7 @@ declare const makeEmptyArray: (w: any, h: any, value?: string) => any[];
|
|
|
1060
1063
|
declare const removeElementAtIndex: (array: any, index: any) => any;
|
|
1061
1064
|
|
|
1062
1065
|
declare const aggregateOtherCategory: (data: any, columnIndexConfig: any, maxElements?: number) => any;
|
|
1063
|
-
declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataFormatting, columnIndexConfig, maxElements, useBuckets, }: {
|
|
1066
|
+
declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataFormatting, columnIndexConfig, maxElements, truncateAt, useBuckets, }: {
|
|
1064
1067
|
data: any;
|
|
1065
1068
|
aggColIndex: any;
|
|
1066
1069
|
columns: any;
|
|
@@ -1068,6 +1071,7 @@ declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataF
|
|
|
1068
1071
|
dataFormatting: any;
|
|
1069
1072
|
columnIndexConfig: any;
|
|
1070
1073
|
maxElements: any;
|
|
1074
|
+
truncateAt?: number;
|
|
1071
1075
|
useBuckets?: boolean;
|
|
1072
1076
|
}) => any;
|
|
1073
1077
|
type CreatePivotDataParams = {
|
package/dist/index.global.js
CHANGED
|
@@ -14450,7 +14450,7 @@
|
|
|
14450
14450
|
];
|
|
14451
14451
|
var DEFAULT_DATA_PAGE_SIZE = 5e4;
|
|
14452
14452
|
var MAX_DATA_PAGE_SIZE = 5e4;
|
|
14453
|
-
var MAX_CHART_ELEMENTS =
|
|
14453
|
+
var MAX_CHART_ELEMENTS = 300;
|
|
14454
14454
|
var WEEKDAY_NAMES_MON = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
|
|
14455
14455
|
var WEEKDAY_NAMES_SUN = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
14456
14456
|
var DOW_STYLES = ["NUM_1_MON", "NUM_1_SUN", "NUM_0_MON", "NUM_0_SUN", "ALPHA_MON", "ALPHA_SUN"];
|
|
@@ -15712,14 +15712,18 @@
|
|
|
15712
15712
|
};
|
|
15713
15713
|
|
|
15714
15714
|
// src/HelperFns/objectHelpers.ts
|
|
15715
|
-
var nameValueObject = (name, value, drill_down) => {
|
|
15715
|
+
var nameValueObject = (name, value, drill_down, operator) => {
|
|
15716
15716
|
const nameValueObj = {
|
|
15717
15717
|
name,
|
|
15718
15718
|
value
|
|
15719
15719
|
};
|
|
15720
|
+
nameValueObj.operator = operator;
|
|
15720
15721
|
if (drill_down) {
|
|
15721
15722
|
nameValueObj.drill_down = drill_down;
|
|
15722
15723
|
}
|
|
15724
|
+
if (operator) {
|
|
15725
|
+
nameValueObj.operator = operator;
|
|
15726
|
+
}
|
|
15723
15727
|
return nameValueObj;
|
|
15724
15728
|
};
|
|
15725
15729
|
var getKeyByValue = (object, value) => {
|
|
@@ -15908,9 +15912,10 @@
|
|
|
15908
15912
|
const groupBys = [];
|
|
15909
15913
|
groupableColumns.forEach((colIndex) => {
|
|
15910
15914
|
const groupByName = columns[colIndex].name;
|
|
15911
|
-
const groupByValue =
|
|
15915
|
+
const groupByValue = row[colIndex];
|
|
15912
15916
|
const groupByDrilldown = columns[colIndex].drill_down;
|
|
15913
|
-
|
|
15917
|
+
const operator = groupByValue == null ? "is" : "=";
|
|
15918
|
+
groupBys.push(nameValueObject(groupByName, `${groupByValue}`, groupByDrilldown, operator));
|
|
15914
15919
|
});
|
|
15915
15920
|
return { groupBys, supportedByAPI: true };
|
|
15916
15921
|
};
|
|
@@ -15927,9 +15932,10 @@
|
|
|
15927
15932
|
const groupByArray = [];
|
|
15928
15933
|
groupableColumns.forEach((colIndex) => {
|
|
15929
15934
|
const groupByName = tableColumns[colIndex].name;
|
|
15930
|
-
const groupByValue =
|
|
15935
|
+
const groupByValue = rowData[colIndex];
|
|
15931
15936
|
const groupByDrilldown = tableColumns[colIndex].drill_down;
|
|
15932
|
-
|
|
15937
|
+
const operator = groupByValue == null ? "is" : "=";
|
|
15938
|
+
groupByArray.push(nameValueObject(groupByName, `${groupByValue}`, groupByDrilldown, operator));
|
|
15933
15939
|
});
|
|
15934
15940
|
return groupByArray;
|
|
15935
15941
|
};
|
|
@@ -15940,23 +15946,29 @@
|
|
|
15940
15946
|
rowHeaderDefinition,
|
|
15941
15947
|
columnHeaderDefinition
|
|
15942
15948
|
}) => {
|
|
15943
|
-
var _a
|
|
15949
|
+
var _a;
|
|
15944
15950
|
try {
|
|
15945
|
-
const columnName =
|
|
15951
|
+
const columnName = columnHeaderDefinition.name;
|
|
15952
|
+
const columnDrilldown = columnHeaderDefinition.drill_down;
|
|
15946
15953
|
const columnField = Number(cell.getField()) - 1;
|
|
15947
15954
|
const columnValue = getKeyByValue(columnHeaders, columnField);
|
|
15948
15955
|
const rowName = rowHeaderDefinition.name;
|
|
15949
|
-
const
|
|
15956
|
+
const rowDrilldown = rowHeaderDefinition.drill_down;
|
|
15957
|
+
const rowIndex = ((_a = cell == null ? void 0 : cell.getRow()) == null ? void 0 : _a.getPosition()) - 1;
|
|
15950
15958
|
const rowValue = getKeyByValue(rowHeaders, rowIndex);
|
|
15951
15959
|
if (columnName && rowName && columnValue !== void 0 && rowValue !== void 0) {
|
|
15952
15960
|
return [
|
|
15953
15961
|
{
|
|
15954
15962
|
name: columnName,
|
|
15955
|
-
value: `${columnValue}
|
|
15963
|
+
value: `${columnValue}`,
|
|
15964
|
+
operator: columnValue == null ? "is" : "=",
|
|
15965
|
+
drill_down: columnDrilldown
|
|
15956
15966
|
},
|
|
15957
15967
|
{
|
|
15958
15968
|
name: rowName,
|
|
15959
|
-
value: `${rowValue}
|
|
15969
|
+
value: `${rowValue}`,
|
|
15970
|
+
operator: rowValue == null ? "is" : "=",
|
|
15971
|
+
drill_down: rowDrilldown
|
|
15960
15972
|
}
|
|
15961
15973
|
];
|
|
15962
15974
|
}
|
|
@@ -18942,6 +18954,7 @@
|
|
|
18942
18954
|
dataFormatting,
|
|
18943
18955
|
columnIndexConfig,
|
|
18944
18956
|
maxElements,
|
|
18957
|
+
truncateAt = MAX_CHART_ELEMENTS,
|
|
18945
18958
|
useBuckets = true
|
|
18946
18959
|
}) => {
|
|
18947
18960
|
const aggColumn = aggColIndex != null ? aggColIndex : columnIndexConfig == null ? void 0 : columnIndexConfig.stringColumnIndex;
|
|
@@ -18980,6 +18993,9 @@
|
|
|
18980
18993
|
if (maxElements && aggregatedData.length > maxElements) {
|
|
18981
18994
|
return aggregateOtherCategory(aggregatedData, columnIndexConfig, maxElements);
|
|
18982
18995
|
}
|
|
18996
|
+
if (truncateAt && aggregatedData.length > truncateAt) {
|
|
18997
|
+
aggregatedData.splice(truncateAt);
|
|
18998
|
+
}
|
|
18983
18999
|
if (useBuckets) {
|
|
18984
19000
|
}
|
|
18985
19001
|
return aggregatedData;
|
|
@@ -22166,24 +22182,32 @@
|
|
|
22166
22182
|
const year = Number((_c = columns == null ? void 0 : columns[colIndex]) == null ? void 0 : _c.name);
|
|
22167
22183
|
const month = row == null ? void 0 : row[stringColumnIndex];
|
|
22168
22184
|
const value = `${(_d = pivotOriginalColumnData == null ? void 0 : pivotOriginalColumnData[year]) == null ? void 0 : _d[month]}`;
|
|
22185
|
+
const operator = value == null ? "is" : "=";
|
|
22169
22186
|
groupBys.push({
|
|
22170
22187
|
name: stringColumn.name,
|
|
22171
22188
|
drill_down: stringColumn.drill_down,
|
|
22172
|
-
value
|
|
22189
|
+
value,
|
|
22190
|
+
operator
|
|
22173
22191
|
});
|
|
22174
22192
|
} else if (stringColumn == null ? void 0 : stringColumn.groupable) {
|
|
22193
|
+
const value = row == null ? void 0 : row[stringColumnIndex];
|
|
22194
|
+
const operator = value == null ? "is" : "=";
|
|
22175
22195
|
groupBys.push({
|
|
22176
22196
|
name: stringColumn.name,
|
|
22177
22197
|
drill_down: stringColumn.drill_down,
|
|
22178
|
-
value: `${
|
|
22198
|
+
value: `${value}`,
|
|
22199
|
+
operator
|
|
22179
22200
|
});
|
|
22180
22201
|
}
|
|
22181
22202
|
if (legendColumn == null ? void 0 : legendColumn.groupable) {
|
|
22182
22203
|
if (column.origColumn) {
|
|
22204
|
+
const value = column == null ? void 0 : column.name;
|
|
22205
|
+
const operator = value == null ? "is" : "=";
|
|
22183
22206
|
groupBys.push({
|
|
22184
22207
|
name: legendColumn.name,
|
|
22185
22208
|
drill_down: legendColumn.drill_down,
|
|
22186
|
-
value: `${
|
|
22209
|
+
value: `${value}`,
|
|
22210
|
+
operator
|
|
22187
22211
|
});
|
|
22188
22212
|
}
|
|
22189
22213
|
}
|