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.

Files changed (95) hide show
  1. package/.travis.yml +2 -0
  2. package/README.md +127 -96
  3. package/commonjs/core.js +11 -6
  4. package/commonjs/helpers/dom/element.js +4 -3
  5. package/commonjs/helpers/mixed.js +8 -4
  6. package/commonjs/index.js +5 -4
  7. package/commonjs/pluginHooks.js +18 -2
  8. package/commonjs/plugins/copyPaste/clipboardData.js +31 -0
  9. package/commonjs/plugins/copyPaste/contextMenuItem/copy.js +1 -2
  10. package/commonjs/plugins/copyPaste/contextMenuItem/cut.js +1 -2
  11. package/commonjs/plugins/copyPaste/copyPaste.js +127 -134
  12. package/commonjs/plugins/copyPaste/pasteEvent.js +19 -0
  13. package/commonjs/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
  14. package/commonjs/plugins/copyPaste/test/textarea.unit.js +2 -2
  15. package/commonjs/plugins/copyPaste/textarea.js +2 -1
  16. package/commonjs/plugins/manualColumnMove/manualColumnMove.js +8 -11
  17. package/commonjs/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
  18. package/commonjs/plugins/manualRowMove/manualRowMove.js +9 -12
  19. package/commonjs/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
  20. package/commonjs/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
  21. package/commonjs/plugins/manualRowMove/ui/_base.js +2 -2
  22. package/commonjs/tableView.js +1 -0
  23. package/dist/handsontable.css +6 -5
  24. package/dist/handsontable.css.map +1 -1
  25. package/dist/handsontable.full.css +6 -5
  26. package/dist/handsontable.full.js +37721 -42290
  27. package/dist/handsontable.full.min.css +4 -4
  28. package/dist/handsontable.full.min.js +5 -5
  29. package/dist/handsontable.js +28732 -28433
  30. package/dist/handsontable.js.map +1 -1
  31. package/dist/handsontable.min.css +4 -4
  32. package/dist/handsontable.min.js +3 -3
  33. package/es/core.js +11 -6
  34. package/es/helpers/dom/element.js +4 -3
  35. package/es/helpers/mixed.js +4 -4
  36. package/es/index.js +3 -4
  37. package/es/pluginHooks.js +18 -2
  38. package/es/plugins/copyPaste/clipboardData.js +27 -0
  39. package/es/plugins/copyPaste/contextMenuItem/copy.js +1 -2
  40. package/es/plugins/copyPaste/contextMenuItem/cut.js +1 -2
  41. package/es/plugins/copyPaste/copyPaste.js +124 -132
  42. package/es/plugins/copyPaste/pasteEvent.js +11 -0
  43. package/es/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
  44. package/es/plugins/copyPaste/test/textarea.unit.js +2 -2
  45. package/es/plugins/copyPaste/textarea.js +2 -1
  46. package/es/plugins/manualColumnMove/manualColumnMove.js +8 -11
  47. package/es/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
  48. package/es/plugins/manualRowMove/manualRowMove.js +9 -12
  49. package/es/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
  50. package/es/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
  51. package/es/plugins/manualRowMove/ui/_base.js +2 -2
  52. package/es/tableView.js +1 -0
  53. package/handsontable.jquery.json +1 -1
  54. package/hot.config.js +1 -1
  55. package/package.json +5 -5
  56. package/src/3rdparty/walkontable/dist/walkontable.js +27234 -11175
  57. package/src/3rdparty/walkontable/dist/walkontable.js.map +1 -1
  58. package/src/3rdparty/walkontable/test/dist/helpers.entry.js +32 -36
  59. package/src/3rdparty/walkontable/test/dist/helpers.entry.js.map +1 -1
  60. package/src/3rdparty/walkontable/test/dist/specs.entry.js +36 -39
  61. package/src/3rdparty/walkontable/test/dist/specs.entry.js.map +1 -1
  62. package/src/core.js +11 -6
  63. package/src/css/handsontable.css +1 -2
  64. package/src/helpers/dom/element.js +4 -3
  65. package/src/helpers/mixed.js +3 -3
  66. package/src/index.js +1 -2
  67. package/src/pluginHooks.js +18 -2
  68. package/src/plugins/copyPaste/clipboardData.js +11 -0
  69. package/src/plugins/copyPaste/contextMenuItem/copy.js +1 -2
  70. package/src/plugins/copyPaste/contextMenuItem/cut.js +1 -2
  71. package/src/plugins/copyPaste/copyPaste.css +3 -1
  72. package/src/plugins/copyPaste/copyPaste.js +120 -127
  73. package/src/plugins/copyPaste/pasteEvent.js +7 -0
  74. package/src/plugins/copyPaste/test/copyPaste.e2e.js +75 -193
  75. package/src/plugins/copyPaste/test/textarea.unit.js +2 -2
  76. package/src/plugins/copyPaste/textarea.js +2 -1
  77. package/src/plugins/manualColumnMove/manualColumnMove.js +6 -9
  78. package/src/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
  79. package/src/plugins/manualRowMove/manualRowMove.js +7 -10
  80. package/src/plugins/manualRowMove/test/manualRowMove.e2e.js +282 -86
  81. package/src/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +51 -190
  82. package/src/plugins/manualRowMove/ui/_base.js +2 -2
  83. package/test/dist/e2e.entry.js +31381 -31131
  84. package/test/dist/e2e.entry.js.map +1 -1
  85. package/test/dist/helpers.entry.js +16 -19
  86. package/test/dist/helpers.entry.js.map +1 -1
  87. package/test/e2e/Core_listen.spec.js +32 -0
  88. package/test/e2e/Core_selection.spec.js +1 -1
  89. package/test/e2e/Core_validate.spec.js +29 -0
  90. package/test/e2e/renderers/checkboxRenderer.spec.js +20 -7
  91. package/test/e2e/settings/fragmentSelection.spec.js +12 -9
  92. package/test/scripts/trigger-pro-tests.sh +41 -0
  93. package/yarn.lock +260 -208
  94. package/.npmignore +0 -19
  95. package/demo/bower_components/numbro/package.json +0 -63
