canvas-datagrid 0.3.19 → 0.3.23

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;
@@ -2520,9 +3009,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2520
3009
  isCorner = /cornerCell/.test(cellStyle),
2521
3010
  isRowHeader = 'rowHeaderCell' === cellStyle,
2522
3011
  isColumnHeader = 'columnHeaderCell' === cellStyle,
3012
+ isFilterable = self.filterable.rows.includes(rowIndex) && self.filterable.columns.includes(headerIndex),
2523
3013
  wrap = self.style.cellWhiteSpace !== 'nowrap',
2524
3014
  selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,
2525
3015
  hovered = self.hovers.rowIndex === rowOrderIndex && (self.attributes.hoverMode === 'row' || self.hovers.columnIndex === columnOrderIndex),
3016
+ openedFilter = self.selectedFilterButton.rowIndex == rowIndex && self.selectedFilterButton.columnIndex == headerIndex,
2526
3017
  active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,
2527
3018
  isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',
2528
3019
  rawValue = rowData ? rowData[header.name] : undefined,
@@ -2610,6 +3101,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2610
3101
  isColumnHeader: isColumnHeader,
2611
3102
  isColumnHeaderCellCap: isColumnHeaderCellCap,
2612
3103
  isRowHeader: isRowHeader,
3104
+ isFilterable: isFilterable,
3105
+ openedFilter: openedFilter,
2613
3106
  rowOpen: rowOpen,
2614
3107
  header: header,
2615
3108
  columnIndex: columnOrderIndex,
@@ -2800,12 +3293,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2800
3293
  createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);
2801
3294
  }
2802
3295
 
2803
- 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
2804
3301
  // when we are filtering. We draw attention to this by drawing a thick
2805
3302
  // border overlapping the two consecutive row headers. If sorting, visible
2806
3303
  // row numbers stay the same (i.e. they don't correspond to the underlying
2807
3304
  // data's row number), so we do not show row gaps in that case.
2808
3305
 
3306
+
2809
3307
  var isSorting = self.orderings.columns && self.orderings.columns.length > 0;
2810
3308
 
2811
3309
  if (isRowHeader && self.attributes.showRowNumbers && self.attributes.showRowNumberGaps && isSorting === false) {
@@ -2827,6 +3325,33 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2827
3325
  };
2828
3326
  }
