canvas-datagrid 0.3.18 → 0.3.22

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.
@@ -11,6 +11,336 @@
11
11
  return /******/ (function() { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
+ /***/ "./lib/button.js":
15
+ /*!***********************!*\
16
+ !*** ./lib/button.js ***!
17
+ \***********************/
18
+ /*! namespace exports */
19
+ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
20
+ /*! other exports [not provided] [no usage info] */
21
+ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
22
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23
+
24
+ "use strict";
25
+ __webpack_require__.r(__webpack_exports__);
26
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27
+ /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
28
+ /* harmony export */ });
29
+ /*jslint browser: true, unparam: true, todo: true*/
30
+
31
+ /*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/
32
+
33
+
34
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
35
+
36
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
+
38
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
+
40
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
41
+
42
+ /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
43
+ var zIndexTop;
44
+
45
+ function applyButtonMenuItemStyle(buttonMenuItemContainer) {
46
+ self.createInlineStyle(buttonMenuItemContainer, 'canvas-datagrid-button-menu-item' + (self.mobile ? '-mobile' : ''));
47
+ buttonMenuItemContainer.addEventListener('mouseover', function () {
48
+ self.createInlineStyle(buttonMenuItemContainer, 'canvas-datagrid-button-menu-item:hover');
49
+ });
50
+ buttonMenuItemContainer.addEventListener('mouseout', function () {
51
+ self.createInlineStyle(buttonMenuItemContainer, 'canvas-datagrid-button-menu-item');
52
+ });
53
+ }
54
+
55
+ function applyButtonStyle(button) {
56
+ self.createInlineStyle(button, 'canvas-datagrid-button-wrapper');
57
+ button.addEventListener('mouseover', function () {
58
+ if (!self.buttonMenu) {
59
+ self.createInlineStyle(button, 'canvas-datagrid-button-wrapper:hover');
60
+ }
61
+ });
62
+ button.addEventListener('mouseout', function () {
63
+ if (!self.buttonMenu) {
64
+ self.createInlineStyle(button, 'canvas-datagrid-button-wrapper');
65
+ }
66
+ });
67
+ }
68
+
69
+ function createButton(pos, items, imgSrc) {
70
+ var wrapper = document.createElement('div'),
71
+ buttonArrow = document.createElement('div'),
72
+ buttonIcon = document.createElement('div'),
73
+ intf = {};
74
+
75
+ if (!Array.isArray(items)) {
76
+ throw new Error('createButton expects an array.');
77
+ }
78
+
79
+ function init() {
80
+ var loc = {},
81
+ s = self.scrollOffset(self.canvas);
82
+
83
+ if (zIndexTop === undefined) {
84
+ zIndexTop = self.style.buttonZIndex;
85
+ }
86
+
87
+ applyButtonStyle(wrapper);
88
+ self.createInlineStyle(buttonIcon, 'canvas-datagrid-button-icon');
89
+ self.createInlineStyle(buttonArrow, 'canvas-datagrid-button-arrow');
90
+ loc.x = pos.left - s.left;
91
+ loc.y = pos.top - s.top;
92
+ loc.height = 0;
93
+ zIndexTop += 1;
94
+ wrapper.style.position = 'absolute';
95
+ wrapper.style.zIndex = zIndexTop;
96
+ wrapper.style.left = loc.x + 'px';
97
+ wrapper.style.top = loc.y + 'px';
98
+ wrapper.left = pos.left + self.scrollBox.scrollLeft;
99
+ wrapper.top = pos.top + self.scrollBox.scrollTop;
100
+ buttonArrow.innerHTML = self.style.buttonArrowDownHTML;
101
+
102
+ if (imgSrc) {
103
+ var img = document.createElement('img');
104
+ img.setAttribute('src', imgSrc);
105
+ img.style.maxWidth = '100%';
106
+ img.style.height = '100%';
107
+ buttonIcon.appendChild(img);
108
+ }
109
+
110
+ wrapper.appendChild(buttonIcon);
111
+ wrapper.appendChild(buttonArrow);
112
+ document.body.appendChild(wrapper);
113
+ wrapper.addEventListener('click', toggleButtonMenu);
114
+ }
115
+
116
+ intf.wrapper = wrapper;
117
+ intf.items = items;
118
+ init();
119
+
120
+ intf.dispose = function () {
121
+ if (wrapper.parentNode) {
122
+ wrapper.parentNode.removeChild(wrapper);
123
+ }
124
+ };
125
+
126
+ return intf;
127
+ }
128
+
129
+ function toggleButtonMenu() {
130
+ function createDisposeEvent() {
131
+ requestAnimationFrame(function () {
132
+ document.addEventListener('click', self.disposeButtonMenu);
133
+ });
134
+ }
135
+
136
+ if (self.buttonMenu) {
137
+ self.disposeButtonMenu();
138
+ } else {
139
+ var pos = {
140
+ left: self.button.wrapper.left - self.scrollBox.scrollLeft,
141
+ top: self.button.wrapper.top + self.button.wrapper.offsetHeight - self.scrollBox.scrollTop
142
+ };
143
+ self.buttonMenu = createButtonMenu(pos, self.button.items);
144
+ self.createInlineStyle(self.button.wrapper, 'canvas-datagrid-button-wrapper:active');
145
+ createDisposeEvent();
146
+ }
147
+ }
148
+
149
+ function createButtonMenu(pos, items) {
150
+ var buttonMenu = document.createElement('div'),
151
+ selectedIndex = -1,
152
+ intf = {},
153
+ rect;
154
+
155
+ function createItems() {
156
+ function addItem(item, menuItemContainer) {
157
+ function addContent(content) {
158
+ if (content === null) {
159
+ return;
160
+ }
161
+
162
+ if (_typeof(content) === 'object') {
163
+ menuItemContainer.appendChild(content);
164
+ return;
165
+ }
166
+
167
+ applyButtonMenuItemStyle(menuItemContainer);
168
+ menuItemContainer.innerHTML = content;
169
+ return;
170
+ }
171
+
172
+ addContent(item.title);
173
+ item.buttonMenuItemContainer = menuItemContainer;
174
+
175
+ if (item.click) {
176
+ menuItemContainer.addEventListener('click', function (ev) {
177
+ item.click.apply(self, [ev]);
178
+ self.disposeButton();
179
+ });
180
+ }
181
+ }
182
+
183
+ var _iterator = _createForOfIteratorHelper(items),
184
+ _step;
185
+
186
+ try {
187
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
188
+ var item = _step.value;
189
+ var buttonMenuItemContainer = document.createElement('div');
190
+ addItem(item, buttonMenuItemContainer);
191
+ buttonMenu.appendChild(buttonMenuItemContainer);
192
+ }
193
+ } catch (err) {
194
+ _iterator.e(err);
195
+ } finally {
196
+ _iterator.f();
197
+ }
198
+ }
199
+
200
+ function clickIndex(idx) {
201
+ items[idx].buttonMenuItemContainer.dispatchEvent(new Event('click'));
202
+ }
203
+
204
+ function init() {
205
+ var loc = {},
206
+ s = self.scrollOffset(self.canvas);
207
+
208
+ if (zIndexTop === undefined) {
209
+ zIndexTop = self.style.buttonZIndex;
210
+ }
211
+
212
+ createItems();
213
+ self.createInlineStyle(buttonMenu, 'canvas-datagrid-button-menu' + (self.mobile ? '-mobile' : ''));
214
+ loc.x = pos.left - s.left;
215
+ loc.y = pos.top - s.top;
216
+ loc.height = 0;
217
+ zIndexTop += 1;
218
+ buttonMenu.style.position = 'absolute';
219
+ buttonMenu.style.zIndex = zIndexTop;
220
+ buttonMenu.style.left = loc.x + 'px';
221
+ buttonMenu.style.top = loc.y + 'px';
222
+ document.body.appendChild(buttonMenu);
223
+ rect = buttonMenu.getBoundingClientRect();
224
+
225
+ if (rect.bottom > window.innerHeight) {
226
+ loc.y = self.button.wrapper.top - buttonMenu.offsetHeight - self.scrollBox.scrollTop;
227
+
228
+ if (loc.y < 0) {
229
+ loc.y = self.style.buttonMenuWindowMargin;
230
+ }
231
+
232
+ if (buttonMenu.offsetHeight > window.innerHeight - self.style.buttonMenuWindowMargin) {
233
+ buttonMenu.style.height = window.innerHeight - self.style.buttonMenuWindowMargin * 2 + 'px';
234
+ }
235
+ }
236
+
237
+ if (rect.right > window.innerWidth) {
238
+ loc.x -= rect.right - window.innerWidth + self.style.buttonMenuWindowMargin;
239
+ }
240
+
241
+ if (loc.x < 0) {
242
+ loc.x = self.style.buttonMenuWindowMargin;
243
+ }
244
+
245
+ if (loc.y < 0) {
246
+ loc.y = self.style.buttonMenuWindowMargin;
247
+ }
248
+
249
+ buttonMenu.style.left = loc.x + 'px';
250
+ buttonMenu.style.top = loc.y + 'px';
251
+ }
252
+
253
+ intf.buttonMenu = buttonMenu;
254
+ init();
255
+ intf.clickIndex = clickIndex;
256
+ intf.rect = rect;
257
+ intf.items = items;
258
+
259
+ intf.dispose = function () {
260
+ if (buttonMenu.parentNode) {
261
+ buttonMenu.parentNode.removeChild(buttonMenu);
262
+ }
263
+ };
264
+
265
+ Object.defineProperty(intf, 'selectedIndex', {
266
+ get: function get() {
267
+ return selectedIndex;
268
+ },
269
+ set: function set(value) {
270
+ if (typeof value !== 'number' || isNaN(value) || !isFinite(value)) {
271
+ throw new Error('Button menu selected index must be a sane number.');
272
+ }
273
+
274
+ selectedIndex = value;
275
+
276
+ if (selectedIndex > items.length - 1) {
277
+ selectedIndex = items.length - 1;
278
+ }
279
+
280
+ if (selectedIndex < 0) {
281
+ selectedIndex = 0;
282
+ }
283
+
284
+ items.forEach(function (item, index) {
285
+ if (index === selectedIndex) {
286
+ return self.createInlineStyle(item.buttonMenuItemContainer, 'canvas-datagrid-button-menu-item:hover');
287
+ }
288
+
289
+ self.createInlineStyle(item.buttonMenuItemContainer, 'canvas-datagrid-button-menu-item');
290
+ });
291
+ }
292
+ });
293
+ return intf;
294
+ }
295
+
296
+ self.disposeButtonMenu = function () {
297
+ if (self.buttonMenu) {
298
+ document.removeEventListener('click', self.disposeButtonMenu);
299
+ self.buttonMenu.dispose();
300
+ self.buttonMenu = undefined;
301
+ self.createInlineStyle(self.button.wrapper, 'canvas-datagrid-button-wrapper:hover');
302
+ }
303
+ };
304
+
305
+ self.disposeButton = function (e) {
306
+ if (e && e.keyCode !== 27) return;
307
+ document.removeEventListener('keydown', self.disposeButton);
308
+ zIndexTop = self.style.buttonZIndex;
309
+ self.disposeButtonMenu();
310
+
311
+ if (self.button) {
312
+ self.button.dispose();
313
+ }
314
+
315
+ self.button = undefined;
316
+ };
317
+
318
+ self.moveButtonPos = function () {
319
+ self.button.wrapper.style.left = self.button.wrapper.left - self.scrollBox.scrollLeft + 'px';
320
+ self.button.wrapper.style.top = self.button.wrapper.top - self.scrollBox.scrollTop + 'px';
321
+ self.disposeButtonMenu();
322
+ };
323
+
324
+ self.attachButton = function (pos, items, imgSrc) {
325
+ function createDisposeEvent() {
326
+ requestAnimationFrame(function () {
327
+ document.addEventListener('keydown', self.disposeButton);
328
+ });
329
+ }
330
+
331
+ if (self.button) {
332
+ self.disposeButton();
333
+ }
334
+
335
+ self.button = createButton(pos, items, imgSrc);
336
+ createDisposeEvent();
337
+ };
338
+
339
+ return;
340
+ }
341
+
342
+ /***/ }),
343
+
14
344
  /***/ "./lib/component.js":
