@syncfusion/ej2-pivotview 19.4.52 → 19.4.55

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.
@@ -234,11 +234,55 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
234
234
  return collection;
235
235
  }
236
236
  };
237
- PivotUtil.cloneFilterSettings = function (collection) {
237
+ PivotUtil.cloneOlapFieldSettings = function (collection) {
238
238
  if (collection) {
239
239
  var clonedCollection = [];
240
240
  for (var _i = 0, collection_2 = collection; _i < collection_2.length; _i++) {
241
241
  var set = collection_2[_i];
242
+ clonedCollection.push(this.getDefinedObj({
243
+ caption: set.caption,
244
+ hasChildren: set.hasChildren,
245
+ id: set.id,
246
+ isSelected: set.isSelected,
247
+ name: set.name,
248
+ spriteCssClass: set.spriteCssClass,
249
+ tag: set.tag,
250
+ type: set.type,
251
+ pid: set.pid,
252
+ expanded: set.expanded,
253
+ defaultHierarchy: set.defaultHierarchy,
254
+ hasAllMember: set.hasAllMember,
255
+ allMember: set.allMember,
256
+ isChecked: set.isChecked,
257
+ filterMembers: set.filterMembers,
258
+ childMembers: set.childMembers,
259
+ searchMembers: set.searchMembers,
260
+ htmlAttributes: set.htmlAttributes,
261
+ currrentMembers: set.currrentMembers,
262
+ isHierarchy: set.isHierarchy,
263
+ isNamedSets: set.isNamedSets,
264
+ formatString: set.formatString,
265
+ actualFilter: set.actualFilter,
266
+ levels: set.levels,
267
+ levelCount: set.levelCount,
268
+ memberType: set.memberType,
269
+ fieldType: set.fieldType,
270
+ parentHierarchy: set.parentHierarchy
271
+ /* eslint-disable @typescript-eslint/no-explicit-any */
272
+ }));
273
+ /* eslint-enable @typescript-eslint/no-explicit-any */
274
+ }
275
+ return clonedCollection;
276
+ }
277
+ else {
278
+ return collection;
279
+ }
280
+ };
281
+ PivotUtil.cloneFilterSettings = function (collection) {
282
+ if (collection) {
283
+ var clonedCollection = [];
284
+ for (var _i = 0, collection_3 = collection; _i < collection_3.length; _i++) {
285
+ var set = collection_3[_i];
242
286
  clonedCollection.push(this.getDefinedObj({
243
287
  name: set.name,
244
288
  type: set.type,
@@ -265,8 +309,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
265
309
  PivotUtil.cloneSortSettings = function (collection) {
266
310
  if (collection) {
267
311
  var clonedCollection = [];
268
- for (var _i = 0, collection_3 = collection; _i < collection_3.length; _i++) {
269
- var set = collection_3[_i];
312
+ for (var _i = 0, collection_4 = collection; _i < collection_4.length; _i++) {
313
+ var set = collection_4[_i];
270
314
  clonedCollection.push(this.getDefinedObj({
271
315
  name: set.name,
272
316
  order: set.order
@@ -283,8 +327,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
283
327
  PivotUtil.cloneDrillMemberSettings = function (collection) {
284
328
  if (collection) {
285
329
  var clonedCollection = [];
286
- for (var _i = 0, collection_4 = collection; _i < collection_4.length; _i++) {
287
- var set = collection_4[_i];
330
+ for (var _i = 0, collection_5 = collection; _i < collection_5.length; _i++) {
331
+ var set = collection_5[_i];
288
332
  clonedCollection.push(this.getDefinedObj({
289
333
  name: set.name,
290
334
  delimiter: set.delimiter,
@@ -302,8 +346,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
302
346
  PivotUtil.cloneFormatSettings = function (collection) {
303
347
  if (collection) {
304
348
  var clonedCollection = [];
305
- for (var _i = 0, collection_5 = collection; _i < collection_5.length; _i++) {
306
- var set = collection_5[_i];
349
+ for (var _i = 0, collection_6 = collection; _i < collection_6.length; _i++) {
350
+ var set = collection_6[_i];
307
351
  clonedCollection.push(this.getDefinedObj({
308
352
  name: set.name,
309
353
  calendar: set.calendar,
@@ -361,8 +405,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
361
405
  PivotUtil.cloneCalculatedFieldSettings = function (collection) {
362
406
  if (collection) {
363
407
  var clonedCollection = [];
364
- for (var _i = 0, collection_6 = collection; _i < collection_6.length; _i++) {
365
- var set = collection_6[_i];
408
+ for (var _i = 0, collection_7 = collection; _i < collection_7.length; _i++) {
409
+ var set = collection_7[_i];
366
410
  clonedCollection.push(this.getDefinedObj({
367
411
  name: set.name,
368
412
  formatString: set.formatString,
@@ -381,8 +425,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
381
425
  PivotUtil.cloneConditionalFormattingSettings = function (collection) {
382
426
  if (collection) {
383
427
  var clonedCollection = [];
384
- for (var _i = 0, collection_7 = collection; _i < collection_7.length; _i++) {
385
- var set = collection_7[_i];
428
+ for (var _i = 0, collection_8 = collection; _i < collection_8.length; _i++) {
429
+ var set = collection_8[_i];
386
430
  clonedCollection.push(this.getDefinedObj({
387
431
  applyGrandTotals: set.applyGrandTotals,
388
432
  conditions: set.conditions,
@@ -409,8 +453,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
409
453
  PivotUtil.cloneGroupSettings = function (collection) {
410
454
  if (collection) {
411
455
  var clonedCollection = [];
412
- for (var _i = 0, collection_8 = collection; _i < collection_8.length; _i++) {
413
- var set = collection_8[_i];
456
+ for (var _i = 0, collection_9 = collection; _i < collection_9.length; _i++) {
457
+ var set = collection_9[_i];
414
458
  clonedCollection.push(this.getDefinedObj({
415
459
  name: set.name,
416
460
  caption: set.caption,
@@ -433,8 +477,8 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
433
477
  PivotUtil.cloneCustomGroups = function (collection) {
434
478
  if (collection) {
435
479
  var clonedCollection = [];
436
- for (var _i = 0, collection_9 = collection; _i < collection_9.length; _i++) {
437
- var set = collection_9[_i];
480
+ for (var _i = 0, collection_10 = collection; _i < collection_10.length; _i++) {
481
+ var set = collection_10[_i];
438
482
  clonedCollection.push(this.getDefinedObj({
439
483
  groupName: set.groupName,
440
484
  items: set.items ? set.items.slice() : set.items
@@ -8808,7 +8852,7 @@ var Render = /** @__PURE__ @class */ (function () {
8808
8852
  if (isNaN(parHeight)) {
8809
8853
  parHeight = parHeight > this.parent.minHeight ? parHeight : this.parent.minHeight;
8810
8854
  }
8811
- if (this.parent.currentView !== 'Chart') {
8855
+ if ((this.parent.showToolbar && this.parent.currentView !== 'Chart') || (!this.parent.showToolbar && this.parent.displayOption.view !== 'Chart')) {
8812
8856
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8813
8857
  var rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8814
8858
  var gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS) ?
@@ -10267,7 +10311,7 @@ var DataSourceUpdate = /** @__PURE__ @class */ (function () {
10267
10311
  break;
10268
10312
  case 'values':
10269
10313
  droppedPosition !== -1 ? _this.parent.dataSourceSettings.values.splice(droppedPosition, 0, dataSourceItem) : _this.parent.dataSourceSettings.values.push(dataSourceItem);
10270
- if (_this.parent.dataType === 'olap' && !_this.parent.engineModule.isMeasureAvail) {
10314
+ if (_this.parent.dataType === 'olap' && !_this.parent.engineModule.isMeasureAvail && !(_this.parent.dataSourceSettings.values.length > 1)) {
10271
10315
  var measureField = {
10272
10316
  name: '[Measures]', caption: 'Measures', showRemoveIcon: true, allowDragAndDrop: true
10273
10317
  };
@@ -15527,13 +15571,6 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15527
15571
  }
15528
15572
  this.parent.element.querySelector('.' + PIVOTCHART).style.width = width + 'px';
15529
15573
  }
15530
- this.parent.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) < 0 &&
15531
- this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis &&
15532
- this.parent.dataSourceSettings.values.length > 0 ? Number(this.parent.chart.height) > (this.parent.dataSourceSettings.values.length * 235) + 100 ? /* eslint-disable-line */
15533
- isNaN(Number(this.getChartHeight())) ? this.getChartHeight().toString() : (Number(this.getChartHeight()) - 5).toString() :
15534
- (!isNaN(Number(this.getChartHeight())) || this.parent.dataSourceSettings.values.length > 1) ?
15535
- ((this.parent.dataSourceSettings.values.length * 235) + 100).toString() :
15536
- this.getChartHeight().toString() : this.getChartHeight().toString();
15537
15574
  this.updateView();
15538
15575
  this.parent.notify(contentReady, {});
15539
15576
  this.parent.trigger(chartLoaded, args);
@@ -25347,6 +25384,13 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25347
25384
  if (this.chart && ((this.showToolbar && this.currentView === 'Chart') || !this.showToolbar)) {
25348
25385
  this.chart.width = (this.showToolbar && this.grid) ? this.getGridWidthAsNumber().toString() :
25349
25386
  (this.displayOption.view === 'Both' && this.grid) ? this.getGridWidthAsNumber().toString() : this.getWidthAsNumber().toString();
25387
+ this.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.chartSettings.chartSeries.type) < 0 &&
25388
+ this.chartSettings.enableScrollOnMultiAxis && this.chartSettings.enableMultipleAxis &&
25389
+ this.dataSourceSettings.values.length > 0 ? Number(this.chart.height) > (this.dataSourceSettings.values.length * 235) + 100 ? /* eslint-disable-line */
25390
+ isNaN(Number(this.pivotChartModule.getChartHeight())) ? this.pivotChartModule.getChartHeight().toString() : (Number(this.pivotChartModule.getChartHeight()) - 5).toString() :
25391
+ (!isNaN(Number(this.pivotChartModule.getChartHeight())) || this.dataSourceSettings.values.length > 1) ?
25392
+ ((this.dataSourceSettings.values.length * 235) + 100).toString() :
25393
+ this.pivotChartModule.getChartHeight().toString() : this.pivotChartModule.getChartHeight().toString();
25350
25394
  if (this.displayOption.view === 'Chart' && this.showGroupingBar && this.groupingBarModule &&
25351
25395
  this.element.querySelector('.' + CHART_GROUPING_BAR_CLASS)) {
25352
25396
  this.groupingBarModule.refreshUI();
@@ -27865,6 +27909,9 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
27865
27909
  DialogRenderer.prototype.onCheckChange = function (args) {
27866
27910
  if (args.checked) {
27867
27911
  this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27912
+ if (this.parent.dataType === 'olap') {
27913
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
27914
+ }
27868
27915
  this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27869
27916
  }
27870
27917
  this.parent.allowDeferLayoutUpdate = !this.parent.allowDeferLayoutUpdate;
@@ -27894,6 +27941,9 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
27894
27941
  var parent = this.parent;
27895
27942
  parent.axisFieldModule.render();
27896
27943
  parent.clonedDataSource = extend({}, parent.dataSourceSettings, null, true);
27944
+ if (this.parent.dataType === 'olap') {
27945
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
27946
+ }
27897
27947
  parent.clonedFieldList = extend({}, parent.pivotFieldList, null, true);
27898
27948
  };
27899
27949
  DialogRenderer.prototype.cancelButtonClick = function () {
@@ -28197,6 +28247,7 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
28197
28247
  var activeindex = this.adaptiveElement.selectedItem;
28198
28248
  this.parent.treeViewModule.render(activeindex);
28199
28249
  };
28250
+ /** @hidden */
28200
28251
  DialogRenderer.prototype.onShowFieldList = function () {
28201
28252
  this.parent.actionObj.actionName = showFieldList;
28202
28253
  if (this.parent.actionBeginMethod()) {
@@ -28209,6 +28260,9 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
28209
28260
  this.parent.axisFieldModule.render();
28210
28261
  }
28211
28262
  this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
28263
+ if (this.parent.dataType === 'olap') {
28264
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
28265
+ }
28212
28266
  this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
28213
28267
  }
28214
28268
  addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
@@ -28234,9 +28288,13 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
28234
28288
  }, true);
28235
28289
  }
28236
28290
  if (Object.keys(this.parent.clonedFieldList).length > 0) {
28237
- this.parent.dataType === 'olap' ? this.parent.olapEngineModule.fieldList = /* eslint-disable-line */
28238
- extend({}, this.parent.clonedFieldList, null, true) :
28291
+ if (this.parent.dataType === 'olap' && this.parent.clonedFieldListData && Object.keys(this.parent.clonedFieldListData).length > 0) {
28292
+ this.parent.olapEngineModule.fieldListData = this.parent.clonedFieldListData;
28293
+ this.parent.olapEngineModule.fieldList = extend({}, this.parent.clonedFieldList, null, true);
28294
+ }
28295
+ else {
28239
28296
  this.parent.engineModule.fieldList = extend({}, this.parent.clonedFieldList, null, true);
28297
+ }
28240
28298
  }
28241
28299
  if (this.parent.isPopupView && this.parent.pivotGridModule) {
28242
28300
  this.parent.pivotGridModule.notify(uiUpdate, this);
@@ -28876,7 +28934,7 @@ var TreeViewRenderer = /** @__PURE__ @class */ (function () {
28876
28934
  this.parent.dataSourceSettings.values.splice(dropPosition, 0, newField) :
28877
28935
  this.parent.dataSourceSettings.values.push(newField);
28878
28936
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28879
- !(this.parent.olapEngineModule).isMeasureAvail) {
28937
+ !(this.parent.olapEngineModule).isMeasureAvail && !(this.parent.dataSourceSettings.values.length > 1)) {
28880
28938
  var measureField = {
28881
28939
  name: '[Measures]', caption: 'Measures', baseField: undefined, baseItem: undefined
28882
28940
  };
@@ -31817,6 +31875,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31817
31875
  this.pivotCommon.control = this;
31818
31876
  if (this.allowDeferLayoutUpdate) {
31819
31877
  this.clonedDataSource = extend({}, this.dataSourceSettings, null, true);
31878
+ if (this.dataType === 'olap') {
31879
+ this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.olapEngineModule.fieldListData);
31880
+ }
31820
31881
  this.clonedFieldList = extend({}, this.pivotFieldList, null, true);
31821
31882
  }
31822
31883
  };
@@ -31998,6 +32059,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31998
32059
  if (pivot.isRequiredUpdate) {
31999
32060
  if (pivot.allowDeferLayoutUpdate) {
32000
32061
  pivot.clonedDataSource = extend({}, pivot.dataSourceSettings, null, true);
32062
+ if (_this.dataType === 'olap') {
32063
+ _this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(_this.olapEngineModule.fieldListData);
32064
+ }
32001
32065
  pivot.clonedFieldList = extend({}, pivot.pivotFieldList, null, true);
32002
32066
  }
32003
32067
  pivot.updateView(pivot.pivotGridModule);
@@ -32083,6 +32147,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
32083
32147
  this.axisFieldModule.render();
32084
32148
  if (!this.isPopupView && this.allowDeferLayoutUpdate) {
32085
32149
  this.clonedDataSource = extend({}, this.dataSourceSettings, null, true);
32150
+ if (this.dataType === 'olap') {
32151
+ this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.olapEngineModule.fieldListData);
32152
+ }
32086
32153
  this.clonedFieldList = extend({}, this.pivotFieldList, null, true);
32087
32154
  }
32088
32155
  }
@@ -32261,6 +32328,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
32261
32328
  if (this.clonedFieldList) {
32262
32329
  this.clonedFieldList = null;
32263
32330
  }
32331
+ if (this.clonedFieldListData) {
32332
+ this.clonedFieldListData = null;
32333
+ }
32264
32334
  if (this.localeObj) {
32265
32335
  this.localeObj = null;
32266
32336
  }
@@ -36255,7 +36325,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36255
36325
  break;
36256
36326
  case (this.parent.element.id + 'fieldlist'):
36257
36327
  if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
36258
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
36328
+ this.parent.pivotFieldListModule.dialogRenderer.onShowFieldList();
36259
36329
  }
36260
36330
  break;
36261
36331
  case (this.parent.element.id + 'formatting'):