2829
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
+
2830
3355
  function drawRowHeader(rowData, rowIndex, rowOrderIndex) {
2831
3356
  if (self.attributes.showRowHeaders) {
2832
3357
  x = 0; // When filtering we'd like to display the actual row numbers,
@@ -3559,15 +4084,7 @@ __webpack_require__.r(__webpack_exports__);
3559
4084
  /*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
3560
4085
 
3561
4086
 
3562
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3563
-
3564
- 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."); }
3565
-
3566
- 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; }
3567
-
3568
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3569
-
3570
- 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; } } }; }
3571
4088
 
3572
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); }
3573
4090
 
@@ -4017,8 +4534,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4017
4534
  self.cursor = 'default';
4018
4535
  self.hovers = {
4019
4536
  rowIndex: cell.rowIndex,
4020
- columnIndex: cell.columnIndex
4537
+ columnIndex: cell.columnIndex,
4538
+ onFilterButton: false
4021
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
+ }
4022
4545
  }
4023
4546
 
4024
4547
  if (self.selecting || self.reorderObject) {
@@ -4057,36 +4580,73 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4057
4580
  if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1) && self.rowBoundaryCrossed) {
4058
4581
  self.selectRow(cell.rowIndex, ctrl, null, true);
4059
4582
  } else if (self.attributes.selectionMode !== 'row') {
4060
- if (!self.dragAddToSelection && cell.rowIndex !== undefined) {
4061
- if (self.selections[cell.rowIndex] && self.selections[cell.rowIndex].indexOf(cell.columnIndex) !== -1) {
4062
- 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
+ });
4063
4601
  }
4602
+
4603
+ self.draw();
4604
+ return;
4064
4605
  } else {
4065
- self.selections[cell.rowIndex] = self.selections[cell.rowIndex] || [];
4066
-
4067
- if (self.selections[cell.rowIndex].indexOf(cell.columnIndex) === -1) {
4068
- self.selections[cell.rowIndex].push(cell.columnIndex);
4069
- var event = {
4070
- selections: self.selections,
4071
- selectedData: self.getSelectedData(),
4072
- selectedCells: self.getSelectedCells(),
4073
- selectionBounds: self.getSelectionBounds()
4074
- };
4075
- 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
+ }
4076
4629
  }
4077
4630
  }
4078
4631
  }
4079
4632
  }
4080
4633
 
4081
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) {
4082
- self.selections = [];
4635
+ if (!(cell.hovered && self.hovers.onFilterButton)) {
4636
+ self.selections = [];
4637
+ }
4638
+
4639
+ if (dragBounds.top === -1) {
4640
+ dragBounds.top = 0;
4641
+ }
4642
+
4083
4643
  sBounds = dragBounds;
4084
4644
 
4085
4645
  if (self.attributes.selectionMode === 'row') {
4086
4646
  for (i = sBounds.top; i <= sBounds.bottom; i += 1) {
4087
4647
  self.selectRow(i, true, null, true);
4088
4648
  }
4089
- } else if (dragBounds.top !== -1) {
4649
+ } else {
4090
4650
  self.selectArea(sBounds, true);
4091
4651
  if (sBounds.left == -1 && sBounds.top !== sBounds.bottom) self.isMultiRowsSelected = true;
4092
4652
  }
@@ -4163,7 +4723,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4163
4723
  }
4164
4724
 
4165
4725
  if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {
4166
- self.setActiveCell(i.columnIndex, i.rowIndex);
4726
+ if (!self.hovers.onFilterButton) {
4727
+ self.setActiveCell(i.columnIndex, i.rowIndex);
4728
+ }
4167
4729
  }
4168
4730
 
4169
4731
  if (self.currentCell.context === 'cell') {
@@ -4264,7 +4826,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4264
4826
  self.ellipsisCache = {};
4265
4827
  };
4266
4828
 
4267
- self.stopDragResize = function () {
4829
+ self.stopDragResize = function (event) {
4830
+ var pos = self.getLayerPos(event);
4831
+
4832
+ if (self.dragMode === 'ew-resize') {
4833
+ var hasMoved = !!(pos.x - self.dragStart.x); // Check that dragItem is selected or part of selection.
4834
+
4835
+ var dragItemIsSelected = self.isColumnSelected(self.dragItem.columnIndex);
4836
+
4837
+ if (hasMoved && dragItemIsSelected) {
4838
+ var width = Math.max(self.resizingStartingWidth + pos.x - self.dragStart.x, self.style.minColumnWidth); // If the column is selected, resize it to width plus any other selected columns.
4839
+
4840
+ self.fitSelectedColumns(width);
4841
+ }
4842
+ }
4843
+
4268
4844
  self.resize();
4269
4845
  document.body.removeEventListener('mousemove', self.dragResizeColumn, false);
4270
4846
  document.body.removeEventListener('mouseup', self.stopDragResize, false);
@@ -4610,7 +5186,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4610
5186
  self.dragAddToSelection = !self.dragStartObject.selected;
4611
5187
 
4612
5188
  if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/.test(self.dragStartObject.context) && self.currentCell && !self.currentCell.isColumnHeader && !move && !freeze && !resize) {
4613
- if (!(self.dragMode == 'row-reorder' && self.isMultiRowsSelected)) self.selections = [];
5189
+ if (!(self.dragMode == 'row-reorder' && self.isMultiRowsSelected) && !(self.currentCell.hovered && self.hovers.onFilterButton)) {
5190
+ self.selections = [];
5191
+ }
4614
5192
  }
4615
5193
 
4616
5194
  if (self.dragStartObject.isGrid) {
@@ -4823,6 +5401,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4823
5401
  self.selectNone();
4824
5402
  } else if (ctrl && e.key === 'a') {
4825
5403
  self.selectAll();
5404
+ } else if (['Backspace', 'Delete'].includes(e.key)) {
5405
+ self.deleteSelectedData();
4826
5406
  } else if (e.key === 'ArrowDown') {
4827
5407
  y += 1;
4828
5408
  } else if (e.key === 'ArrowUp') {
@@ -5012,10 +5592,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5012
5592
  }
5013
5593
 
5014
5594
  if (self.currentCell.context === 'ew-resize' && self.currentCell.style === 'columnHeaderCell') {
5015
- self.fitColumnToValues(self.currentCell.header.name);
5595
+ // Check that double-clicked cell is selected or part of selection.
5596
+ var currentCellIsSelected = self.isColumnSelected(self.currentCell.columnIndex);
5597
+
5598
+ if (currentCellIsSelected) {
5599
+ // There might be more
5600
+ self.fitSelectedColumns();
5601
+ } else {
5602
+ self.fitColumnToValues(self.currentCell.header.name);
5603
+ }
5016
5604
  } else if (self.currentCell.context === 'ew-resize' && self.currentCell.style === 'cornerCell') {
5017
5605
  self.autosize();
5018
- } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {
5606
+ } else if (['cell', 'activeCell'].includes(self.currentCell.style) && !self.hovers.onFilterButton) {
5019
5607
  self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);
5020
5608
  }
5021
5609
  };
@@ -5222,51 +5810,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5222
5810
  };
5223
5811
 
5224
5812
  self.cut = function (e) {
5225
- self.copy(e);
5226
- var schema = self.getSchema();
5227
- var affectedCells = [];
5228
-
5229
- var _iterator2 = _createForOfIteratorHelper(self.selections.entries()),
5230
- _step2;
5231
-
5232
- try {
5233
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
5234
- var _step2$value = _slicedToArray(_step2.value, 2),
5235
- rowIndex = _step2$value[0],
5236
- row = _step2$value[1];
5237
-
5238
- if (!row) continue;
5239
- var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
5813
+ if (self.dispatchEvent('cut', {
5814
+ NativeEvent: e
5815
+ })) {
5816
+ return;
5817
+ } // Expecting instance of `ClipboardEvent` with `clipboardData` attribute
5240
5818
 
5241
- var _iterator3 = _createForOfIteratorHelper(row),
5242
- _step3;
5243
5819
 
5244
- try {
5245
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
5246
- var columnIndex = _step3.value;
5247
- var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
5248
- var colName = schema[boundColumnIndex].name;
5249
- self.viewData[rowIndex][colName] = '';
5250
- affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
5251
- }
5252
- } catch (err) {
5253
- _iterator3.e(err);
5254
- } finally {
5255
- _iterator3.f();
5256
- }
5257
- }
5258
- } catch (err) {
5259
- _iterator2.e(err);
5260
- } finally {
5261
- _iterator2.f();
5820
+ if (!self.hasFocus || !e.clipboardData) {
5821
+ return;
5262
5822
  }
5263
5823
 
5264
- if (self.dispatchEvent('cut', {
5265
- NativeEvent: e,
5824
+ self.copySelectedCellsToClipboard(e.clipboardData);
5825
+ var affectedCells = self.clearSelectedCells();
5826
+ self.dispatchEvent('aftercut', {
5266
5827
  cells: affectedCells
5267
- })) {
5268
- return;
5269
- }
5828
+ });
5829
+ requestAnimationFrame(function () {
5830
+ return self.draw();
5831
+ });
5270
5832
  };
5271
5833
 
5272
5834
  self.copy = function (e) {
@@ -5274,82 +5836,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5274
5836
  NativeEvent: e
5275
5837
  })) {
5276
5838
  return;
5277
- }
5839
+ } // Expecting instance of `ClipboardEvent` with `clipboardData` attribute
5840
+
5278
5841
 
5279
5842
  if (!self.hasFocus || !e.clipboardData) {
5280
5843
  return;
5281
5844
  }
5282
5845
 
5283
- var t = '',
5284
- d = '',
5285
- textRows = [],
5286
- sData = self.getSelectedData(),
5287
- s = self.getSchema(),
5288
- sSorted = [],
5289
- firstRowKeys,
5290
- isNeat = true; // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy
5291
-
5292
- function htmlSafe(v) {
5293
- if (typeof v === 'number') return v;
5294
- return v.replace(/</g, '&lt;').replace(/>/g, '&gt;');
5295
- }
5296
-
5297
- s.forEach(function (column, columnIndex) {
5298
- sSorted.push(s[self.orders.columns[columnIndex]]);
5299
- });
5300
-
5301
- if (sData.length > 0) {
5302
- sData.forEach(function (row) {
5303
- if (!row) return;
5304
- var rowKeys = Object.keys(row);
5305
- var textRow = [];
5306
- if (!firstRowKeys) firstRowKeys = Object.keys(row);
5307
- if (isNeat && rowKeys.length !== firstRowKeys.length) isNeat = false;
5308
- sSorted.forEach(function (column, columnIndex) {
5309
- if (rowKeys.indexOf(String(column.name)) < 0) {
5310
- if (firstRowKeys.indexOf(String(column.name)) < 0) {
5311
- return;
5312
- } else if (isNeat) {
5313
- isNeat = false;
5314
- }
5315
- }
5316
-
5317
- textRow.push(row[column.name] || '');
5318
- });
5319
- textRows.push(textRow);
5320
- });
5321
-
5322
- if (isNeat) {
5323
- t = textRows.map(function (row) {
5324
- return row.join('\t');
5325
- }).join('\n');
5326
- /**
5327
- * The html content copied by Excel has not header
5328
- */
5329
-
5330
- d += '<table>';
5331
- d += textRows.map(function (row) {
5332
- return '<tr>' + row.map(function (value) {
5333
- return '<td>' + htmlSafe(value) + '</td>';
5334
- }).join('') + '</tr>';
5335
- }).join('');
5336
- d += '</table>';
5337
- } else {
5338
- t = textRows.map(function (row) {
5339
- return row.join('');
5340
- }).join('');
5341
- d = t;
5342
- }
5343
-
5344
- if (t) {
5345
- e.clipboardData.setData('text/html', d);
5346
- e.clipboardData.setData('text/plain', t);
5347
- e.clipboardData.setData('text/csv', t);
5348
- e.clipboardData.setData('application/json', JSON.stringify(sData));
5349
- }
5350
-
5351
- e.preventDefault();
5352
- }
5846
+ self.copySelectedCellsToClipboard(e.clipboardData);
5847
+ e.preventDefault();
5353
5848
  };