15
345
  /*!**************************!*\
16
346
  !*** ./lib/component.js ***!
@@ -467,6 +797,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
467
797
  }
468
798
  }
469
799
 
800
+ function fade(element) {
801
+ var opacity = 1;
802
+ var timer = setInterval(function () {
803
+ if (opacity <= 0.1) {
804
+ clearInterval(timer);
805
+ element.style.display = 'none';
806
+
807
+ if (element.parentNode) {
808
+ element.parentNode.removeChild(element);
809
+ }
810
+ }
811
+
812
+ element.style.opacity = opacity;
813
+ element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
814
+ opacity -= opacity * 0.1;
815
+ }, self.attributes.animationDurationHideContextMenu * 0.1);
816
+ }
817
+
818
+ function unfade(element) {
819
+ var opacity = 0.1;
820
+ element.style.display = 'block';
821
+ var timer = setInterval(function () {
822
+ if (opacity >= 1) {
823
+ clearInterval(timer);
824
+ }
825
+
826
+ element.style.opacity = opacity;
827
+ element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
828
+ opacity += opacity * 0.1;
829
+ }, self.attributes.animationDurationShowContextMenu * 0.1);
830
+ }
831
+
470
832
  function startHoverScroll(type) {
471
833
  return function t() {
472
834
  var a = self.attributes.contextHoverScrollAmount;
@@ -504,6 +866,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
504
866
  loc.y = pos.top - s.top;
505
867
  loc.height = 0;
506
868
  zIndexTop += 1;
869
+ container.style.opacity = 0;
507
870
  container.style.position = 'absolute';
508
871
  upArrow.style.color = self.style.contextMenuArrowColor;
509
872
  downArrow.style.color = self.style.contextMenuArrowColor;
@@ -540,6 +903,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
540
903
  container.appendChild(upArrow);
541
904
  document.body.appendChild(downArrow);
542
905
  document.body.appendChild(container);
906
+ unfade(container);
543
907
  rect = container.getBoundingClientRect(); // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)
544
908
 
545
909
  if (rect.bottom > window.innerHeight) {
@@ -600,9 +964,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
600
964
  c.dispose();
601
965
  });
602
966
  [downArrow, upArrow, container].forEach(function (el) {
603
- if (el.parentNode) {
604
- el.parentNode.removeChild(el);
605
- }
967
+ fade(el);
606
968
  });
607
969
  };
608
970
 
@@ -923,7 +1285,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
923
1285
  }
924
1286
  };
925
1287
 
926
- self.disposeContextMenu = function () {
1288
+ self.disposeContextMenu = function (event) {
927
1289
  document.removeEventListener('click', self.disposeContextMenu);
928
1290
  zIndexTop = self.style.contextMenuZIndex;
929
1291
  self.disposeAutocomplete();
@@ -933,6 +1295,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
933
1295
  }
934
1296
 
935
1297
  self.contextMenu = undefined;
1298
+
1299
+ if (event) {
1300
+ self.canvas.focus();
1301
+ self.mousedown(event);
1302
+ self.mouseup(event);
1303
+ }
936
1304
  };
937
1305
 
938
1306
  self.contextmenuEvent = function (e, overridePos) {
@@ -940,10 +1308,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
940
1308
  return;
941
1309
  }
942
1310
 
943
- function createDiposeEvent() {
1311
+ function createDisposeEvent() {
944
1312
  requestAnimationFrame(function () {
945
1313
  document.addEventListener('click', self.disposeContextMenu);
946
- document.removeEventListener('mouseup', createDiposeEvent);
1314
+ document.removeEventListener('mouseup', createDisposeEvent);
947
1315
  });
948
1316
  }
949
1317
 
@@ -960,7 +1328,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
960
1328
  addDefaultContextMenuItem(ev);
961
1329
  }
962
1330
 
963
- if (self.dispatchEvent('contextmenu', ev)) {
1331
+ if (e.type !== 'mousedown' && self.dispatchEvent('contextmenu', ev)) {
964
1332
  return;
965
1333
  }
966
1334
 
@@ -983,8 +1351,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
983
1351
  contextPosition.width = self.width - self.style.mobileContextMenuMargin * 2 + 'px';
984
1352
  }
985
1353
 
1354
+ if (e.type == 'mousedown') {
1355
+ contextPosition.top += self.style.filterButtonMenuOffsetTop;
1356
+ }
1357
+
986
1358
  self.contextMenu = createContextMenu(ev, contextPosition, items);
987
- document.addEventListener('mouseup', createDiposeEvent);
1359
+
1360
+ if (e.type == 'mousedown') {
1361
+ document.addEventListener('mouseup', createDisposeEvent);
1362
+ } else {
1363
+ createDisposeEvent();
1364
+ }
1365
+
988
1366
  e.preventDefault();
989
1367
  }
990
1368
  };
@@ -1016,8 +1394,8 @@ __webpack_require__.r(__webpack_exports__);
1016
1394
 
1017
1395
  /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
1018
1396
  self.defaults = {
1019
- attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['autoGenerateSchema', false], ['autoResizeColumns', false], ['autoResizeRows', false], ['autoScrollOnMousemove', false], ['autoScrollMargin', 5], ['blanksText', '(Blanks)'], ['borderDragBehavior', 'none'], ['borderResizeZone', 10], ['clearSettingsOptionText', 'Clear saved settings'], ['columnHeaderClickBehavior', 'sort'], ['columnSelectorHiddenText', '&nbsp;&nbsp;&nbsp;'], ['columnSelectorText', 'Add/Remove columns'], ['columnSelectorVisibleText', "\u2713"], ['contextHoverScrollAmount', 2], ['contextHoverScrollRateMs', 5], ['copyHeadersOnSelectAll', true], ['copyText', 'Copy'], ['debug', false], ['editable', true], ['ellipsisText', '...'], ['filterOptionText', 'Filter %s'], ['filterTextPrefix', '(filtered) '], ['filterFrozenRows', true], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['hoverMode', 'cell'], ['keepFocusOnMouseOut', false], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['saveAppearance', true], ['scrollAnimationPPSThreshold', 0.75], ['scrollPointerLock', false], ['scrollRepeatRate', 75], ['selectionFollowsActiveCell', false], ['selectionHandleBehavior', 'none'], ['selectionMode', 'cell'], ['selectionScrollIncrement', 20], ['selectionScrollZone', 20], ['showClearSettingsOption', true], ['showColumnHeaders', true], ['showColumnSelector', true], ['showCopy', false], ['showFilter', true], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], ['showPaste', false], ['showPerformance', false], ['showRowHeaders', true], ['showRowNumbers', true], ['showRowNumberGaps', true], ['singleSelectionMode', false], ['snapToRow', false], ['sortFrozenRows', true], ['touchContextMenuTimeMs', 800], ['touchDeadZone', 3], ['touchEasingMethod', 'easeOutQuad'], ['touchReleaseAcceleration', 1000], ['touchReleaseAnimationDurationMs', 2000], ['touchScrollZone', 20], ['touchSelectHandleZone', 20], ['touchZoomSensitivity', 0.005], ['touchZoomMin', 0.5], ['touchZoomMax', 1.75], ['maxPixelRatio', 2], ['tree', false], ['treeHorizontalScroll', false]],
1020
- styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '&#x25BA;'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '&#x25BC;'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '&#x25BC;'], ['contextMenuArrowUpHTML', '&#x25B2;'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'], ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerWidth', 2], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['width', 'auto']]
1397
+ attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['animationDurationShowContextMenu', 50], ['animationDurationHideContextMenu', 50], ['autoGenerateSchema', false], ['autoResizeColumns', false], ['autoResizeRows', false], ['autoScrollOnMousemove', false], ['autoScrollMargin', 5], ['blanksText', '(Blanks)'], ['borderDragBehavior', 'none'], ['borderResizeZone', 10], ['clearSettingsOptionText', 'Clear saved settings'], ['columnHeaderClickBehavior', 'sort'], ['columnSelectorHiddenText', '&nbsp;&nbsp;&nbsp;'], ['columnSelectorText', 'Add/Remove columns'], ['columnSelectorVisibleText', "\u2713"], ['contextHoverScrollAmount', 2], ['contextHoverScrollRateMs', 5], ['copyHeadersOnSelectAll', true], ['copyText', 'Copy'], ['debug', false], ['editable', true], ['ellipsisText', '...'], ['filterOptionText', 'Filter %s'], ['filterTextPrefix', '(filtered) '], ['filterFrozenRows', true], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['hoverMode', 'cell'], ['keepFocusOnMouseOut', false], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['saveAppearance', true], ['scrollAnimationPPSThreshold', 0.75], ['scrollPointerLock', false], ['scrollRepeatRate', 75], ['selectionFollowsActiveCell', false], ['selectionHandleBehavior', 'none'], ['selectionMode', 'cell'], ['selectionScrollIncrement', 20], ['selectionScrollZone', 20], ['showClearSettingsOption', true], ['showColumnHeaders', true], ['showColumnSelector', true], ['showCopy', false], ['showFilter', true], ['showFilterInCell', false], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], ['showPaste', false], ['showPerformance', false], ['showRowHeaders', true], ['showRowNumbers', true], ['showRowNumberGaps', true], ['singleSelectionMode', false], ['snapToRow', false], ['sortFrozenRows', true], ['touchContextMenuTimeMs', 800], ['touchDeadZone', 3], ['touchEasingMethod', 'easeOutQuad'], ['touchReleaseAcceleration', 1000], ['touchReleaseAnimationDurationMs', 2000], ['touchScrollZone', 20], ['touchSelectHandleZone', 20], ['touchZoomSensitivity', 0.005], ['touchZoomMin', 0.5], ['touchZoomMax', 1.75], ['maxPixelRatio', 2], ['tree', false], ['treeHorizontalScroll', false]],
1398
+ styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['buttonArrowColor', 'rgba(50, 50, 50, 1)'], ['buttonArrowDownHTML', '&#x25BC;'], ['buttonZIndex', 10000], ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonBorderColor', 'rgba(172, 172, 172, 1)'], ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'], ['buttonMenuWindowMargin', 30], ['buttonPadding', '3px'], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '&#x25BA;'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '&#x25BC;'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '&#x25BC;'], ['contextMenuArrowUpHTML', '&#x25B2;'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'], ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['filterButtonArrowBorderWidth', 1], ['filterButtonArrowClickRadius', 5], ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'], ['filterButtonArrowHeight', 5], ['filterButtonArrowWidth', 8], ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'], ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'], ['filterButtonBorderRadius', 3], ['filterButtonHeight', 20], ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['filterButtonMenuOffsetTop', 10], ['filterButtonWidth', 20], ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'], ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerWidth', 2], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['width', 'auto']]
1021
1399
  };
1022
1400
  }
1023
1401
 
@@ -1494,6 +1872,96 @@ __webpack_require__.r(__webpack_exports__);
1494
1872
 
1495
1873
  self.createInlineStyle = function (el, className) {
1496
1874
  var css = {
1875
+ 'canvas-datagrid-button-wrapper': {
1876
+ display: 'inline-block',
1877
+ padding: self.style.buttonPadding,
1878
+ borderWidth: '1px',
1879
+ borderStyle: 'solid',
1880
+ borderColor: self.style.buttonBorderColor,
1881
+ cursor: 'pointer',
1882
+ background: self.style.buttonBackgroundColor,
1883
+ userSelect: 'none'
1884
+ },
1885
+ 'canvas-datagrid-button-wrapper:hover': {
1886
+ borderColor: self.style.buttonBorderColor,
1887
+ background: self.style.buttonHoverBackgroundColor
1888
+ },
1889
+ 'canvas-datagrid-button-wrapper:active': {
1890
+ borderColor: self.style.buttonActiveBorderColor,
1891
+ background: self.style.buttonActiveBackgroundColor
1892
+ },
1893
+ 'canvas-datagrid-button-icon': {
1894
+ width: '18px',
1895
+ height: '18px',
1896
+ display: 'inline-block',
1897
+ verticalAlign: 'middle'
1898
+ },
1899
+ 'canvas-datagrid-button-arrow': {
1900
+ display: 'inline-block',
1901
+ color: self.style.buttonArrowColor,
1902
+ fontSize: '9px'
1903
+ },
1904
+ 'canvas-datagrid-button-menu-item-mobile': {
1905
+ lineHeight: 'normal',
1906
+ fontWeight: 'normal',
1907
+ fontFamily: self.style.contextMenuFontFamily,
1908
+ fontSize: self.style.contextMenuFontSize,
1909
+ color: 'inherit',
1910
+ background: 'inherit',
1911
+ margin: self.style.contextMenuItemMargin,
1912
+ borderRadius: self.style.contextMenuItemBorderRadius,
1913
+ verticalAlign: 'middle'
1914
+ },
1915
+ 'canvas-datagrid-button-menu-item': {
1916
+ lineHeight: 'normal',
1917
+ fontWeight: 'normal',
1918
+ fontFamily: self.style.contextMenuFontFamily,
1919
+ fontSize: self.style.contextMenuFontSize,
1920
+ color: 'inherit',
1921
+ background: 'inherit',
1922
+ margin: self.style.contextMenuItemMargin,
1923
+ borderRadius: self.style.contextMenuItemBorderRadius,
1924
+ verticalAlign: 'middle'
1925
+ },
1926
+ 'canvas-datagrid-button-menu-item:hover': {
1927
+ background: self.style.contextMenuHoverBackground,
1928
+ color: self.style.contextMenuHoverColor
1929
+ },
1930
+ 'canvas-datagrid-button-menu-label': {
1931
+ margin: self.style.contextMenuLabelMargin,
1932
+ display: self.style.contextMenuLabelDisplay,
1933
+ minWidth: self.style.contextMenuLabelMinWidth,
1934
+ maxWidth: self.style.contextMenuLabelMaxWidth
1935
+ },
1936
+ 'canvas-datagrid-button-menu-mobile': {
1937
+ lineHeight: 'normal',
1938
+ fontWeight: 'normal',
1939
+ fontFamily: self.style.contextMenuFontFamily,
1940
+ fontSize: self.style.contextMenuFontSize,
1941
+ background: self.style.contextMenuBackground,
1942
+ color: self.style.contextMenuColor,
1943
+ border: self.style.contextMenuBorder,
1944
+ padding: self.style.contextMenuPadding,
1945
+ borderRadius: self.style.contextMenuBorderRadius,
1946
+ opacity: self.style.contextMenuOpacity,
1947
+ overflow: 'hidden',
1948
+ whiteSpace: 'nowrap'
1949
+ },
1950
+ 'canvas-datagrid-button-menu': {
1951
+ lineHeight: 'normal',
1952
+ fontWeight: 'normal',
1953
+ fontFamily: self.style.contextMenuFontFamily,
1954
+ fontSize: self.style.contextMenuFontSize,
1955
+ background: self.style.contextMenuBackground,
1956
+ color: self.style.contextMenuColor,
1957
+ border: self.style.contextMenuBorder,
1958
+ padding: self.style.contextMenuPadding,
1959
+ borderRadius: self.style.contextMenuBorderRadius,
1960
+ opacity: self.style.contextMenuOpacity,
1961
+ overflow: 'hidden',
1962
+ whiteSpace: 'nowrap',
1963
+ cursor: self.style.contextMenuCursor
1964
+ },
1497
1965
  'canvas-datagrid-context-menu-filter-input': {
1498
1966
  height: '19px',
1499
1967
  verticalAlign: 'bottom',
@@ -1939,6 +2407,27 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
1939
2407
  return ml + aw + mr;
1940
2408
  }
1941
2409
 
2410
+ function drawFilterButtonArrow(x, y) {
2411
+ var mt = (self.style.filterButtonHeight - self.style.filterButtonArrowHeight) / 2 * self.scale,
2412
+ ml = (self.style.filterButtonWidth - self.style.filterButtonArrowWidth) / 2 * self.scale,
2413
+ aw = self.style.filterButtonArrowWidth * self.scale,
2414
+ ah = self.style.filterButtonArrowHeight * self.scale;
2415
+ x += self.canvasOffsetLeft;
2416
+ y += self.canvasOffsetTop;
2417
+ self.ctx.fillStyle = self.style.filterButtonArrowColor;
2418
+ self.ctx.strokeStyle = self.style.filterButtonArrowBorderColor;
2419
+ self.ctx.beginPath();
2420
+ x = x + ml;
2421
+ y = y + mt;
2422
+ self.ctx.moveTo(x, y);
2423
+ self.ctx.lineTo(x + aw, y);
2424
+ self.ctx.lineTo(x + aw * 0.5, y + ah);
2425
+ self.ctx.moveTo(x, y);
2426
+ self.ctx.stroke();
2427
+ self.ctx.fill();
2428
+ return ml + aw;
2429
+ }
2430
+
1942
2431
  function radiusRect(x, y, w, h, radius) {
1943
2432
  x += self.canvasOffsetLeft;
1944
2433
  y += self.canvasOffsetTop;
@@ -2386,8 +2875,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2386
2875
  m = self.style.scrollBarBoxMargin * 2;
2387
2876
  self.ctx.strokeStyle = self.style.scrollBarBorderColor;
2388
2877
  self.ctx.lineWidth = self.style.scrollBarBorderWidth;
2389
- en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin + (en.horizontalBar.width - self.scrollBox.scrollBoxWidth) * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth);
2390
- en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin + (en.verticalBar.height - self.scrollBox.scrollBoxHeight) * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight);
2878
+
2879
+ if (self.frozenColumn > 0) {
2880
+ en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin + self.scrollCache.x[self.frozenColumn - 1] + (en.horizontalBar.width - self.scrollCache.x[self.frozenColumn - 1] - self.scrollBox.scrollBoxWidth) * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth);
2881
+ } else {
2882
+ en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin + (en.horizontalBar.width - self.scrollBox.scrollBoxWidth) * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth);
2883
+ }
2884
+
2885
+ en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin + self.scrollCache.y[self.frozenRow] + (en.verticalBar.height - self.scrollBox.scrollBoxHeight - self.scrollCache.y[self.frozenRow]) * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight);
2391
2886
 
2392
2887
  if (self.scrollBox.horizontalBarVisible) {
2393
2888
  self.ctx.fillStyle = self.style.scrollBarBackgroundColor;
@@ -2514,9 +3009,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2514
3009
  isCorner = /cornerCell/.test(cellStyle),
2515
3010
  isRowHeader = 'rowHeaderCell' === cellStyle,
2516
3011
  isColumnHeader = 'columnHeaderCell' === cellStyle,
3012
+ isFilterable = self.filterable.rows.includes(rowIndex) && self.filterable.columns.includes(headerIndex),
2517
3013
  wrap = self.style.cellWhiteSpace !== 'nowrap',
2518
3014
  selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,
2519
3015
  hovered = self.hovers.rowIndex === rowOrderIndex && (self.attributes.hoverMode === 'row' || self.hovers.columnIndex === columnOrderIndex),
3016
+ openedFilter = self.selectedFilterButton.rowIndex == rowIndex && self.selectedFilterButton.columnIndex == headerIndex,
2520
3017
  active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,
2521
3018
  isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',
2522
3019
  rawValue = rowData ? rowData[header.name] : undefined,
@@ -2604,6 +3101,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2604
3101
  isColumnHeader: isColumnHeader,
2605
3102
  isColumnHeaderCellCap: isColumnHeaderCellCap,
2606
3103
  isRowHeader: isRowHeader,
3104
+ isFilterable: isFilterable,
3105
+ openedFilter: openedFilter,
2607
3106
  rowOpen: rowOpen,
2608
3107
  header: header,
2609
3108
  columnIndex: columnOrderIndex,
@@ -2794,12 +3293,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2794
3293
  createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);
2795
3294
  }
2796
3295
 
2797
- self.ctx.restore(); // Gaps may occur in row numbers between consecutively rendered rows
3296
+ self.ctx.restore();
3297
+
3298
+ if (isFilterable) {
3299
+ drawFilterButton(cell);
3300
+ } // Gaps may occur in row numbers between consecutively rendered rows
2798
3301
  // when we are filtering. We draw attention to this by drawing a thick
2799
3302
  // border overlapping the two consecutive row headers. If sorting, visible
2800
3303
  // row numbers stay the same (i.e. they don't correspond to the underlying
2801
3304
  // data's row number), so we do not show row gaps in that case.
2802
3305
 
3306
+
2803
3307
  var isSorting = self.orderings.columns && self.orderings.columns.length > 0;
2804
3308
 
2805
3309
  if (isRowHeader && self.attributes.showRowNumbers && self.attributes.showRowNumberGaps && isSorting === false) {
@@ -2821,6 +3325,33 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2821
3325
  };
2822
3326
  }
2823
3327
 
3328
+ function drawFilterButton(cell, ev) {
3329
+ var posX = cell.x + cell.width - self.style.filterButtonWidth - 1;
3330
+ var posY = cell.y + cell.height - self.style.filterButtonHeight - 2;
3331
+
3332
+ if (self.dispatchEvent('beforerenderfilterbutton', ev)) {
3333
+ return;
3334
+ }
3335
+
3336
+ self.ctx.save();
3337
+ self.ctx.strokeStyle = self.style.filterButtonBorderColor;
3338
+ self.ctx.fillStyle = self.style.filterButtonBackgroundColor;
3339
+
3340
+ if (cell.openedFilter) {
3341
+ self.ctx.fillStyle = self.style.filterButtonActiveBackgroundColor;
3342
+ } else if (cell.hovered && self.hovers.onFilterButton) {
3343
+ self.ctx.fillStyle = self.style.filterButtonHoverBackgroundColor;
3344
+ }
3345
+
3346
+ radiusRect(posX, posY, self.style.filterButtonWidth, self.style.filterButtonHeight, self.style.filterButtonBorderRadius);
3347
+ self.ctx.stroke();
3348
+ self.ctx.fill();
3349
+ drawFilterButtonArrow(posX, posY);
3350
+ self.ctx.clip();
3351
+ self.dispatchEvent('afterrenderfilterbutton', ev);
3352
+ self.ctx.restore();
3353
+ }
3354
+
2824
3355
  function drawRowHeader(rowData, rowIndex, rowOrderIndex) {
2825
3356
  if (self.attributes.showRowHeaders) {
2826
3357
  x = 0; // When filtering we'd like to display the actual row numbers,
@@ -3178,6 +3709,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3178
3709
  self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;
3179
3710
 
3180
3711
  if (self.dragMode === 'row-reorder') {
3712
+ for (var k = 0; k < self.selections.length; k++) {
3713
+ if (!self.selections[k] || k == self.reorderObject.rowIndex) continue;
3714
+ b.height += self.getRowHeight(k);
3715
+ }
3716
+
3181
3717
  b.width = w;
3182
3718
  b.x = 0;
3183
3719
  m.width = w;
@@ -3192,6 +3728,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3192
3728
  addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');
3193
3729
  }
3194
3730
  } else if (self.dragMode === 'column-reorder' && self.reorderObject) {
3731
+ var selectedColumns = self.selections[0];
3732
+
3733
+ for (var k = 1; k < selectedColumns.length; k++) {
3734
+ b.width += self.getColumnWidth(self.orders.columns[selectedColumns[k]]);
3735
+ }
3736
+
3195
3737
  b.height = h;
3196
3738
  b.y = 0;
3197
3739
  m.height = h;
@@ -3542,15 +4084,7 @@ __webpack_require__.r(__webpack_exports__);
3542
4084
  /*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
3543
4085
 
3544
4086
 
3545
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3546
-
3547
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3548
-
3549
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
3550
-
3551
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3552
-
3553
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
4087
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
3554
4088
 
3555
4089
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3556
4090
 
@@ -3809,14 +4343,20 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3809
4343
  setScrollBoxSize();
3810
4344
  self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;
3811
4345
  self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;
3812
- self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;
4346
+
4347
+ if (self.frozenColumn > 0) {
4348
+ self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn - 1]) / dataWidth;
4349
+ } else {
4350
+ self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;
4351
+ }
4352
+
3813
4353
  self.scrollBox.scrollBoxWidth = self.scrollBox.width * self.scrollBox.widthBoxRatio - self.style.scrollBarWidth - b - d; // TODO: This heightBoxRatio number is terribly wrong.
3814
4354
  // They should be a result of the size of the grid/canvas?
3815
4355
  // it being off causes the scroll bar to "slide" under
3816
4356
  // the dragged mouse.
3817
4357
  // https://github.com/TonyGermaneri/canvas-datagrid/issues/97
3818
4358
 
3819
- self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;
4359
+ self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight - self.scrollCache.y[self.frozenRow]) / dataHeight;
3820
4360
  self.scrollBox.scrollBoxHeight = self.scrollBox.height * self.scrollBox.heightBoxRatio - self.style.scrollBarWidth - b - d;
3821
4361
  self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);
3822
4362
  self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize); // horizontal
@@ -3831,11 +4371,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3831
4371
  nb.height = self.style.scrollBarBoxWidth; // vertical
3832
4372
 
3833
4373
  v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;
3834
- v.y += columnHeaderCellHeight;
4374
+ v.y += columnHeaderCellHeight + self.scrollCache.y[self.frozenRow];
3835
4375
  v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;
3836
4376
  v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m; // vertical box
3837
4377
 
3838
4378
  vb.x = v.x + self.style.scrollBarBoxMargin;
4379
+ vb.y += self.scrollCache.y[self.frozenRow];
3839
4380
  vb.width = self.style.scrollBarBoxWidth;
3840
4381
  vb.height = self.scrollBox.scrollBoxHeight; // corner
3841
4382
 
@@ -3993,8 +4534,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3993
4534
  self.cursor = 'default';
3994
4535
  self.hovers = {
3995
4536
  rowIndex: cell.rowIndex,
3996
- columnIndex: cell.columnIndex
4537
+ columnIndex: cell.columnIndex,
4538
+ onFilterButton: false
3997
4539
  };
4540
+
4541
+ if (cell.isFilterable && x > cell.x + cell.width + self.canvasOffsetLeft - self.style.filterButtonWidth && x < cell.x + cell.width + self.canvasOffsetLeft && y > cell.y + cell.height + self.canvasOffsetTop - self.style.filterButtonHeight && y < cell.y + cell.height + self.canvasOffsetTop) {
4542
+ self.hovers.onFilterButton = true;
4543
+ self.draw();
4544
+ }
3998
4545
  }
3999
4546
 
4000
4547
  if (self.selecting || self.reorderObject) {
@@ -4033,37 +4580,75 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4033
4580
  if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1) && self.rowBoundaryCrossed) {
4034
4581
  self.selectRow(cell.rowIndex, ctrl, null, true);
4035
4582
  } else if (self.attributes.selectionMode !== 'row') {
4036
- if (!self.dragAddToSelection && cell.rowIndex !== undefined) {
4037
- if (self.selections[cell.rowIndex] && self.selections[cell.rowIndex].indexOf(cell.columnIndex) !== -1) {
4038
- self.selections[cell.rowIndex].splice(self.selections[cell.rowIndex].indexOf(cell.columnIndex), 1);
4583
+ if (cell.hovered && self.hovers.onFilterButton) {
4584
+ if (cell.openedFilter) {
4585
+ cell.openedFilter = false;
4586
+ self.selectedFilterButton = {
4587
+ columnIndex: -1,
4588
+ rowIndex: -1
4589
+ };
4590
+ } else {
4591
+ self.selectedFilterButton.rowIndex = cell.rowIndex;
4592
+ self.selectedFilterButton.columnIndex = cell.columnIndex;
4593
+ self.contextmenuEvent(e, {
4594
+ x: cell.x + cell.width - self.style.filterButtonWidth,
4595
+ y: cell.y + cell.height,
4596
+ rect: {
4597
+ left: 0,
4598
+ top: 0
4599
+ }
4600
+ });
4039
4601
  }
4602
+
4603
+ self.draw();
4604
+ return;
4040
4605
  } else {
4041
- self.selections[cell.rowIndex] = self.selections[cell.rowIndex] || [];
4042
-
4043
- if (self.selections[cell.rowIndex].indexOf(cell.columnIndex) === -1) {
4044
- self.selections[cell.rowIndex].push(cell.columnIndex);
4045
- var event = {
4046
- selections: self.selections,
4047
- selectedData: self.getSelectedData(),
4048
- selectedCells: self.getSelectedCells(),
4049
- selectionBounds: self.getSelectionBounds()
4050
- };
4051
- self.dispatchEvent('selectionchanged', event);
4606
+ self.selectedFilterButton = {
4607
+ columnIndex: -1,
4608
+ rowIndex: -1
4609
+ };
4610
+ if (self.hovers.onFilterButton) return;
4611
+
4612
+ if (!self.dragAddToSelection && cell.rowIndex !== undefined) {
4613
+ if (self.selections[cell.rowIndex] && self.selections[cell.rowIndex].indexOf(cell.columnIndex) !== -1) {
4614
+ self.selections[cell.rowIndex].splice(self.selections[cell.rowIndex].indexOf(cell.columnIndex), 1);
4615
+ }
4616
+ } else {
4617
+ self.selections[cell.rowIndex] = self.selections[cell.rowIndex] || [];
4618
+
4619
+ if (self.selections[cell.rowIndex].indexOf(cell.columnIndex) === -1) {
4620
+ self.selections[cell.rowIndex].push(cell.columnIndex);
4621
+ var event = {
4622
+ selections: self.selections,
4623
+ selectedData: self.getSelectedData(),
4624
+ selectedCells: self.getSelectedCells(),
4625
+ selectionBounds: self.getSelectionBounds()
4626
+ };
4627
+ self.dispatchEvent('selectionchanged', event);
4628
+ }
4052
4629
  }
4053
4630
  }
4054
4631
  }
4055
- }
4632
+ }
4633
+
4634
+ if ((!self.selectionBounds || dragBounds.top !== self.selectionBounds.top || dragBounds.left !== self.selectionBounds.left || dragBounds.bottom !== self.selectionBounds.bottom || dragBounds.right !== self.selectionBounds.right) && !ctrl) {
4635
+ if (!(cell.hovered && self.hovers.onFilterButton)) {
4636
+ self.selections = [];
4637
+ }
4638
+
4639
+ if (dragBounds.top === -1) {
4640
+ dragBounds.top = 0;
4641
+ }
4056
4642
 
4057
- if ((!self.selectionBounds || dragBounds.top !== self.selectionBounds.top || dragBounds.left !== self.selectionBounds.left || dragBounds.bottom !== self.selectionBounds.bottom || dragBounds.right !== self.selectionBounds.right) && !ctrl) {
4058
- self.selections = [];
4059
4643
  sBounds = dragBounds;
4060
4644
 
4061
4645
  if (self.attributes.selectionMode === 'row') {
4062
4646
  for (i = sBounds.top; i <= sBounds.bottom; i += 1) {
4063
4647
  self.selectRow(i, true, null, true);
4064
4648
  }
4065
- } else if (dragBounds.top !== -1) {
4649
+ } else {
4066
4650
  self.selectArea(sBounds, true);
4651
+ if (sBounds.left == -1 && sBounds.top !== sBounds.bottom) self.isMultiRowsSelected = true;
4067
4652
  }
4068
4653
  }
4069
4654
 
@@ -4138,7 +4723,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4138
4723
  }
4139
4724
 
4140
4725
  if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {
4141
- self.setActiveCell(i.columnIndex, i.rowIndex);
4726
+ if (!self.hovers.onFilterButton) {
4727
+ self.setActiveCell(i.columnIndex, i.rowIndex);
4728
+ }
4142
4729
  }
4143
4730
 
4144
4731
  if (self.currentCell.context === 'cell') {
@@ -4161,12 +4748,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4161
4748
  checkSelectionChange();
4162
4749
  return;
4163
4750
  }
4164
-
4165
- if (self.attributes.columnHeaderClickBehavior === 'select') {
4166
- self.selectColumn(i.header.index, ctrl, e.shiftKey);
4167
- self.draw();
4168
- return;
4169
- }
4170
4751
  }
4171
4752
 
4172
4753
  self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];
@@ -4245,7 +4826,33 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4245
4826
  self.ellipsisCache = {};
4246
4827
  };
4247
4828
 
4248
- self.stopDragResize = function () {
4829
+ self.stopDragResize = function (e) {
4830
+ var pos = self.getLayerPos(e);
4831
+ var hasMoved = !!(pos.x - self.dragStart.x);
4832
+ var width = self.resizingStartingWidth + pos.x - self.dragStart.x;
4833
+
4834
+ if (self.dragMode === 'ew-resize') {
4835
+ var selectedColumns = self.selections[0];
4836
+ var dragItemIsSelected = self.isColumnSelected(self.dragItem.columnIndex);
4837
+
4838
+ if (dragItemIsSelected) {
4839
+ var _iterator = _createForOfIteratorHelper(selectedColumns),
4840
+ _step;
4841
+
4842
+ try {
4843
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
4844
+ var selectedColumnIndex = _step.value;
4845
+ var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(selectedColumnIndex);
4846
+ if (hasMoved && dragItemIsSelected && self.isColumnSelected(selectedColumnIndex)) self.sizes.columns[boundColumnIndex] = width;
4847
+ }
4848
+ } catch (err) {
4849
+ _iterator.e(err);
4850
+ } finally {
4851
+ _iterator.f();
4852
+ }
4853
+ }
4854
+ }
4855
+
4249
4856
  self.resize();
4250
4857
  document.body.removeEventListener('mousemove', self.dragResizeColumn, false);
4251
4858
  document.body.removeEventListener('mouseup', self.stopDragResize, false);
@@ -4346,6 +4953,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4346
4953
  return;
4347
4954
  }
4348
4955
 
4956
+ if ((e.ctrlKey || e.metaKey || e.shiftKey) && self.reorderObject) {
4957
+ if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected(self.draggingItem.header.index)) {
4958
+ self.selectColumn(self.draggingItem.header.index, false, false);
4959
+ }
4960
+ }
4961
+
4349
4962
  if (self.dispatchEvent('reordering', {
4350
4963
  NativeEvent: e,
4351
4964
  source: self.dragStartObject,
@@ -4357,6 +4970,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4357
4970
 
4358
4971
  if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {
4359
4972
  self.reorderObject = self.draggingItem;
4973
+ if (self.isMultiRowsSelected) self.reorderObject = self.getVisibleCellByIndex(-1, self.activeCell.rowIndex);
4360
4974
  self.reorderTarget = self.currentCell;
4361
4975
  self.reorderObject.dragOffset = {
4362
4976
  x: x,
@@ -4369,7 +4983,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4369
4983
  self.stopDragReorder = function (e) {
4370
4984
  var oIndex,
4371
4985
  tIndex,
4372
- odata,
4986
+ odata = [],
4373
4987
  cr = {
4374
4988
  'row-reorder': self.orders.rows,
4375
4989
  'column-reorder': self.orders.columns
@@ -4392,14 +5006,45 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4392
5006
  tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);
4393
5007
 
4394
5008
  if (self.dragMode === 'column-reorder') {
4395
- cr[self.dragMode].splice(oIndex, 1);
4396
- cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);
5009
+ var sortColumnIndices = [];
5010
+ var seletedColumnIndices = [];
5011
+
5012
+ if (self.selections[0]) {
5013
+ self.selections[0].forEach(function (value) {
5014
+ sortColumnIndices.push(self.orders.columns[value]);
5015
+ });
5016
+ }
5017
+
5018
+ var deleteCount = sortColumnIndices.length;
5019
+ cr[self.dragMode].splice(oIndex, deleteCount);
5020
+ if (tIndex > oIndex) tIndex = tIndex - (deleteCount - 1);
5021
+
5022
+ for (var i = 0; i < sortColumnIndices.length; i++) {
5023
+ seletedColumnIndices.push(tIndex + i);
5024
+ cr[self.dragMode].splice(tIndex + i, 0, sortColumnIndices[i]);
5025
+ }
5026
+
4397
5027
  self.orders.columns = cr[self.dragMode];
5028
+ self.viewData.forEach(function (row, rowIndex) {
5029
+ self.selections[rowIndex] = seletedColumnIndices;
5030
+ });
4398
5031
  } else {
4399
- // self.orders.rows = cr[self.dragMode];
4400
- odata = self.viewData[oIndex];
4401
- self.viewData[oIndex] = self.viewData[tIndex];
4402
- self.viewData[tIndex] = odata;
5032
+ var selectedRows = [];
5033
+ self.selections.forEach(function (row, rowIndex) {
5034
+ if (row) {
5035
+ selectedRows.push(row);
5036
+ odata.push(self.viewData[rowIndex]);
5037
+ }
5038
+ });
5039
+ self.viewData.splice(oIndex, odata.length);
5040
+ self.selections = [];
5041
+ if (tIndex > oIndex) tIndex = tIndex - (odata.length - 1);
5042
+ self.activeCell.rowIndex = tIndex;
5043
+
5044
+ for (var i = 0; i < odata.length; i++) {
5045
+ self.viewData.splice(tIndex + i, 0, odata[i]);
5046
+ self.selections[tIndex + i] = selectedRows[i];
5047
+ }
4403
5048
  }
4404
5049
 
4405
5050
  self.resize();
@@ -4465,18 +5110,36 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4465
5110
  return;
4466
5111
  }
4467
5112
 
4468
- var pos = self.getLayerPos(e);
5113
+ var pos = self.getLayerPos(e),
5114
+ bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,
5115
+ columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,
5116
+ columnHeaderCellHeight = self.getColumnHeaderCellHeight(),
5117
+ rowHeaderCellWidth = self.getRowHeaderCellWidth();
4469
5118
  self.ignoreNextClick = true;
4470
5119
  self.freezeMarkerPosition = pos;
4471
5120
 
4472
5121
  if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {
4473
5122
  self.scrollBox.scrollTop = 0;
4474
5123
  self.frozenRow = self.currentCell.rowIndex + 1;
5124
+ self.scrollBox.bar.v.y = columnHeaderCellHeight + columnHeaderCellBorder + self.scrollCache.y[self.frozenRow];
5125
+ self.scrollBox.box.v.y = columnHeaderCellHeight + columnHeaderCellBorder + self.scrollCache.y[self.frozenRow];
5126
+ var dataHeight = self.scrollCache.y[self.scrollCache.y.length - 1];
5127
+ self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight - self.scrollCache.y[self.frozenRow]) / dataHeight;
5128
+ self.scrollBox.scrollBoxHeight = self.scrollBox.height * self.scrollBox.heightBoxRatio - self.style.scrollBarWidth;
5129
+ self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);
5130
+ self.scrollBox.box.v.height = self.scrollBox.scrollBoxHeight;
4475
5131
  }
4476
5132
 
4477
5133
  if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {
4478
5134
  self.scrollBox.scrollLeft = 0;
4479
5135
  self.frozenColumn = self.currentCell.columnIndex + 1;
5136
+ self.scrollBox.bar.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
5137
+ self.scrollBox.box.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
5138
+ var dataWidth = self.scrollCache.x[self.scrollCache.x.length - 1];
5139
+ self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn - 1]) / dataWidth;
5140
+ self.scrollBox.scrollBoxWidth = self.scrollBox.width * self.scrollBox.widthBoxRatio - self.style.scrollBarWidth;
5141
+ self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);
5142
+ self.scrollBox.box.h.width = self.scrollBox.scrollBoxWidth;
4480
5143
  }
4481
5144
 
4482
5145
  if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {
@@ -4535,7 +5198,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4535
5198
  self.dragAddToSelection = !self.dragStartObject.selected;
4536
5199
 
4537
5200
  if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/.test(self.dragStartObject.context) && self.currentCell && !self.currentCell.isColumnHeader && !move && !freeze && !resize) {
4538
- self.selections = [];
5201
+ if (!(self.dragMode == 'row-reorder' && self.isMultiRowsSelected) && !(self.currentCell.hovered && self.hovers.onFilterButton)) {
5202
+ self.selections = [];
5203
+ }
4539
5204
  }
4540
5205
 
4541
5206
  if (self.dragStartObject.isGrid) {
@@ -4626,9 +5291,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4626
5291
  if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {
4627
5292
  self.draggingItem = self.dragStartObject;
4628
5293
 
4629
- if (self.dragMode === 'column-reorder' && self.attributes.columnHeaderClickBehavior === 'select') {
5294
+ if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected(self.currentCell.header.index)) {
4630
5295
  self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
4631
- self.draw();
5296
+ } else if (self.dragMode === 'row-reorder' && !self.isMultiRowsSelected) {
5297
+ self.selectRow(self.dragStartObject.rowIndex, ctrl, null);
4632
5298
  }
4633
5299
 
4634
5300
  document.body.addEventListener('mousemove', self.dragReorder, false);
@@ -4639,16 +5305,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4639
5305
 
4640
5306
  self.mouseup = function (e) {
4641
5307
  clearTimeout(self.scrollTimer);
4642
- var ctrl = e.ctrlKey || e.metaKey;
4643
5308
  self.cellBoundaryCrossed = true;
4644
5309
  self.rowBoundaryCrossed = true;
4645
5310
  self.columnBoundaryCrossed = true;
4646
-
4647
- if (self.draggingItem) {
4648
- self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
4649
- self.draw();
4650
- }
4651
-
4652
5311
  self.selecting = undefined;
4653
5312
  self.draggingItem = undefined;
4654
5313
  self.dragStartObject = undefined;
@@ -4754,6 +5413,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4754
5413
  self.selectNone();
4755
5414
  } else if (ctrl && e.key === 'a') {
4756
5415
  self.selectAll();
5416
+ } else if (['Backspace', 'Delete'].includes(e.key)) {
5417
+ self.deleteSelectedData();
4757
5418
  } else if (e.key === 'ArrowDown') {
4758
5419
  y += 1;
4759
5420
  } else if (e.key === 'ArrowUp') {
@@ -4837,12 +5498,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4837
5498
  }
4838
5499
  }
4839
5500
 
4840
- var _iterator = _createForOfIteratorHelper(self.selections),
4841
- _step;
5501
+ var _iterator2 = _createForOfIteratorHelper(self.selections),
5502
+ _step2;
4842
5503
 
4843
5504
  try {
4844
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
4845
- var selection = _step.value;
5505
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
5506
+ var selection = _step2.value;
4846
5507
 
4847
5508
  if (e.key === 'ArrowRight' && selection) {
4848
5509
  if (x > lastSelectedColumn) {
@@ -4865,9 +5526,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4865
5526
  }
4866
5527
  }
4867
5528
  } catch (err) {
4868
- _iterator.e(err);
5529
+ _iterator2.e(err);
4869
5530
  } finally {
4870
- _iterator.f();
5531
+ _iterator2.f();
4871
5532
  }
4872
5533
 
4873
5534
  self.selectionBounds = self.getSelectionBounds();
@@ -4943,10 +5604,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4943
5604
  }
4944
5605
 
4945
5606
  if (self.currentCell.context === 'ew-resize' && self.currentCell.style === 'columnHeaderCell') {
4946
- self.fitColumnToValues(self.currentCell.header.name);
5607
+ // Check that double-clicked cell is selected or part of selection.
5608
+ var currentCellIsSelected = self.isColumnSelected(self.currentCell.columnIndex);
5609
+
5610
+ if (currentCellIsSelected) {
5611
+ // There might be more
5612
+ self.fitSelectedColumns();
5613
+ } else {
5614
+ self.fitColumnToValues(self.currentCell.header.name);
5615
+ }
4947
5616
  } else if (self.currentCell.context === 'ew-resize' && self.currentCell.style === 'cornerCell') {
4948
5617
  self.autosize();
4949
- } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {
5618
+ } else if (['cell', 'activeCell'].includes(self.currentCell.style) && !self.hovers.onFilterButton) {
4950
5619
  self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);
4951
5620
  }
4952
5621
  };
@@ -5153,51 +5822,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5153
5822
  };
5154
5823
 
5155
5824
  self.cut = function (e) {
5156
- self.copy(e);
5157
- var schema = self.getSchema();
5158
- var affectedCells = [];
5159
-
5160
- var _iterator2 = _createForOfIteratorHelper(self.selections.entries()),
5161
- _step2;
5162
-
5163
- try {
5164
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
5165
- var _step2$value = _slicedToArray(_step2.value, 2),
5166
- rowIndex = _step2$value[0],
5167
- row = _step2$value[1];
5168
-
5169
- if (!row) continue;
5170
- var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
5825
+ if (self.dispatchEvent('cut', {
5826
+ NativeEvent: e
5827
+ })) {
5828
+ return;
5829
+ } // Expecting instance of `ClipboardEvent` with `clipboardData` attribute
5171
5830
 
5172
- var _iterator3 = _createForOfIteratorHelper(row),
5173
- _step3;
5174
5831
 
5175
- try {
5176
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
5177
- var columnIndex = _step3.value;
5178
- var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
5179
- var colName = schema[boundColumnIndex].name;
5180
- self.viewData[rowIndex][colName] = '';
5181
- affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
5182
- }
5183
- } catch (err) {
5184
- _iterator3.e(err);
5185
- } finally {
5186
- _iterator3.f();
5187
- }
5188
- }
5189
- } catch (err) {
5190
- _iterator2.e(err);
5191
- } finally {
5192
- _iterator2.f();
5832
+ if (!self.hasFocus || !e.clipboardData) {
5833
+ return;
5193
5834
  }
5194
5835
 
5195
- if (self.dispatchEvent('cut', {
5196
- NativeEvent: e,
5836
+ self.copySelectedCellsToClipboard(e.clipboardData);
5837
+ var affectedCells = self.clearSelectedCells();
5838
+ self.dispatchEvent('aftercut', {
5197
5839
  cells: affectedCells
5198
- })) {
5199
- return;
5200
- }
5840
+ });
5841
+ requestAnimationFrame(function () {
5842
+ return self.draw();
5843
+ });
5201
5844
  };
5202
5845
 
5203
5846
  self.copy = function (e) {
@@ -5205,81 +5848,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5205
5848
  NativeEvent: e
5206
5849
  })) {
5207
5850
  return;
5208
- }
5851
+ } // Expecting instance of `ClipboardEvent` with `clipboardData` attribute
5852
+
5209
5853
 
5210
5854
  if (!self.hasFocus || !e.clipboardData) {
5211
5855
  return;
5212
5856
  }
5213
5857
 
5214
- var t = '',
5215
- d = '',
5216
- textRows = [],
5217
- sData = self.getSelectedData(),
5218
- s = self.getSchema(),
5219
- sSorted = [],
5220
- firstRowKeys,
5221
- isNeat = true; // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy
5222
-
5223
- function htmlSafe(v) {
5224
- return v.replace(/</g, '&lt;').replace(/>/g, '&gt;');
5225
- }
5226
-
5227
- s.forEach(function (column, columnIndex) {
5228
- sSorted.push(s[self.orders.columns[columnIndex]]);
5229
- });
5230
-
5231
- if (sData.length > 0) {
5232
- sData.forEach(function (row) {
5233
- if (!row) return;
5234
- var rowKeys = Object.keys(row);
5235
- var textRow = [];
5236
- if (!firstRowKeys) firstRowKeys = Object.keys(row);
5237
- if (isNeat && rowKeys.length !== firstRowKeys.length) isNeat = false;
5238
- sSorted.forEach(function (column, columnIndex) {
5239
- if (rowKeys.indexOf(column.name) < 0) {
5240
- if (firstRowKeys.indexOf(column.name) < 0) {
5241
- return;
5242
- } else if (isNeat) {
5243
- isNeat = false;
5244
- }
5245
- }
5246
-
5247
- textRow.push(row[column.name] || '');
5248
- });
5249
- textRows.push(textRow);
5250
- });
5251
-
5252
- if (isNeat) {
5253
- t = textRows.map(function (row) {
5254
- return row.join('\t');
5255
- }).join('\n');
5256
- /**
5257
- * The html content copied by Excel has not header
5258
- */
5259
-
5260
- d += '<table>';
5261
- d += textRows.map(function (row) {
5262
- return '<tr>' + row.map(function (value) {
5263
- return '<td>' + htmlSafe(value) + '</td>';
5264
- }).join('') + '</tr>';
5265
- }).join('');
5266
- d += '</table>';
5267
- } else {
5268
- t = textRows.map(function (row) {
5269
- return row.join('');
5270
- }).join('');
5271
- d = t;
5272
- }
5273
-
5274
- if (t) {
5275
- e.clipboardData.setData('text/html', d);
5276
- e.clipboardData.setData('text/plain', t);
5277
- e.clipboardData.setData('text/csv', t);
5278
- e.clipboardData.setData('application/json', JSON.stringify(sData));
5279
- }
5280
-
5281
- e.preventDefault();
5282
- }
5858
+ self.copySelectedCellsToClipboard(e.clipboardData);
5859
+ e.preventDefault();
5283
5860
  };
