@syncfusion/ej2-layouts 20.4.40 → 20.4.48

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.40
3
+ * version : 20.4.48
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-layouts@*",
3
- "_id": "@syncfusion/ej2-layouts@20.4.38",
3
+ "_id": "@syncfusion/ej2-layouts@20.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-MgFvFavT0QESxZEp9ggKjUGezpUa47dy5ni0b9beyu4TjeIlU7HwIHxuMaTF+m6+UOY1QqIo4kmLo2d1O/vrpw==",
5
+ "_integrity": "sha512-FsMlyjEuCRPFozN4SxqHQlPZsNjGwNYJH3BRJrwsHYZqqYd+qaxyHkAOX+1WkVmIbDEhSZwg84jb17e9BmrzhQ==",
6
6
  "_location": "/@syncfusion/ej2-layouts",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -27,8 +27,8 @@
27
27
  "/@syncfusion/ej2-react-layouts",
28
28
  "/@syncfusion/ej2-vue-layouts"
29
29
  ],
30
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-layouts/-/ej2-layouts-20.4.38.tgz",
31
- "_shasum": "0b3c2541ff0f2ae4ff7ec0798a2727ee23ea0223",
30
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-layouts/-/ej2-layouts-20.4.42.tgz",
31
+ "_shasum": "4fe954b5ab6341cea34ef3a63176e28a72950b36",
32
32
  "_spec": "@syncfusion/ej2-layouts@*",
33
33
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
34
34
  "author": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~20.4.40"
39
+ "@syncfusion/ej2-base": "~20.4.48"
40
40
  },
41
41
  "deprecated": false,
42
42
  "description": "A package of Essential JS 2 layout pure CSS components such as card and avatar. The card is used as small container to show content in specific structure, whereas the avatars are icons, initials or figures representing particular person.",
@@ -76,7 +76,7 @@
76
76
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/layouts"
77
77
  },
78
78
  "typings": "index.d.ts",
79
- "version": "20.4.40",
79
+ "version": "20.4.48",
80
80
  "sideEffects": false,
81
81
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
82
82
  }
@@ -215,6 +215,7 @@ export declare class DashboardLayout extends Component<HTMLElement> implements I
215
215
  private panelsSizeY;
216
216
  private resizeHeight;
217
217
  private refreshListener;