5354
5849
 
5355
5850
  return;
@@ -5362,6 +5857,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5362
5857
  !*** ./lib/events/util.js ***!
5363
5858
  \****************************/
5364
5859
  /*! namespace exports */
5860
+ /*! export createHTMLString [provided] [no usage info] [missing usage info prevents renaming] */
5861
+ /*! export createTextString [provided] [no usage info] [missing usage info prevents renaming] */
5862
+ /*! export htmlSafe [provided] [no usage info] [missing usage info prevents renaming] */
5365
5863
  /*! export isSupportedHtml [provided] [no usage info] [missing usage info prevents renaming] */
5366
5864
  /*! export parseData [provided] [no usage info] [missing usage info prevents renaming] */
5367
5865
  /*! export parseHtmlTable [provided] [no usage info] [missing usage info prevents renaming] */
@@ -5375,12 +5873,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5375
5873
  "use strict";
5376
5874
  __webpack_require__.r(__webpack_exports__);
5377
5875
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5876
+ /* harmony export */ "createTextString": function() { return /* binding */ createTextString; },
5877
+ /* harmony export */ "createHTMLString": function() { return /* binding */ createHTMLString; },
5378
5878
  /* harmony export */ "isSupportedHtml": function() { return /* binding */ isSupportedHtml; },