5284
5861
 
5285
5862
  return;
@@ -5292,6 +5869,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5292
5869
  !*** ./lib/events/util.js ***!
5293
5870
  \****************************/
5294
5871
  /*! namespace exports */
5872
+ /*! export createHTMLString [provided] [no usage info] [missing usage info prevents renaming] */
5873
+ /*! export createTextString [provided] [no usage info] [missing usage info prevents renaming] */
5874
+ /*! export htmlSafe [provided] [no usage info] [missing usage info prevents renaming] */
5295
5875
  /*! export isSupportedHtml [provided] [no usage info] [missing usage info prevents renaming] */
5296
5876
  /*! export parseData [provided] [no usage info] [missing usage info prevents renaming] */
5297
5877
  /*! export parseHtmlTable [provided] [no usage info] [missing usage info prevents renaming] */
@@ -5305,12 +5885,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5305
5885
  "use strict";
5306
5886
  __webpack_require__.r(__webpack_exports__);
5307
5887
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5888
+ /* harmony export */ "createTextString": function() { return /* binding */ createTextString; },
5889
+ /* harmony export */ "createHTMLString": function() { return /* binding */ createHTMLString; },
5308
5890
  /* harmony export */ "isSupportedHtml": function() { return /* binding */ isSupportedHtml; },
