@syncfusion/ej2-pivotview 19.4.54 → 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.
@@ -230,6 +230,49 @@ class PivotUtil {
230
230
  return collection;
231
231
  }
232
232
  }
233
+ static cloneOlapFieldSettings(collection) {
234
+ if (collection) {
235
+ let clonedCollection = [];
236
+ for (let set of collection) {
237
+ clonedCollection.push(this.getDefinedObj({
238
+ caption: set.caption,
239
+ hasChildren: set.hasChildren,
240
+ id: set.id,
241
+ isSelected: set.isSelected,
242
+ name: set.name,
243
+ spriteCssClass: set.spriteCssClass,
244
+ tag: set.tag,
245
+ type: set.type,
246
+ pid: set.pid,
247
+ expanded: set.expanded,
248
+ defaultHierarchy: set.defaultHierarchy,
249
+ hasAllMember: set.hasAllMember,
250
+ allMember: set.allMember,
251
+ isChecked: set.isChecked,
252
+ filterMembers: set.filterMembers,
253
+ childMembers: set.childMembers,
254
+ searchMembers: set.searchMembers,
255
+ htmlAttributes: set.htmlAttributes,
256
+ currrentMembers: set.currrentMembers,
257
+ isHierarchy: set.isHierarchy,
258
+ isNamedSets: set.isNamedSets,
259
+ formatString: set.formatString,
260
+ actualFilter: set.actualFilter,
261
+ levels: set.levels,
262
+ levelCount: set.levelCount,
263
+ memberType: set.memberType,
264
+ fieldType: set.fieldType,
265
+ parentHierarchy: set.parentHierarchy
266
+ /* eslint-disable @typescript-eslint/no-explicit-any */
267
+ }));
268
+ /* eslint-enable @typescript-eslint/no-explicit-any */
269
+ }
270
+ return clonedCollection;
271
+ }
272
+ else {
273
+ return collection;
274
+ }
275
+ }
233
276
  static cloneFilterSettings(collection) {
234
277
  if (collection) {
235
278
  let clonedCollection = [];
@@ -8666,7 +8709,7 @@ class Render {
8666
8709
  if (isNaN(parHeight)) {
8667
8710
  parHeight = parHeight > this.parent.minHeight ? parHeight : this.parent.minHeight;
8668
8711
  }
8669
- if (this.parent.currentView !== 'Chart') {
8712
+ if ((this.parent.showToolbar && this.parent.currentView !== 'Chart') || (!this.parent.showToolbar && this.parent.displayOption.view !== 'Chart')) {
8670
8713
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8671
8714
  let rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8672
8715
  let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS) ?
@@ -27139,6 +27182,9 @@ class DialogRenderer {
27139
27182
  onCheckChange(args) {
27140
27183
  if (args.checked) {
27141
27184
  this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27185
+ if (this.parent.dataType === 'olap') {
27186
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
27187
+ }
27142
27188
  this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27143
27189
  }
27144
27190
  this.parent.allowDeferLayoutUpdate = !this.parent.allowDeferLayoutUpdate;
@@ -27168,6 +27214,9 @@ class DialogRenderer {
27168
27214
  let parent = this.parent;
27169
27215
  parent.axisFieldModule.render();
27170
27216
  parent.clonedDataSource = extend({}, parent.dataSourceSettings, null, true);
27217
+ if (this.parent.dataType === 'olap') {
27218
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
27219
+ }
27171
27220
  parent.clonedFieldList = extend({}, parent.pivotFieldList, null, true);
27172
27221
  }
27173
27222
  cancelButtonClick() {
@@ -27469,6 +27518,7 @@ class DialogRenderer {
27469
27518
  let activeindex = this.adaptiveElement.selectedItem;
27470
27519
  this.parent.treeViewModule.render(activeindex);
27471
27520
  }
27521
+ /** @hidden */
27472
27522
  onShowFieldList() {
27473
27523
  this.parent.actionObj.actionName = showFieldList;
27474
27524
  if (this.parent.actionBeginMethod()) {
@@ -27481,6 +27531,9 @@ class DialogRenderer {
27481
27531
  this.parent.axisFieldModule.render();
27482
27532
  }
27483
27533
  this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27534
+ if (this.parent.dataType === 'olap') {
27535
+ this.parent.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData);
27536
+ }
27484
27537
  this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27485
27538
  }
27486
27539
  addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
@@ -27506,9 +27559,13 @@ class DialogRenderer {
27506
27559
  }, true);
27507
27560
  }
27508
27561
  if (Object.keys(this.parent.clonedFieldList).length > 0) {
27509
- this.parent.dataType === 'olap' ? this.parent.olapEngineModule.fieldList = /* eslint-disable-line */
27510
- extend({}, this.parent.clonedFieldList, null, true) :
27562
+ if (this.parent.dataType === 'olap' && this.parent.clonedFieldListData && Object.keys(this.parent.clonedFieldListData).length > 0) {
27563
+ this.parent.olapEngineModule.fieldListData = this.parent.clonedFieldListData;
27564
+ this.parent.olapEngineModule.fieldList = extend({}, this.parent.clonedFieldList, null, true);
27565
+ }
27566
+ else {
27511
27567
  this.parent.engineModule.fieldList = extend({}, this.parent.clonedFieldList, null, true);
27568
+ }
27512
27569
  }
27513
27570
  if (this.parent.isPopupView && this.parent.pivotGridModule) {
27514
27571
  this.parent.pivotGridModule.notify(uiUpdate, this);
@@ -31020,6 +31077,9 @@ let PivotFieldList = class PivotFieldList extends Component {
31020
31077
  this.pivotCommon.control = this;
31021
31078
  if (this.allowDeferLayoutUpdate) {
31022
31079
  this.clonedDataSource = extend({}, this.dataSourceSettings, null, true);
31080
+ if (this.dataType === 'olap') {
31081
+ this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.olapEngineModule.fieldListData);
31082
+ }
31023
31083
  this.clonedFieldList = extend({}, this.pivotFieldList, null, true);
31024
31084
  }
31025
31085
  }
@@ -31199,6 +31259,9 @@ let PivotFieldList = class PivotFieldList extends Component {
31199
31259
  if (pivot.isRequiredUpdate) {
31200
31260
  if (pivot.allowDeferLayoutUpdate) {
31201
31261
  pivot.clonedDataSource = extend({}, pivot.dataSourceSettings, null, true);
31262
+ if (this.dataType === 'olap') {
31263
+ this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.olapEngineModule.fieldListData);
31264
+ }
31202
31265
  pivot.clonedFieldList = extend({}, pivot.pivotFieldList, null, true);
31203
31266
  }
31204
31267
  pivot.updateView(pivot.pivotGridModule);
@@ -31284,6 +31347,9 @@ let PivotFieldList = class PivotFieldList extends Component {
31284
31347
  this.axisFieldModule.render();
31285
31348
  if (!this.isPopupView && this.allowDeferLayoutUpdate) {
31286
31349
  this.clonedDataSource = extend({}, this.dataSourceSettings, null, true);
31350
+ if (this.dataType === 'olap') {
31351
+ this.clonedFieldListData = PivotUtil.cloneOlapFieldSettings(this.olapEngineModule.fieldListData);
31352
+ }
31287
31353
  this.clonedFieldList = extend({}, this.pivotFieldList, null, true);
31288
31354
  }
31289
31355
  }
@@ -31461,6 +31527,9 @@ let PivotFieldList = class PivotFieldList extends Component {
31461
31527
  if (this.clonedFieldList) {
31462
31528
  this.clonedFieldList = null;
31463
31529
  }
31530
+ if (this.clonedFieldListData) {
31531
+ this.clonedFieldListData = null;
31532
+ }
31464
31533
  if (this.localeObj) {
31465
31534
  this.localeObj = null;
31466
31535
  }
@@ -35415,7 +35484,7 @@ class Toolbar$2 {
35415
35484
  break;
35416
35485
  case (this.parent.element.id + 'fieldlist'):
35417
35486
  if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
35418
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
35487
+ this.parent.pivotFieldListModule.dialogRenderer.onShowFieldList();
35419
35488
  }
35420
35489
  break;
35421
35490
  case (this.parent.element.id + 'formatting'):