5379
- /* harmony export */ "sanitizeElementData": function() { return /* binding */ sanitizeElementData; },
5879
+ /* harmony export */ "htmlSafe": function() { return /* binding */ htmlSafe; },
5380
5880
  /* harmony export */ "parseData": function() { return /* binding */ parseData; },
5381
5881
  /* harmony export */ "parseHtmlTable": function() { return /* binding */ parseHtmlTable; },
5382
5882
  /* harmony export */ "parseHtmlText": function() { return /* binding */ parseHtmlText; },
5383
- /* harmony export */ "parseText": function() { return /* binding */ parseText; }
5883
+ /* harmony export */ "parseText": function() { return /* binding */ parseText; },
5884
+ /* harmony export */ "sanitizeElementData": function() { return /* binding */ sanitizeElementData; }
5384
5885
  /* harmony export */ });
5385
5886
 
5386
5887
 
@@ -5503,6 +6004,36 @@ var parseData = function parseData(data, mimeType) {
5503
6004
  return parseText(data);
5504
6005
  };
5505
6006
 
6007
+ var htmlSafe = function htmlSafe(value) {
6008
+ if (typeof value === 'number') return value;
6009
+ return value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
6010
+ };
6011
+
6012
+ var createTextString = function createTextString(selectedData, isNeat) {
6013
+ // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy.
6014
+ // If not isNeat we just return a simple string of concatenated values.
6015
+ if (!isNeat) return selectedData.map(function (row) {
6016
+ return Object.values(row).join('');
6017
+ }).join(''); // If isNeat, we can create tab separated mutti-line text.
6018
+
6019
+ return selectedData.map(function (row) {
6020
+ return Object.values(row).join('\t');
6021
+ }).join('\n');
6022
+ };
6023
+
6024
+ var createHTMLString = function createHTMLString(selectedData, isNeat) {
6025
+ if (!isNeat) return createTextString(selectedData, isNeat); // If isNeat, we can create a HTML table with the selected data.
6026
+
6027
+ var htmlString = '<table>';
6028
+ htmlString += selectedData.map(function (row) {
6029
+ return '<tr>' + Object.values(row).map(function (value) {
6030
+ return '<td>' + htmlSafe(value) + '</td>';
6031
+ }).join('') + '</tr>';
6032
+ }).join('');
6033
+ htmlString += '</table>';
6034
+ return htmlString;
6035
+ };
6036
+
5506
6037
 