5309
- /* harmony export */ "sanitizeElementData": function() { return /* binding */ sanitizeElementData; },
5891
+ /* harmony export */ "htmlSafe": function() { return /* binding */ htmlSafe; },
5310
5892
  /* harmony export */ "parseData": function() { return /* binding */ parseData; },
5311
5893
  /* harmony export */ "parseHtmlTable": function() { return /* binding */ parseHtmlTable; },
5312
5894
  /* harmony export */ "parseHtmlText": function() { return /* binding */ parseHtmlText; },
5313
- /* harmony export */ "parseText": function() { return /* binding */ parseText; }
5895
+ /* harmony export */ "parseText": function() { return /* binding */ parseText; },
5896
+ /* harmony export */ "sanitizeElementData": function() { return /* binding */ sanitizeElementData; }
5314
5897
  /* harmony export */ });
5315
5898
 
5316
5899
 
@@ -5433,6 +6016,36 @@ var parseData = function parseData(data, mimeType) {
5433
6016
  return parseText(data);
5434
6017
  };
5435
6018
 
6019
+ var htmlSafe = function htmlSafe(value) {
6020
+ if (typeof value === 'number') return value;
6021
+ return value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
6022
+ };
6023
+
6024
+ var createTextString = function createTextString(selectedData, isNeat) {
6025
+ // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy.
6026
+ // If not isNeat we just return a simple string of concatenated values.
6027
+ if (!isNeat) return selectedData.map(function (row) {
6028
+ return Object.values(row).join('');
6029
+ }).join(''); // If isNeat, we can create tab separated mutti-line text.
6030
+
6031
+ return selectedData.map(function (row) {
6032
+ return Object.values(row).join('\t');
6033
+ }).join('\n');
6034
+ };
6035
+
6036
+ var createHTMLString = function createHTMLString(selectedData, isNeat) {
6037
+ if (!isNeat) return createTextString(selectedData, isNeat); // If isNeat, we can create a HTML table with the selected data.
6038
+
6039
+ var htmlString = '<table>';
6040
+ htmlString += selectedData.map(function (row) {
6041
+ return '<tr>' + Object.values(row).map(function (value) {
6042
+ return '<td>' + htmlSafe(value) + '</td>';
6043
+ }).join('') + '</tr>';
6044
+ }).join('');
6045
+ htmlString += '</table>';
6046
+ return htmlString;
6047
+ };
6048
+
5436
6049
 
