handsontable 0.34.1 → 0.34.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/.travis.yml +2 -0
- package/README.md +127 -96
- package/commonjs/core.js +11 -6
- package/commonjs/helpers/dom/element.js +4 -3
- package/commonjs/helpers/mixed.js +8 -4
- package/commonjs/index.js +5 -4
- package/commonjs/pluginHooks.js +18 -2
- package/commonjs/plugins/copyPaste/clipboardData.js +31 -0
- package/commonjs/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/commonjs/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/commonjs/plugins/copyPaste/copyPaste.js +127 -134
- package/commonjs/plugins/copyPaste/pasteEvent.js +19 -0
- package/commonjs/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
- package/commonjs/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/commonjs/plugins/copyPaste/textarea.js +2 -1
- package/commonjs/plugins/manualColumnMove/manualColumnMove.js +8 -11
- package/commonjs/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/commonjs/plugins/manualRowMove/manualRowMove.js +9 -12
- package/commonjs/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
- package/commonjs/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
- package/commonjs/plugins/manualRowMove/ui/_base.js +2 -2
- package/commonjs/tableView.js +1 -0
- package/dist/handsontable.css +6 -5
- package/dist/handsontable.css.map +1 -1
- package/dist/handsontable.full.css +6 -5
- package/dist/handsontable.full.js +37721 -42290
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +5 -5
- package/dist/handsontable.js +28732 -28433
- package/dist/handsontable.js.map +1 -1
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +3 -3
- package/es/core.js +11 -6
- package/es/helpers/dom/element.js +4 -3
- package/es/helpers/mixed.js +4 -4
- package/es/index.js +3 -4
- package/es/pluginHooks.js +18 -2
- package/es/plugins/copyPaste/clipboardData.js +27 -0
- package/es/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/es/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/es/plugins/copyPaste/copyPaste.js +124 -132
- package/es/plugins/copyPaste/pasteEvent.js +11 -0
- package/es/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
- package/es/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/es/plugins/copyPaste/textarea.js +2 -1
- package/es/plugins/manualColumnMove/manualColumnMove.js +8 -11
- package/es/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/es/plugins/manualRowMove/manualRowMove.js +9 -12
- package/es/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
- package/es/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
- package/es/plugins/manualRowMove/ui/_base.js +2 -2
- package/es/tableView.js +1 -0
- package/handsontable.jquery.json +1 -1
- package/hot.config.js +1 -1
- package/package.json +5 -5
- package/src/3rdparty/walkontable/dist/walkontable.js +27234 -11175
- package/src/3rdparty/walkontable/dist/walkontable.js.map +1 -1
- package/src/3rdparty/walkontable/test/dist/helpers.entry.js +32 -36
- package/src/3rdparty/walkontable/test/dist/helpers.entry.js.map +1 -1
- package/src/3rdparty/walkontable/test/dist/specs.entry.js +36 -39
- package/src/3rdparty/walkontable/test/dist/specs.entry.js.map +1 -1
- package/src/core.js +11 -6
- package/src/css/handsontable.css +1 -2
- package/src/helpers/dom/element.js +4 -3
- package/src/helpers/mixed.js +3 -3
- package/src/index.js +1 -2
- package/src/pluginHooks.js +18 -2
- package/src/plugins/copyPaste/clipboardData.js +11 -0
- package/src/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/src/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/src/plugins/copyPaste/copyPaste.css +3 -1
- package/src/plugins/copyPaste/copyPaste.js +120 -127
- package/src/plugins/copyPaste/pasteEvent.js +7 -0
- package/src/plugins/copyPaste/test/copyPaste.e2e.js +75 -193
- package/src/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/src/plugins/copyPaste/textarea.js +2 -1
- package/src/plugins/manualColumnMove/manualColumnMove.js +6 -9
- package/src/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/src/plugins/manualRowMove/manualRowMove.js +7 -10
- package/src/plugins/manualRowMove/test/manualRowMove.e2e.js +282 -86
- package/src/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +51 -190
- package/src/plugins/manualRowMove/ui/_base.js +2 -2
- package/test/dist/e2e.entry.js +31381 -31131
- package/test/dist/e2e.entry.js.map +1 -1
- package/test/dist/helpers.entry.js +16 -19
- package/test/dist/helpers.entry.js.map +1 -1
- package/test/e2e/Core_listen.spec.js +32 -0
- package/test/e2e/Core_selection.spec.js +1 -1
- package/test/e2e/Core_validate.spec.js +29 -0
- package/test/e2e/renderers/checkboxRenderer.spec.js +20 -7
- package/test/e2e/settings/fragmentSelection.spec.js +12 -9
- package/test/scripts/trigger-pro-tests.sh +41 -0
- package/yarn.lock +260 -208
- package/.npmignore +0 -19
- package/demo/bower_components/numbro/package.json +0 -63
@@ -22,16 +22,12 @@ var _SheetClip2 = _interopRequireDefault(_SheetClip);
|
|
22
22
|
|
23
23
|
var _src = require('./../../3rdparty/walkontable/src');
|
24
24
|
|
25
|
-
var _unicode = require('./../../helpers/unicode');
|
26
|
-
|
27
25
|
var _element = require('./../../helpers/dom/element');
|
28
26
|
|
29
27
|
var _array = require('./../../helpers/array');
|
30
28
|
|
31
29
|
var _number = require('./../../helpers/number');
|
32
30
|
|
33
|
-
var _event = require('./../../helpers/dom/event');
|
34
|
-
|
35
31
|
var _plugins = require('./../../plugins');
|
36
32
|
|
37
33
|
var _textarea = require('./textarea');
|
@@ -50,6 +46,10 @@ var _eventManager = require('./../../eventManager');
|
|
50
46
|
|
51
47
|
var _eventManager2 = _interopRequireDefault(_eventManager);
|
52
48
|
|
49
|
+
var _pasteEvent = require('./pasteEvent');
|
50
|
+
|
51
|
+
var _pasteEvent2 = _interopRequireDefault(_pasteEvent);
|
52
|
+
|
53
53
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
54
54
|
|
55
55
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -143,7 +143,10 @@ var CopyPaste = function (_BasePlugin) {
|
|
143
143
|
_this.textarea = void 0;
|
144
144
|
|
145
145
|
privatePool.set(_this, {
|
146
|
-
|
146
|
+
isTriggeredByCopy: false,
|
147
|
+
isTriggeredByCut: false,
|
148
|
+
isBeginEditing: false,
|
149
|
+
isFragmentSelectionEnabled: false
|
147
150
|
});
|
148
151
|
return _this;
|
149
152
|
}
|
@@ -173,10 +176,11 @@ var CopyPaste = function (_BasePlugin) {
|
|
173
176
|
if (this.enabled) {
|
174
177
|
return;
|
175
178
|
}
|
176
|
-
|
177
179
|
var settings = this.hot.getSettings();
|
180
|
+
var priv = privatePool.get(this);
|
178
181
|
|
179
182
|
this.textarea = _textarea2.default.getSingleton();
|
183
|
+
priv.isFragmentSelectionEnabled = settings.fragmentSelection;
|
180
184
|
|
181
185
|
if (_typeof(settings.copyPaste) === 'object') {
|
182
186
|
this.pasteMode = settings.copyPaste.pasteMode || this.pasteMode;
|
@@ -187,14 +191,15 @@ var CopyPaste = function (_BasePlugin) {
|
|
187
191
|
this.addHook('afterContextMenuDefaultOptions', function (options) {
|
188
192
|
return _this2.onAfterContextMenuDefaultOptions(options);
|
189
193
|
});
|
190
|
-
this.addHook('
|
191
|
-
return _this2.
|
194
|
+
this.addHook('afterSelectionEnd', function () {
|
195
|
+
return _this2.onAfterSelectionEnd();
|
192
196
|
});
|
193
197
|
|
194
198
|
this.registerEvents();
|
195
199
|
|
196
200
|
_get(CopyPaste.prototype.__proto__ || Object.getPrototypeOf(CopyPaste.prototype), 'enablePlugin', this).call(this);
|
197
201
|
}
|
202
|
+
|
198
203
|
/**
|
199
204
|
* Updates the plugin to use the latest options you have specified.
|
200
205
|
*/
|
@@ -258,10 +263,6 @@ var CopyPaste = function (_BasePlugin) {
|
|
258
263
|
|
259
264
|
this.copyableRanges = this.hot.runHooks('modifyCopyableRange', this.copyableRanges);
|
260
265
|
|
261
|
-
var copyableData = this.getRangedCopyableData(this.copyableRanges);
|
262
|
-
|
263
|
-
this.textarea.setValue(copyableData);
|
264
|
-
|
265
266
|
if (endRow !== finalEndRow || endCol !== finalEndCol) {
|
266
267
|
this.hot.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, this.rowsLimit, this.columnsLimit);
|
267
268
|
}
|
@@ -357,57 +358,32 @@ var CopyPaste = function (_BasePlugin) {
|
|
357
358
|
|
358
359
|
/**
|
359
360
|
* Copy action.
|
360
|
-
*
|
361
|
-
* @param {Boolean} isTriggeredByClick Flag to determine that copy action was executed by the mouse click.
|
362
361
|
*/
|
363
362
|
|
364
363
|
}, {
|
365
364
|
key: 'copy',
|
366
|
-
value: function copy(
|
367
|
-
var
|
368
|
-
|
369
|
-
var allowCopying = !!this.hot.runHooks('beforeCopy', rangedData, this.copyableRanges);
|
370
|
-
|
371
|
-
if (allowCopying) {
|
372
|
-
this.textarea.setValue(_SheetClip2.default.stringify(rangedData));
|
373
|
-
this.textarea.select();
|
365
|
+
value: function copy() {
|
366
|
+
var priv = privatePool.get(this);
|
374
367
|
|
375
|
-
|
376
|
-
document.execCommand('copy');
|
377
|
-
}
|
368
|
+
priv.isTriggeredByCopy = true;
|
378
369
|
|
379
|
-
|
380
|
-
|
381
|
-
this.textarea.setValue('');
|
382
|
-
}
|
370
|
+
this.textarea.select();
|
371
|
+
document.execCommand('copy');
|
383
372
|
}
|
384
373
|
|
385
374
|
/**
|
386
375
|
* Cut action.
|
387
|
-
*
|
388
|
-
* @param {Boolean} isTriggeredByClick Flag to determine that cut action was executed by the mouse click.
|
389
376
|
*/
|
390
377
|
|
391
378
|
}, {
|
392
379
|
key: 'cut',
|
393
|
-
value: function cut(
|
394
|
-
var
|
395
|
-
|
396
|
-
var allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges);
|
397
|
-
|
398
|
-
if (allowCuttingOut) {
|
399
|
-
this.textarea.setValue(_SheetClip2.default.stringify(rangedData));
|
400
|
-
this.hot.selection.empty();
|
401
|
-
this.textarea.select();
|
380
|
+
value: function cut() {
|
381
|
+
var priv = privatePool.get(this);
|
402
382
|
|
403
|
-
|
404
|
-
document.execCommand('cut');
|
405
|
-
}
|
383
|
+
priv.isTriggeredByCut = true;
|
406
384
|
|
407
|
-
|
408
|
-
|
409
|
-
this.textarea.setValue('');
|
410
|
-
}
|
385
|
+
this.textarea.select();
|
386
|
+
document.execCommand('cut');
|
411
387
|
}
|
412
388
|
|
413
389
|
/**
|
@@ -421,10 +397,10 @@ var CopyPaste = function (_BasePlugin) {
|
|
421
397
|
value: function paste() {
|
422
398
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
423
399
|
|
424
|
-
|
400
|
+
var pasteData = new _pasteEvent2.default();
|
401
|
+
pasteData.clipboardData.setData('text/plain', value);
|
425
402
|
|
426
|
-
this.onPaste();
|
427
|
-
this.onInput();
|
403
|
+
this.onPaste(pasteData);
|
428
404
|
}
|
429
405
|
|
430
406
|
/**
|
@@ -441,71 +417,124 @@ var CopyPaste = function (_BasePlugin) {
|
|
441
417
|
this.eventManager.addEventListener(this.textarea.element, 'paste', function (event) {
|
442
418
|
return _this5.onPaste(event);
|
443
419
|
});
|
444
|
-
this.eventManager.addEventListener(this.textarea.element, '
|
445
|
-
return _this5.
|
420
|
+
this.eventManager.addEventListener(this.textarea.element, 'cut', function (event) {
|
421
|
+
return _this5.onCut(event);
|
422
|
+
});
|
423
|
+
this.eventManager.addEventListener(this.textarea.element, 'copy', function (event) {
|
424
|
+
return _this5.onCopy(event);
|
446
425
|
});
|
447
426
|
}
|
448
427
|
|
449
428
|
/**
|
450
|
-
*
|
429
|
+
* `copy` event callback on textarea element.
|
451
430
|
*
|
431
|
+
* @param {Event} event ClipboardEvent.
|
452
432
|
* @private
|
453
433
|
*/
|
454
434
|
|
455
435
|
}, {
|
456
|
-
key: '
|
457
|
-
value: function
|
458
|
-
|
436
|
+
key: 'onCopy',
|
437
|
+
value: function onCopy(event) {
|
438
|
+
var priv = privatePool.get(this);
|
459
439
|
|
460
|
-
this.
|
440
|
+
if (!this.hot.isListening() && !priv.isTriggeredByCopy) {
|
441
|
+
return;
|
442
|
+
}
|
443
|
+
|
444
|
+
this.setCopyableText();
|
445
|
+
priv.isTriggeredByCopy = false;
|
446
|
+
|
447
|
+
var rangedData = this.getRangedData(this.copyableRanges);
|
448
|
+
var allowCopying = !!this.hot.runHooks('beforeCopy', rangedData, this.copyableRanges);
|
449
|
+
var value = '';
|
450
|
+
|
451
|
+
if (allowCopying) {
|
452
|
+
value = _SheetClip2.default.stringify(rangedData);
|
453
|
+
|
454
|
+
if (event && event.clipboardData) {
|
455
|
+
event.clipboardData.setData('text/plain', value);
|
456
|
+
} else if (typeof ClipboardEvent === 'undefined') {
|
457
|
+
window.clipboardData.setData('Text', value);
|
458
|
+
}
|
459
|
+
|
460
|
+
this.hot.runHooks('afterCopy', rangedData, this.copyableRanges);
|
461
|
+
}
|
462
|
+
|
463
|
+
event.preventDefault();
|
461
464
|
}
|
462
465
|
|
463
466
|
/**
|
464
|
-
* `
|
467
|
+
* `cut` event callback on textarea element.
|
465
468
|
*
|
469
|
+
* @param {Event} event ClipboardEvent.
|
466
470
|
* @private
|
467
471
|
*/
|
468
472
|
|
469
473
|
}, {
|
470
|
-
key: '
|
471
|
-
value: function
|
474
|
+
key: 'onCut',
|
475
|
+
value: function onCut(event) {
|
472
476
|
var priv = privatePool.get(this);
|
473
477
|
|
474
|
-
priv.
|
478
|
+
if (!this.hot.isListening() && !priv.isTriggeredByCut) {
|
479
|
+
return;
|
480
|
+
}
|
481
|
+
|
482
|
+
this.setCopyableText();
|
483
|
+
priv.isTriggeredByCut = false;
|
484
|
+
|
485
|
+
var rangedData = this.getRangedData(this.copyableRanges);
|
486
|
+
var allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges);
|
487
|
+
var value = void 0;
|
488
|
+
|
489
|
+
if (allowCuttingOut) {
|
490
|
+
value = _SheetClip2.default.stringify(rangedData);
|
491
|
+
|
492
|
+
if (event && event.clipboardData) {
|
493
|
+
event.clipboardData.setData('text/plain', value);
|
494
|
+
} else if (typeof ClipboardEvent === 'undefined') {
|
495
|
+
window.clipboardData.setData('Text', value);
|
496
|
+
}
|
497
|
+
|
498
|
+
this.hot.selection.empty();
|
499
|
+
this.hot.runHooks('afterCut', rangedData, this.copyableRanges);
|
500
|
+
}
|
501
|
+
|
502
|
+
event.preventDefault();
|
475
503
|
}
|
476
504
|
|
477
505
|
/**
|
478
|
-
* `
|
506
|
+
* `paste` event callback on textarea element.
|
479
507
|
*
|
508
|
+
* @param {Event} event ClipboardEvent or pseudo ClipboardEvent, if paste was called manually.
|
480
509
|
* @private
|
481
510
|
*/
|
482
511
|
|
483
512
|
}, {
|
484
|
-
key: '
|
485
|
-
value: function
|
513
|
+
key: 'onPaste',
|
514
|
+
value: function onPaste(event) {
|
486
515
|
var _this6 = this;
|
487
516
|
|
488
|
-
|
489
|
-
|
490
|
-
if (!this.hot.isListening() || !priv.isTriggeredByPaste) {
|
517
|
+
if (!this.hot.isListening()) {
|
491
518
|
return;
|
492
519
|
}
|
520
|
+
if (event && event.preventDefault) {
|
521
|
+
event.preventDefault();
|
522
|
+
}
|
523
|
+
|
524
|
+
var inputArray = void 0;
|
493
525
|
|
494
|
-
|
526
|
+
if (event && typeof event.clipboardData !== 'undefined') {
|
527
|
+
this.textarea.setValue(event.clipboardData.getData('text/plain'));
|
528
|
+
} else if (typeof ClipboardEvent === 'undefined' && typeof window.clipboardData !== 'undefined') {
|
529
|
+
this.textarea.setValue(window.clipboardData.getData('Text'));
|
530
|
+
}
|
495
531
|
|
496
|
-
|
497
|
-
|
498
|
-
selected = void 0,
|
499
|
-
coordsFrom = void 0,
|
500
|
-
coordsTo = void 0,
|
501
|
-
cellRange = void 0,
|
502
|
-
topLeftCorner = void 0,
|
503
|
-
bottomRightCorner = void 0,
|
504
|
-
areaStart = void 0,
|
505
|
-
areaEnd = void 0;
|
532
|
+
inputArray = _SheetClip2.default.parse(this.textarea.getValue());
|
533
|
+
this.textarea.setValue(' ');
|
506
534
|
|
507
|
-
|
508
|
-
|
535
|
+
if (inputArray.length === 0) {
|
536
|
+
return;
|
537
|
+
}
|
509
538
|
|
510
539
|
var allowPasting = !!this.hot.runHooks('beforePaste', inputArray, this.copyableRanges);
|
511
540
|
|
@@ -513,19 +542,19 @@ var CopyPaste = function (_BasePlugin) {
|
|
513
542
|
return;
|
514
543
|
}
|
515
544
|
|
516
|
-
selected = this.hot.getSelected();
|
517
|
-
coordsFrom = new _src.CellCoords(selected[0], selected[1]);
|
518
|
-
coordsTo = new _src.CellCoords(selected[2], selected[3]);
|
519
|
-
cellRange = new _src.CellRange(coordsFrom, coordsFrom, coordsTo);
|
520
|
-
topLeftCorner = cellRange.getTopLeftCorner();
|
521
|
-
bottomRightCorner = cellRange.getBottomRightCorner();
|
522
|
-
areaStart = topLeftCorner;
|
523
|
-
areaEnd = new _src.CellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));
|
545
|
+
var selected = this.hot.getSelected();
|
546
|
+
var coordsFrom = new _src.CellCoords(selected[0], selected[1]);
|
547
|
+
var coordsTo = new _src.CellCoords(selected[2], selected[3]);
|
548
|
+
var cellRange = new _src.CellRange(coordsFrom, coordsFrom, coordsTo);
|
549
|
+
var topLeftCorner = cellRange.getTopLeftCorner();
|
550
|
+
var bottomRightCorner = cellRange.getBottomRightCorner();
|
551
|
+
var areaStart = topLeftCorner;
|
552
|
+
var areaEnd = new _src.CellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));
|
524
553
|
|
525
554
|
var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1;
|
526
555
|
var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1;
|
527
556
|
|
528
|
-
this.hot.addHookOnce('afterChange', function (changes
|
557
|
+
this.hot.addHookOnce('afterChange', function (changes) {
|
529
558
|
var changesLength = changes ? changes.length : 0;
|
530
559
|
|
531
560
|
if (changesLength) {
|
@@ -569,62 +598,26 @@ var CopyPaste = function (_BasePlugin) {
|
|
569
598
|
}
|
570
599
|
|
571
600
|
/**
|
572
|
-
*
|
601
|
+
* We have to keep focus on textarea element, to make possible use of the browser tools (copy, cut, paste).
|
573
602
|
*
|
574
603
|
* @private
|
575
|
-
* @param {Event} event
|
576
604
|
*/
|
577
605
|
|
578
606
|
}, {
|
579
|
-
key: '
|
580
|
-
value: function
|
581
|
-
var
|
607
|
+
key: 'onAfterSelectionEnd',
|
608
|
+
value: function onAfterSelectionEnd() {
|
609
|
+
var priv = privatePool.get(this);
|
610
|
+
var editor = this.hot.getActiveEditor();
|
582
611
|
|
583
|
-
if (
|
612
|
+
if (editor && typeof editor.isOpened !== 'undefined' && editor.isOpened()) {
|
584
613
|
return;
|
585
614
|
}
|
586
|
-
if (this.
|
615
|
+
if (priv.isFragmentSelectionEnabled && !this.textarea.isActive() && (0, _element.getSelectionText)()) {
|
587
616
|
return;
|
588
617
|
}
|
589
|
-
if ((0, _event.isImmediatePropagationStopped)(event)) {
|
590
|
-
return;
|
591
|
-
}
|
592
|
-
if (!this.textarea.isActive() && (0, _element.getSelectionText)()) {
|
593
|
-
return;
|
594
|
-
}
|
595
|
-
|
596
|
-
if ((0, _unicode.isCtrlKey)(event.keyCode)) {
|
597
|
-
// When fragmentSelection is enabled and some text is selected then don't blur selection calling 'setCopyableText'
|
598
|
-
if (this.hot.getSettings().fragmentSelection && (0, _element.getSelectionText)()) {
|
599
|
-
return;
|
600
|
-
}
|
601
618
|
|
602
|
-
|
603
|
-
|
604
|
-
(0, _event.stopImmediatePropagation)(event);
|
605
|
-
|
606
|
-
return;
|
607
|
-
}
|
608
|
-
|
609
|
-
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
610
|
-
var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
|
611
|
-
|
612
|
-
if (ctrlDown) {
|
613
|
-
if (event.keyCode == _unicode.KEY_CODES.A) {
|
614
|
-
setTimeout(function () {
|
615
|
-
_this7.setCopyableText();
|
616
|
-
}, 0);
|
617
|
-
}
|
618
|
-
if (event.keyCode == _unicode.KEY_CODES.X) {
|
619
|
-
this.cut();
|
620
|
-
}
|
621
|
-
if (event.keyCode == _unicode.KEY_CODES.C) {
|
622
|
-
this.copy();
|
623
|
-
}
|
624
|
-
if (event.keyCode == _unicode.KEY_CODES.V) {
|
625
|
-
this.triggerPaste();
|
626
|
-
}
|
627
|
-
}
|
619
|
+
this.setCopyableText();
|
620
|
+
this.textarea.select();
|
628
621
|
}
|
629
622
|
|
630
623
|
/**
|
@@ -0,0 +1,19 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _clipboardData = require('./clipboardData');
|
6
|
+
|
7
|
+
var _clipboardData2 = _interopRequireDefault(_clipboardData);
|
8
|
+
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
+
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12
|
+
|
13
|
+
var PasteEvent = function PasteEvent() {
|
14
|
+
_classCallCheck(this, PasteEvent);
|
15
|
+
|
16
|
+
this.clipboardData = new _clipboardData2.default();
|
17
|
+
};
|
18
|
+
|
19
|
+
exports.default = PasteEvent;
|