5507
6038
 
5508
6039
  /***/ }),
@@ -5514,7 +6045,7 @@ var parseData = function parseData(data, mimeType) {
5514
6045
  /*! namespace exports */
5515
6046
  /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
5516
6047
  /*! other exports [not provided] [no usage info] */
5517
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
6048
+ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
5518
6049
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5519
6050
 
5520
6051
  "use strict";
@@ -5522,6 +6053,7 @@ __webpack_require__.r(__webpack_exports__);
5522
6053
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5523
6054
  /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
5524
6055
  /* harmony export */ });
6056
+ /* harmony import */ var _events_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/util */ "./lib/events/util.js");
5525
6057
  /*jslint browser: true, unparam: true, todo: true*/
5526
6058
 
5527
6059
  /*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
@@ -5543,6 +6075,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5543
6075
 
5544
6076
  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; }
5545
6077
 
6078
+
5546
6079
  /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self, ctor) {
5547
6080
  self.scale = 1;
5548
6081
  self.orders = {
@@ -5602,6 +6135,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5602
6135
  trees: {}
5603
6136
  };
5604
6137
  self.selections = [];
6138
+ self.filterable = {
6139
+ rows: [],
6140
+ columns: []
6141
+ };
6142
+ self.selectedFilterButton = {
6143
+ columnIndex: -1,
6144
+ rowIndex: -1
6145
+ };
5605
6146
  self.hovers = {};
5606
6147
  self.attributes = {};
5607
6148
  self.style = {};
@@ -5619,7 +6160,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5619
6160
  self.openChildren = {};
5620
6161
  self.scrollModes = ['vertical-scroll-box', 'vertical-scroll-top', 'vertical-scroll-bottom', 'horizontal-scroll-box', 'horizontal-scroll-right', 'horizontal-scroll-left'];
5621
6162
  self.componentL1Events = {};
5622
- 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'];
6163
+ 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'];
5623
6164
  self.mouse = {
5624
6165
  x: 0,
5625
6166
  y: 0
@@ -5739,6 +6280,122 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5739
6280
  return selectedCells;
5740
6281
  };
5741
6282
 
6283
+ self.copySelectedCellsToClipboard = function (clipboardData) {
6284
+ var selectedData = [];
6285
+ var schema = self.getSchema();
6286
+ var firstRowAsString;
6287
+ var isNeat = true; // Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy
6288
+
6289
+ var _iterator3 = _createForOfIteratorHelper(self.selections.entries()),
6290
+ _step3;
6291
+
6292
+ try {
6293
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6294
+ var _step3$value = _slicedToArray(_step3.value, 2),
6295
+ rowIndex = _step3$value[0],
6296
+ row = _step3$value[1];
6297
+
6298
+ // If no cells are selected for a particular rowIndex the selections array will contain an empty element for that rowIndex.
6299
+ if (!row) continue; // Convert to string for easy comparison to the first row.
6300
+
6301
+ var rowAsString = row.join(',').toString();
6302
+ var rowDict = {};
6303
+ if (!firstRowAsString) firstRowAsString = row.join(',').toString();
6304
+ if (isNeat && rowAsString !== firstRowAsString) isNeat = false;
6305
+ var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
6306
+
6307
+ var _iterator4 = _createForOfIteratorHelper(row),
6308
+ _step4;
6309
+
6310
+ try {
6311
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
6312
+ var columnIndex = _step4.value;
6313
+ // If the whole row is selected the columnIndex for the rowHeader is -1.
6314
+ if (columnIndex < 0) continue;
6315
+ var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
6316
+ var columnName = schema[boundColumnIndex].name;
6317
+ var value = self.originalData[boundRowIndex][columnName];
6318
+ rowDict[columnName] = value;
6319
+ }
6320
+ } catch (err) {
6321
+ _iterator4.e(err);
6322
+ } finally {
6323
+ _iterator4.f();
6324
+ }
6325
+
6326
+ selectedData.push(rowDict);
6327
+ }
6328
+ } catch (err) {
6329
+ _iterator3.e(err);
6330
+ } finally {
6331
+ _iterator3.f();
6332
+ }
6333
+
6334
+ if (selectedData.length > 0) {
6335
+ var textString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createTextString)(selectedData, isNeat);
6336
+ var htmlString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createHTMLString)(selectedData, isNeat);
6337
+ var copiedData = {
6338
+ 'text/plain': textString,
6339
+ 'text/html': htmlString,
6340
+ 'text/csv': textString,
6341
+ 'application/json': JSON.stringify(selectedData)
6342
+ };
6343
+
6344
+ for (var _i2 = 0, _Object$entries = Object.entries(copiedData); _i2 < _Object$entries.length; _i2++) {
6345
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
6346
+ mimeType = _Object$entries$_i[0],
6347
+ data = _Object$entries$_i[1];
6348
+
6349
+ clipboardData.setData(mimeType, data);
6350
+ }
6351
+ }
6352
+ };
6353
+
6354
+ self.clearSelectedCells = function () {
6355
+ var schema = self.getSchema();
6356
+ var affectedCells = [];
6357
+
6358
+ var _iterator5 = _createForOfIteratorHelper(self.selections.entries()),
6359
+ _step5;
6360
+
6361
+ try {
6362
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6363
+ var _step5$value = _slicedToArray(_step5.value, 2),
6364
+ rowIndex = _step5$value[0],
6365
+ row = _step5$value[1];
6366
+
6367
+ // If no cells are selected for a particular rowIndex the selections array will contain an empty element for that rowIndex.
6368
+ if (!row) continue;
6369
+ var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
6370
+
6371
+ var _iterator6 = _createForOfIteratorHelper(row),
6372
+ _step6;
6373
+
6374
+ try {
6375
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
6376
+ var columnIndex = _step6.value;
6377
+ // If the whole row is selected the columnIndex for the rowHeader is -1.
6378
+ if (columnIndex < 0) continue;
6379
+ var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
6380
+ var columnName = schema[boundColumnIndex].name;
6381
+ self.viewData[boundRowIndex][columnName] = '';
6382
+ affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
6383
+ }
6384
+ } catch (err) {
6385
+ _iterator6.e(err);
6386
+ } finally {
6387
+ _iterator6.f();
6388
+ }
6389
+ }
6390
+ } catch (err) {
6391
+ _iterator5.e(err);
6392
+ } finally {
6393
+ _iterator5.f();
6394
+ }
6395
+
6396
+ return affectedCells;
6397
+ };
6398
+
5742
6399
  self.getBoundRowIndexFromViewRowIndex = function (viewRowIndex) {
5743
6400
  if (self.boundRowIndexMap && self.boundRowIndexMap.has(viewRowIndex)) {
5744
6401
  return self.boundRowIndexMap.get(viewRowIndex);
@@ -5815,6 +6472,39 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5815
6472
  self.orders.rows = fillArray(0, self.originalData.length - 1);
5816
6473
  };
5817
6474
 
6475
+ self.fitSelectedColumns = function (width) {
6476
+ var selectedColumns = self.selections[0];
6477
+ var schema = self.getSchema();
6478
+
6479
+ var _iterator7 = _createForOfIteratorHelper(selectedColumns),
6480
+ _step7;
6481
+
6482
+ try {
6483
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
6484
+ var selectedColumn = _step7.value;
6485
+
6486
+ // Make sure the column is not the row header and that the whole column has in fact been selected.
6487
+ if (selectedColumn >= 0 && self.isColumnSelected(selectedColumn)) {
6488
+ if (isNaN(width)) {
6489
+ var column = schema[self.orders.columns[selectedColumn]];
6490
+ self.fitColumnToValues(column.name);
6491
+ } else {
6492
+ self.sizes.columns[selectedColumn] = width;
6493
+ self.dispatchEvent('resizecolumn', {
6494
+ x: width,
6495
+ y: self.resizingStartingHeight,
6496
+ draggingItem: self.currentCell
6497
+ });
6498
+ }
6499
+ }
6500
+ }
6501
+ } catch (err) {
6502
+ _iterator7.e(err);
6503
+ } finally {
6504
+ _iterator7.f();
6505
+ }
6506
+ };
6507
+
5818
6508
  self.getVisibleSchema = function () {
5819
6509
  return self.getSchema().filter(function (col) {
5820
6510
  return !col.hidden;
@@ -5881,9 +6571,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5881
6571
  }); // Apply filtering
5882
6572
 
5883
6573
  var _loop = function _loop() {
5884
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
5885
- headerName = _Object$entries$_i[0],
5886
- filterText = _Object$entries$_i[1];
6574
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
6575
+ headerName = _Object$entries2$_i[0],
6576
+ filterText = _Object$entries2$_i[1];
5887
6577
 
5888
6578
  var header = self.getHeaderByName(headerName);
5889
6579
 
@@ -5902,19 +6592,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5902
6592
  });
5903
6593
  };
5904
6594
 
5905
- for (var _i2 = 0, _Object$entries = Object.entries(self.columnFilters); _i2 < _Object$entries.length; _i2++) {
6595
+ for (var _i3 = 0, _Object$entries2 = Object.entries(self.columnFilters); _i3 < _Object$entries2.length; _i3++) {
5906
6596
  var _ret = _loop();
5907
6597
 
5908
6598
  if (_ret === "continue") continue;
5909
6599
  } // Apply sorting
5910
6600
 
5911
6601
 
5912
- var _iterator3 = _createForOfIteratorHelper(self.orderings.columns),
5913
- _step3;
6602
+ var _iterator8 = _createForOfIteratorHelper(self.orderings.columns),
6603
+ _step8;
5914
6604
 
5915
6605
  try {
5916
6606
  var _loop2 = function _loop2() {
5917
- var column = _step3.value;
6607
+ var column = _step8.value;
5918
6608
  var sortFn = column.sortFunction(column.orderBy, column.orderDirection);
5919
6609
  newViewData.sort(function (_ref7, _ref8) {
5920
6610
  var _ref9 = _slicedToArray(_ref7, 1),
@@ -5929,13 +6619,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5929
6619
  });
5930
6620
  };
5931
6621
 
5932
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6622
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
5933
6623
  _loop2();
5934
6624
  }
5935
6625
  } catch (err) {
5936
- _iterator3.e(err);
6626
+ _iterator8.e(err);
5937
6627
  } finally {
5938
- _iterator3.f();
6628
+ _iterator8.f();
5939
6629
  }
5940
6630
 
5941
6631
  return {
@@ -6089,6 +6779,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6089
6779
  self.controlInput.removeEventListener('keypress', self.keypress, false);
6090
6780
  self.controlInput.removeEventListener('keyup', self.keyup, false);
6091
6781
  self.controlInput.removeEventListener('keydown', self.keydown, false);
6782
+ document.body.removeEventListener('mousemove', self.mousemove);
6092
6783
  window.removeEventListener('resize', self.resize);
6093
6784
 
6094
6785
  if (self.observer && self.observer.disconnect) {
@@ -6265,6 +6956,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6265
6956
  };
6266
6957
  Object.keys(self.style).forEach(self.parseStyleValue);
6267
6958
  self.intf.moveSelection = self.moveSelection;
6959
+ self.intf.deleteSelectedData = self.deleteSelectedData;
6268
6960
  self.intf.moveTo = self.moveTo;
6269
6961
  self.intf.addEventListener = self.addEventListener;
6270
6962
  self.intf.removeEventListener = self.removeEventListener;
@@ -6298,6 +6990,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6298
6990
  self.intf.clearChangeLog = self.clearChangeLog;
6299
6991
  self.intf.gotoCell = self.gotoCell;
6300
6992
  self.intf.gotoRow = self.gotoRow;
6993
+ self.intf.addButton = self.addButton;
6301
6994
  self.intf.getHeaderByName = self.getHeaderByName;
6302
6995
  self.intf.findColumnScrollLeft = self.findColumnScrollLeft;
6303
6996
  self.intf.findRowScrollTop = self.findRowScrollTop;
@@ -7106,6 +7799,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7106
7799
  if (!preventScrollEvent) {
7107
7800
  self.scroll();
7108
7801
  }
7802
+
7803
+ if (self.button) {
7804
+ self.moveButtonPos();
7805
+ }
7109
7806
  }
7110
7807
 
7111
7808
  function setScrollLeft(value, preventScrollEvent) {
@@ -7130,6 +7827,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7130
7827
  if (!preventScrollEvent) {
7131
7828
  self.scroll();
7132
7829
  }
7830
+
7831
+ if (self.button) {
7832
+ self.moveButtonPos();
7833
+ }
7133
7834
  }
7134
7835
 
7135
7836
  self.scrollBox.toString = function () {
@@ -7238,8 +7939,9 @@ __webpack_require__.r(__webpack_exports__);
7238
7939
  /* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./touch */ "./lib/touch.js");