5437
6050
 
5438
6051
  /***/ }),
@@ -5444,7 +6057,7 @@ var parseData = function parseData(data, mimeType) {
5444
6057
  /*! namespace exports */
5445
6058
  /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
5446
6059
  /*! other exports [not provided] [no usage info] */
5447
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
6060
+ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
5448
6061
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5449
6062
 
5450
6063
  "use strict";
@@ -5452,6 +6065,7 @@ __webpack_require__.r(__webpack_exports__);
5452
6065
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5453
6066
  /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
5454
6067
  /* harmony export */ });
6068
+ /* harmony import */ var _events_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/util */ "./lib/events/util.js");
5455
6069
  /*jslint browser: true, unparam: true, todo: true*/
5456
6070
 
5457
6071
  /*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
@@ -5473,6 +6087,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5473
6087
 
5474
6088
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5475
6089
 
6090
+
5476
6091
  /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self, ctor) {
5477
6092
  self.scale = 1;
5478
6093
  self.orders = {
@@ -5532,6 +6147,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5532
6147
  trees: {}
5533
6148
  };
5534
6149
  self.selections = [];
6150
+ self.filterable = {
6151
+ rows: [],
6152
+ columns: []
6153
+ };
6154
+ self.selectedFilterButton = {
6155
+ columnIndex: -1,
6156
+ rowIndex: -1
6157
+ };
5535
6158
  self.hovers = {};
5536
6159
  self.attributes = {};
5537
6160
  self.style = {};
@@ -5549,7 +6172,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5549
6172
  self.openChildren = {};
5550
6173
  self.scrollModes = ['vertical-scroll-box', 'vertical-scroll-top', 'vertical-scroll-bottom', 'horizontal-scroll-box', 'horizontal-scroll-right', 'horizontal-scroll-left'];
5551
6174
  self.componentL1Events = {};
5552
- self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
6175
+ self.eventNames = ['afterdraw', 'afterrendercell', 'afterrenderfilterbutton', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beforerenderfilterbutton', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
5553
6176
  self.mouse = {
5554
6177
  x: 0,
5555
6178
  y: 0
@@ -5669,6 +6292,122 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5669
6292
  return selectedCells;
5670
6293
  };
5671
6294
 
6295
+ self.copySelectedCellsToClipboard = function (clipboardData) {
6296
+ var selectedData = [];
6297
+ var schema = self.getSchema();
6298
+ var firstRowAsString;
6299
+ var isNeat = true; // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy
6300
+
6301
+ var _iterator3 = _createForOfIteratorHelper(self.selections.entries()),
6302
+ _step3;
6303
+
6304
+ try {
6305
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6306
+ var _step3$value = _slicedToArray(_step3.value, 2),
6307
+ rowIndex = _step3$value[0],
6308
+ row = _step3$value[1];
6309
+
6310
+ // If no cells are selected for a particular rowIndex the selections array will contain an empty element for that rowIndex.
6311
+ if (!row) continue; // Convert to string for easy comparison to the first row.
6312
+
6313
+ var rowAsString = row.join(',').toString();
6314
+ var rowDict = {};
6315
+ if (!firstRowAsString) firstRowAsString = row.join(',').toString();
6316
+ if (isNeat && rowAsString !== firstRowAsString) isNeat = false;
6317
+ var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
6318
+
6319
+ var _iterator4 = _createForOfIteratorHelper(row),
6320
+ _step4;
6321
+
6322
+ try {
6323
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
6324
+ var columnIndex = _step4.value;
6325
+ // If the whole row is selected the columnIndex for the rowHeader is -1.
6326
+ if (columnIndex < 0) continue;
6327
+ var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
6328
+ var columnName = schema[boundColumnIndex].name;
6329
+ var value = self.originalData[boundRowIndex][columnName];
6330
+ rowDict[columnName] = value;
6331
+ }
6332
+ } catch (err) {
6333
+ _iterator4.e(err);
6334
+ } finally {
6335
+ _iterator4.f();
6336
+ }
6337
+
6338
+ selectedData.push(rowDict);
6339
+ }
6340
+ } catch (err) {
6341
+ _iterator3.e(err);
6342
+ } finally {
6343
+ _iterator3.f();
6344
+ }
6345
+
6346
+ if (selectedData.length > 0) {
6347
+ var textString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createTextString)(selectedData, isNeat);
6348
+ var htmlString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createHTMLString)(selectedData, isNeat);
6349
+ var copiedData = {
6350
+ 'text/plain': textString,
6351
+ 'text/html': htmlString,
6352
+ 'text/csv': textString,
6353
+ 'application/json': JSON.stringify(selectedData)
6354
+ };
6355
+
6356
+ for (var _i2 = 0, _Object$entries = Object.entries(copiedData); _i2 < _Object$entries.length; _i2++) {
6357
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
6358
+ mimeType = _Object$entries$_i[0],
6359
+ data = _Object$entries$_i[1];
6360
+
6361
+ clipboardData.setData(mimeType, data);
6362
+ }
6363
+ }
6364
+ };
6365
+
6366
+ self.clearSelectedCells = function () {
6367
+ var schema = self.getSchema();
6368
+ var affectedCells = [];
6369
+
6370
+ var _iterator5 = _createForOfIteratorHelper(self.selections.entries()),
6371
+ _step5;
6372
+
6373
+ try {
6374
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6375
+ var _step5$value = _slicedToArray(_step5.value, 2),
6376
+ rowIndex = _step5$value[0],
6377
+ row = _step5$value[1];
6378
+
6379
+ // If no cells are selected for a particular rowIndex the selections array will contain an empty element for that rowIndex.
6380
+ if (!row) continue;
6381
+ var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
6382
+
6383
+ var _iterator6 = _createForOfIteratorHelper(row),
6384
+ _step6;
6385
+
6386
+ try {
6387
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
6388
+ var columnIndex = _step6.value;
6389
+ // If the whole row is selected the columnIndex for the rowHeader is -1.
6390
+ if (columnIndex < 0) continue;
6391
+ var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
6392
+ var columnName = schema[boundColumnIndex].name;
6393
+ self.viewData[boundRowIndex][columnName] = '';
6394
+ affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
6395
+ }
6396
+ } catch (err) {
6397
+ _iterator6.e(err);
6398
+ } finally {
6399
+ _iterator6.f();
6400
+ }
6401
+ }
6402
+ } catch (err) {
6403
+ _iterator5.e(err);
6404
+ } finally {
6405
+ _iterator5.f();
6406
+ }
6407
+
6408
+ return affectedCells;
6409
+ };
6410
+
5672
6411
  self.getBoundRowIndexFromViewRowIndex = function (viewRowIndex) {
5673
6412
  if (self.boundRowIndexMap && self.boundRowIndexMap.has(viewRowIndex)) {
5674
6413
  return self.boundRowIndexMap.get(viewRowIndex);
@@ -5745,6 +6484,30 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5745
6484
  self.orders.rows = fillArray(0, self.originalData.length - 1);
5746
6485
  };
5747
6486
 
6487
+ self.fitSelectedColumns = function () {
6488
+ var selectedColumns = self.selections[0];
6489
+ var schema = self.getSchema();
6490
+
6491
+ var _iterator7 = _createForOfIteratorHelper(selectedColumns),
6492
+ _step7;
6493
+
6494
+ try {
6495
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
6496
+ var selectedColumn = _step7.value;
6497
+
6498
+ // Make sure the column is not the row header and that the whole column has in fact been selected.
6499
+ if (selectedColumn >= 0 && self.isColumnSelected(selectedColumn)) {
6500
+ var column = schema[self.orders.columns[selectedColumn]];
6501
+ self.fitColumnToValues(column.name);
6502
+ }
6503
+ }
6504
+ } catch (err) {
6505
+ _iterator7.e(err);
6506
+ } finally {
6507
+ _iterator7.f();
6508
+ }
6509
+ };
6510
+
5748
6511
  self.getVisibleSchema = function () {
5749
6512
  return self.getSchema().filter(function (col) {
5750
6513
  return !col.hidden;
@@ -5811,9 +6574,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5811
6574
  }); // Apply filtering
5812
6575
 
5813
6576
  var _loop = function _loop() {
5814
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
5815
- headerName = _Object$entries$_i[0],
5816
- filterText = _Object$entries$_i[1];
6577
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
6578
+ headerName = _Object$entries2$_i[0],
6579
+ filterText = _Object$entries2$_i[1];
5817
6580
 
5818
6581
  var header = self.getHeaderByName(headerName);
5819
6582
 
@@ -5832,19 +6595,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5832
6595
  });
5833
6596
  };
5834
6597
 
5835
- for (var _i2 = 0, _Object$entries = Object.entries(self.columnFilters); _i2 < _Object$entries.length; _i2++) {
6598
+ for (var _i3 = 0, _Object$entries2 = Object.entries(self.columnFilters); _i3 < _Object$entries2.length; _i3++) {
5836
6599
  var _ret = _loop();
5837
6600
 
5838
6601
  if (_ret === "continue") continue;
5839
6602
  } // Apply sorting
5840
6603
 
5841
6604
 
5842
- var _iterator3 = _createForOfIteratorHelper(self.orderings.columns),
5843
- _step3;
6605
+ var _iterator8 = _createForOfIteratorHelper(self.orderings.columns),
6606
+ _step8;
5844
6607
 
5845
6608
  try {
5846
6609
  var _loop2 = function _loop2() {
5847
- var column = _step3.value;
6610
+ var column = _step8.value;
5848
6611
  var sortFn = column.sortFunction(column.orderBy, column.orderDirection);
5849
6612
  newViewData.sort(function (_ref7, _ref8) {
5850
6613
  var _ref9 = _slicedToArray(_ref7, 1),
@@ -5859,13 +6622,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5859
6622
  });
5860
6623
  };
5861
6624
 
5862
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6625
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
5863
6626
  _loop2();
5864
6627
  }
5865
6628
  } catch (err) {
5866
- _iterator3.e(err);
6629
+ _iterator8.e(err);
5867
6630
  } finally {
5868
- _iterator3.f();
6631
+ _iterator8.f();
5869
6632
  }
5870
6633
 
5871
6634
  return {
@@ -6019,6 +6782,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6019
6782
  self.controlInput.removeEventListener('keypress', self.keypress, false);
6020
6783
  self.controlInput.removeEventListener('keyup', self.keyup, false);
6021
6784
  self.controlInput.removeEventListener('keydown', self.keydown, false);
6785
+ document.body.removeEventListener('mousemove', self.mousemove);
6022
6786
  window.removeEventListener('resize', self.resize);
6023
6787
 
6024
6788
  if (self.observer && self.observer.disconnect) {
@@ -6195,6 +6959,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6195
6959
  };
6196
6960
  Object.keys(self.style).forEach(self.parseStyleValue);
6197
6961
  self.intf.moveSelection = self.moveSelection;
6962
+ self.intf.deleteSelectedData = self.deleteSelectedData;
6198
6963
  self.intf.moveTo = self.moveTo;
6199
6964
  self.intf.addEventListener = self.addEventListener;
6200
6965
  self.intf.removeEventListener = self.removeEventListener;
@@ -6228,6 +6993,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6228
6993
  self.intf.clearChangeLog = self.clearChangeLog;
6229
6994
  self.intf.gotoCell = self.gotoCell;
6230
6995
  self.intf.gotoRow = self.gotoRow;
6996
+ self.intf.addButton = self.addButton;
6231
6997
  self.intf.getHeaderByName = self.getHeaderByName;
6232
6998
  self.intf.findColumnScrollLeft = self.findColumnScrollLeft;
6233
6999
  self.intf.findRowScrollTop = self.findRowScrollTop;
@@ -7036,6 +7802,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7036
7802
  if (!preventScrollEvent) {
7037
7803
  self.scroll();
7038
7804
  }
7805
+
7806
+ if (self.button) {
7807
+ self.moveButtonPos();
7808
+ }
7039
7809
  }
7040
7810
 
7041
7811
  function setScrollLeft(value, preventScrollEvent) {
@@ -7060,6 +7830,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7060
7830
  if (!preventScrollEvent) {
7061
7831
  self.scroll();
7062
7832
  }
7833
+
7834
+ if (self.button) {
7835
+ self.moveButtonPos();
7836
+ }
7063
7837
  }
7064
7838
 
7065
7839
  self.scrollBox.toString = function () {
@@ -7168,8 +7942,9 @@ __webpack_require__.r(__webpack_exports__);
7168
7942
  /* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./touch */ "./lib/touch.js");