@@ -54,7 +54,7 @@ describe('manualRowMove', function () {
54
54
  manualRowMove: true
55
55
  });
56
56
 
57
- var $headers = [this.$container.find('tbody tr:eq(0) th:eq(0)'), this.$container.find('tbody tr:eq(1) th:eq(0)'), this.$container.find('tbody tr:eq(2) th:eq(0)')];
57
+ var $headers = [spec().$container.find('tbody tr:eq(0) th:eq(0)'), spec().$container.find('tbody tr:eq(1) th:eq(0)'), spec().$container.find('tbody tr:eq(2) th:eq(0)')];
58
58
 
59
59
  $headers[0].simulate('mousedown');
60
60
  $headers[0].simulate('mouseup');
@@ -66,202 +66,60 @@ describe('manualRowMove', function () {
66
66
  expect(spec().$container.find('.ht__manualRowMove--backlight:visible').length).toBe(1);
67
67
  });
68
68
 
69
- it('should run `beforeRowMove` with proper `target` parameter (moving row above first header)', function () {
70
- var targetParameterInsideCallback = void 0;
69
+ describe('backlight', function () {
70
+ it('should set proper left position of element when colWidths is undefined', function () {
71
+ handsontable({
72
+ data: Handsontable.helper.createSpreadsheetData(10, 10),
73
+ rowHeaders: true,
74
+ manualRowMove: true
75
+ });
71
76
 
72
- handsontable({
73
- data: Handsontable.helper.createSpreadsheetData(30, 30),
74
- rowHeaders: true,
75
- colHeaders: true,
76
- manualRowMove: true,
77
- beforeRowMove: function beforeRowMove(rows, target) {
78
- targetParameterInsideCallback = target;
79
- }
80
- });
81
- var $fistHeader = this.$container.find('tbody tr:eq(0) th:eq(0)');
77
+ var $headerTH = spec().$container.find('tbody tr:eq(0) th:eq(0)');
82
78
 
83
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
84
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mouseup');
85
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
79
+ $headerTH.simulate('mousedown');
80
+ $headerTH.simulate('mouseup');
81
+ $headerTH.simulate('mousedown');
86
82
 
87
- $fistHeader.simulate('mouseover');
88
- $fistHeader.simulate('mousemove', {
89
- clientY: $fistHeader.offset().bottom - $fistHeader.height() - 50
83
+ expect(spec().$container.find('.ht__manualRowMove--backlight')[0].offsetLeft).toBe(50);
90
84
  });
91
- $fistHeader.simulate('mouseup');
92
85
 
93
- expect(targetParameterInsideCallback).toEqual(0);
94
- });
86
+ it('should set proper left position of element when colWidths is defined', function () {
87
+ handsontable({
88
+ data: Handsontable.helper.createSpreadsheetData(10, 10),
89
+ rowHeaders: true,
90
+ manualRowMove: true,
91
+ colWidths: 100
92
+ });
95
93
 
96
- it('should run `beforeRowMove` with proper `target` parameter (moving row to the top of first header)', function () {
97
- var targetParameterInsideCallback = void 0;
94
+ var $headerTH = spec().$container.find('tbody tr:eq(0) th:eq(0)');
98
95
 
99
- handsontable({
100
- data: Handsontable.helper.createSpreadsheetData(30, 30),
101
- rowHeaders: true,
102
- manualRowMove: true,
103
- colHeaders: true,
104
- beforeRowMove: function beforeRowMove(rows, target) {
105
- targetParameterInsideCallback = target;
106
- }
107
- });
108
- var $fistHeader = this.$container.find('tbody tr:eq(0) th:eq(0)');
96
+ $headerTH.simulate('mousedown');
97
+ $headerTH.simulate('mouseup');
98
+ $headerTH.simulate('mousedown');
109
99
 
110
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
111
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mouseup');
112
- this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
113
-
114
- $fistHeader.simulate('mouseover');
115
- $fistHeader.simulate('mousemove', {
116
- clientY: $fistHeader.offset().bottom - $fistHeader.height()
117
- });
118
- $fistHeader.simulate('mouseup');
119
-
120
- expect(targetParameterInsideCallback).toEqual(0);
121
- });
122
-
123
- it('should run `beforeRowMove` with proper `target` parameter (moving row to the middle of the table)', function () {
124
- var targetParameterInsideCallback = void 0;
125
-
126
- handsontable({
127
- data: Handsontable.helper.createSpreadsheetData(30, 30),
128
- rowHeaders: true,
129
- manualRowMove: true,
130
- beforeRowMove: function beforeRowMove(rows, target) {
131
- targetParameterInsideCallback = target;
132
- }
100
+ expect(spec().$container.find('.ht__manualRowMove--backlight')[0].offsetLeft).toBe(50);
133
101
  });
134
-
135
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
136
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
137
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
138
-
139
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
140
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
141
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
142
-
143
- expect(targetParameterInsideCallback).toEqual(2);
144
102
  });
145
103
 
146
- it('should run `beforeRowMove` with proper `target` parameter (moving row to the top of last header)', function () {
147
- var targetParameterInsideCallback = void 0;
148
-
149
- handsontable({
150
- data: Handsontable.helper.createSpreadsheetData(30, 30),
151
- rowHeaders: true,
152
- manualRowMove: true,
153
- beforeRowMove: function beforeRowMove(rows, target) {
154
- targetParameterInsideCallback = target;
155
- }
156
- });
104
+ describe('guideline', function () {
105
+ it('should set proper top position of element when target is first row and column headers are disabled', function () {
106
+ handsontable({
107
+ data: Handsontable.helper.createSpreadsheetData(10, 10),
108
+ rowHeaders: true,
109
+ colHeaders: false,
110
+ manualRowMove: true
111
+ });
157
112
 
158
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
159
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
160
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
113
+ var $headers = [spec().$container.find('tbody tr:eq(0) th:eq(0)'), spec().$container.find('tbody tr:eq(1) th:eq(0)')];
161
114
 
162
- this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mouseover');
163
- this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mousemove');
164
- this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mouseup');
115
+ $headers[1].simulate('mousedown');
116
+ $headers[1].simulate('mouseup');
117
+ $headers[1].simulate('mousedown');
118
+ $headers[0].simulate('mouseover');
119
+ $headers[0].simulate('mousemove');
165
120
 
166
- expect(targetParameterInsideCallback).toEqual(29);
167
- });
168
-
169
- it('should run `beforeRowMove` with proper `target` parameter (moving row to the bottom of last header)', function () {
170
- var targetParameterInsideCallback = void 0;
171
-
172
- handsontable({
173
- data: Handsontable.helper.createSpreadsheetData(30, 30),
174
- rowHeaders: true,
175
- manualRowMove: true,
176
- beforeRowMove: function beforeRowMove(rows, target) {
177
- targetParameterInsideCallback = target;
178
- }
121
+ expect(spec().$container.find('.ht__manualRowMove--guideline')[0].offsetTop).toBe(-1);
179
122
  });
180
- var $lastHeader = this.$container.find('tbody tr:eq(29) th:eq(0)');
181
-
182
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
183
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
184
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
185
-
186
- $lastHeader.simulate('mouseover');
187
- $lastHeader.simulate('mousemove', {
188
- clientY: $lastHeader.offset().top + $lastHeader.height()
189
- });
190
- $lastHeader.simulate('mouseup');
191
-
192
- expect(targetParameterInsideCallback).toEqual(30);
193
- });
194
-
195
- it('should run `beforeRowMove` with proper `target` parameter (moving row below last header)', function () {
196
- var targetParameterInsideCallback = void 0;
197
-
198
- handsontable({
199
- data: Handsontable.helper.createSpreadsheetData(30, 30),
200
- rowHeaders: true,
201
- manualRowMove: true,
202
- beforeRowMove: function beforeRowMove(rows, target) {
203
- targetParameterInsideCallback = target;
204
- }
205
- });
206
- var $lastHeader = this.$container.find('tbody tr:eq(29) th:eq(0)');
207
-
208
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
209
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
210
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
211
-
212
- $lastHeader.simulate('mouseover');
213
- $lastHeader.simulate('mousemove', {
214
- clientY: $lastHeader.offset().top + $lastHeader.height() + 200
215
- });
216
- $lastHeader.simulate('mouseup');
217
-
218
- expect(targetParameterInsideCallback).toEqual(30);
219
- });
220
-
221
- it('should run `beforeRowMove` with proper visual `target` parameter', function () {
222
- var targetParameterInsideCallback = void 0;
223
-
224
- handsontable({
225
- data: Handsontable.helper.createSpreadsheetData(30, 30),
226
- rowHeaders: true,
227
- manualRowMove: [1, 2, 0],
228
- beforeRowMove: function beforeRowMove(rows, target) {
229
- targetParameterInsideCallback = target;
230
- }
231
- });
232
-
233
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
234
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
235
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
236
-
237
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
238
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
239
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
240
-
241
- expect(targetParameterInsideCallback).toEqual(2);
242
- });
243
-
244
- it('should run `afterRowMove` with proper visual `target` parameter', function () {
245
- var targetParameterInsideCallback = void 0;
246
-
247
- handsontable({
248
- data: Handsontable.helper.createSpreadsheetData(30, 30),
249
- rowHeaders: true,
250
- manualRowMove: [1, 2, 0],
251
- afterRowMove: function afterRowMove(rows, target) {
252
- targetParameterInsideCallback = target;
253
- }
254
- });
255
-
256
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
257
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
258
- this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
259
-
260
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
261
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
262
- this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
263
-
264
- expect(targetParameterInsideCallback).toEqual(2);
265
123
  });
266
124
  });
267
125
  });
@@ -112,10 +112,10 @@ var BaseUI = function () {
112
112
  }, {
113
113
  key: 'setPosition',
114
114
  value: function setPosition(top, left) {
115
- if (top) {
115
+ if (top !== void 0) {
116
116
  this._element.style.top = top + UNIT;
117
117
  }
118
- if (left) {
118
+ if (left !== void 0) {
119
119
  this._element.style.left = left + UNIT;
120
120
  }
121
121
  }
package/es/tableView.js CHANGED
@@ -192,6 +192,7 @@ function TableView(instance) {
192
192
  border: {
193
193
  width: 1,
194
194
  color: 'red'
195
+ // style: 'solid' // not used
195
196
  }
196
197
  })];
197
198
  selections.current = selections[0];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "handsontable",
3
3
  "title": "Handsontable",
4
- "version": "0.34.1",
4
+ "version": "0.34.5",
5
5
  "author": {
6
6
  "name": "Handsoncode",
7
7
  "email": "hello@handsontable.com",
package/hot.config.js CHANGED
@@ -8,5 +8,5 @@ module.exports = {
8
8
  HOT_PACKAGE_TYPE: 'ce',
9
9
  HOT_PACKAGE_NAME: packageBody.name,
10
10
  HOT_BUILD_DATE: moment().format('DD/MM/YYYY HH:mm:ss'),
11
- HOT_RELEASE_DATE: '06/09/2017',
11
+ HOT_RELEASE_DATE: '12/10/2017',
12
12
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.34.1",
13
+ "version": "0.34.5",
14
14
  "browser": "dist/handsontable.js",
15
15
  "main": "commonjs/index.js",
16
16
  "module": "es/index.js",
@@ -81,17 +81,17 @@
81
81
  "eslint": "^4.3.0",
82
82
  "eslint-config-airbnb-base": "^11.3.1",
83
83
  "eslint-plugin-import": "^2.7.0",
84
- "extract-text-webpack-plugin": "^2.1.2",
84
+ "extract-text-webpack-plugin": "^3.0.0",
85
85
  "glob": "^7.1.2",
86
86
  "grunt": "^1.0.1",
87
87
  "grunt-lib-phantomjs": "^1.1.0",
88
- "html-webpack-plugin": "^2.29.0",
88
+ "html-webpack-plugin": "^2.30.1",
89
89
  "jasmine-co": "^1.2.2",
90
90
  "jasmine-core": "2.5.2",
91
91
  "jasmine-terminal-reporter": "^1.0.3",
92
92
  "jest": "^19.0.0",
93
93
  "loader-utils": "^1.1.0",
94
- "optimize-css-assets-webpack-plugin": "^1.3.2",
94
+ "optimize-css-assets-webpack-plugin": "^3.1.1",
95
95
  "progress-bar-webpack-plugin": "^1.10.0",
96
96
  "request": "^2.81.0",
97
97
  "rimraf": "^2.5.4",
@@ -100,7 +100,7 @@
100
100
  "supports-color": "^4.2.1",
101
101
  "tree-kill": "^1.1.0",
102
102
  "typescript": "^2.4.2",
103
- "webpack": "^2.7.0"
103
+ "webpack": "^3.5.6"
104
104
  },
105
105
  "license": "MIT",
106
106
  "jest": {