7239
7940
  /* harmony import */ var _intf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intf */ "./lib/intf.js");
7240
7941
  /* harmony import */ var _contextMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./contextMenu */ "./lib/contextMenu.js");
7241
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom */ "./lib/dom.js");
7242
- /* harmony import */ var _publicMethods__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./publicMethods */ "./lib/publicMethods.js");
7942
+ /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./button */ "./lib/button.js");
7943
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom */ "./lib/dom.js");
7944
+ /* harmony import */ var _publicMethods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./publicMethods */ "./lib/publicMethods.js");
7243
7945
  /*jslint browser: true, unparam: true, todo: true, evil: true*/
7244
7946
 
7245
7947
  /*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
@@ -7256,8 +7958,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7256
7958
 
7257
7959
 
7258
7960
 
7961
+
7259
7962
  var webComponent = (0,_component__WEBPACK_IMPORTED_MODULE_0__.default)();
7260
- 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];
7963
+ 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];
7261
7964
 
7262
7965
  function Grid(args) {
7263
7966
  args = args || {};
@@ -7625,6 +8328,20 @@ __webpack_require__.r(__webpack_exports__);
7625
8328
  delete self.columnFilters[column];
7626
8329
  } else {
7627
8330
  self.columnFilters[column] = value;
8331
+
8332
+ if (self.attributes.showFilterInCell) {
8333
+ self.filterable.rows.push(0);
8334
+ self.orders.columns.forEach(function (value, index) {
8335
+ self.filterable.columns.push(index);
8336
+ });
8337
+ }
8338
+ }
8339
+
8340
+ if (!Object.keys(self.columnFilters).length) {
8341
+ self.filterable = {
8342
+ rows: [],
8343
+ columns: []
8344
+ };
7628
8345
  }
7629
8346
 
7630
8347
  self.refresh();
@@ -7718,6 +8435,28 @@ __webpack_require__.r(__webpack_exports__);
7718
8435
  self.gotoRow = function (y) {
7719
8436
  self.gotoCell(0, y);
7720
8437
  };
8438
+ /**
8439
+ * Add a button into the cell.
8440
+ * @memberof canvasDatagrid
8441
+ * @name addButton
8442
+ * @method
8443
+ * @param {number} columnIndex The column index of the cell to to add a button.
8444
+ * @param {number} rowIndex The row index of the cell to to add a button.
8445
+ * @param {object} offset Offset how far go away from cell.
8446
+ * @param {object} items a list of items to add into button menu.
8447
+ * @param {string} imgSrc icon path to add into button.
8448
+ */
8449
+
8450
+
8451
+ self.addButton = function (columnIndex, rowIndex, offset, items, imgSrc) {
8452
+ var cells = self.visibleCells.filter(function (c) {
8453
+ return c.sortColumnIndex === columnIndex && c.sortRowIndex === rowIndex;
8454
+ });
8455
+ self.attachButton({
8456
+ top: cells[0].y + cells[0].height + offset.y,
8457
+ left: cells[0].x + cells[0].width + offset.x
8458
+ }, items, imgSrc);
8459
+ };
7721
8460
  /**
7722
8461
  * Scrolls the cell at cell x, row y into view if it is not already.
7723
8462
  * @memberof canvasDatagrid
@@ -8162,7 +8901,14 @@ __webpack_require__.r(__webpack_exports__);
8162
8901
  return;
8163
8902
  }
8164
8903
 
8165
- self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index] = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);
8904
+ var columnIndex = name === 'cornerCell' ? -1 : self.getHeaderByName(name).index;
8905
+ var newSize = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);
8906
+ self.sizes.columns[columnIndex] = newSize;
8907
+ self.dispatchEvent('resizecolumn', {
8908
+ x: newSize,
8909
+ y: self.resizingStartingHeight,
8910
+ draggingItem: self.currentCell
8911
+ });
8166
8912
 
8167
8913
  if (!internal) {
8168
8914
  self.resize();
@@ -8283,6 +9029,29 @@ __webpack_require__.r(__webpack_exports__);
8283
9029
  });
8284
9030
  self.selections = sel;
8285
9031
  };
9032
+ /**
9033
+ * Deletes currently selected data.
9034
+ * @memberof canvasDatagrid
9035
+ * @name deleteSelectedData
9036
+ * @method
9037
+ * @param {boolean} dontDraw Suppress the draw method after the selection change.
9038
+ */
9039
+
9040
+
9041
+ self.deleteSelectedData = function (dontDraw) {
9042
+ var affectedCells = self.clearSelectedCells();
9043
+ self.dispatchEvent('afterdelete', {
9044
+ cells: affectedCells
9045
+ });
9046
+
9047
+ if (dontDraw) {
9048
+ return;
9049
+ }
9050
+
9051
+ requestAnimationFrame(function () {
9052
+ return self.draw();
9053
+ });
9054
+ };
8286
9055
  /**
8287
9056
  * 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.
8288
9057
  * @memberof canvasDatagrid