7169
7943
  /* harmony import */ var _intf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intf */ "./lib/intf.js");
7170
7944
  /* harmony import */ var _contextMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./contextMenu */ "./lib/contextMenu.js");
7171
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom */ "./lib/dom.js");
7172
- /* harmony import */ var _publicMethods__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./publicMethods */ "./lib/publicMethods.js");
7945
+ /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./button */ "./lib/button.js");
7946
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom */ "./lib/dom.js");
7947
+ /* harmony import */ var _publicMethods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./publicMethods */ "./lib/publicMethods.js");
7173
7948
  /*jslint browser: true, unparam: true, todo: true, evil: true*/
7174
7949
 
7175
7950
  /*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
@@ -7186,8 +7961,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7186
7961
 
7187
7962
 
7188
7963
 
7964
+
7189
7965
  var webComponent = (0,_component__WEBPACK_IMPORTED_MODULE_0__.default)();
7190
- var modules = [_defaults__WEBPACK_IMPORTED_MODULE_1__.default, _draw__WEBPACK_IMPORTED_MODULE_2__.default, _events__WEBPACK_IMPORTED_MODULE_3__.default, _touch__WEBPACK_IMPORTED_MODULE_4__.default, _intf__WEBPACK_IMPORTED_MODULE_5__.default, _contextMenu__WEBPACK_IMPORTED_MODULE_6__.default, _dom__WEBPACK_IMPORTED_MODULE_7__.default, _publicMethods__WEBPACK_IMPORTED_MODULE_8__.default];
7966
+ var modules = [_defaults__WEBPACK_IMPORTED_MODULE_1__.default, _draw__WEBPACK_IMPORTED_MODULE_2__.default, _events__WEBPACK_IMPORTED_MODULE_3__.default, _touch__WEBPACK_IMPORTED_MODULE_4__.default, _intf__WEBPACK_IMPORTED_MODULE_5__.default, _contextMenu__WEBPACK_IMPORTED_MODULE_6__.default, _button__WEBPACK_IMPORTED_MODULE_7__.default, _dom__WEBPACK_IMPORTED_MODULE_8__.default, _publicMethods__WEBPACK_IMPORTED_MODULE_9__.default];
7191
7967
 
7192
7968
  function Grid(args) {
7193
7969
  args = args || {};
@@ -7555,6 +8331,20 @@ __webpack_require__.r(__webpack_exports__);
7555
8331
  delete self.columnFilters[column];
7556
8332
  } else {
7557
8333
  self.columnFilters[column] = value;
8334
+
8335
+ if (self.attributes.showFilterInCell) {
8336
+ self.filterable.rows.push(0);
8337
+ self.orders.columns.forEach(function (value, index) {
8338
+ self.filterable.columns.push(index);
8339
+ });
8340
+ }
8341
+ }
8342
+
8343
+ if (!Object.keys(self.columnFilters).length) {
8344
+ self.filterable = {
8345
+ rows: [],
8346
+ columns: []
8347
+ };
7558
8348
  }
7559
8349
 
7560
8350
  self.refresh();
@@ -7648,6 +8438,28 @@ __webpack_require__.r(__webpack_exports__);
7648
8438
  self.gotoRow = function (y) {
7649
8439
  self.gotoCell(0, y);
7650
8440
  };
8441
+ /**
8442
+ * Add a button into the cell.
8443
+ * @memberof canvasDatagrid
8444
+ * @name addButton
8445
+ * @method
8446
+ * @param {number} columnIndex The column index of the cell to to add a button.
8447
+ * @param {number} rowIndex The row index of the cell to to add a button.
8448
+ * @param {object} offset Offset how far go away from cell.
8449
+ * @param {object} items a list of items to add into button menu.
8450
+ * @param {string} imgSrc icon path to add into button.
8451
+ */
8452
+
8453
+
8454
+ self.addButton = function (columnIndex, rowIndex, offset, items, imgSrc) {
8455
+ var cells = self.visibleCells.filter(function (c) {
8456
+ return c.sortColumnIndex === columnIndex && c.sortRowIndex === rowIndex;
8457
+ });
8458
+ self.attachButton({
8459
+ top: cells[0].y + cells[0].height + offset.y,
8460
+ left: cells[0].x + cells[0].width + offset.x
8461
+ }, items, imgSrc);
8462
+ };
7651
8463
  /**
7652
8464
  * Scrolls the cell at cell x, row y into view if it is not already.
7653
8465
  * @memberof canvasDatagrid
@@ -7738,6 +8550,35 @@ __webpack_require__.r(__webpack_exports__);
7738
8550
 
7739
8551
  self.draw();
7740
8552
  };
8553
+ /**
8554
+ * Returns true if indices of columns next to the selected columnIndex is selected on every row.
8555
+ * @memberof canvasDatagrid
8556
+ * @name isMultiColumnsSelected
8557
+ * @method
8558
+ * @param {number} columnIndex The column index to check.
8559
+ */
8560
+
8561
+
8562
+ self.isMultiColumnsSelected = function (columnIndex) {
8563
+ var multiColIsSelected = true;
8564
+ self.viewData.forEach(function (row, rowIndex) {
8565
+ var columnIndices = self.selections[rowIndex];
8566
+
8567
+ if (!columnIndices || columnIndices.length <= 1 || columnIndices.indexOf(columnIndex) === -1) {
8568
+ multiColIsSelected = false;
8569
+ } else if (columnIndices.length > 1) {
8570
+ if (columnIndices[0] != columnIndex) multiColIsSelected = false;else {
8571
+ for (var i = 0; i < columnIndices.length - 1; i++) {
8572
+ if (columnIndices[i] + 1 != columnIndices[i + 1]) {
8573
+ multiColIsSelected = false;
8574
+ break;
8575
+ }
8576
+ }
8577
+ }
8578
+ }
8579
+ });
8580
+ return multiColIsSelected;
8581
+ };
7741
8582
  /**
7742
8583
  * Returns true if the selected columnIndex is selected on every row.
7743
8584
  * @memberof canvasDatagrid
@@ -7750,7 +8591,7 @@ __webpack_require__.r(__webpack_exports__);
7750
8591
  self.isColumnSelected = function (columnIndex) {
7751
8592
  var colIsSelected = true;
7752
8593
  self.viewData.forEach(function (row, rowIndex) {
7753
- if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {
8594
+ if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(columnIndex) === -1) {
7754
8595
  colIsSelected = false;
7755
8596
  }
7756
8597
  });
@@ -7878,6 +8719,7 @@ __webpack_require__.r(__webpack_exports__);
7878
8719
  st,
7879
8720
  en,
7880
8721
  s = self.getVisibleSchema();
8722
+ self.isMultiRowsSelected = false;
7881
8723
 
7882
8724
  function de() {
7883
8725
  if (supressEvent) {
@@ -8062,7 +8904,14 @@ __webpack_require__.r(__webpack_exports__);
8062
8904
  return;
8063
8905
  }
8064
8906
 
8065
- self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index] = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);
8907
+ var columnIndex = name === 'cornerCell' ? -1 : self.getHeaderByName(name).index;
8908
+ var newSize = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);
8909
+ self.sizes.columns[columnIndex] = newSize;
8910
+ self.dispatchEvent('resizecolumn', {
8911
+ x: newSize,
8912
+ y: self.resizingStartingHeight,
8913
+ draggingItem: self.currentCell
8914
+ });
8066
8915
 
8067
8916
  if (!internal) {
8068
8917
  self.resize();
@@ -8183,6 +9032,29 @@ __webpack_require__.r(__webpack_exports__);
8183
9032
  });
8184
9033
  self.selections = sel;
8185
9034
  };
9035
+ /**
9036
+ * Deletes currently selected data.
9037
+ * @memberof canvasDatagrid
9038
+ * @name deleteSelectedData
9039
+ * @method
9040
+ * @param {boolean} dontDraw Suppress the draw method after the selection change.
9041
+ */
9042
+
9043
+
9044
+ self.deleteSelectedData = function (dontDraw) {
9045
+ var affectedCells = self.clearSelectedCells();
9046
+ self.dispatchEvent('afterdelete', {
9047
+ cells: affectedCells
9048
+ });
9049
+
9050
+ if (dontDraw) {
9051
+ return;
9052
+ }
9053
+
9054
+ requestAnimationFrame(function () {
9055
+ return self.draw();
9056
+ });
9057
+ };
8186
9058
  /**
8187
9059
  * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.
8188
9060
  * @memberof canvasDatagrid