jsl-ui 8.14.1 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { IJSLComponent, IJSLVNode } from "jsl-render";
2
2
  import { IDialogOptions, JSLDialog } from "../../ui/dialog";
3
- import { IMoveableOptions } from '../../interaction/moveable';
3
+ import { IMoveableOptions } from "../../interaction/moveable";
4
4
  import { IResizeOptions } from "../../interaction/resizable";
5
5
  export interface IDialogComponentOptions extends IDialogOptions {
6
6
  width?: string;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { JSLRender } from "jsl-render";
13
13
  import { Dialog } from "../../ui/dialog";
14
- import { Moveable } from '../../interaction/moveable';
14
+ import { Moveable } from "../../interaction/moveable";
15
15
  import { EventHandler } from "../../interaction/eventhandler";
16
16
  import { Resizable } from "../../interaction/resizable";
17
17
  import { UILang } from "../../core/lang";
@@ -7,6 +7,7 @@
7
7
  padding: 0.3rem;
8
8
  border-bottom: 1px solid #c9c9c9;
9
9
  border-top: 1px solid #c9c9c9;
10
+ flex-shrink: 0;
10
11
  background: linear-gradient(90deg,
11
12
  rgb(255,255,255) 0%,
12
13
  rgb(246,246,246) 20%,
@@ -58,12 +58,11 @@ var ExcelFilter = /** @class */ (function () {
58
58
  return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
59
59
  };
60
60
  ExcelFilter.prototype.show = function (col) {
61
- var _a;
62
61
  return __awaiter(this, void 0, void 0, function () {
63
- var values, filters, currentFilters, mode, filterOptions, oldCheckedValues, _i, currentFilters_1, f, dlg, dlgBody, id, search, cbAllContainer, cbAll, cbAllLabel, sortedValues, _b, values_1, x, o, visibleValues, checkedValues, cbContainer, rowHeight, height, vr, renderer, dlgObj, dlgOkButton, dlgCancelButton, dlgClearButton;
62
+ var values, filters, currentFilters, mode, filterOptions, oldCheckedValues, _i, currentFilters_1, f, dlg, dlgBody, id, search, cbAllContainer, cbAll, cbAllLabel, sortedValues, _a, values_1, x, o, visibleValues, checkedValues, cbContainer, rowHeight, height, vr, renderer, dlgObj, dlgOkButton, dlgCancelButton, dlgClearButton;
64
63
  var _this = this;
65
- return __generator(this, function (_c) {
66
- switch (_c.label) {
64
+ return __generator(this, function (_b) {
65
+ switch (_b.label) {
67
66
  case 0:
68
67
  filters = this.grid.getFilters();
69
68
  currentFilters = filters.filter(function (f) { return f.columnId === col.id; });
@@ -82,8 +81,8 @@ var ExcelFilter = /** @class */ (function () {
82
81
  }
83
82
  return [4 /*yield*/, filterOptions(col)];
84
83
  case 2:
85
- values = _c.sent();
86
- _c.label = 3;
84
+ values = _b.sent();
85
+ _b.label = 3;
87
86
  case 3:
88
87
  oldCheckedValues = {};
89
88
  if (currentFilters.length > 0) {
@@ -127,15 +126,15 @@ var ExcelFilter = /** @class */ (function () {
127
126
  dlgBody.appendChild(cbAllContainer);
128
127
  sortedValues = [];
129
128
  if (Array.isArray(values)) {
130
- for (_b = 0, values_1 = values; _b < values_1.length; _b++) {
131
- x = values_1[_b];
132
- sortedValues.push({ id: x, txt: (x !== null && x !== void 0 ? x : "") });
129
+ for (_a = 0, values_1 = values; _a < values_1.length; _a++) {
130
+ x = values_1[_a];
131
+ sortedValues.push({ id: [x], txt: (x !== null && x !== void 0 ? x : "") });
133
132
  }
134
133
  }
135
134
  else {
136
135
  for (o in values) {
137
136
  if (values.hasOwnProperty(o)) {
138
- sortedValues.push({ id: o, txt: (_a = values[o], (_a !== null && _a !== void 0 ? _a : "")) });
137
+ sortedValues.push({ id: values[o], txt: (o !== null && o !== void 0 ? o : "") });
139
138
  }
140
139
  }
141
140
  }
@@ -156,13 +155,19 @@ var ExcelFilter = /** @class */ (function () {
156
155
  tag: "input",
157
156
  attr: {
158
157
  id: id + "_" + args.index,
159
- checked: checkedValues[args.rowData.id] ? "checked" : undefined,
158
+ checked: checkedValues[args.rowData.id[0]] ? "checked" : undefined,
160
159
  change: function (_, node) {
161
160
  if (node.dom.checked) {
162
- checkedValues[args.rowData.id] = true;
161
+ for (var _i = 0, _a = args.rowData.id; _i < _a.length; _i++) {
162
+ var selId = _a[_i];
163
+ checkedValues[selId] = true;
164
+ }
163
165
  }
164
166
  else {
165
- delete checkedValues[args.rowData.id];
167
+ for (var _b = 0, _c = args.rowData.id; _b < _c.length; _b++) {
168
+ var selId = _c[_b];
169
+ delete checkedValues[selId];
170
+ }
166
171
  }
167
172
  // check if all values or none are checked
168
173
  var allChecked = Object.getOwnPropertyNames(checkedValues).length === sortedValues.length;
@@ -201,11 +206,22 @@ var ExcelFilter = /** @class */ (function () {
201
206
  });
202
207
  cbAll.addEventListener("change", function () {
203
208
  for (var i = 0; i < visibleValues.length; i++) {
209
+ // if (cbAll.checked) {
210
+ // checkedValues[visibleValues[i].id] = true;
211
+ // } else {
212
+ // delete checkedValues[visibleValues[i].id];
213
+ // }
204
214
  if (cbAll.checked) {
205
- checkedValues[visibleValues[i].id] = true;
215
+ for (var _i = 0, _a = visibleValues[i].id; _i < _a.length; _i++) {
216
+ var selId = _a[_i];
217
+ checkedValues[selId] = true;
218
+ }
206
219
  }
207
220
  else {
208
- delete checkedValues[visibleValues[i].id];
221
+ for (var _b = 0, _c = visibleValues[i].id; _b < _c.length; _b++) {
222
+ var selId = _c[_b];
223
+ delete checkedValues[selId];
224
+ }
209
225
  }
210
226
  }
211
227
  renderer.refresh();
@@ -276,13 +292,20 @@ var ExcelFilter = /** @class */ (function () {
276
292
  // }
277
293
  // }
278
294
  ExcelFilter.prototype.getDistinctValues = function (col) {
279
- var result = {};
295
+ var textToValues = {};
280
296
  for (var idx = 0, len = this.grid.getDataLength(); idx < len; idx++) {
281
297
  var item = this.grid.getDataItem(idx);
282
298
  var value = this.grid.getDataItemValueForColumn(item, col);
283
- result[value] = this.grid.getFormattedValue(col, value, item);
299
+ var text = this.grid.getFormattedValue(col, value, item);
300
+ var valueList = textToValues[text];
301
+ if (valueList == null) {
302
+ valueList = textToValues[text] = [];
303
+ }
304
+ if (valueList.indexOf(value) < 0) {
305
+ valueList.push(value);
306
+ }
284
307
  }
285
- return result;
308
+ return textToValues;
286
309
  };
287
310
  return ExcelFilter;
288
311
  }());
@@ -0,0 +1 @@
1
+ export declare function CellExternalCopyManager(options: any): void;
@@ -0,0 +1,411 @@
1
+ import { jQueryReplacement } from "../../core/jq";
2
+ import { Slick } from "../slick.core";
3
+ var $ = jQueryReplacement;
4
+ // register namespace
5
+ $.deepExtend(Slick, {
6
+ "CellExternalCopyManager": CellExternalCopyManager
7
+ });
8
+ export function CellExternalCopyManager(options) {
9
+ /*
10
+ This manager enables users to copy/paste data from/to an external Spreadsheet application
11
+ such as MS-Excel® or OpenOffice-Spreadsheet.
12
+
13
+ Since it is not possible to access directly the clipboard in javascript, the plugin uses
14
+ a trick to do it's job. After detecting the keystroke, we dynamically create a textarea
15
+ where the browser copies/pastes the serialized data.
16
+
17
+ options:
18
+ copiedCellStyle : sets the css className used for copied cells. default : "copied"
19
+ copiedCellStyleLayerKey : sets the layer key for setting css values of copied cells. default : "copy-manager"
20
+ dataItemColumnValueExtractor : option to specify a custom column value extractor function
21
+ dataItemColumnValueSetter : option to specify a custom column value setter function
22
+ clipboardCommandHandler : option to specify a custom handler for paste actions
23
+ includeHeaderWhenCopying : set to true and the plugin will take the name property from each column (which is usually what appears in your header) and put that as the first row of the text that's copied to the clipboard
24
+ bodyElement: option to specify a custom DOM element which to will be added the hidden textbox. It's useful if the grid is inside a modal dialog.
25
+ onCopyInit: optional handler to run when copy action initializes
26
+ onCopySuccess: optional handler to run when copy action is complete
27
+ newRowCreator: function to add rows to table if paste overflows bottom of table, if this function is not provided new rows will be ignored.
28
+ readOnlyMode: suppresses paste
29
+ headerColumnValueExtractor : option to specify a custom column header value extractor function
30
+ */
31
+ var _grid;
32
+ var _self = this;
33
+ var _copiedRanges;
34
+ var _options = options || {};
35
+ var _copiedCellStyleLayerKey = _options.copiedCellStyleLayerKey || "copy-manager";
36
+ var _copiedCellStyle = _options.copiedCellStyle || "copied";
37
+ var _clearCopyTI = 0;
38
+ var _bodyElement = _options.bodyElement || document.body;
39
+ var _onCopyInit = _options.onCopyInit || null;
40
+ var _onCopySuccess = _options.onCopySuccess || null;
41
+ var keyCodes = {
42
+ 'C': 67,
43
+ 'V': 86,
44
+ 'ESC': 27,
45
+ 'INSERT': 45
46
+ };
47
+ function init(grid) {
48
+ _grid = grid;
49
+ _grid.onKeyDown.subscribe(handleKeyDown);
50
+ // we need a cell selection model
51
+ var cellSelectionModel = grid.getSelectionModel();
52
+ if (!cellSelectionModel) {
53
+ throw new Error("Selection model is mandatory for this plugin. Please set a selection model on the grid before adding this plugin: grid.setSelectionModel(new Slick.CellSelectionModel())");
54
+ }
55
+ // we give focus on the grid when a selection is done on it.
56
+ // without this, if the user selects a range of cell without giving focus on a particular cell, the grid doesn't get the focus and key stroke handles (ctrl+c) don't work
57
+ cellSelectionModel.onSelectedRangesChanged.subscribe(function (e, args) {
58
+ _grid.focus();
59
+ });
60
+ }
61
+ function destroy() {
62
+ _grid.onKeyDown.unsubscribe(handleKeyDown);
63
+ }
64
+ function getHeaderValueForColumn(columnDef) {
65
+ if (_options.headerColumnValueExtractor) {
66
+ var val = _options.headerColumnValueExtractor(columnDef);
67
+ if (val) {
68
+ return val;
69
+ }
70
+ }
71
+ return columnDef.name;
72
+ }
73
+ function getDataItemValueForColumn(item, columnDef, e) {
74
+ if (_options.dataItemColumnValueExtractor) {
75
+ var val = _options.dataItemColumnValueExtractor(item, columnDef);
76
+ if (val) {
77
+ return val;
78
+ }
79
+ }
80
+ var retVal = '';
81
+ // if a custom getter is not defined, we call serializeValue of the editor to serialize
82
+ if (columnDef.editor) {
83
+ var editorArgs = {
84
+ 'container': document.createElement('div'),
85
+ 'column': columnDef,
86
+ 'position': { 'top': 0, 'left': 0 },
87
+ 'grid': _grid,
88
+ 'event': e
89
+ };
90
+ var editor = new columnDef.editor(editorArgs);
91
+ editor.loadValue(item);
92
+ retVal = editor.serializeValue();
93
+ editor.destroy();
94
+ }
95
+ else {
96
+ retVal = item[columnDef.field];
97
+ }
98
+ return retVal;
99
+ }
100
+ function setDataItemValueForColumn(item, columnDef, value) {
101
+ if (columnDef.denyPaste) {
102
+ return null;
103
+ }
104
+ if (_options.dataItemColumnValueSetter) {
105
+ return _options.dataItemColumnValueSetter(item, columnDef, value);
106
+ }
107
+ // if a custom setter is not defined, we call applyValue of the editor to unserialize
108
+ if (columnDef.editor) {
109
+ var editorArgs = {
110
+ 'container': document.createElement('div'),
111
+ 'column': columnDef,
112
+ 'position': { 'top': 0, 'left': 0 },
113
+ 'grid': _grid
114
+ };
115
+ var editor = new columnDef.editor(editorArgs);
116
+ editor.loadValue(item);
117
+ editor.applyValue(item, value);
118
+ editor.destroy();
119
+ }
120
+ else {
121
+ item[columnDef.field] = value;
122
+ }
123
+ }
124
+ function _createTextBox(innerText) {
125
+ var ta = document.createElement('textarea');
126
+ ta.style.position = 'absolute';
127
+ ta.style.left = '-1000px';
128
+ ta.style.top = document.body.scrollTop + 'px';
129
+ ta.value = innerText;
130
+ _bodyElement.appendChild(ta);
131
+ ta.select();
132
+ return ta;
133
+ }
134
+ function _decodeTabularData(_grid, ta) {
135
+ var columns = _grid.getColumns();
136
+ var clipText = ta.value;
137
+ var clipRows = clipText.split(/[\n\f\r]/);
138
+ // trim trailing CR if present
139
+ if (clipRows[clipRows.length - 1] == "") {
140
+ clipRows.pop();
141
+ }
142
+ var clippedRange = [];
143
+ var j = 0;
144
+ _bodyElement.removeChild(ta);
145
+ for (var i = 0; i < clipRows.length; i++) {
146
+ if (clipRows[i] != "")
147
+ clippedRange[j++] = clipRows[i].split("\t");
148
+ else
149
+ clippedRange[i] = [""];
150
+ }
151
+ var selectedCell = _grid.getActiveCell();
152
+ var ranges = _grid.getSelectionModel().getSelectedRanges();
153
+ var selectedRange = ranges && ranges.length ? ranges[0] : null; // pick only one selection
154
+ var activeRow = null;
155
+ var activeCell = null;
156
+ if (selectedRange) {
157
+ activeRow = selectedRange.fromRow;
158
+ activeCell = selectedRange.fromCell;
159
+ }
160
+ else if (selectedCell) {
161
+ activeRow = selectedCell.row;
162
+ activeCell = selectedCell.cell;
163
+ }
164
+ else {
165
+ // we don't know where to paste
166
+ return;
167
+ }
168
+ var oneCellToMultiple = false;
169
+ var destH = clippedRange.length;
170
+ var destW = clippedRange.length ? clippedRange[0].length : 0;
171
+ if (clippedRange.length == 1 && clippedRange[0].length == 1 && selectedRange) {
172
+ oneCellToMultiple = true;
173
+ destH = selectedRange.toRow - selectedRange.fromRow + 1;
174
+ destW = selectedRange.toCell - selectedRange.fromCell + 1;
175
+ }
176
+ var availableRows = _grid.getData().length - activeRow;
177
+ var addRows = 0;
178
+ // ignore new rows if we don't have a "newRowCreator"
179
+ if (availableRows < destH && _options.newRowCreator) {
180
+ var d = _grid.getData();
181
+ for (addRows = 1; addRows <= destH - availableRows; addRows++)
182
+ d.push({});
183
+ _grid.setData(d);
184
+ _grid.render();
185
+ }
186
+ var overflowsBottomOfGrid = activeRow + destH > _grid.getDataLength();
187
+ if (_options.newRowCreator && overflowsBottomOfGrid) {
188
+ var newRowsNeeded = activeRow + destH - _grid.getDataLength();
189
+ _options.newRowCreator(newRowsNeeded);
190
+ }
191
+ var clipCommand = {
192
+ isClipboardCommand: true,
193
+ clippedRange: clippedRange,
194
+ oldValues: [],
195
+ cellExternalCopyManager: _self,
196
+ _options: _options,
197
+ setDataItemValueForColumn: setDataItemValueForColumn,
198
+ markCopySelection: markCopySelection,
199
+ oneCellToMultiple: oneCellToMultiple,
200
+ activeRow: activeRow,
201
+ activeCell: activeCell,
202
+ destH: destH,
203
+ destW: destW,
204
+ maxDestY: _grid.getDataLength(),
205
+ maxDestX: _grid.getColumns().length,
206
+ h: 0,
207
+ w: 0,
208
+ execute: function () {
209
+ this.h = 0;
210
+ for (var y = 0; y < this.destH; y++) {
211
+ this.oldValues[y] = [];
212
+ this.w = 0;
213
+ this.h++;
214
+ for (var x = 0; x < this.destW; x++) {
215
+ this.w++;
216
+ var desty = activeRow + y;
217
+ var destx = activeCell + x;
218
+ if (desty < this.maxDestY && destx < this.maxDestX) {
219
+ var nd = _grid.getCellNode(desty, destx);
220
+ var dt = _grid.getDataItem(desty);
221
+ this.oldValues[y][x] = dt[columns[destx]['field']];
222
+ if (oneCellToMultiple)
223
+ this.setDataItemValueForColumn(dt, columns[destx], clippedRange[0][0]);
224
+ else
225
+ this.setDataItemValueForColumn(dt, columns[destx], clippedRange[y] ? clippedRange[y][x] : '');
226
+ _grid.updateCell(desty, destx);
227
+ _grid.onCellChange.notify({
228
+ row: desty,
229
+ cell: destx,
230
+ item: dt,
231
+ grid: _grid
232
+ });
233
+ }
234
+ }
235
+ }
236
+ var bRange = {
237
+ 'fromCell': activeCell,
238
+ 'fromRow': activeRow,
239
+ 'toCell': activeCell + this.w - 1,
240
+ 'toRow': activeRow + this.h - 1
241
+ };
242
+ this.markCopySelection([bRange]);
243
+ _grid.getSelectionModel().setSelectedRanges([bRange]);
244
+ this.cellExternalCopyManager.onPasteCells.notify({ ranges: [bRange] });
245
+ },
246
+ undo: function () {
247
+ for (var y = 0; y < this.destH; y++) {
248
+ for (var x = 0; x < this.destW; x++) {
249
+ var desty = activeRow + y;
250
+ var destx = activeCell + x;
251
+ if (desty < this.maxDestY && destx < this.maxDestX) {
252
+ var nd = _grid.getCellNode(desty, destx);
253
+ var dt = _grid.getDataItem(desty);
254
+ if (oneCellToMultiple)
255
+ this.setDataItemValueForColumn(dt, columns[destx], this.oldValues[0][0]);
256
+ else
257
+ this.setDataItemValueForColumn(dt, columns[destx], this.oldValues[y][x]);
258
+ _grid.updateCell(desty, destx);
259
+ _grid.onCellChange.notify({
260
+ row: desty,
261
+ cell: destx,
262
+ item: dt,
263
+ grid: _grid
264
+ });
265
+ }
266
+ }
267
+ }
268
+ var bRange = {
269
+ 'fromCell': activeCell,
270
+ 'fromRow': activeRow,
271
+ 'toCell': activeCell + this.w - 1,
272
+ 'toRow': activeRow + this.h - 1
273
+ };
274
+ this.markCopySelection([bRange]);
275
+ _grid.getSelectionModel().setSelectedRanges([bRange]);
276
+ this.cellExternalCopyManager.onPasteCells.notify({ ranges: [bRange] });
277
+ if (addRows > 1) {
278
+ var d = _grid.getData();
279
+ for (; addRows > 1; addRows--)
280
+ d.splice(d.length - 1, 1);
281
+ _grid.setData(d);
282
+ _grid.render();
283
+ }
284
+ }
285
+ };
286
+ if (_options.clipboardCommandHandler) {
287
+ _options.clipboardCommandHandler(clipCommand);
288
+ }
289
+ else {
290
+ clipCommand.execute();
291
+ }
292
+ }
293
+ function handleKeyDown(e, args) {
294
+ var ranges;
295
+ if (!_grid.getEditorLock().isActive() || _grid.getOptions().autoEdit) {
296
+ if (e.which == keyCodes.ESC) {
297
+ if (_copiedRanges) {
298
+ e.preventDefault();
299
+ clearCopySelection();
300
+ _self.onCopyCancelled.notify({ ranges: _copiedRanges });
301
+ _copiedRanges = null;
302
+ }
303
+ }
304
+ if ((e.which === keyCodes.C || e.which === keyCodes.INSERT) && (e.ctrlKey || e.metaKey) && !e.shiftKey) { // CTRL+C or CTRL+INS
305
+ if (_onCopyInit) {
306
+ _onCopyInit.call();
307
+ }
308
+ ranges = _grid.getSelectionModel().getSelectedRanges();
309
+ if (ranges.length != 0) {
310
+ _copiedRanges = ranges;
311
+ markCopySelection(ranges);
312
+ _self.onCopyCells.notify({ ranges: ranges });
313
+ var columns = _grid.getColumns();
314
+ var clipText = "";
315
+ for (var rg = 0; rg < ranges.length; rg++) {
316
+ var range = ranges[rg];
317
+ var clipTextRows = [];
318
+ for (var i = range.fromRow; i < range.toRow + 1; i++) {
319
+ var clipTextCells = [];
320
+ var dt = _grid.getDataItem(i);
321
+ if (clipTextRows.length === 0 && _options.includeHeaderWhenCopying) {
322
+ var clipTextHeaders = [];
323
+ for (var j = range.fromCell; j < range.toCell + 1; j++) {
324
+ if (columns[j].name.length > 0)
325
+ clipTextHeaders.push(getHeaderValueForColumn(columns[j]));
326
+ }
327
+ clipTextRows.push(clipTextHeaders.join("\t"));
328
+ }
329
+ for (var j = range.fromCell; j < range.toCell + 1; j++) {
330
+ clipTextCells.push(getDataItemValueForColumn(dt, columns[j], e));
331
+ }
332
+ clipTextRows.push(clipTextCells.join("\t"));
333
+ }
334
+ clipText += clipTextRows.join("\r\n") + "\r\n";
335
+ }
336
+ // if (true) {
337
+ navigator.clipboard.writeText(clipText);
338
+ // }
339
+ // else {
340
+ // var focusEl = document.activeElement;
341
+ // var ta = _createTextBox(clipText);
342
+ // ta.focus();
343
+ // setTimeout(function () {
344
+ // _bodyElement.removeChild(ta);
345
+ // // restore focus
346
+ // if (focusEl)
347
+ // (focusEl.focus();
348
+ // else
349
+ // console.log("Not element to restore focus to after copy?");
350
+ // }, 100);
351
+ // if (_onCopySuccess) {
352
+ // var rowCount = 0;
353
+ // // If it's cell selection, use the toRow/fromRow fields
354
+ // if (ranges.length === 1) {
355
+ // rowCount = (ranges[0].toRow + 1) - ranges[0].fromRow;
356
+ // }
357
+ // else {
358
+ // rowCount = ranges.length;
359
+ // }
360
+ // _onCopySuccess.call(this, rowCount);
361
+ // }
362
+ // return false;
363
+ // }
364
+ }
365
+ }
366
+ if (!_options.readOnlyMode && ((e.which === keyCodes.V && (e.ctrlKey || e.metaKey) && !e.shiftKey)
367
+ || (e.which === keyCodes.INSERT && e.shiftKey && !e.ctrlKey))) { // CTRL+V or Shift+INS
368
+ var ta = _createTextBox('');
369
+ setTimeout(function () {
370
+ _decodeTabularData(_grid, ta);
371
+ }, 100);
372
+ return false;
373
+ }
374
+ }
375
+ }
376
+ function markCopySelection(ranges) {
377
+ clearCopySelection();
378
+ var columns = _grid.getColumns();
379
+ var hash = {};
380
+ for (var i = 0; i < ranges.length; i++) {
381
+ for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) {
382
+ hash[j] = {};
383
+ for (var k = ranges[i].fromCell; k <= ranges[i].toCell && k < columns.length; k++) {
384
+ hash[j][columns[k].id] = _copiedCellStyle;
385
+ }
386
+ }
387
+ }
388
+ _grid.setCellCssStyles(_copiedCellStyleLayerKey, hash);
389
+ clearTimeout(_clearCopyTI);
390
+ _clearCopyTI = window.setTimeout(function () {
391
+ _self.clearCopySelection();
392
+ }, 2000);
393
+ }
394
+ function clearCopySelection() {
395
+ _grid.removeCellCssStyles(_copiedCellStyleLayerKey);
396
+ }
397
+ function setIncludeHeaderWhenCopying(includeHeaderWhenCopying) {
398
+ _options.includeHeaderWhenCopying = includeHeaderWhenCopying;
399
+ }
400
+ $.shallowExtend(this, {
401
+ "init": init,
402
+ "destroy": destroy,
403
+ "pluginName": "CellExternalCopyManager",
404
+ "clearCopySelection": clearCopySelection,
405
+ "handleKeyDown": handleKeyDown,
406
+ "onCopyCells": new Slick.Event(),
407
+ "onCopyCancelled": new Slick.Event(),
408
+ "onPasteCells": new Slick.Event(),
409
+ "setIncludeHeaderWhenCopying": setIncludeHeaderWhenCopying
410
+ });
411
+ }
@@ -12,7 +12,7 @@ export interface ISlickCreatorOptions extends ISlickGridOptions {
12
12
  saveColumnsKey?: string;
13
13
  groupItemMetadataProvider?: any;
14
14
  getFilterValues?: (column: ISlickColumn) => Promise<{
15
- [key: string]: string;
15
+ [key: string]: any[];
16
16
  } | any[]>;
17
17
  showFilterDialog?: (column: ISlickColumn, grid: IJSLGrid<any>) => void;
18
18
  }
@@ -154,7 +154,8 @@ export function LookupEditor(args) {
154
154
  // (args.grid as ISlickGrid<any>).getContainerNode().appendChild(dom);
155
155
  // },
156
156
  onChange: function (e) {
157
- args.grid.getEditorLock().commitChangesOnly();
157
+ args.commitChangesOnly();
158
+ // args.grid.getEditorLock().commitChangesOnly();
158
159
  } }, args.column.editorOptions));
159
160
  //dropdown = DropDown(input, { ...{ data, searchable: false, defaultSelected: false, pagination: 100 }, ...args.column.editorOptions });
160
161
  new JSLRender(args.container, false).render(dropdown);
@@ -2957,9 +2957,16 @@ export function SlickGrid(container, data, columns, options) {
2957
2957
  }
2958
2958
  }
2959
2959
  function invalidate() {
2960
+ var currentActiveCell = null;
2961
+ if (currentEditor) {
2962
+ currentActiveCell = getActiveCell();
2963
+ }
2960
2964
  updateRowCount();
2961
2965
  invalidateAllRows();
2962
2966
  render();
2967
+ if (currentActiveCell) {
2968
+ makeActiveCellEditable(null, null, {});
2969
+ }
2963
2970
  }
2964
2971
  function invalidateAllRows() {
2965
2972
  if (currentEditor) {