218
+ private eventVar;
218
219
  /**
219
220
  * If allowDragging is set to true, then the DashboardLayout allows you to drag and reorder the panels.
220
221
  *
@@ -136,6 +136,7 @@ var DashboardLayout = /** @class */ (function (_super) {
136
136
  // to maintain sizeY in mobile device
137
137
  _this.panelsSizeY = 0;
138
138
  _this.resizeHeight = false;
139
+ _this.eventVar = false;
139
140
  setValue('mergePersistData', _this.mergePersistPanelData, _this);
140
141
  return _this;
141
142
  }
@@ -2013,69 +2014,91 @@ var DashboardLayout = /** @class */ (function (_super) {
2013
2014
  };
2014
2015
  DashboardLayout.prototype.enableDraggingContent = function (collections) {
2015
2016
  var _this = this;
2016
- for (var i = 0; i < collections.length; i++) {
2017
+ var _loop_6 = function (i) {
2017
2018
  var abortArray = ['.e-resize', '.' + dragRestrict];
2018
2019
  var cellElement = collections[i];
2019
2020
  {
2020
- this.dragobj = new Draggable(cellElement, {
2021
+ this_4.dragobj = new Draggable(cellElement, {
2021
2022
  preventDefault: false,
2022
2023
  clone: false,
2023
- dragArea: this.element,
2024
+ dragArea: this_4.element,
2024
2025
  isDragScroll: true,
2025
- handle: this.draggableHandle ? this.draggableHandle : '.e-panel',
2026
+ handle: this_4.draggableHandle ? this_4.draggableHandle : '.e-panel',
2026
2027
  abort: abortArray,
2027
- dragStart: this.onDraggingStart.bind(this),
2028
+ dragStart: this_4.onDraggingStart.bind(this_4),
2028
2029
  dragStop: function (args) {
2029
- var model = _this.getCellInstance(_this.mainElement.id);
2030
- if (_this.allowPushing &&
2031
- _this.collisions(model.row, model.col, model.sizeX, model.sizeY, _this.mainElement).length > 0) {
2032
- _this.setHolderPosition(args);
2033
- _this.setPanelPosition(_this.mainElement, model.row, model.col);
2034
- _this.updatePanelLayout(_this.mainElement, model);
2035
- }
2036
- else {
2037
- _this.setPanelPosition(_this.mainElement, model.row, model.col);
2038
- }
2039
- _this.mainElement = null;
2040
- var item = _this.getPanelBase(args);
2041
- if (_this.shadowEle) {
2042
- detach(_this.shadowEle);
2030
+ _this.trigger('dragStop', args);
2031
+ if (isNullOrUndefined(args.cancel)) {
2032
+ args.cancel = false;
2043
2033
  }
2044
- removeClass([_this.element], [preventSelect]);
2045
- removeClass([args.element], [dragging]);
2046
- _this.shadowEle = null;
2047
- args.element.classList.remove('e-dragging');
2048
- var row = _this.getRowColumnDragValues(args)[0];
2049
- var col = _this.getRowColumnDragValues(args)[1];
2050
- var panelModel = _this.getCellInstance(args.element.id);
2051
- if (_this.allowPushing &&
2052
- _this.collisions(row, col, panelModel.sizeX, panelModel.sizeY, document.getElementById(item.id)).length === 0) {
2053
- _this.panelPropertyChange(_this.getCellInstance(args.element.id), { row: row, col: col });
2054
- _this.oldRowCol[args.element.id].row = row;
2055
- _this.oldRowCol[args.element.id].col = col;
2056
- _this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2057
- _this.sortedPanel();
2034
+ if (!(args.cancel)) {
2035
+ var model = _this.getCellInstance(_this.mainElement.id);
2036
+ if (_this.allowPushing &&
2037
+ _this.collisions(model.row, model.col, model.sizeX, model.sizeY, _this.mainElement).length > 0) {
2038
+ _this.setHolderPosition(args);
2039
+ _this.setPanelPosition(_this.mainElement, model.row, model.col);
2040
+ _this.updatePanelLayout(_this.mainElement, model);
2041
+ }
2042
+ else {
2043
+ _this.setPanelPosition(_this.mainElement, model.row, model.col);
2044
+ }
2045
+ _this.mainElement = null;
2046
+ var item = _this.getPanelBase(args);
2047
+ if (_this.shadowEle) {
2048
+ detach(_this.shadowEle);
2049
+ }
2050
+ removeClass([_this.element], [preventSelect]);
2051
+ removeClass([args.element], [dragging]);
2052
+ _this.shadowEle = null;
2053
+ args.element.classList.remove('e-dragging');
2054
+ var row = _this.getRowColumnDragValues(args)[0];
2055
+ var col = _this.getRowColumnDragValues(args)[1];
2056
+ var panelModel = _this.getCellInstance(args.element.id);
2057
+ if (_this.allowPushing &&
2058
+ _this.collisions(row, col, panelModel.sizeX, panelModel.sizeY, document.getElementById(item.id)).length === 0) {
2059
+ _this.panelPropertyChange(_this.getCellInstance(args.element.id), { row: row, col: col });
2060
+ _this.oldRowCol[args.element.id].row = row;
2061
+ _this.oldRowCol[args.element.id].col = col;
2062
+ _this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2063
+ _this.sortedPanel();
2064
+ }
2065
+ else {
2066
+ _this.panelPropertyChange(_this.getCellInstance(args.element.id), {
2067
+ row: _this.oldRowCol[args.element.id].row,
2068
+ col: _this.oldRowCol[args.element.id].col
2069
+ });
2070
+ args.element.setAttribute('data-col', _this.getCellInstance(args.element.id).col.toString());
2071
+ args.element.setAttribute('data-row', _this.getCellInstance(args.element.id).row.toString());
2072
+ _this.sortedPanel();
2073
+ }
2074
+ var panelInstance = _this.getCellInstance(args.element.id);
2075
+ _this.setPanelPosition(args.element, panelInstance.row, panelInstance.col);
2076
+ _this.updatePanels();
2077
+ _this.updateCloneArrayObject();
2078
+ _this.checkForChanges(true);
2079
+ _this.dragStopEventArgs = { event: args.event, element: args.element };
2080
+ _this.trigger('dragStop', args);
2081
+ _this.resizeEvents();
2082
+ _this.rows = _this.maxRow(true);
2083
+ _this.setHeightWidth();
2084
+ _this.updateDragArea();
2058
2085
  }
2059
2086
  else {
2060
- _this.panelPropertyChange(_this.getCellInstance(args.element.id), {
2061
- row: _this.oldRowCol[args.element.id].row,
2062
- col: _this.oldRowCol[args.element.id].col
2063
- });
2064
- args.element.setAttribute('data-col', _this.getCellInstance(args.element.id).col.toString());
2065
- args.element.setAttribute('data-row', _this.getCellInstance(args.element.id).row.toString());
2066
- _this.sortedPanel();
2087
+ var currentPanel = _this.getCellInstance(_this.mainElement.id);
2088
+ for (i = 0; i < _this.panels.length; i++) {
2089
+ if (_this.panels[i].id === currentPanel.id) {
2090
+ args.element.setAttribute('data-col', _this.panelsInitialModel[i].col.toString());
2091
+ args.element.setAttribute('data-row', _this.panelsInitialModel[i].row.toString());
2092
+ currentPanel.col = _this.panelsInitialModel[i].col;
2093
+ currentPanel.row = _this.panelsInitialModel[i].row;
2094
+ _this.setPanelPosition(_this.mainElement, _this.panelsInitialModel[i].row, _this.panelsInitialModel[i].col);
2095
+ _this.updatePanelLayout(_this.mainElement, currentPanel);
2096
+ }
2097
+ }
2098
+ if (_this.shadowEle) {
2099
+ detach(_this.shadowEle);
2100
+ }
2067
2101
  }
2068
- var panelInstance = _this.getCellInstance(args.element.id);
2069
- _this.setPanelPosition(args.element, panelInstance.row, panelInstance.col);
2070
- _this.updatePanels();
2071
- _this.updateCloneArrayObject();
2072
- _this.checkForChanges(true);
2073
- _this.dragStopEventArgs = { event: args.event, element: args.element };
2074
- _this.trigger('dragStop', args);
2075
- _this.resizeEvents();
2076
- _this.rows = _this.maxRow(true);
2077
- _this.setHeightWidth();
2078
- _this.updateDragArea();
2079
2102
  },
2080
2103
  drag: function (args) {
2081
2104
  _this.draggedEventArgs = {
@@ -2087,10 +2110,16 @@ var DashboardLayout = /** @class */ (function (_super) {
2087
2110
  _this.onDragStart(args);
2088
2111
  }
2089
2112
  });
2090
- if (this.dragCollection.indexOf(this.dragobj) === -1) {
2091
- this.dragCollection.push(this.dragobj);
2113
+ if (this_4.dragCollection.indexOf(this_4.dragobj) === -1) {
2114
+ this_4.dragCollection.push(this_4.dragobj);
2092
2115
  }
2093
2116
  }
2117
+ out_i_1 = i;
2118
+ };
2119
+ var this_4 = this, out_i_1;
2120
+ for (var i = 0; i < collections.length; i++) {
2121
+ _loop_6(i);
2122
+ i = out_i_1;
2094
2123
  }
2095
2124
  };
2096
2125
  DashboardLayout.prototype.updatePanels = function () {
@@ -2113,28 +2142,38 @@ var DashboardLayout = /** @class */ (function (_super) {
2113
2142
  DashboardLayout.prototype.onDraggingStart = function (args) {
2114
2143
  var dragArgs = args;
2115
2144
  this.trigger('dragStart', dragArgs, function (dragArgs) {
2145
+ if (isNullOrUndefined(args.cancel)) {
2146
+ args.cancel = false;
2147
+ }
2116
2148
  });
2117
- this.panelsInitialModel = this.cloneModels(this.panels);
2118
- this.mainElement = args.element;
2119
- this.cloneObject = JSON.parse(JSON.stringify(this.cloneObject));
2120
- var eleRowValue = this.startRow = parseInt(args.element.getAttribute('data-row'), 10);
2121
- this.startCol = parseInt(args.element.getAttribute('data-col'), 10);
2122
- var eleSizeY = parseInt(args.element.getAttribute('data-sizeY'), 10);
2123
- this.updateRowsHeight(eleRowValue, eleSizeY, eleSizeY);
2124
- this.updateDragArea();
2125
- this.shadowEle = document.createElement('div');
2126
- this.shadowEle.classList.add('e-holder');
2127
- this.shadowEle.classList.add('e-holder-transition');
2128
- setStyle(this.shadowEle, { 'position': 'absolute' });
2129
- addClass([this.element], [preventSelect]);
2130
- addClass([args.element], [dragging]);
2131
- this.element.appendChild(this.shadowEle);
2132
- this.renderReactTemplates();
2133
- this.shadowEle = document.querySelector('.e-holder');
2134
- this.shadowEle.style.height = (this.getCellInstance(args.element.id).sizeY * this.cellSize[1]) + 'px';
2135
- this.shadowEle.style.width = (this.getCellInstance(args.element.id).sizeX * this.cellSize[0]) + 'px';
2136
- var panelInstance = this.getCellInstance(args.element.id);
2137
- this.setPanelPosition(this.shadowEle, panelInstance.row, panelInstance.col);
2149
+ this.eventVar = args.cancel;
2150
+ if (!(args.cancel)) {
2151
+ this.panelsInitialModel = this.cloneModels(this.panels);
2152
+ this.mainElement = args.element;
2153
+ this.cloneObject = JSON.parse(JSON.stringify(this.cloneObject));
2154
+ var eleRowValue = this.startRow = parseInt(args.element.getAttribute('data-row'), 10);
2155
+ this.startCol = parseInt(args.element.getAttribute('data-col'), 10);
2156
+ var eleSizeY = parseInt(args.element.getAttribute('data-sizeY'), 10);
2157
+ this.updateRowsHeight(eleRowValue, eleSizeY, eleSizeY);
2158
+ this.updateDragArea();
2159
+ this.shadowEle = document.createElement('div');
2160
+ this.shadowEle.classList.add('e-holder');
2161
+ this.shadowEle.classList.add('e-holder-transition');
2162
+ setStyle(this.shadowEle, { 'position': 'absolute' });
2163
+ addClass([this.element], [preventSelect]);
2164
+ addClass([args.element], [dragging]);
2165
+ this.element.appendChild(this.shadowEle);
2166
+ this.renderReactTemplates();
2167
+ this.shadowEle = document.querySelector('.e-holder');
2168
+ this.shadowEle.style.height = (this.getCellInstance(args.element.id).sizeY * this.cellSize[1]) + 'px';
2169
+ this.shadowEle.style.width = (this.getCellInstance(args.element.id).sizeX * this.cellSize[0]) + 'px';
2170
+ var panelInstance = this.getCellInstance(args.element.id);
2171
+ this.setPanelPosition(this.shadowEle, panelInstance.row, panelInstance.col);
2172
+ }
2173
+ else {
2174
+ removeClass([this.element], [preventSelect]);
2175
+ removeClass([args.element], [dragging]);
2176
+ }
2138
2177
  };
2139
2178
  // eslint-disable-next-line
2140
2179
  DashboardLayout.prototype.cloneModels = function (source, target) {
@@ -2157,60 +2196,67 @@ var DashboardLayout = /** @class */ (function (_super) {
2157
2196
  var endCol;
2158
2197
  var endRow;
2159
2198
  var dragCol;
2160
- var col = dragCol = this.getRowColumnDragValues(args)[1];
2161
- var row = this.getRowColumnDragValues(args)[0];
2162
- if (col < 0 || row < 0) {
2163
- return;
2164
- }
2165
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2166
- var panelModel = this.getCellInstance(args.element.id);
2167
- this.updateRowsHeight(panelModel.row, panelModel.sizeY, 1);
2168
- this.updateDragArea();
2169
- if (this.allowPushing) {
2170
- this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2199
+ if (!this.eventVar) {
2200
+ var col = dragCol = this.getRowColumnDragValues(args)[1];
2201
+ var row = this.getRowColumnDragValues(args)[0];
2202
+ if (col < 0 || row < 0) {
2203
+ return;
2204
+ }
2171
2205
  this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2172
- endCol = this.oldRowCol[(args.element.id)].col;
2173
- endRow = this.oldRowCol[(args.element.id)].row;
2174
- this.oldRowCol[(args.element.id)] = { row: row, col: col };
2175
- this.updateOldRowColumn();
2176
- if (this.startCol !== endCol || this.startRow !== endRow) {
2177
- this.setHolderPosition(args);
2178
- if (this.startCol !== endCol) {
2179
- this.startRow = endRow;
2180
- }
2181
- if (this.startRow !== endRow) {
2182
- this.startCol = endCol;
2183
- }
2184
- if (this.allowPushing) {
2185
- this.mainElement = args.element;
2186
- var model = panelModel;
2187
- this.checkCollision = this.collisions(model.row, model.col, model.sizeX, model.sizeY, args.element);
2188
- if (panelModel.col >= this.checkColumnValue) {
2189
- this.checkCollision = [];
2206
+ var panelModel = this.getCellInstance(args.element.id);
2207
+ this.updateRowsHeight(panelModel.row, panelModel.sizeY, 1);
2208
+ this.updateDragArea();
2209
+ if (this.allowPushing) {
2210
+ this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2211
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2212
+ endCol = this.oldRowCol[(args.element.id)].col;
2213
+ endRow = this.oldRowCol[(args.element.id)].row;
2214
+ this.oldRowCol[(args.element.id)] = { row: row, col: col };
2215
+ this.updateOldRowColumn();
2216
+ if (this.startCol !== endCol || this.startRow !== endRow) {
2217
+ this.setHolderPosition(args);
2218
+ if (this.startCol !== endCol) {
2219
+ this.startRow = endRow;
2220
+ }
2221
+ if (this.startRow !== endRow) {
2222
+ this.startCol = endCol;
2223
+ }
2224
+ if (this.allowPushing) {
2225
+ this.mainElement = args.element;
2226
+ var model = panelModel;
2227
+ this.checkCollision = this.collisions(model.row, model.col, model.sizeX, model.sizeY, args.element);
2228
+ if (panelModel.col >= this.checkColumnValue) {
2229
+ this.checkCollision = [];
2230
+ }
2231
+ this.updatePanelLayout(args.element, panelModel);
2232
+ this.moveItemsUpwards();
2190
2233
  }
2191
- this.updatePanelLayout(args.element, panelModel);
2192
- this.moveItemsUpwards();
2193
2234
  }
2194
2235
  }
2236
+ if (this.allowPushing !== false) {
2237
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2238
+ }
2239
+ if (this.oldRowCol[args.element.id].row !== row || this.oldRowCol[args.element.id].col !== col) {
2240
+ this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2241
+ this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2242
+ }
2243
+ if (this.startCol !== dragCol) {
2244
+ this.startCol = endCol;
2245
+ this.moveItemsUpwards();
2246
+ }
2247
+ if (!this.allowPushing) {
2248
+ this.setHolderPosition(args);
2249
+ }
2250
+ this.removeResizeClasses(this.panelCollection);
2251
+ this.setClasses(this.panelCollection);
2252
+ if (this.allowPushing === false) {
2253
+ return;
2254
+ }
2195
2255
  }
2196
- if (this.allowPushing !== false) {
2197
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2198
- }
2199
- if (this.oldRowCol[args.element.id].row !== row || this.oldRowCol[args.element.id].col !== col) {
2200
- this.panelPropertyChange(this.getCellInstance(args.element.id), { row: row, col: col });
2201
- this.setAttributes({ value: { col: col.toString(), row: row.toString() } }, args.element);
2202
- }
2203
- if (this.startCol !== dragCol) {
2204
- this.startCol = endCol;
2205
- this.moveItemsUpwards();
2206
- }
2207
- if (!this.allowPushing) {
2208
- this.setHolderPosition(args);
2209
- }
2210
- this.removeResizeClasses(this.panelCollection);
2211
- this.setClasses(this.panelCollection);
2212
- if (this.allowPushing === false) {
2213
- return;
2256
+ else {
2257
+ this.dragobj.intDestroy(args.event);
2258
+ removeClass([this.element], [preventSelect]);
2259
+ removeClass([args.element], [dragging]);
2214
2260
  }
2215
2261
  };
2216
2262
  DashboardLayout.prototype.getPanelBase = function (args) {
@@ -2843,16 +2889,16 @@ var DashboardLayout = /** @class */ (function (_super) {
2843
2889
  /* istanbul ignore next */
2844
2890
  DashboardLayout.prototype.mergePanels = function (sortedPanels, panels) {
2845
2891
  var storedColumns = sortedPanels;
2846
- var _loop_6 = function (i) {
2847
- this_4.checkForIDValues(panels);
2892
+ var _loop_7 = function (i) {
2893
+ this_5.checkForIDValues(panels);
2848
2894
  var localPanel = panels.filter(function (pan) { return pan.id === storedColumns[i].id; })[0];
2849
2895
  if (!isNullOrUndefined(localPanel)) {
2850
2896
  storedColumns[i] = extend(localPanel, storedColumns[i], {}, true);
2851
2897
  }
2852
2898
  };
2853
- var this_4 = this;
2899
+ var this_5 = this;
2854
2900
  for (var i = 0; i < storedColumns.length; i++) {
2855
- _loop_6(i);
2901
+ _loop_7(i);
2856
2902
  }
2857
2903
  };
2858
2904
  /**
@@ -402,8 +402,8 @@ export declare class Splitter extends Component<HTMLElement> {
402
402
  private wireClickEvents;
403
403
  private clickHandler;
404
404
  private expandAction;
405
+ private getIcon;
405
406
  private expandPane;
406
- private checkStaticPanes;
407
407
  private updateFlexGrow;
408
408
  private hideTargetBarIcon;
409
409
  private showTargetBarIcon;
@@ -414,7 +414,10 @@ export declare class Splitter extends Component<HTMLElement> {
414
414
  private beforeAction;
415
415
  private updatePaneSettings;
416
416
  private splitterProperty;
417
- private showCurrentBarIcon;
417
+ private showCurrentBarIcons;
418
+ private hideBarIcons;
419
+ private getCollapseCount;
420
+ private checkResizableProp;
418
421
  private updateIconsOnExpand;
419
422
  private afterAction;
420
423
  private currentIndex;