@syncfusion/ej2-pivotview 19.3.46 → 19.3.47
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/CHANGELOG.md +13 -5
- package/dist/ej2-pivotview.umd.min.js +2 -2
- package/dist/ej2-pivotview.umd.min.js.map +1 -1
- package/dist/es6/ej2-pivotview.es2015.js +193 -83
- package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
- package/dist/es6/ej2-pivotview.es5.js +217 -107
- package/dist/es6/ej2-pivotview.es5.js.map +1 -1
- package/dist/global/ej2-pivotview.min.js +2 -2
- package/dist/global/ej2-pivotview.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/base/engine.d.ts +2 -0
- package/src/base/engine.js +126 -91
- package/src/pivotview/actions/drill-through.js +3 -1
- package/src/pivotview/actions/excel-export.js +3 -2
- package/src/pivotview/actions/pdf-export.js +4 -3
- package/src/pivotview/base/pivotview-model.d.ts +1 -1
- package/src/pivotview/base/pivotview.d.ts +3 -1
- package/src/pivotview/base/pivotview.js +31 -7
- package/src/pivotview/renderer/render.d.ts +1 -0
- package/src/pivotview/renderer/render.js +50 -3
|
@@ -3866,10 +3866,14 @@ class PivotEngine {
|
|
|
3866
3866
|
if (keyInd !== 0) {
|
|
3867
3867
|
member.valueSort.levelName = parentMember + this.valueSortSettings.headerDelimiter + member.formattedText;
|
|
3868
3868
|
member.valueSort[parentMember + this.valueSortSettings.headerDelimiter + member.formattedText] = 1;
|
|
3869
|
+
member.valueSort.uniqueName = parentMember + this.valueSortSettings.headerDelimiter + (member.actualText ? member.actualText : member.formattedText);
|
|
3870
|
+
member.valueSort[parentMember + this.valueSortSettings.headerDelimiter + (member.actualText ? member.actualText : member.formattedText)] = 1;
|
|
3869
3871
|
}
|
|
3870
3872
|
else {
|
|
3871
3873
|
member.valueSort[member.formattedText] = 1;
|
|
3872
3874
|
member.valueSort.levelName = member.formattedText;
|
|
3875
|
+
member.valueSort[member.actualText ? member.actualText : member.formattedText] = 1;
|
|
3876
|
+
member.valueSort.uniqueName = (member.actualText ? member.actualText : member.formattedText);
|
|
3873
3877
|
}
|
|
3874
3878
|
let memberString = member.valueSort.axis + this.valueSortSettings.headerDelimiter + member.valueSort.levelName;
|
|
3875
3879
|
member.isDrilled = (valueFil && this.isValueFiltersAvail) ?
|
|
@@ -4037,10 +4041,16 @@ class PivotEngine {
|
|
|
4037
4041
|
slicedHeader.formattedText;
|
|
4038
4042
|
slicedHeader.valueSort[parentMember + this.valueSortSettings.headerDelimiter +
|
|
4039
4043
|
slicedHeader.formattedText] = 1;
|
|
4044
|
+
slicedHeader.valueSort.uniqueName = parentMember + this.valueSortSettings.headerDelimiter +
|
|
4045
|
+
(slicedHeader.actualText ? slicedHeader.actualText : slicedHeader.formattedText);
|
|
4046
|
+
slicedHeader.valueSort[parentMember + this.valueSortSettings.headerDelimiter +
|
|
4047
|
+
(slicedHeader.actualText ? slicedHeader.actualText : slicedHeader.formattedText)] = 1;
|
|
4040
4048
|
}
|
|
4041
4049
|
else {
|
|
4042
4050
|
slicedHeader.valueSort[slicedHeader.formattedText] = 1;
|
|
4043
4051
|
slicedHeader.valueSort.levelName = slicedHeader.formattedText;
|
|
4052
|
+
slicedHeader.valueSort[(slicedHeader.actualText ? slicedHeader.actualText : slicedHeader.formattedText)] = 1;
|
|
4053
|
+
slicedHeader.valueSort.uniqueName = (slicedHeader.actualText ? slicedHeader.actualText : slicedHeader.formattedText);
|
|
4044
4054
|
}
|
|
4045
4055
|
member.members = [];
|
|
4046
4056
|
hierarchy.push(member);
|
|
@@ -4225,6 +4235,7 @@ class PivotEngine {
|
|
|
4225
4235
|
isDrilled: false,
|
|
4226
4236
|
indexObject: {},
|
|
4227
4237
|
members: [],
|
|
4238
|
+
actualText: 'Grand' + customText,
|
|
4228
4239
|
formattedText: 'Grand' + customText,
|
|
4229
4240
|
ordinal: len,
|
|
4230
4241
|
type: 'grand sum',
|
|
@@ -4232,6 +4243,8 @@ class PivotEngine {
|
|
|
4232
4243
|
};
|
|
4233
4244
|
set[len].valueSort[set[len].formattedText] = 1;
|
|
4234
4245
|
set[len].valueSort.levelName = set[len].formattedText;
|
|
4246
|
+
set[len].valueSort[set[len].actualText] = 1;
|
|
4247
|
+
set[len].valueSort.uniqueName = set[len].actualText;
|
|
4235
4248
|
for (let ln = 0, lt = filter.length; ln < lt; ln++) {
|
|
4236
4249
|
set[len].indexObject[filter[ln]] = filter[ln];
|
|
4237
4250
|
}
|
|
@@ -4252,74 +4265,85 @@ class PivotEngine {
|
|
|
4252
4265
|
let isLeastNode = !reformAxis[tnum].members.length;
|
|
4253
4266
|
row.colIndex = 0;
|
|
4254
4267
|
row.rowIndex = tnum;
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
this.
|
|
4258
|
-
|
|
4268
|
+
let isRowFieldsAvail = false;
|
|
4269
|
+
if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.values.length > 1) {
|
|
4270
|
+
this.rowIndex = (isNullOrUndefined(this.rowIndex) && !isLeastNode && this.dataSourceSettings.rows.length === 0) ? row.index : this.rowIndex;
|
|
4271
|
+
isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') !== 0);
|
|
4272
|
+
if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') === 0) {
|
|
4273
|
+
row.index = this.rowIndex;
|
|
4274
|
+
}
|
|
4259
4275
|
}
|
|
4260
|
-
|
|
4261
|
-
data[tnum]
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
let
|
|
4271
|
-
let
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4276
|
+
if (!isRowFieldsAvail) {
|
|
4277
|
+
if (!data[tnum]) {
|
|
4278
|
+
data[tnum] = [];
|
|
4279
|
+
this.valueContent[actCnt] = {};
|
|
4280
|
+
data[tnum][0] = this.valueContent[actCnt][0] = this.frameHeaderWithKeys(row);
|
|
4281
|
+
}
|
|
4282
|
+
else {
|
|
4283
|
+
data[tnum][0] = this.valueContent[actCnt][0] = this.frameHeaderWithKeys(row);
|
|
4284
|
+
}
|
|
4285
|
+
if (this.valueAxis && (this.isMultiMeasures || this.alwaysShowValueHeader)) {
|
|
4286
|
+
let hpos = tnum;
|
|
4287
|
+
let actpos = actCnt;
|
|
4288
|
+
let rowIndex = tnum;
|
|
4289
|
+
let isValueCellUpdated = false;
|
|
4290
|
+
if ((((!(level === 0 && this.measureIndex === 0) && !isLeastNode) || isLeastNode) && row.type === 'value' && !row.valueSort.axis) ||
|
|
4291
|
+
(level > this.measureIndex && row.axis === 'row' && row.valueSort.axis)) {
|
|
4292
|
+
let vln = 0;
|
|
4293
|
+
let isValueIndexFound = false;
|
|
4294
|
+
for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
|
|
4295
|
+
if (!isValueIndexFound) {
|
|
4296
|
+
for (vln = 0; vln < vlt; vln++) {
|
|
4297
|
+
if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
|
|
4298
|
+
isValueIndexFound = true;
|
|
4299
|
+
isValueCellUpdated = true;
|
|
4300
|
+
break;
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
}
|
|
4304
|
+
if (level > this.measureIndex && row.axis == 'row' && row.valueSort.axis) {
|
|
4305
|
+
this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
|
|
4306
|
+
}
|
|
4307
|
+
else {
|
|
4308
|
+
if (!reformAxis[pIndex]) {
|
|
4309
|
+
isValueCellUpdated = false;
|
|
4279
4310
|
break;
|
|
4280
4311
|
}
|
|
4312
|
+
this.updateRowData(reformAxis, columns, tnum, data, vln, pIndex, cln, dln, actCnt, rTotal, cTotal);
|
|
4281
4313
|
}
|
|
4314
|
+
dln = data[tnum].length;
|
|
4282
4315
|
}
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
}
|
|
4291
|
-
this.updateRowData(reformAxis, columns, tnum, data, vln, pIndex, cln, dln, actCnt, rTotal, cTotal);
|
|
4316
|
+
}
|
|
4317
|
+
if (!isValueCellUpdated) {
|
|
4318
|
+
for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
|
|
4319
|
+
dln = data[tnum].length;
|
|
4320
|
+
data[hpos][dln] = this.valueContent[actpos][dln] = {
|
|
4321
|
+
axis: 'value', actualText: '', colSpan: 1,
|
|
4322
|
+
colIndex: dln, formattedText: '', hasChild: false
|
|
4323
|
+
};
|
|
4292
4324
|
}
|
|
4293
|
-
dln = data[tnum].length;
|
|
4294
4325
|
}
|
|
4326
|
+
this.recursiveRowData(rows, reformAxis, columns, rowIndex, data, vlt, isLeastNode, rln, vlt, level, rTotal, cTotal);
|
|
4295
4327
|
}
|
|
4296
|
-
|
|
4328
|
+
else {
|
|
4297
4329
|
for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
}
|
|
4307
|
-
else {
|
|
4308
|
-
for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
|
|
4309
|
-
for (let vln = 0; vln < vlt; vln++) {
|
|
4310
|
-
if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
|
|
4311
|
-
let name = this.values[vln].caption ? this.values[vln].caption : this.values[vln].name;
|
|
4312
|
-
if (columns[cln].valueSort.levelName && columns[cln].valueSort.levelName.toString().indexOf(name) > -1) {
|
|
4330
|
+
for (let vln = 0; vln < vlt; vln++) {
|
|
4331
|
+
if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
|
|
4332
|
+
if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
|
|
4333
|
+
this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
|
|
4334
|
+
dln = data[tnum].length;
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
else {
|
|
4313
4338
|
this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
|
|
4314
4339
|
dln = data[tnum].length;
|
|
4315
4340
|
}
|
|
4316
4341
|
}
|
|
4317
|
-
else {
|
|
4318
|
-
this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
|
|
4319
|
-
dln = data[tnum].length;
|
|
4320
|
-
}
|
|
4321
4342
|
}
|
|
4343
|
+
this.recursiveRowData(rows, reformAxis, columns, tnum, data, vlt, isLeastNode, rln, 0, level, rTotal, cTotal);
|
|
4322
4344
|
}
|
|
4345
|
+
}
|
|
4346
|
+
else if (!isLeastNode) {
|
|
4323
4347
|
this.recursiveRowData(rows, reformAxis, columns, tnum, data, vlt, isLeastNode, rln, 0, level, rTotal, cTotal);
|
|
4324
4348
|
}
|
|
4325
4349
|
}
|
|
@@ -5115,14 +5139,17 @@ class PivotEngine {
|
|
|
5115
5139
|
return currentCellSets;
|
|
5116
5140
|
}
|
|
5117
5141
|
/* eslint-disable , @typescript-eslint/no-explicit-any */
|
|
5118
|
-
updateValueMembers(hasMeasureIndex, headerInfo,
|
|
5142
|
+
updateValueMembers(hasMeasureIndex, headerInfo, levelInfo, columnHeaders, axis, vcnt, levelIndex) {
|
|
5143
|
+
let levelName = levelInfo && !isNullOrUndefined(levelInfo.levelName) ? levelInfo.levelName.toString() : undefined;
|
|
5144
|
+
let uniqueName = levelInfo && !isNullOrUndefined(levelInfo.uniqueName) ? levelInfo.uniqueName.toString() : undefined;
|
|
5119
5145
|
if (hasMeasureIndex) {
|
|
5120
5146
|
for (let vln = 0; vln < vcnt; vln++) {
|
|
5121
|
-
let
|
|
5147
|
+
let field = this.values[vln];
|
|
5148
|
+
let name = field.caption ? field.caption : field.name;
|
|
5122
5149
|
let calObj = {
|
|
5123
5150
|
axis: this.valueAxis ? 'row' : 'column',
|
|
5124
5151
|
rowIndex: !this.valueAxis ? (headerInfo && levelIndex <= headerInfo.rowIndex ? (headerInfo.rowIndex + 1) : levelIndex) : 0,
|
|
5125
|
-
actualText:
|
|
5152
|
+
actualText: field.name,
|
|
5126
5153
|
formattedText: name,
|
|
5127
5154
|
level: 0,
|
|
5128
5155
|
valueSort: {},
|
|
@@ -5134,14 +5161,16 @@ class PivotEngine {
|
|
|
5134
5161
|
indexObject: !this.valueAxis && headerInfo ? headerInfo.indexObject : null
|
|
5135
5162
|
};
|
|
5136
5163
|
if (axis.length > 0) {
|
|
5137
|
-
calObj.showSubTotals =
|
|
5164
|
+
calObj.showSubTotals = field.showSubTotals;
|
|
5138
5165
|
}
|
|
5139
5166
|
let vData = calObj.valueSort;
|
|
5140
|
-
vData.axis = !this.valueAxis ?
|
|
5167
|
+
vData.axis = !this.valueAxis ? field.name : undefined;
|
|
5141
5168
|
vData[(levelName ? (levelName + this.valueSortSettings.headerDelimiter) : '') + name] = 1;
|
|
5169
|
+
vData[(uniqueName ? (uniqueName + this.valueSortSettings.headerDelimiter) : '') + field.name] = 1;
|
|
5142
5170
|
vData.levelName = (levelName ? (levelName + this.valueSortSettings.headerDelimiter) : '') + name;
|
|
5171
|
+
vData.uniqueName = (uniqueName ? (uniqueName + this.valueSortSettings.headerDelimiter) : '') + field.name;
|
|
5143
5172
|
columnHeaders.push(calObj);
|
|
5144
|
-
this.updateValueMembers(false, headerInfo,
|
|
5173
|
+
this.updateValueMembers(false, headerInfo, vData, calObj.members, axis, vcnt, levelIndex + 1);
|
|
5145
5174
|
}
|
|
5146
5175
|
}
|
|
5147
5176
|
else {
|
|
@@ -5152,7 +5181,9 @@ class PivotEngine {
|
|
|
5152
5181
|
let hData = {};
|
|
5153
5182
|
hData.axis = header.valueSort.axis;
|
|
5154
5183
|
hData[(levelName ? (levelName + this.valueSortSettings.headerDelimiter) : '') + header.formattedText] = 1;
|
|
5184
|
+
hData[(uniqueName ? (uniqueName + this.valueSortSettings.headerDelimiter) : '') + header.actualText] = 1;
|
|
5155
5185
|
hData.levelName = (levelName ? (levelName + this.valueSortSettings.headerDelimiter) : '') + header.formattedText;
|
|
5186
|
+
hData.uniqueName = (uniqueName ? (uniqueName + this.valueSortSettings.headerDelimiter) : '') + header.actualText;
|
|
5156
5187
|
header.valueSort = hData;
|
|
5157
5188
|
let drillInfo = hData.axis + this.valueSortSettings.headerDelimiter + hData.levelName;
|
|
5158
5189
|
if (header.isDrilled && ((this.isExpandAll && this.fieldDrillCollection[drillInfo]) ||
|
|
@@ -5163,16 +5194,16 @@ class PivotEngine {
|
|
|
5163
5194
|
if (header.isDrilled && axis[rln].members.length > 0) {
|
|
5164
5195
|
if (this.valueAxis && levelIndex < this.measureIndex && this.measureIndex !== (levelIndex + 1) && (!(axis[rln].hasChild &&
|
|
5165
5196
|
((!isNullOrUndefined(axis[rln].showSubTotals) && !axis[rln].showSubTotals) || !this.showSubTotals || !this.showRowSubTotals)))) {
|
|
5166
|
-
this.updateValueMembers(true, header, hData
|
|
5197
|
+
this.updateValueMembers(true, header, hData, columnHeaders[columnHeaders.length - 1].members, [], vcnt, levelIndex);
|
|
5167
5198
|
}
|
|
5168
|
-
this.updateValueMembers(this.measureIndex === (levelIndex + 1), header, hData
|
|
5199
|
+
this.updateValueMembers(this.measureIndex === (levelIndex + 1), header, hData, columnHeaders[columnHeaders.length - 1].members, axis[rln].members, vcnt, levelIndex + 1);
|
|
5169
5200
|
if (!this.valueAxis && levelIndex < this.measureIndex && this.measureIndex !== (levelIndex + 1) && (!(axis[rln].hasChild &&
|
|
5170
5201
|
((!isNullOrUndefined(axis[rln].showSubTotals) && !axis[rln].showSubTotals) || !this.showSubTotals || !this.showColumnSubTotals)))) {
|
|
5171
|
-
this.updateValueMembers(true, header, hData
|
|
5202
|
+
this.updateValueMembers(true, header, hData, columnHeaders[columnHeaders.length - 1].members, [], vcnt, levelIndex);
|
|
5172
5203
|
}
|
|
5173
5204
|
}
|
|
5174
5205
|
else if (levelIndex < this.measureIndex) {
|
|
5175
|
-
this.updateValueMembers(true, header, hData
|
|
5206
|
+
this.updateValueMembers(true, header, hData, columnHeaders[columnHeaders.length - 1].members, [], vcnt, levelIndex);
|
|
5176
5207
|
}
|
|
5177
5208
|
}
|
|
5178
5209
|
}
|
|
@@ -5215,11 +5246,12 @@ class PivotEngine {
|
|
|
5215
5246
|
if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
|
|
5216
5247
|
let columnHeaders = [];
|
|
5217
5248
|
if (this.showGrandTotals && this.showColumnGrandTotals && axis[axis.length - 1].type == 'grand sum') {
|
|
5218
|
-
this.updateValueMembers(this.measureIndex === 0, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
|
|
5249
|
+
this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
|
|
5219
5250
|
this.updateValueMembers(false, null, null, columnHeaders, axis.slice(axis.length - 1, axis.length), vcnt, -1);
|
|
5220
5251
|
}
|
|
5221
5252
|
else {
|
|
5222
|
-
|
|
5253
|
+
let hasColumnTotal = columns.length === 0 && axis.length === 1 && axis[0].type == 'grand sum';
|
|
5254
|
+
this.updateValueMembers(!hasColumnTotal && this.measureIndex === 0, null, null, columnHeaders, axis, vcnt, hasColumnTotal ? -1 : 0);
|
|
5223
5255
|
}
|
|
5224
5256
|
this.getAggregatedHeaders(rows, columns, this.rMembers, columnHeaders, values);
|
|
5225
5257
|
if (this.selectedHeaders.values.length > 0) {
|
|
@@ -5253,11 +5285,12 @@ class PivotEngine {
|
|
|
5253
5285
|
}
|
|
5254
5286
|
else if (rowAxis.length == 0 && (this.valueAxis && (this.isMultiMeasures || this.alwaysShowValueHeader)) && this.values.length > 0) {
|
|
5255
5287
|
if (this.showGrandTotals && this.showRowGrandTotals && this.rMembers[this.rMembers.length - 1].type == 'grand sum') {
|
|
5256
|
-
this.updateValueMembers(this.measureIndex == 0, null, null, rowAxis, this.rMembers.slice(0, this.rMembers.length - 1), this.values.length, 0);
|
|
5288
|
+
this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(0, this.rMembers.length - 1), this.values.length, 0);
|
|
5257
5289
|
this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(this.rMembers.length - 1, this.rMembers.length), this.values.length, -1);
|
|
5258
5290
|
}
|
|
5259
5291
|
else {
|
|
5260
|
-
|
|
5292
|
+
let hasRowTotal = rows.length === 0 && this.rMembers.length === 1 && this.rMembers[0].type == 'grand sum';
|
|
5293
|
+
this.updateValueMembers(!hasRowTotal && this.measureIndex == 0, null, null, rowAxis, this.rMembers, this.values.length, hasRowTotal ? -1 : 0);
|
|
5261
5294
|
}
|
|
5262
5295
|
this.getAggregatedHeaders(rows, columns, rowAxis, axis, values);
|
|
5263
5296
|
if (this.selectedHeaders.values.length > 0) {
|
|
@@ -5365,6 +5398,8 @@ class PivotEngine {
|
|
|
5365
5398
|
let vData = data[colItmLn][(tnum * vcnt) + 1 + vln].valueSort;
|
|
5366
5399
|
vData[axis[rln].valueSort.levelName + this.valueSortSettings.headerDelimiter + name] = 1;
|
|
5367
5400
|
vData.levelName = axis[rln].valueSort.levelName + this.valueSortSettings.headerDelimiter + name;
|
|
5401
|
+
vData[axis[rln].valueSort.uniqueName + this.valueSortSettings.headerDelimiter + this.values[vln].name] = 1;
|
|
5402
|
+
vData.uniqueName = axis[rln].valueSort.uniqueName + this.valueSortSettings.headerDelimiter + this.values[vln].name;
|
|
5368
5403
|
if (vData && vData[sortText]) {
|
|
5369
5404
|
this.valueSortSettings.columnIndex = (tnum * vcnt) + 1 + vln;
|
|
5370
5405
|
}
|
|
@@ -7980,6 +8015,8 @@ class Render {
|
|
|
7980
8015
|
if (tCell && (this.parent.notEmpty) && this.engine.headerContent) {
|
|
7981
8016
|
let customClass = this.parent.hyperlinkSettings.cssClass;
|
|
7982
8017
|
let cell = args.data[0];
|
|
8018
|
+
let isRowFieldsAvail = cell.valueSort.levelName === (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row' &&
|
|
8019
|
+
this.parent.localeObj.getConstant('grandTotal') + (this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) + (cell.formattedText));
|
|
7983
8020
|
tCell.setAttribute('index', cell.rowIndex ? cell.rowIndex.toString() : '0');
|
|
7984
8021
|
if (tCell.getAttribute('aria-colindex') === '0') {
|
|
7985
8022
|
if (this.parent.dataType === 'pivot') {
|
|
@@ -8033,11 +8070,17 @@ class Render {
|
|
|
8033
8070
|
if (cell.type === 'grand sum') {
|
|
8034
8071
|
this.rowGrandPos = cell.rowIndex;
|
|
8035
8072
|
tCell.classList.add('e-gtot');
|
|
8036
|
-
|
|
8073
|
+
let values = this.parent.dataSourceSettings.values;
|
|
8074
|
+
localizedText = isNullOrUndefined(cell.valueSort.axis) ? (this.parent.dataSourceSettings.rows.length === 0 && values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row') ?
|
|
8075
|
+
this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values[values.length - 1].type) + ' ' +
|
|
8076
|
+
this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values[values.length - 1].caption) ? values[values.length - 1].caption : values[values.length - 1].name) :
|
|
8077
|
+
this.parent.localeObj.getConstant('grandTotal') : cell.formattedText;
|
|
8037
8078
|
}
|
|
8038
8079
|
else if (cell.valueSort.levelName === (this.parent.localeObj.getConstant('grandTotal') +
|
|
8039
8080
|
(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) + (cell.formattedText))) {
|
|
8040
8081
|
tCell.classList.add('e-gtot');
|
|
8082
|
+
localizedText = isRowFieldsAvail ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cell.actualText].aggregateType) + ' '
|
|
8083
|
+
+ this.parent.localeObj.getConstant('of') + ' ' + cell.formattedText : localizedText;
|
|
8041
8084
|
}
|
|
8042
8085
|
else {
|
|
8043
8086
|
tCell.classList.add('e-stot');
|
|
@@ -8081,6 +8124,7 @@ class Render {
|
|
|
8081
8124
|
tCell.classList.add(VALUESCONTENT);
|
|
8082
8125
|
cell = args.data[Number(tCell.getAttribute('aria-colindex'))];
|
|
8083
8126
|
cell = isNullOrUndefined(cell) ? args.column.customAttributes.cell : cell;
|
|
8127
|
+
cell.isGrandSum = isRowFieldsAvail ? true : cell.isGrandSum;
|
|
8084
8128
|
if (cell.isSum) {
|
|
8085
8129
|
tCell.classList.add(SUMMARY);
|
|
8086
8130
|
}
|
|
@@ -8288,16 +8332,20 @@ class Render {
|
|
|
8288
8332
|
else {
|
|
8289
8333
|
tCell = this.onOlapColumnCellBoundEvent(tCell, cell);
|
|
8290
8334
|
}
|
|
8291
|
-
|
|
8335
|
+
let isColumnFieldsAvail = (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column' &&
|
|
8336
|
+
cell.valueSort.levelName === (this.parent.localeObj.getConstant('grandTotal') + (this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) + (cell.formattedText)));
|
|
8337
|
+
if (cell.type || isColumnFieldsAvail) {
|
|
8292
8338
|
tCell.classList.add(cell.type === 'grand sum' ? 'e-gtot' : 'e-stot');
|
|
8293
8339
|
if (cell.type === 'grand sum') {
|
|
8294
8340
|
this.colGrandPos = cell.colIndex;
|
|
8295
8341
|
}
|
|
8296
|
-
else {
|
|
8342
|
+
else if (cell.type) {
|
|
8297
8343
|
tCell.classList.add('e-colstot');
|
|
8298
8344
|
}
|
|
8299
8345
|
let localizedText = cell.type === 'grand sum' ? (isNullOrUndefined(cell.valueSort.axis) ? this.parent.localeObj.getConstant('grandTotal') : cell.formattedText) :
|
|
8300
8346
|
cell.formattedText.split('Total')[0] + this.parent.localeObj.getConstant('total');
|
|
8347
|
+
localizedText = isColumnFieldsAvail ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cell.actualText].aggregateType)
|
|
8348
|
+
+ ' ' + this.parent.localeObj.getConstant('of') + ' ' + cell.formattedText : localizedText;
|
|
8301
8349
|
if (tCell.querySelector('.e-headertext') !== null) {
|
|
8302
8350
|
tCell.querySelector('.e-headertext').innerText = localizedText;
|
|
8303
8351
|
}
|
|
@@ -8735,8 +8783,39 @@ class Render {
|
|
|
8735
8783
|
}
|
|
8736
8784
|
return formatArray;
|
|
8737
8785
|
}
|
|
8786
|
+
getValidHeader(args, axis) {
|
|
8787
|
+
let values = this.parent.dataSourceSettings.values;
|
|
8788
|
+
if (axis === 'row') {
|
|
8789
|
+
let cellInfo = args;
|
|
8790
|
+
if (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) {
|
|
8791
|
+
if (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row' && (this.parent.localeObj.getConstant('grandTotal') +
|
|
8792
|
+
this.parent.dataSourceSettings.valueSortSettings.headerDelimiter + cellInfo.value) === cellInfo.data[0].valueSort.levelName) {
|
|
8793
|
+
return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cellInfo.value.toString()].aggregateType)
|
|
8794
|
+
+ ' ' + this.parent.localeObj.getConstant('of') + ' ' + cellInfo.value.toString();
|
|
8795
|
+
}
|
|
8796
|
+
else if (values.length === 1) {
|
|
8797
|
+
return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values[values.length - 1].type)
|
|
8798
|
+
+ ' ' + this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values[values.length - 1].caption) ? values[values.length - 1].caption : values[values.length - 1].name);
|
|
8799
|
+
}
|
|
8800
|
+
}
|
|
8801
|
+
return cellInfo.value;
|
|
8802
|
+
}
|
|
8803
|
+
else if (axis === 'column') {
|
|
8804
|
+
let cellInfo = args;
|
|
8805
|
+
if (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) {
|
|
8806
|
+
if (!isNullOrUndefined(args.gridCell.column.customAttributes) && this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column' &&
|
|
8807
|
+
(this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter + cellInfo.gridCell.column.customAttributes.cell.formattedText)
|
|
8808
|
+
=== cellInfo.gridCell.column.customAttributes.cell.valueSort.levelName) {
|
|
8809
|
+
return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cellInfo
|
|
8810
|
+
.gridCell.column.customAttributes.cell.actualText].aggregateType) + ' ' + this.parent.localeObj.getConstant('of') + ' ' + cellInfo.gridCell.column.customAttributes.cell.formattedText;
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
return (cellInfo.cell).value;
|
|
8814
|
+
}
|
|
8815
|
+
}
|
|
8738
8816
|
/* eslint-disable */
|
|
8739
8817
|
excelColumnEvent(args) {
|
|
8818
|
+
(args.cell).value = this.getValidHeader(args, 'column');
|
|
8740
8819
|
if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
|
|
8741
8820
|
this.parent.lastColumn = args.gridCell.column;
|
|
8742
8821
|
args.gridCell.column.width = args.gridCell.column.minWidth;
|
|
@@ -8745,6 +8824,7 @@ class Render {
|
|
|
8745
8824
|
this.parent.trigger(excelHeaderQueryCellInfo, args);
|
|
8746
8825
|
}
|
|
8747
8826
|
pdfColumnEvent(args) {
|
|
8827
|
+
(args.cell).value = this.getValidHeader(args, 'column');
|
|
8748
8828
|
if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
|
|
8749
8829
|
this.parent.lastColumn = args.gridCell.column;
|
|
8750
8830
|
args.gridCell.column.width = args.gridCell.column.minWidth;
|
|
@@ -8785,6 +8865,7 @@ class Render {
|
|
|
8785
8865
|
}
|
|
8786
8866
|
}
|
|
8787
8867
|
args = this.exportContentEvent(args);
|
|
8868
|
+
args.value = args.column.field === '0.formattedText' ? this.getValidHeader(args, 'row') : args.value;
|
|
8788
8869
|
this.parent.trigger(excelQueryCellInfo, args);
|
|
8789
8870
|
}
|
|
8790
8871
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -8808,6 +8889,7 @@ class Render {
|
|
|
8808
8889
|
}
|
|
8809
8890
|
args.style = { paragraphIndent: level * 10 };
|
|
8810
8891
|
this.lastSpan = isValueCell ? this.lastSpan : level;
|
|
8892
|
+
args.value = this.getValidHeader(args, 'row');
|
|
8811
8893
|
}
|
|
8812
8894
|
this.parent.trigger(pdfQueryCellInfo, args);
|
|
8813
8895
|
}
|
|
@@ -13724,11 +13806,13 @@ class DrillThrough {
|
|
|
13724
13806
|
let valuetText = aggType === 'CalculatedField' ? valueCaption.toString() : aggType !== '' ?
|
|
13725
13807
|
(this.parent.localeObj.getConstant(aggType) + ' ' + this.parent.localeObj.getConstant('of') + ' ' + valueCaption) :
|
|
13726
13808
|
valueCaption;
|
|
13809
|
+
let rowHeaders = this.parent.dataSourceSettings.valueAxis === 'row' ? this.parent.getRowText(Number(element.getAttribute('index')), 0) :
|
|
13810
|
+
pivotValue.rowHeaders === '' ? '' : pivotValue.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(' - ');
|
|
13727
13811
|
let eventArgs = {
|
|
13728
13812
|
currentTarget: element,
|
|
13729
13813
|
currentCell: pivotValue,
|
|
13730
13814
|
rawData: rawData,
|
|
13731
|
-
rowHeaders:
|
|
13815
|
+
rowHeaders: rowHeaders,
|
|
13732
13816
|
columnHeaders: pivotValue.columnHeaders === '' ? '' : pivotValue.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(' - '),
|
|
13733
13817
|
value: valuetText + '(' + pivotValue.formattedText + ')',
|
|
13734
13818
|
gridColumns: this.drillThroughDialog.frameGridColumns(rawData),
|
|
@@ -23656,13 +23740,21 @@ let PivotView = class PivotView extends Component {
|
|
|
23656
23740
|
let cell = this.pivotValues[rowIndex][colIndex];
|
|
23657
23741
|
let level = this.getLevel(cell);
|
|
23658
23742
|
let rowText = cell.type === 'grand sum' ? this.localeObj.getConstant('grandTotal') : cell.formattedText;
|
|
23659
|
-
|
|
23660
|
-
rowIndex
|
|
23661
|
-
|
|
23662
|
-
|
|
23663
|
-
|
|
23664
|
-
|
|
23665
|
-
|
|
23743
|
+
if (this.dataSourceSettings.valueAxis === 'row') {
|
|
23744
|
+
rowText = (this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.values.length > 1) ? this.pivotValues[rowIndex][0].valueSort.levelName.toString().slice((this.localeObj.getConstant('grandTotal')
|
|
23745
|
+
+ this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString() : this.dataSourceSettings.values.length === 1 ? !isNullOrUndefined(this.dataSourceSettings.values[0].caption) ?
|
|
23746
|
+
this.dataSourceSettings.values[0].caption : this.dataSourceSettings.values[0].name : this.pivotValues[rowIndex][0].valueSort.levelName.toString();
|
|
23747
|
+
return rowText.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(' - ');
|
|
23748
|
+
}
|
|
23749
|
+
else {
|
|
23750
|
+
while (level > 0 || cell.index === undefined) {
|
|
23751
|
+
rowIndex--;
|
|
23752
|
+
cell = this.pivotValues[rowIndex][colIndex];
|
|
23753
|
+
if (cell.index !== undefined) {
|
|
23754
|
+
if (level > cell.level) {
|
|
23755
|
+
rowText = rowText + ' - ' + cell.formattedText;
|
|
23756
|
+
level = level - 1;
|
|
23757
|
+
}
|
|
23666
23758
|
}
|
|
23667
23759
|
}
|
|
23668
23760
|
}
|
|
@@ -25047,6 +25139,22 @@ let PivotView = class PivotView extends Component {
|
|
|
25047
25139
|
this.numberFormattingModule.showNumberFormattingDialog();
|
|
25048
25140
|
}
|
|
25049
25141
|
}
|
|
25142
|
+
/** @hidden */
|
|
25143
|
+
getValuesHeader(pivotCell, type) {
|
|
25144
|
+
let values = this.dataSourceSettings.values;
|
|
25145
|
+
if (type === 'value' && !isNullOrUndefined(pivotCell.valueSort) && (this.localeObj.getConstant('grandTotal') + this.dataSourceSettings.valueSortSettings.headerDelimiter + pivotCell.formattedText)
|
|
25146
|
+
=== pivotCell.valueSort.levelName && ((pivotCell.axis === 'column' && this.dataSourceSettings.columns.length === 0 && this.dataSourceSettings.valueAxis === 'column') || (pivotCell.axis === 'row' &&
|
|
25147
|
+
this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.valueAxis === 'row'))) {
|
|
25148
|
+
return this.localeObj.getConstant('total') + ' ' + this.localeObj.getConstant(this.engineModule.fieldList[pivotCell.actualText].aggregateType) + ' ' +
|
|
25149
|
+
this.localeObj.getConstant('of') + ' ' + pivotCell.formattedText;
|
|
25150
|
+
}
|
|
25151
|
+
else if (type === 'grandTotal' && values.length === 1 && this.dataSourceSettings.valueAxis === 'row' && pivotCell.formattedText === this.localeObj.getConstant('grandTotal')) {
|
|
25152
|
+
return this.localeObj.getConstant('total') + ' ' + this.localeObj.getConstant(values[values.length - 1].type) + ' ' +
|
|
25153
|
+
this.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values[values.length - 1].caption) ? values[values.length - 1].caption
|
|
25154
|
+
: values[values.length - 1].name);
|
|
25155
|
+
}
|
|
25156
|
+
return pivotCell.formattedText;
|
|
25157
|
+
}
|
|
25050
25158
|
};
|
|
25051
25159
|
__decorate([
|
|
25052
25160
|
Property('USD')
|
|
@@ -25494,13 +25602,14 @@ class ExcelExport$1 {
|
|
|
25494
25602
|
if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
|
|
25495
25603
|
let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
|
|
25496
25604
|
if (pivotCell.type === 'grand sum') {
|
|
25497
|
-
cellValue = this.parent.
|
|
25605
|
+
cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
|
|
25606
|
+
this.parent.localeObj.getConstant('grandTotal');
|
|
25498
25607
|
}
|
|
25499
25608
|
else if (pivotCell.type === 'sum') {
|
|
25500
25609
|
cellValue = cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total'));
|
|
25501
25610
|
}
|
|
25502
25611
|
else {
|
|
25503
|
-
cellValue = cellValue;
|
|
25612
|
+
cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
|
|
25504
25613
|
}
|
|
25505
25614
|
if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
|
|
25506
25615
|
cells.push({
|
|
@@ -25817,9 +25926,10 @@ class PDFExport {
|
|
|
25817
25926
|
let pivotCell = pivotValues[rCnt][cCnt];
|
|
25818
25927
|
if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
|
|
25819
25928
|
let cellValue = pivotCell.formattedText;
|
|
25820
|
-
cellValue =
|
|
25821
|
-
|
|
25822
|
-
|
|
25929
|
+
cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
|
|
25930
|
+
cellValue = pivotCell.type === 'grand sum' ? (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
|
|
25931
|
+
this.parent.localeObj.getConstant('grandTotal') : (pivotCell.type === 'sum' ?
|
|
25932
|
+
cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total')) : cellValue);
|
|
25823
25933
|
if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
|
|
25824
25934
|
pdfGridRow.cells.getCell(localCnt).columnSpan = pivotCell.colSpan ?
|
|
25825
25935
|
(pageSize - localCnt < pivotCell.colSpan ? pageSize - localCnt : pivotCell.colSpan) : 1;
|