@syncfusion/ej2-layouts 20.4.42 → 20.4.53

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.
@@ -1106,17 +1106,20 @@ let Splitter = class Splitter extends Component {
1106
1106
  }
1107
1107
  e.target.classList.add(SPLIT_BAR_HOVER);
1108
1108
  }
1109
+ this.splitterDetails(e);
1109
1110
  const icon = e.target;
1110
- if (icon.classList.contains(ARROW_LEFT) || icon.classList.contains(ARROW_UP)) {
1111
- this.collapseAction(e);
1112
- }
1113
- if (icon.classList.contains(ARROW_RIGHT) || icon.classList.contains(ARROW_DOWN)) {
1114
- this.expandAction(e);
1111
+ if (icon.classList.contains(ARROW_LEFT) || icon.classList.contains(ARROW_RIGHT) ||
1112
+ icon.classList.contains(ARROW_DOWN) || icon.classList.contains(ARROW_UP)) {
1113
+ if (!this.nextPane.classList.contains(PANE_HIDDEN) && !this.previousPane.classList.contains(PANE_HIDDEN)) {
1114
+ this.collapseAction(e);
1115
+ }
1116
+ else {
1117
+ this.expandAction(e);
1118
+ }
1119
+ this.updateSplitterSize();
1115
1120
  }
1116
- this.updateSplitterSize();
1117
1121
  }
