@syncfusion/ej2-pivotview 19.4.43 → 19.4.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.
@@ -9939,7 +9939,7 @@ class NodeStateModified {
9939
9939
  this.parent.engineModule.updateFieldlistData(fieldName);
9940
9940
  }
9941
9941
  }
9942
- this.parent.dataSourceUpdate.updateDataSource(fieldName, droppedClass, droppedPosition);
9942
+ nodeDropped = this.parent.dataSourceUpdate.updateDataSource(fieldName, droppedClass, droppedPosition);
9943
9943
  return nodeDropped;
9944
9944
  }
9945
9945
  getButtonPosition(target, droppedClass) {
@@ -9986,6 +9986,7 @@ class DataSourceUpdate {
9986
9986
  let dataSourceItem;
9987
9987
  let draggedClass;
9988
9988
  let draggedPosition = -1;
9989
+ let nodeDropped = true;
9989
9990
  let row = this.parent.dataSourceSettings.rows;
9990
9991
  let column = this.parent.dataSourceSettings.columns;
9991
9992
  let value = this.parent.dataSourceSettings.values;
@@ -10112,7 +10113,11 @@ class DataSourceUpdate {
10112
10113
  });
10113
10114
  }
10114
10115
  }
10116
+ else {
10117
+ nodeDropped = false;
10118
+ }
10115
10119
  });
10120
+ return nodeDropped;
10116
10121
  }
10117
10122
  /**
10118
10123
  * Updates the dataSource by removing the given field from the dataSource.
@@ -15609,7 +15614,7 @@ class PivotChart {
15609
15614
  if (this.parent && this.parent.isDestroyed) {
15610
15615
  return;
15611
15616
  }
15612
- if (this.engineModule) {
15617
+ if (this.engineModule && !this.parent.destroyEngine) {
15613
15618
  this.engineModule.fieldList = {};
15614
15619
  this.engineModule = {};
15615
15620
  }
@@ -21853,6 +21858,8 @@ let PivotView = class PivotView extends Component {
21853
21858
  this.isServerWaitingPopup = false;
21854
21859
  /** @hidden */
21855
21860
  this.actionObj = {};
21861
+ /** @hidden */
21862
+ this.destroyEngine = false;
21856
21863
  this.pivotView = this;
21857
21864
  setValue('mergePersistData', this.mergePersistPivotData, this);
21858
21865
  }
@@ -22999,24 +23006,37 @@ let PivotView = class PivotView extends Component {
22999
23006
  this.displayOption.primary : newProp.displayOption.view);
23000
23007
  if (this.showGroupingBar || this.showFieldList) {
23001
23008
  if (this.showFieldList && this.pivotFieldListModule) {
23009
+ this.pivotFieldListModule.destroyEngine = true;
23002
23010
  this.pivotFieldListModule.destroy();
23011
+ this.pivotFieldListModule.destroyEngine = false;
23003
23012
  }
23004
- if (this.showGroupingBar && this.groupingBarModule) {
23005
- this.groupingBarModule.destroy();
23006
- }
23013
+ /**
23014
+ * Below lines are affected the grouping bar render between table and chart.
23015
+ * In "Init subcomponent" function, grouping bar rendered properly for table and chart view.
23016
+ * So, The below lines are commanded out.
23017
+ */
23018
+ // if (this.showGroupingBar && this.groupingBarModule) {
23019
+ // this.groupingBarModule.destroy();
23020
+ // }
23007
23021
  this.notify(initSubComponent, this);
23008
23022
  }
23009
23023
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
23010
23024
  this.renderEmptyGrid();
23011
23025
  if (newProp.displayOption.view === 'Table') {
23012
23026
  if (this.pivotChartModule) {
23027
+ this.destroyEngine = true;
23013
23028
  this.pivotChartModule.destroy();
23029
+ this.destroyEngine = false;
23014
23030
  this.chart = undefined;
23015
23031
  this.pivotChartModule = undefined;
23016
23032
  }
23017
23033
  }
23018
23034
  }
23019
23035
  else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
23036
+ if (this.grid) {
23037
+ this.grid.destroy();
23038
+ this.grid = undefined;
23039
+ }
23020
23040
  this.pivotChartModule = new PivotChart();
23021
23041
  }
23022
23042
  }