1118
1122
  expandAction(e) {
1119
- this.splitterDetails(e);
1120
1123
  const eventArgs = this.beforeAction(e);
1121
1124
  if (this.expandFlag) {
1122
1125
  this.trigger('beforeExpand', eventArgs, (beforeExpandArgs) => {
@@ -1131,6 +1134,10 @@ let Splitter = class Splitter extends Component {
1131
1134
  this.expandPane(e);
1132
1135
  }
1133
1136
  }
1137
+ getIcon(e) {
1138
+ const targetClass = e.target.className.split(' ').filter((className) => className !== NAVIGATE_ARROW && className !== HIDE_ICON);
1139
+ return targetClass[0];
1140
+ }
1134
1141
  expandPane(e) {
1135
1142
  this.removeStaticPanes();
1136
1143
  const collapseCount = this.element.querySelectorAll('.' + COLLAPSE_PANE).length;
@@ -1139,46 +1146,41 @@ let Splitter = class Splitter extends Component {
1139
1146
  !this.nextPane.classList.contains(EXPAND_PANE) && this.nextPane.nextElementSibling.classList.contains(PANE) &&
1140
1147
  !this.nextPane.nextElementSibling.classList.contains(STATIC_PANE) && !(collapseCount === this.allPanes.length - 2));
1141
1148
  const collapseClass = [COLLAPSE_PANE, PANE_HIDDEN];
1142
- if (!this.previousPane.classList.contains(COLLAPSE_PANE)) {
1143
- removeClass([this.nextPane], EXPAND_PANE);
1144
- removeClass([this.previousPane], collapseClass);
1145
- addClass([this.previousPane], EXPAND_PANE);
1146
- addClass([this.nextPane], collapseClass);
1147
- if (this.expandFlag) {
1148
- this.updatePaneSettings(this.nextPaneIndex, true);
1149
+ const icon = this.getIcon(e);
1150
+ const isLeftOrUp = icon === ARROW_LEFT || icon === ARROW_UP;
1151
+ const collapsePane = isLeftOrUp ? this.nextPane : this.previousPane;
1152
+ const expandPane = isLeftOrUp ? this.previousPane : this.nextPane;
1153
+ const expandPaneIndex = isLeftOrUp ? this.nextPaneIndex : this.prevPaneIndex;
1154
+ removeClass([collapsePane], collapseClass);
1155
+ collapsePane.setAttribute('aria-hidden', 'false');
1156
+ // cCount is calculated after removing the COLLAPSE_PANE
1157
+ const cCount = this.element.querySelectorAll('.' + COLLAPSE_PANE).length;
1158
+ if (cCount > 0) {
1159
+ if (!expandPane.classList.contains(COLLAPSE_PANE)) {
1160
+ addClass([expandPane], EXPAND_PANE);
1161
+ expandPane.setAttribute('aria-expanded', 'true');
1162
+ }
1163
+ }
1164
+ else if (cCount === 0) {
1165
+ for (let i = 0; i < this.allPanes.length; i++) {
1166
+ if (!this.allPanes[i].classList.contains(COLLAPSE_PANE)) {
1167
+ removeClass([this.allPanes[i]], EXPAND_PANE);
1168
+ this.allPanes[i].setAttribute('aria-expanded', 'false');
1169
+ }
1149
1170
  }
1150
1171
  }
1151
- else {
1152
- removeClass([this.previousPane], collapseClass);
1153
- removeClass([this.nextPane], EXPAND_PANE);
1154
- if (this.expandFlag) {
1155
- this.updatePaneSettings(this.prevPaneIndex, false);
1156
- }
1172
+ if (this.expandFlag) {
1173
+ this.updatePaneSettings(expandPaneIndex, false);
1157
1174
  }
1158
- this.updateIconsOnExpand(e);
1159
- this.previousPane.setAttribute('aria-expanded', 'true');
1160
- this.nextPane.setAttribute('aria-expanded', 'false');
1161
- this.updateFlexGrow(this.checkStaticPanes());
1175
+ this.updateIconsOnExpand(e, icon);
1176
+ this.updateFlexGrow();
1162
1177
  if (flexStatus) {
1163
1178
  this.previousPane.classList.remove(EXPAND_PANE);
1179
+ this.previousPane.setAttribute('aria-expanded', 'false');
1164
1180
  this.previousPane.style.flexGrow = '';
1165
1181
  }
1166
1182
  }
1167
- checkStaticPanes() {
1168
- let staticPane = true;
1169
- for (let i = 0; i < this.allPanes.length; i++) {
1170
- if (!this.allPanes[i].classList.contains(COLLAPSE_PANE) && staticPane) {
1171
- if (this.allPanes[i].classList.contains(STATIC_PANE)) {
1172
- staticPane = true;
1173
- }
1174
- else {
1175
- staticPane = false;
1176
- }
1177
- }
1178
- }
1179
- return staticPane;
1180
- }
1181
- updateFlexGrow(status) {
1183
+ updateFlexGrow() {
1182
1184
  let collapseCount = 0;
1183
1185
  for (let j = 0; j < this.element.children.length; j++) {
1184
1186
  if (this.element.children[j].classList.contains(COLLAPSE_PANE)) {
@@ -1189,9 +1191,6 @@ let Splitter = class Splitter extends Component {
1189
1191
  const panes = this.allPanes;
1190
1192
  for (let i = 0; i < panes.length; i++) {
1191
1193
  panes[i].style.flexGrow = '';
1192
- if (status && !this.nextPane.classList.contains(COLLAPSE_PANE)) {
1193
- this.nextPane.style.flexGrow = '1';
1194
- }
1195
1194
  if (visiblePane && this.allPanes[i].classList.contains(COLLAPSE_PANE) && this.paneSettings[i].size &&
1196
1195
  i !== this.allPanes.length - 1) {
1197
1196
  panes[i].style.flexGrow = '';
@@ -1210,75 +1209,65 @@ let Splitter = class Splitter extends Component {
1210
1209
  showTargetBarIcon(targetBar, targetArrow) {
1211
1210
  removeClass([select('.' + targetArrow, targetBar)], HIDE_ICON);
1212
1211
  }
1213
- updateIconsOnCollapse(e) {
1212
+ updateIconsOnCollapse(e, targetIcon) {
1214
1213
  this.splitterProperty();
1215
- if (this.previousPane.classList.contains(COLLAPSE_PANE) && !this.nextPane.classList.contains(COLLAPSE_PANE)) {
1216
- addClass([e.target], HIDE_ICON);
1217
- if (this.paneSettings[this.prevPaneIndex].collapsible) {
1218
- this.showCurrentBarIcon();
1219
- }
1220
- this.resizableModel(this.currentBarIndex, false);
1221
- if (this.previousPane.classList.contains(COLLAPSE_PANE) && !this.nextPane.classList.contains(COLLAPSE_PANE) &&
1222
- !this.paneSettings[this.prevPaneIndex].collapsible) {
1223
- this.hideTargetBarIcon(this.prevBar, this.rightArrow);
1224
- }
1225
- if (this.previousPane.previousElementSibling && !this.previousPane.previousElementSibling.classList.contains(COLLAPSE_PANE)) {
1226
- if (this.previousPane.classList.contains(COLLAPSE_PANE) && this.paneSettings[this.prevPaneIndex].collapsible) {
1227
- this.showTargetBarIcon(this.prevBar, this.leftArrow);
1214
+ const removeIcon = this.arrow;
1215
+ const otherBar = this.currentBarIndex === (this.allBars.length - 1) ? this.prevBar : this.nextBar;
1216
+ const otherBarIndex = this.currentBarIndex === (this.allBars.length - 1) ? this.currentBarIndex - 1
1217
+ : this.currentBarIndex + 1;
1218
+ if (!e.target.classList.contains(HIDE_ICON)) {
1219
+ if (this.splitInstance.prevPaneCollapsed || this.splitInstance.nextPaneCollapsed) {
1220
+ if (this.paneSettings[this.prevPaneIndex].collapsible && this.paneSettings[this.nextPaneIndex].collapsible) {
1221
+ this.resizableModel(this.currentBarIndex, false);
1222
+ this.hideTargetBarIcon(this.currentSeparator, targetIcon);
1223
+ if (!isNullOrUndefined(otherBar)) {
1224
+ const otherPrevPaneIndex = otherBarIndex;
1225
+ const otherNextPaneIndex = otherBarIndex + 1;
1226
+ const collapsecount = this.getCollapseCount(otherPrevPaneIndex, otherNextPaneIndex);
1227
+ if (this.paneSettings[otherPrevPaneIndex].collapsible &&
1228
+ this.paneSettings[otherNextPaneIndex].collapsible) {
1229
+ if (collapsecount === 1) {
1230
+ this.hideTargetBarIcon(otherBar, removeIcon);
1231
+ this.resizableModel(otherBarIndex, false);
1232
+ }
1233
+ else if (collapsecount === 2) {
1234
+ this.hideBarIcons(otherBar);
1235
+ this.resizableModel(otherBarIndex, false);
1236
+ }
1237
+ if (!this.paneSettings[otherPrevPaneIndex].collapsible ||
1238
+ !this.paneSettings[otherNextPaneIndex].collapsible) {
1239
+ this.hideTargetBarIcon(otherBar, targetIcon);
1240
+ }
1241
+ }
1242
+ }
1228
1243
  }
1229
- else if (!this.paneSettings[this.prevPaneIndex].collapsible) {
1230
- this.hideTargetBarIcon(this.prevBar, this.leftArrow);
1244
+ else {
1245
+ this.showTargetBarIcon(this.currentSeparator, removeIcon);
1246
+ this.hideTargetBarIcon(this.currentSeparator, targetIcon);
1247
+ this.resizableModel(this.currentBarIndex, false);
1231
1248
  }
1232
1249
  }
1233
- if (!isNullOrUndefined(this.prevBar)) {
1234
- this.resizableModel(this.currentBarIndex - 1, false);
1235
- this.hideTargetBarIcon(this.prevBar, this.arrow);
1236
- }
1237
- if (!this.paneSettings[this.prevPaneIndex].collapsible) {
1238
- this.hideTargetBarIcon(this.currentSeparator, this.rightArrow);
1239
- }
1240
1250
  }
1241
- else if (!this.splitInstance.prevPaneCollapsed && !this.splitInstance.nextPaneExpanded) {
1242
- if (this.paneSettings[this.currentBarIndex].resizable) {
1243
- this.resizableModel(this.currentBarIndex, true);
1244
- }
1245
- if (!this.splitInstance.nextPaneNextEle.classList.contains(COLLAPSE_PANE) &&
1246
- this.paneSettings[this.currentBarIndex + 1].resizable) {
1247
- this.resizableModel(this.currentBarIndex + 1, true);
1248
- }
1249
- if (!this.paneSettings[this.currentBarIndex].collapsible) {
1250
- addClass([e.target], HIDE_ICON);
1251
- }
1252
- if (this.previousPane && this.prevPaneIndex === 0 && (this.paneSettings[this.prevPaneIndex].collapsible)) {
1253
- this.showTargetBarIcon(this.currentSeparator, this.leftArrow);
1254
- }
1255
- if (this.nextPane && this.nextPaneIndex === this.allPanes.length - 1 && (this.paneSettings[this.nextPaneIndex].collapsible)) {
1256
- this.showTargetBarIcon(this.getPrevBar(this.nextPaneIndex), this.rightArrow);
1257
- }
1258
- if (!(this.previousPane.classList.contains(COLLAPSE_PANE)) && this.paneSettings[this.nextPaneIndex].collapsible) {
1259
- this.showTargetBarIcon(this.currentSeparator, this.rightArrow);
1251
+ else {
1252
+ this.resizableModel(this.currentBarIndex, false);
1253
+ if (!isNullOrUndefined(otherBar)) {
1254
+ this.resizableModel(otherBarIndex, false);
1260
1255
  }
1261
- if (!isNullOrUndefined(this.nextBar)) {
1262
- if (this.nextPane.nextElementSibling && (this.nextPane.nextElementSibling.classList.contains(COLLAPSE_PANE) &&
1263
- this.paneSettings[this.nextPaneIndex + 1].collapsible) ||
1264
- (!this.nextPane.nextElementSibling.classList.contains(COLLAPSE_PANE) &&
1265
- this.paneSettings[this.nextPaneIndex].collapsible)) {
1266
- this.showTargetBarIcon(this.nextBar, this.leftArrow);
1267
- }
1268
- else if (!this.paneSettings[this.splitInstance.nextPaneIndex + 1].collapsible &&
1269
- this.paneSettings[this.currentBarIndex]) {
1270
- this.hideTargetBarIcon(this.nextBar, this.arrow);
1256
+ if (!this.paneSettings[this.prevPaneIndex].collapsible || !this.paneSettings[this.nextPaneIndex].collapsible) {
1257
+ if (!isNullOrUndefined(otherBar)) {
1258
+ this.hideTargetBarIcon(otherBar, targetIcon);
1271
1259
  }
1260
+ this.hideTargetBarIcon(this.currentSeparator, removeIcon);
1272
1261
  }
1273
- if (!(this.nextPaneIndex === this.allPanes.length - 1) && this.nextPane.nextElementSibling &&
1274
- !this.nextPane.classList.contains(COLLAPSE_PANE) && !this.nextPane.nextElementSibling.classList.contains(COLLAPSE_PANE)
1275
- && !this.paneSettings[this.nextPaneIndex + 1].collapsible) {
1276
- this.hideTargetBarIcon(this.nextBar, this.rightArrow);
1262
+ else {
1263
+ if (!isNullOrUndefined(otherBar)) {
1264
+ this.hideTargetBarIcon(otherBar, removeIcon);
1265
+ }
1266
+ this.showTargetBarIcon(this.currentSeparator, removeIcon);
1277
1267
  }
1278
1268
  }
1279
1269
  }
1280
1270
  collapseAction(e) {
1281
- this.splitterDetails(e);
1282
1271
  const eventArgs = this.beforeAction(e);
1283
1272
  if (this.collapseFlag) {
1284
1273
  this.collapsePane(e);
@@ -1304,26 +1293,43 @@ let Splitter = class Splitter extends Component {
1304
1293
  !(collapseCount === this.allPanes.length - 2)) || (this.nextPane.classList.contains(COLLAPSE_PANE) &&
1305
1294
  !this.previousPane.classList.contains(STATIC_PANE) && this.nextPane.classList.contains(STATIC_PANE));
1306
1295
  const collapseClass = [COLLAPSE_PANE, PANE_HIDDEN];
1307
- if (this.nextPane.classList.contains(COLLAPSE_PANE)) {
1308
- removeClass([this.previousPane], EXPAND_PANE);
1309
- removeClass([this.nextPane], collapseClass);
1310
- if (!this.collapseFlag) {
1311
- this.updatePaneSettings(this.nextPaneIndex, false);
1312
- }
1296
+ const icon = this.getIcon(e);
1297
+ const isLeftOrUp = icon === ARROW_LEFT || icon === ARROW_UP;
1298
+ const collapsePane = isLeftOrUp ? this.previousPane : this.nextPane;
1299
+ const expandPane = isLeftOrUp ? this.nextPane : this.previousPane;
1300
+ const collapsePaneIndex = isLeftOrUp ? this.prevPaneIndex : this.nextPaneIndex;
1301
+ removeClass([collapsePane], EXPAND_PANE);
1302
+ collapsePane.setAttribute('aria-expanded', 'false');
1303
+ addClass([collapsePane], collapseClass);
1304
+ collapsePane.setAttribute('aria-hidden', 'true');
1305
+ const isFlexPane = collapsePane.style.flexBasis === '';
1306
+ if (isFlexPane) {
1307
+ addClass([expandPane], EXPAND_PANE);
1308
+ expandPane.setAttribute('aria-expanded', 'true');
1313
1309
  }
1314
1310
  else {
1315
- removeClass([this.previousPane], EXPAND_PANE);
1316
- removeClass([this.nextPane], collapseClass);
1317
- addClass([this.nextPane], EXPAND_PANE);
1318
- addClass([this.previousPane], collapseClass);
1319
- if (!this.collapseFlag) {
1320
- this.updatePaneSettings(this.prevPaneIndex, true);
1321
- }
1322
- }
1323
- this.updateIconsOnCollapse(e);
1324
- this.previousPane.setAttribute('aria-expanded', 'false');
1325
- this.nextPane.setAttribute('aria-expanded', 'true');
1326
- this.updateFlexGrow(this.checkStaticPanes());
1311
+ let isFlexPaneHidden = true;
1312
+ for (let i = 0; i < this.allPanes.length; i++) {
1313
+ if (!this.allPanes[i].classList.contains(COLLAPSE_PANE)) {
1314
+ if (this.allPanes[i].style.flexBasis === '' && !this.allPanes[i].classList.contains(COLLAPSE_PANE)
1315
+ && !this.allPanes[i].classList.contains(EXPAND_PANE)) {
1316
+ addClass([this.allPanes[i]], EXPAND_PANE);
1317
+ this.allPanes[i].setAttribute('aria-expanded', 'true');
1318
+ isFlexPaneHidden = false;
1319
+ break;
1320
+ }
1321
+ }
1322
+ }
1323
+ if (isFlexPaneHidden) {
1324
+ addClass([expandPane], EXPAND_PANE);
1325
+ expandPane.setAttribute('aria-expanded', 'true');
1326
+ }
1327
+ }
1328
+ if (!this.collapseFlag) {
1329
+ this.updatePaneSettings(collapsePaneIndex, true);
1330
+ }
1331
+ this.updateIconsOnCollapse(e, icon);
1332
+ this.updateFlexGrow();
1327
1333
  if (flexStatus) {
1328
1334
  this.nextPane.classList.remove(EXPAND_PANE);
1329
1335
  this.nextPane.style.flexGrow = '';
@@ -1367,71 +1373,95 @@ let Splitter = class Splitter extends Component {
1367
1373
  prevPanePreEle: this.previousPane.previousElementSibling
1368
1374
  };
1369
1375
  }
1370
- showCurrentBarIcon() {
1376
+ showCurrentBarIcons() {
1371
1377
  removeClass([select('.' + this.arrow, this.currentSeparator)], HIDE_ICON);
1372
1378
  }
1373
- updateIconsOnExpand(e) {
1379
+ hideBarIcons(bar) {
1380
+ addClass([select('.' + this.arrow, bar)], HIDE_ICON);
1381
+ }
1382
+ getCollapseCount(prevPaneIndex, nextPaneIndex) {
1383
+ let collapsecount = 0;
1384
+ if (this.allPanes[prevPaneIndex].classList.contains(COLLAPSE_PANE)) {
1385
+ collapsecount = collapsecount + 1;
1386
+ }
1387
+ if (this.allPanes[nextPaneIndex].classList.contains(COLLAPSE_PANE)) {
1388
+ collapsecount = collapsecount + 1;
1389
+ }
1390
+ return collapsecount;
1391
+ }
1392
+ checkResizableProp(prevPaneIndex, nextPaneIndex) {
1393
+ if (this.paneSettings[prevPaneIndex].resizable && this.paneSettings[nextPaneIndex].resizable) {
1394
+ return true;
1395
+ }
1396
+ else {
1397
+ return false;
1398
+ }
1399
+ }
1400
+ updateIconsOnExpand(e, targetIcon) {
1374
1401
  this.splitterProperty();
1375
- addClass([e.target], HIDE_ICON);
1376
- if (!this.splitInstance.prevPaneExpanded && !this.splitInstance.nextPaneCollapsed) {
1377
- if (this.paneSettings[this.prevPaneIndex].collapsible) {
1378
- this.showCurrentBarIcon();
1379
- }
1380
- if (this.paneSettings[this.nextPaneIndex].collapsible) {
1381
- removeClass([e.target], HIDE_ICON);
1382
- }
1383
- if (this.paneSettings[this.currentBarIndex].resizable) {
1384
- this.resizableModel(this.currentBarIndex, true);
1385
- }
1386
- if (!isNullOrUndefined(this.prevBar) &&
1387
- !this.splitInstance.prevPanePreEle.classList.contains(COLLAPSE_PANE)) {
1388
- if (this.paneSettings[this.currentBarIndex - 1].resizable) {
1389
- this.resizableModel(this.currentBarIndex - 1, true);
1390
- }
1391
- if (this.paneSettings[this.prevPaneIndex].collapsible) {
1392
- this.showTargetBarIcon(this.prevBar, this.rightArrow);
1393
- }
1394
- if (!this.paneSettings[this.currentBarIndex - 1].collapsible) {
1395
- this.hideTargetBarIcon(this.prevBar, this.arrow);
1396
- if (this.paneSettings[this.currentBarIndex].collapsible &&
1397
- !this.paneSettings[this.currentBarIndex + 1].collapsible) {
1398
- this.hideTargetBarIcon(this.currentSeparator, this.rightArrow);
1402
+ const showIcon = this.arrow;
1403
+ const otherBar = this.currentBarIndex === (this.allBars.length - 1) ? this.prevBar : this.nextBar;
1404
+ const otherBarIndex = this.currentBarIndex === (this.allBars.length - 1) ?
1405
+ this.currentBarIndex - 1 : this.currentBarIndex + 1;
1406
+ if (!e.target.classList.contains(HIDE_ICON)) {
1407
+ // prevPane ! collapsed && nextPane ! collapsed
1408
+ if (!this.splitInstance.prevPaneCollapsed && !this.splitInstance.nextPaneCollapsed) {
1409
+ if (this.paneSettings[this.prevPaneIndex].collapsible && this.paneSettings[this.nextPaneIndex].collapsible) {
1410
+ this.showCurrentBarIcons();
1411
+ if (this.checkResizableProp(this.prevPaneIndex, this.nextPaneIndex)) {
1412
+ this.resizableModel(this.currentBarIndex, true);
1413
+ }
1414
+ else {
1415
+ this.resizableModel(this.currentBarIndex, false);
1416
+ }
1417
+ if (!isNullOrUndefined(otherBar)) {
1418
+ const otherPrevPaneIndex = otherBarIndex;
1419
+ const otherNextPaneIndex = otherBarIndex + 1;
1420
+ const collapsecount = this.getCollapseCount(otherPrevPaneIndex, otherNextPaneIndex);
1421
+ if (this.paneSettings[otherPrevPaneIndex].collapsible &&
1422
+ this.paneSettings[otherNextPaneIndex].collapsible) {
1423
+ if (collapsecount === 0) {
1424
+ this.showTargetBarIcon(otherBar, targetIcon);
1425
+ this.showTargetBarIcon(otherBar, showIcon);
1426
+ if (this.checkResizableProp(otherPrevPaneIndex, otherNextPaneIndex)) {
1427
+ this.resizableModel(otherBarIndex, true);
1428
+ }
1429
+ }
1430
+ else if (collapsecount === 1) {
1431
+ this.hideBarIcons(otherBar);
1432
+ // If condition Edge case in flexible cases
1433
+ if (this.allPanes[otherPrevPaneIndex].classList.contains(EXPAND_PANE) ||
1434
+ this.allPanes[otherNextPaneIndex].classList.contains(EXPAND_PANE)) {
1435
+ this.showTargetBarIcon(otherBar, showIcon);
1436
+ }
1437
+ else {
1438
+ // Common case
1439
+ this.showTargetBarIcon(otherBar, targetIcon);
1440
+ }
1441
+ this.resizableModel(otherBarIndex, false);
1442
+ }
1443
+ }
1399
1444
  }
1400
1445
  }
1401
- else if (this.paneSettings[this.currentBarIndex].collapsible &&
1402
- !this.paneSettings[this.currentBarIndex + 1].collapsible) {
1403
- this.hideTargetBarIcon(this.currentSeparator, this.rightArrow);
1404
- }
1405
- }
1406
- else {
1407
- if (this.previousPane.previousElementSibling && this.paneSettings[this.prevPaneIndex].collapsible &&
1408
- (this.previousPane.previousElementSibling.classList.contains(COLLAPSE_PANE) &&
1409
- this.paneSettings[this.prevPaneIndex - 1].collapsible)) {
1410
- this.showTargetBarIcon(this.prevBar, this.rightArrow);
1411
- }
1412
- if (!this.paneSettings[this.currentBarIndex + 1].collapsible) {
1413
- this.hideTargetBarIcon(this.currentSeparator, this.rightArrow);
1446
+ else {
1447
+ this.hideTargetBarIcon(this.currentSeparator, targetIcon);
1448
+ this.showTargetBarIcon(this.currentSeparator, showIcon);
1449
+ if (!this.splitInstance.prevPaneCollapsed && !this.splitInstance.nextPaneCollapsed) {
1450
+ if (this.checkResizableProp(this.prevPaneIndex, this.nextPaneIndex)) {
1451
+ this.resizableModel(this.currentBarIndex, true);
1452
+ }
1453
+ }
1454
+ else {
1455
+ this.resizableModel(this.currentBarIndex, false);
1456
+ }
1414
1457
  }
1415
1458
  }
1416
1459
  }
1417
- else if (this.splitInstance.prevPaneExpanded && this.splitInstance.nextPaneCollapsed) {
1418
- this.resizableModel(this.currentBarIndex, false);
1419
- this.resizableModel(this.currentBarIndex + 1, false);
1420
- if (this.paneSettings[this.nextPaneIndex].collapsible) {
1421
- this.showCurrentBarIcon();
1422
- }
1423
- if (!isNullOrUndefined(this.nextBar)) {
1424
- this.hideTargetBarIcon(this.nextBar, this.arrow);
1425
- }
1426
- if (this.nextPane && this.nextPaneIndex === this.allPanes.length - 1 && (!this.paneSettings[this.nextPaneIndex].collapsible &&
1427
- this.splitInstance.nextPaneCollapsed)) {
1428
- this.hideTargetBarIcon(this.currentSeparator, this.arrow);
1429
- }
1430
- if (!(this.nextPaneIndex === this.allPanes.length - 1) && this.nextPane.nextElementSibling &&
1431
- this.nextPane.classList.contains(COLLAPSE_PANE) &&
1432
- !this.nextPane.nextElementSibling.classList.contains(COLLAPSE_PANE)
1433
- && this.paneSettings[this.nextPaneIndex].collapsible) {
1434
- this.showTargetBarIcon(this.nextBar, this.rightArrow);
1460
+ else {
1461
+ if (!this.paneSettings[this.prevPaneIndex].collapsible && !this.paneSettings[this.nextPaneIndex].collapsible) {
1462
+ if (this.checkResizableProp(this.prevPaneIndex, this.nextPaneIndex)) {
1463
+ this.resizableModel(this.currentBarIndex, true);
1464
+ }
1435
1465
  }
1436
1466
  }
1437
1467
  }
@@ -1751,7 +1781,7 @@ let Splitter = class Splitter extends Component {
1751
1781
  }
1752
1782
  const allFlexiblePanes = flexPaneCount === this.allPanes.length;
1753
1783
  // Two flexible Pane Case.
1754
- if (this.previousPane.style.flexBasis === '' && this.nextPane.style.flexBasis == '' && !allFlexiblePanes) {
1784
+ if (this.previousPane.style.flexBasis === '' && this.nextPane.style.flexBasis === '' && !allFlexiblePanes) {
1755
1785
  const middlePaneIndex = this.allPanes.length % this.allBars.length;
1756
1786
  if (this.prevPaneIndex === middlePaneIndex) {
1757
1787
  this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
@@ -2404,6 +2434,7 @@ let DashboardLayout = class DashboardLayout extends Component {
2404
2434
  // to maintain sizeY in mobile device
2405
2435
  this.panelsSizeY = 0;
2406
2436
  this.resizeHeight = false;
2437
+ this.eventVar = false;
2407
2438
  setValue('mergePersistData', this.mergePersistPanelData, this);
2408
2439
  }
2409
2440
  /**
@@ -4269,56 +4300,77 @@ let DashboardLayout = class DashboardLayout extends Component {
4269
4300
  abort: abortArray,
4270
4301
  dragStart: this.onDraggingStart.bind(this),
4271
4302
  dragStop: (args) => {
4272
- const model = this.getCellInstance(this.mainElement.id);
4273
- if (this.allowPushing &&
4274
- this.collisions(model.row, model.col, model.sizeX, model.sizeY, this.mainElement).length > 0) {
4275
- this.setHolderPosition(args);
4276
- this.setPanelPosition(this.mainElement, model.row, model.col);
4277
- this.updatePanelLayout(this.mainElement, model);
4278
- }
4279
- else {
4280
- this.setPanelPosition(this.mainElement, model.row, model.col);
4281
- }
4282
- this.mainElement = null;
4283
- const item = this.getPanelBase(args);
4284
- if (this.shadowEle) {
4285
- detach(this.shadowEle);
4303
+ this.trigger('dragStop', args);
4304
+ if (isNullOrUndefined(args.cancel)) {
4305
+ args.cancel = false;
4286
4306
  }
4287
- removeClass([this.element], [preventSelect]);
4288
- removeClass([args.element], [dragging]);
4289
- this.shadowEle = null;
4290
- args.element.classList.remove('e-dragging');
4291
- const row = this.getRowColumnDragValues(args)[0];
4292
- const col = this.getRowColumnDragValues(args)[1];
4293
- const panelModel = this.getCellInstance(args.element.id);
4294
- if (this.allowPushing &&
4295
- this.collisions(row, col, panelModel.sizeX, panelModel.sizeY, document.getElementById(item.id)).length === 0) {
4296
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4297
- this.oldRowCol[args.element.id].row = row;
4298
- this.oldRowCol[args.element.id].col = col;
4299
- this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4300
- this.sortedPanel();
4307
+ if (!(args.cancel)) {
4308
+ const model = this.getCellInstance(this.mainElement.id);
4309
+ if (this.allowPushing &&
4310
+ this.collisions(model.row, model.col, model.sizeX, model.sizeY, this.mainElement).length > 0) {
4311
+ this.setHolderPosition(args);
4312
+ this.setPanelPosition(this.mainElement, model.row, model.col);
4313
+ this.updatePanelLayout(this.mainElement, model);
4314
+ }
4315
+ else {
4316
+ this.setPanelPosition(this.mainElement, model.row, model.col);
4317
+ }
4318
+ this.mainElement = null;
4319
+ const item = this.getPanelBase(args);
4320
+ if (this.shadowEle) {
4321
+ detach(this.shadowEle);
4322
+ }
4323
+ removeClass([this.element], [preventSelect]);
4324
+ removeClass([args.element], [dragging]);
4325
+ this.shadowEle = null;
4326
+ args.element.classList.remove('e-dragging');
4327
+ const row = this.getRowColumnDragValues(args)[0];
4328
+ const col = this.getRowColumnDragValues(args)[1];
4329
+ const panelModel = this.getCellInstance(args.element.id);
4330
+ if (this.allowPushing &&
4331
+ this.collisions(row, col, panelModel.sizeX, panelModel.sizeY, document.getElementById(item.id)).length === 0) {
4332
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4333
+ this.oldRowCol[args.element.id].row = row;
4334
+ this.oldRowCol[args.element.id].col = col;
4335
+ this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4336
+ this.sortedPanel();
4337
+ }
4338
+ else {
4339
+ this.panelPropertyChange(this.getCellInstance(args.element.id), {
4340
+ row: this.oldRowCol[args.element.id].row,
4341
+ col: this.oldRowCol[args.element.id].col
4342
+ });
4343
+ args.element.setAttribute('data-col', this.getCellInstance(args.element.id).col.toString());
4344
+ args.element.setAttribute('data-row', this.getCellInstance(args.element.id).row.toString());
4345
+ this.sortedPanel();
4346
+ }
4347
+ const panelInstance = this.getCellInstance(args.element.id);
4348
+ this.setPanelPosition(args.element, panelInstance.row, panelInstance.col);
4349
+ this.updatePanels();
4350
+ this.updateCloneArrayObject();
4351
+ this.checkForChanges(true);
4352
+ this.dragStopEventArgs = { event: args.event, element: args.element };
4353
+ this.resizeEvents();
4354
+ this.rows = this.maxRow(true);
4355
+ this.setHeightWidth();
4356
+ this.updateDragArea();
4301
4357
  }
4302
4358
  else {
4303
- this.panelPropertyChange(this.getCellInstance(args.element.id), {
4304
- row: this.oldRowCol[args.element.id].row,
4305
- col: this.oldRowCol[args.element.id].col
4306
- });
4307
- args.element.setAttribute('data-col', this.getCellInstance(args.element.id).col.toString());
4308
- args.element.setAttribute('data-row', this.getCellInstance(args.element.id).row.toString());
4309
- this.sortedPanel();
4359
+ let currentPanel = this.getCellInstance(this.mainElement.id);
4360
+ for (i = 0; i < this.panels.length; i++) {
4361
+ if (this.panels[i].id === currentPanel.id) {
4362
+ args.element.setAttribute('data-col', this.panelsInitialModel[i].col.toString());
4363
+ args.element.setAttribute('data-row', this.panelsInitialModel[i].row.toString());
4364
+ currentPanel.col = this.panelsInitialModel[i].col;
4365
+ currentPanel.row = this.panelsInitialModel[i].row;
4366
+ this.setPanelPosition(this.mainElement, this.panelsInitialModel[i].row, this.panelsInitialModel[i].col);
4367
+ this.updatePanelLayout(this.mainElement, currentPanel);
4368
+ }
4369
+ }
4370
+ if (this.shadowEle) {
4371
+ detach(this.shadowEle);
4372
+ }
4310
4373
  }
4311
- const panelInstance = this.getCellInstance(args.element.id);
4312
- this.setPanelPosition(args.element, panelInstance.row, panelInstance.col);
4313
- this.updatePanels();
4314
- this.updateCloneArrayObject();
4315
- this.checkForChanges(true);
4316
- this.dragStopEventArgs = { event: args.event, element: args.element };
4317
- this.trigger('dragStop', args);
4318
- this.resizeEvents();
4319
- this.rows = this.maxRow(true);
4320
- this.setHeightWidth();
4321
- this.updateDragArea();
4322
4374
  },
4323
4375
  drag: (args) => {
4324
4376
  this.draggedEventArgs = {
@@ -4356,28 +4408,38 @@ let DashboardLayout = class DashboardLayout extends Component {
4356
4408
  onDraggingStart(args) {
4357
4409
  const dragArgs = args;
4358
4410
  this.trigger('dragStart', dragArgs, (dragArgs) => {
4411
+ if (isNullOrUndefined(args.cancel)) {
4412
+ args.cancel = false;
4413
+ }
4359
4414
  });
4360
- this.panelsInitialModel = this.cloneModels(this.panels);
4361
- this.mainElement = args.element;
4362
- this.cloneObject = JSON.parse(JSON.stringify(this.cloneObject));
4363
- const eleRowValue = this.startRow = parseInt(args.element.getAttribute('data-row'), 10);
4364
- this.startCol = parseInt(args.element.getAttribute('data-col'), 10);
4365
- const eleSizeY = parseInt(args.element.getAttribute('data-sizeY'), 10);
4366
- this.updateRowsHeight(eleRowValue, eleSizeY, eleSizeY);
4367
- this.updateDragArea();
4368
- this.shadowEle = document.createElement('div');
4369
- this.shadowEle.classList.add('e-holder');
4370
- this.shadowEle.classList.add('e-holder-transition');
4371
- setStyleAttribute(this.shadowEle, { 'position': 'absolute' });
4372
- addClass([this.element], [preventSelect]);
4373
- addClass([args.element], [dragging]);
4374
- this.element.appendChild(this.shadowEle);
4375
- this.renderReactTemplates();
4376
- this.shadowEle = document.querySelector('.e-holder');
4377
- this.shadowEle.style.height = (this.getCellInstance(args.element.id).sizeY * this.cellSize[1]) + 'px';
4378
- this.shadowEle.style.width = (this.getCellInstance(args.element.id).sizeX * this.cellSize[0]) + 'px';
4379
- const panelInstance = this.getCellInstance(args.element.id);
4380
- this.setPanelPosition(this.shadowEle, panelInstance.row, panelInstance.col);
4415
+ this.eventVar = args.cancel;
4416
+ if (!(args.cancel)) {
4417
+ this.panelsInitialModel = this.cloneModels(this.panels);
4418
+ this.mainElement = args.element;
4419
+ this.cloneObject = JSON.parse(JSON.stringify(this.cloneObject));
4420
+ const eleRowValue = this.startRow = parseInt(args.element.getAttribute('data-row'), 10);
4421
+ this.startCol = parseInt(args.element.getAttribute('data-col'), 10);
4422
+ const eleSizeY = parseInt(args.element.getAttribute('data-sizeY'), 10);
4423
+ this.updateRowsHeight(eleRowValue, eleSizeY, eleSizeY);
4424
+ this.updateDragArea();
4425
+ this.shadowEle = document.createElement('div');
4426
+ this.shadowEle.classList.add('e-holder');
4427
+ this.shadowEle.classList.add('e-holder-transition');
4428
+ setStyleAttribute(this.shadowEle, { 'position': 'absolute' });
4429
+ addClass([this.element], [preventSelect]);
4430
+ addClass([args.element], [dragging]);
4431
+ this.element.appendChild(this.shadowEle);
4432
+ this.renderReactTemplates();
4433
+ this.shadowEle = document.querySelector('.e-holder');
4434
+ this.shadowEle.style.height = (this.getCellInstance(args.element.id).sizeY * this.cellSize[1]) + 'px';
4435
+ this.shadowEle.style.width = (this.getCellInstance(args.element.id).sizeX * this.cellSize[0]) + 'px';
4436
+ const panelInstance = this.getCellInstance(args.element.id);
4437
+ this.setPanelPosition(this.shadowEle, panelInstance.row, panelInstance.col);
4438
+ }
4439
+ else {
4440
+ removeClass([this.element], [preventSelect]);
4441
+ removeClass([args.element], [dragging]);
4442
+ }
4381
4443
  }
4382
4444
  // eslint-disable-next-line
4383
4445
  cloneModels(source, target) {
@@ -4400,60 +4462,67 @@ let DashboardLayout = class DashboardLayout extends Component {
4400
4462
  let endCol;
4401
4463
  let endRow;
4402
4464
  let dragCol;
4403
- const col = dragCol = this.getRowColumnDragValues(args)[1];
4404
- const row = this.getRowColumnDragValues(args)[0];
4405
- if (col < 0 || row < 0) {
4406
- return;
4407
- }
4408
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4409
- const panelModel = this.getCellInstance(args.element.id);
4410
- this.updateRowsHeight(panelModel.row, panelModel.sizeY, 1);
4411
- this.updateDragArea();
4412
- if (this.allowPushing) {
4413
- this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4465
+ if (!this.eventVar) {
4466
+ const col = dragCol = this.getRowColumnDragValues(args)[1];
4467
+ const row = this.getRowColumnDragValues(args)[0];
4468
+ if (col < 0 || row < 0) {
4469
+ return;
4470
+ }
4414
4471
  this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4415
- endCol = this.oldRowCol[(args.element.id)].col;
4416
- endRow = this.oldRowCol[(args.element.id)].row;
4417
- this.oldRowCol[(args.element.id)] = { row: row, col: col };
4418
- this.updateOldRowColumn();
4419
- if (this.startCol !== endCol || this.startRow !== endRow) {
4420
- this.setHolderPosition(args);
4421
- if (this.startCol !== endCol) {
4422
- this.startRow = endRow;
4423
- }
4424
- if (this.startRow !== endRow) {
4425
- this.startCol = endCol;
4426
- }
4427
- if (this.allowPushing) {
4428
- this.mainElement = args.element;
4429
- const model = panelModel;
4430
- this.checkCollision = this.collisions(model.row, model.col, model.sizeX, model.sizeY, args.element);
4431
- if (panelModel.col >= this.checkColumnValue) {
4432
- this.checkCollision = [];
4472
+ const panelModel = this.getCellInstance(args.element.id);
4473
+ this.updateRowsHeight(panelModel.row, panelModel.sizeY, 1);
4474
+ this.updateDragArea();
4475
+ if (this.allowPushing) {
4476
+ this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4477
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4478
+ endCol = this.oldRowCol[(args.element.id)].col;
4479
+ endRow = this.oldRowCol[(args.element.id)].row;
4480
+ this.oldRowCol[(args.element.id)] = { row: row, col: col };
4481
+ this.updateOldRowColumn();
4482
+ if (this.startCol !== endCol || this.startRow !== endRow) {
4483
+ this.setHolderPosition(args);
4484
+ if (this.startCol !== endCol) {
4485
+ this.startRow = endRow;
4486
+ }
4487
+ if (this.startRow !== endRow) {
4488
+ this.startCol = endCol;
4489
+ }
4490
+ if (this.allowPushing) {
4491
+ this.mainElement = args.element;
4492
+ const model = panelModel;
4493
+ this.checkCollision = this.collisions(model.row, model.col, model.sizeX, model.sizeY, args.element);
4494
+ if (panelModel.col >= this.checkColumnValue) {
4495
+ this.checkCollision = [];
4496
+ }
4497
+ this.updatePanelLayout(args.element, panelModel);
4498
+ this.moveItemsUpwards();
4433
4499
  }
4434
- this.updatePanelLayout(args.element, panelModel);
4435
- this.moveItemsUpwards();
4436
4500
  }
4437
4501
  }
4502
+ if (this.allowPushing !== false) {
4503
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4504
+ }
4505
+ if (this.oldRowCol[args.element.id].row !== row || this.oldRowCol[args.element.id].col !== col) {
4506
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4507
+ this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4508
+ }
4509
+ if (this.startCol !== dragCol) {
4510
+ this.startCol = endCol;
4511
+ this.moveItemsUpwards();
4512
+ }
4513
+ if (!this.allowPushing) {
4514
+ this.setHolderPosition(args);
4515
+ }
4516
+ this.removeResizeClasses(this.panelCollection);
4517
+ this.setClasses(this.panelCollection);
4518
+ if (this.allowPushing === false) {
4519
+ return;
4520
+ }
4438
4521
  }
4439
- if (this.allowPushing !== false) {
4440
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4441
- }
4442
- if (this.oldRowCol[args.element.id].row !== row || this.oldRowCol[args.element.id].col !== col) {
4443
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
4444
- this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
4445
- }
4446
- if (this.startCol !== dragCol) {
4447
- this.startCol = endCol;
4448
- this.moveItemsUpwards();
4449
- }
4450
- if (!this.allowPushing) {
4451
- this.setHolderPosition(args);
4452
- }
4453
- this.removeResizeClasses(this.panelCollection);
4454
- this.setClasses(this.panelCollection);
4455
- if (this.allowPushing === false) {
4456
- return;
4522
+ else {
4523
+ this.dragobj.intDestroy(args.event);
4524
+ removeClass([this.element], [preventSelect]);
4525
+ removeClass([args.element], [dragging]);
4457
4526
  }
4458
4527
  }
4459
4528
  getPanelBase(args) {
@@ -5071,6 +5140,7 @@ let DashboardLayout = class DashboardLayout extends Component {
5071
5140
  for (const key of keys) {
5072
5141
  if ((typeof getValue(key, this) === 'object' && !isNullOrUndefined(getValue(key, this)))) {
5073
5142
  if (Array.isArray(getValue(key, this)) && key === 'panels') {
5143
+ // eslint-disable-next-line
5074
5144
  this.mergePanels(dataObj[key], this[key]);
5075
5145
  }
5076
5146
  }