@@ -24014,12 +24034,12 @@ let PivotView = class PivotView extends Component {
24014
24034
  let hasField = false;
24015
24035
  if (cell && this.dataType === 'olap') {
24016
24036
  let measureName = cell.actualText;
24017
- if (!isNullOrUndefined(measureName) && !this.olapEngineModule.fieldList[measureName]) {
24037
+ if (!isNullOrUndefined(measureName) && this.olapEngineModule.fieldList && !this.olapEngineModule.fieldList[measureName]) {
24018
24038
  let tupleInfo = this.olapEngineModule.tupRowInfo;
24019
24039
  measureName = cell.rowOrdinal > -1 && tupleInfo.length > 0 && tupleInfo[cell.rowOrdinal] &&
24020
24040
  !isNullOrUndefined(tupleInfo[cell.rowOrdinal].measureName) ? tupleInfo[cell.rowOrdinal].measureName : measureName;
24021
24041
  }
24022
- if (this.olapEngineModule.fieldList[measureName]) {
24042
+ if (this.olapEngineModule.fieldList && this.olapEngineModule.fieldList[measureName]) {
24023
24043
  let field = this.olapEngineModule.fieldList[measureName];
24024
24044
  aggregateType = field.isCalculatedField ? field.type : field.aggregateType;
24025
24045
  caption = (this.olapEngineModule.dataFields[measureName] &&
@@ -24029,7 +24049,7 @@ let PivotView = class PivotView extends Component {
24029
24049
  }
24030
24050
  }
24031
24051
  else {
24032
- if (cell && this.engineModule.fieldList[cell.actualText]) {
24052
+ if (cell && this.engineModule.fieldList && this.engineModule.fieldList[cell.actualText]) {
24033
24053
  let field = this.engineModule.fieldList[cell.actualText];
24034
24054
  aggregateType = field.aggregateType;
24035
24055
  if ((aggregateType !== 'DistinctCount') && (field.type !== 'number' || field.type === 'include' ||
@@ -28005,6 +28025,9 @@ class TreeViewRenderer {
28005
28025
  return buttonElement;
28006
28026
  }
28007
28027
  nodeStateChange(args) {
28028
+ if (!args.isInteracted) {
28029
+ return;
28030
+ }
28008
28031
  let node = closest(args.node, '.' + TEXT_CONTENT_CLASS);
28009
28032
  if (!isNullOrUndefined(node)) {
28010
28033
  let li = closest(node, 'li');
@@ -28036,7 +28059,7 @@ class TreeViewRenderer {
28036
28059
  this.updateNodeStateChange(id, args, selectedNode);
28037
28060
  }
28038
28061
  else {
28039
- this.updateCheckState(selectedNode);
28062
+ this.updateCheckState(selectedNode, args.action);
28040
28063
  }
28041
28064
  });
28042
28065
  }
@@ -28063,7 +28086,7 @@ class TreeViewRenderer {
28063
28086
  this.updateNodeStateChange(id, args, selectedNode);
28064
28087
  }
28065
28088
  else {
28066
- this.updateCheckState(selectedNode);
28089
+ this.updateCheckState(selectedNode, args.action);
28067
28090
  }
28068
28091
  });
28069
28092
  }
@@ -28120,19 +28143,17 @@ class TreeViewRenderer {
28120
28143
  break;
28121
28144
  }
28122
28145
  }
28123
- updateCheckState(selectedNode) {
28146
+ updateCheckState(selectedNode, action) {
28124
28147
  let chkState = this.fieldTable.element.querySelectorAll('.e-checkbox-wrapper');
28125
28148
  let innerText = this.fieldTable.element.querySelectorAll('.e-list-text');
28126
28149
  let checkClass = this.fieldTable.element.querySelectorAll('.e-frame');
28127
28150
  for (let i = 0; i < chkState.length; i++) {
28128
28151
  if (selectedNode.caption === innerText[i].textContent) {
28129
- if (chkState[i].getAttribute('aria-checked') === 'false') {
28130
- chkState[i].setAttribute('aria-checked', 'false');
28131
- checkClass[i].classList.add(NODE_CHECK_CLASS);
28152
+ if (action === 'check') {
28153
+ this.fieldTable.uncheckAll([selectedNode['id']]);
28132
28154
  }
28133
28155
  else {
28134
- chkState[i].setAttribute('aria-checked', 'true');
28135
- checkClass[i].classList.remove(NODE_CHECK_CLASS);
28156
+ this.fieldTable.checkAll([selectedNode['id']]);
28136
28157
  }
28137
28158
  }
28138
28159
  }
@@ -28181,6 +28202,9 @@ class TreeViewRenderer {
28181
28202
  }
28182
28203
  }
28183
28204
  addNode(args) {
28205
+ if (!args.isInteracted) {
28206
+ return;
28207
+ }
28184
28208
  /* eslint-disable */
28185
28209
  let fieldList = this.parent.pivotFieldList;
28186
28210
  let selectedNode = fieldList[args.data[0].id.toString()];
@@ -28188,17 +28212,18 @@ class TreeViewRenderer {
28188
28212
  let fieldInfo = PivotUtil.getFieldInfo(selectedNode.id.toString(), this.parent);
28189
28213
  let control = this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
28190
28214
  if (args.action === 'check') {
28215
+ let axis = ['filters', 'columns', 'rows', 'values'];
28191
28216
  let eventdrop = {
28192
28217
  fieldName: fieldInfo.fieldName, dropField: fieldInfo.fieldItem,
28193
28218
  dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings),
28194
- dropAxis: 'rows', draggedAxis: 'fieldlist', cancel: false
28219
+ dropAxis: axis[this.parent.dialogRenderer.adaptiveElement.selectedItem], draggedAxis: 'fieldlist', cancel: false
28195
28220
  };
28196
28221
  control.trigger(fieldDrop, eventdrop, (observedArgs) => {
28197
28222
  if (!observedArgs.cancel) {
28198
28223
  this.selectedNodes.push(selectedNode.id.toString());
28199
28224
  }
28200
28225
  else {
28201
- this.updateCheckState(selectedNode);
28226
+ this.updateCheckState(selectedNode, args.action);
28202
28227
  }
28203
28228
  });
28204
28229
  }
@@ -28219,7 +28244,7 @@ class TreeViewRenderer {
28219
28244
  }
28220
28245
  }
28221
28246
  else {
28222
- this.updateCheckState(selectedNode);
28247
+ this.updateCheckState(selectedNode, args.action);
28223
28248
  }
28224
28249
  });
28225
28250
  }
@@ -28612,7 +28637,7 @@ class AxisTableRenderer {
28612
28637
  addClass([element[element.length - 1].querySelector('.' + DROP_INDICATOR_CLASS + '-last')], INDICATOR_HOVER_CLASS);
28613
28638
  }
28614
28639
  }
28615
- else if (e.type === 'mouseleave') {
28640
+ else if (!this.parent.isDragging || (!e.target.classList.contains(DROPPABLE_CLASS) && e.type === 'mouseleave')) {
28616
28641
  removeClass([].slice.call(parentElement.querySelectorAll('.' + DROP_INDICATOR_CLASS)), INDICATOR_HOVER_CLASS);
28617
28642
  removeClass([].slice.call(parentElement.querySelectorAll('.' + DROP_INDICATOR_CLASS + '-last')), INDICATOR_HOVER_CLASS);
28618
28643
  }
@@ -30270,6 +30295,8 @@ let PivotFieldList = class PivotFieldList extends Component {
30270
30295
  this.remoteData = [];
30271
30296
  /** @hidden */
30272
30297
  this.actionObj = {};
30298
+ /** @hidden */
30299
+ this.destroyEngine = false;
30273
30300
  }
30274
30301
  /**
30275
30302
  * To provide the array of modules needed for control rendering
@@ -31351,7 +31378,7 @@ let PivotFieldList = class PivotFieldList extends Component {
31351
31378
  */
31352
31379
  destroy() {
31353
31380
  this.unWireEvent();
31354
- if (this.engineModule) {
31381
+ if (this.engineModule && !this.destroyEngine) {
31355
31382
  this.engineModule.fieldList = {};
31356
31383
  this.engineModule.rMembers = null;
31357
31384
  this.engineModule.cMembers = null;
@@ -31359,7 +31386,7 @@ let PivotFieldList = class PivotFieldList extends Component {
31359
31386
  this.engineModule.indexMatrix = null;
31360
31387
  this.engineModule = {};
31361
31388
  }
31362
- if (this.olapEngineModule) {
31389
+ if (this.olapEngineModule && !this.destroyEngine) {
31363
31390
  this.olapEngineModule.fieldList = {};
31364
31391
  this.olapEngineModule = {};
31365
31392
  }
@@ -34317,7 +34344,7 @@ class GroupingBar {
34317
34344
  }
34318
34345
  dropIndicatorUpdate(e) {
34319
34346
  if ((this.parent.isDragging && e.target.classList.contains(DROPPABLE_CLASS) && e.type === 'mouseover') ||
34320
- e.type === 'mouseleave') {
34347
+ (!this.parent.isDragging || (!e.target.classList.contains(DROPPABLE_CLASS) && e.type === 'mouseleave'))) {
34321
34348
  removeClass([].slice.call(this.parent.element.querySelectorAll('.' + DROP_INDICATOR_CLASS)), INDICATOR_HOVER_CLASS);
34322
34349
  removeClass([].slice.call(this.parent.element.querySelectorAll('.' + DROP_INDICATOR_CLASS + '-last')), INDICATOR_HOVER_CLASS);
34323
34350
  }