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
@@ -13,7 +13,7 @@ describe('manualRowMove', () => {
|
|
13
13
|
});
|
14
14
|
|
15
15
|
describe('UI', () => {
|
16
|
-
it('should append UI elements to wtHider after click on row header',
|
16
|
+
it('should append UI elements to wtHider after click on row header', () => {
|
17
17
|
handsontable({
|
18
18
|
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
19
19
|
rowHeaders: true,
|
@@ -30,7 +30,7 @@ describe('manualRowMove', () => {
|
|
30
30
|
expect(spec().$container.find('.ht__manualRowMove--backlight').length).toBe(1);
|
31
31
|
});
|
32
32
|
|
33
|
-
it('should part of UI elements be visible on dragging action',
|
33
|
+
it('should part of UI elements be visible on dragging action', () => {
|
34
34
|
handsontable({
|
35
35
|
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
36
36
|
rowHeaders: true,
|
@@ -47,7 +47,7 @@ describe('manualRowMove', () => {
|
|
47
47
|
expect(spec().$container.find('.ht__manualRowMove--backlight:visible').length).toBe(1);
|
48
48
|
});
|
49
49
|
|
50
|
-
it('should all of UI elements be visible on dragging action',
|
50
|
+
it('should all of UI elements be visible on dragging action', () => {
|
51
51
|
handsontable({
|
52
52
|
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
53
53
|
rowHeaders: true,
|
@@ -55,9 +55,9 @@ describe('manualRowMove', () => {
|
|
55
55
|
});
|
56
56
|
|
57
57
|
const $headers = [
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
spec().$container.find('tbody tr:eq(0) th:eq(0)'),
|
59
|
+
spec().$container.find('tbody tr:eq(1) th:eq(0)'),
|
60
|
+
spec().$container.find('tbody tr:eq(2) th:eq(0)'),
|
61
61
|
];
|
62
62
|
|
63
63
|
$headers[0].simulate('mousedown');
|
@@ -70,202 +70,63 @@ describe('manualRowMove', () => {
|
|
70
70
|
expect(spec().$container.find('.ht__manualRowMove--backlight:visible').length).toBe(1);
|
71
71
|
});
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
describe('backlight', () => {
|
74
|
+
it('should set proper left position of element when colWidths is undefined', () => {
|
75
|
+
handsontable({
|
76
|
+
data: Handsontable.helper.createSpreadsheetData(10, 10),
|
77
|
+
rowHeaders: true,
|
78
|
+
manualRowMove: true
|
79
|
+
});
|
75
80
|
|
76
|
-
|
77
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
78
|
-
rowHeaders: true,
|
79
|
-
colHeaders: true,
|
80
|
-
manualRowMove: true,
|
81
|
-
beforeRowMove: (rows, target) => {
|
82
|
-
targetParameterInsideCallback = target;
|
83
|
-
}
|
84
|
-
});
|
85
|
-
const $fistHeader = this.$container.find('tbody tr:eq(0) th:eq(0)');
|
86
|
-
|
87
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
|
88
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mouseup');
|
89
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
|
90
|
-
|
91
|
-
$fistHeader.simulate('mouseover');
|
92
|
-
$fistHeader.simulate('mousemove', {
|
93
|
-
clientY: $fistHeader.offset().bottom - $fistHeader.height() - 50
|
94
|
-
});
|
95
|
-
$fistHeader.simulate('mouseup');
|
96
|
-
|
97
|
-
expect(targetParameterInsideCallback).toEqual(0);
|
98
|
-
});
|
99
|
-
|
100
|
-
it('should run `beforeRowMove` with proper `target` parameter (moving row to the top of first header)', function () {
|
101
|
-
let targetParameterInsideCallback;
|
102
|
-
|
103
|
-
handsontable({
|
104
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
105
|
-
rowHeaders: true,
|
106
|
-
manualRowMove: true,
|
107
|
-
colHeaders: true,
|
108
|
-
beforeRowMove: (rows, target) => {
|
109
|
-
targetParameterInsideCallback = target;
|
110
|
-
}
|
111
|
-
});
|
112
|
-
const $fistHeader = this.$container.find('tbody tr:eq(0) th:eq(0)');
|
113
|
-
|
114
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
|
115
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mouseup');
|
116
|
-
this.$container.find('tbody tr:eq(1) th:eq(0)').simulate('mousedown');
|
117
|
-
|
118
|
-
$fistHeader.simulate('mouseover');
|
119
|
-
$fistHeader.simulate('mousemove', {
|
120
|
-
clientY: $fistHeader.offset().bottom - $fistHeader.height()
|
121
|
-
});
|
122
|
-
$fistHeader.simulate('mouseup');
|
123
|
-
|
124
|
-
expect(targetParameterInsideCallback).toEqual(0);
|
125
|
-
});
|
126
|
-
|
127
|
-
it('should run `beforeRowMove` with proper `target` parameter (moving row to the middle of the table)', function () {
|
128
|
-
let targetParameterInsideCallback;
|
129
|
-
|
130
|
-
handsontable({
|
131
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
132
|
-
rowHeaders: true,
|
133
|
-
manualRowMove: true,
|
134
|
-
beforeRowMove: (rows, target) => {
|
135
|
-
targetParameterInsideCallback = target;
|
136
|
-
}
|
137
|
-
});
|
138
|
-
|
139
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
140
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
|
141
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
142
|
-
|
143
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
|
144
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
|
145
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
|
146
|
-
|
147
|
-
expect(targetParameterInsideCallback).toEqual(2);
|
148
|
-
});
|
149
|
-
|
150
|
-
it('should run `beforeRowMove` with proper `target` parameter (moving row to the top of last header)', function () {
|
151
|
-
let targetParameterInsideCallback;
|
152
|
-
|
153
|
-
handsontable({
|
154
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
155
|
-
rowHeaders: true,
|
156
|
-
manualRowMove: true,
|
157
|
-
beforeRowMove: (rows, target) => {
|
158
|
-
targetParameterInsideCallback = target;
|
159
|
-
}
|
160
|
-
});
|
161
|
-
|
162
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
163
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
|
164
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
165
|
-
|
166
|
-
this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mouseover');
|
167
|
-
this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mousemove');
|
168
|
-
this.$container.find('tbody tr:eq(29) th:eq(0)').simulate('mouseup');
|
169
|
-
|
170
|
-
expect(targetParameterInsideCallback).toEqual(29);
|
171
|
-
});
|
172
|
-
|
173
|
-
it('should run `beforeRowMove` with proper `target` parameter (moving row to the bottom of last header)', function () {
|
174
|
-
let targetParameterInsideCallback;
|
175
|
-
|
176
|
-
handsontable({
|
177
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
178
|
-
rowHeaders: true,
|
179
|
-
manualRowMove: true,
|
180
|
-
beforeRowMove: (rows, target) => {
|
181
|
-
targetParameterInsideCallback = target;
|
182
|
-
}
|
183
|
-
});
|
184
|
-
const $lastHeader = this.$container.find('tbody tr:eq(29) th:eq(0)');
|
81
|
+
const $headerTH = spec().$container.find('tbody tr:eq(0) th:eq(0)');
|
185
82
|
|
186
|
-
|
187
|
-
|
188
|
-
|
83
|
+
$headerTH.simulate('mousedown');
|
84
|
+
$headerTH.simulate('mouseup');
|
85
|
+
$headerTH.simulate('mousedown');
|
189
86
|
|
190
|
-
|
191
|
-
$lastHeader.simulate('mousemove', {
|
192
|
-
clientY: $lastHeader.offset().top + $lastHeader.height()
|
87
|
+
expect(spec().$container.find('.ht__manualRowMove--backlight')[0].offsetLeft).toBe(50);
|
193
88
|
});
|
194
|
-
$lastHeader.simulate('mouseup');
|
195
89
|
|
196
|
-
|
197
|
-
|
90
|
+
it('should set proper left position of element when colWidths is defined', () => {
|
91
|
+
handsontable({
|
92
|
+
data: Handsontable.helper.createSpreadsheetData(10, 10),
|
93
|
+
rowHeaders: true,
|
94
|
+
manualRowMove: true,
|
95
|
+
colWidths: 100,
|
96
|
+
});
|
198
97
|
|
199
|
-
|
200
|
-
let targetParameterInsideCallback;
|
98
|
+
const $headerTH = spec().$container.find('tbody tr:eq(0) th:eq(0)');
|
201
99
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
manualRowMove: true,
|
206
|
-
beforeRowMove: (rows, target) => {
|
207
|
-
targetParameterInsideCallback = target;
|
208
|
-
}
|
209
|
-
});
|
210
|
-
const $lastHeader = this.$container.find('tbody tr:eq(29) th:eq(0)');
|
100
|
+
$headerTH.simulate('mousedown');
|
101
|
+
$headerTH.simulate('mouseup');
|
102
|
+
$headerTH.simulate('mousedown');
|
211
103
|
|
212
|
-
|
213
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
|
214
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
215
|
-
|
216
|
-
$lastHeader.simulate('mouseover');
|
217
|
-
$lastHeader.simulate('mousemove', {
|
218
|
-
clientY: $lastHeader.offset().top + $lastHeader.height() + 200
|
104
|
+
expect(spec().$container.find('.ht__manualRowMove--backlight')[0].offsetLeft).toBe(50);
|
219
105
|
});
|
220
|
-
$lastHeader.simulate('mouseup');
|
221
|
-
|
222
|
-
expect(targetParameterInsideCallback).toEqual(30);
|
223
106
|
});
|
224
107
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
108
|
+
describe('guideline', () => {
|
109
|
+
it('should set proper top position of element when target is first row and column headers are disabled', () => {
|
110
|
+
handsontable({
|
111
|
+
data: Handsontable.helper.createSpreadsheetData(10, 10),
|
112
|
+
rowHeaders: true,
|
113
|
+
colHeaders: false,
|
114
|
+
manualRowMove: true,
|
115
|
+
});
|
116
|
+
|
117
|
+
const $headers = [
|
118
|
+
spec().$container.find('tbody tr:eq(0) th:eq(0)'),
|
119
|
+
spec().$container.find('tbody tr:eq(1) th:eq(0)'),
|
120
|
+
];
|
121
|
+
|
122
|
+
$headers[1].simulate('mousedown');
|
123
|
+
$headers[1].simulate('mouseup');
|
124
|
+
$headers[1].simulate('mousedown');
|
125
|
+
$headers[0].simulate('mouseover');
|
126
|
+
$headers[0].simulate('mousemove');
|
127
|
+
|
128
|
+
expect(spec().$container.find('.ht__manualRowMove--guideline')[0].offsetTop).toBe(-1);
|
235
129
|
});
|
236
|
-
|
237
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
238
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
|
239
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
240
|
-
|
241
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
|
242
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
|
243
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
|
244
|
-
|
245
|
-
expect(targetParameterInsideCallback).toEqual(2);
|
246
|
-
});
|
247
|
-
|
248
|
-
it('should run `afterRowMove` with proper visual `target` parameter', function () {
|
249
|
-
let targetParameterInsideCallback;
|
250
|
-
|
251
|
-
handsontable({
|
252
|
-
data: Handsontable.helper.createSpreadsheetData(30, 30),
|
253
|
-
rowHeaders: true,
|
254
|
-
manualRowMove: [1, 2, 0],
|
255
|
-
afterRowMove: (rows, target) => {
|
256
|
-
targetParameterInsideCallback = target;
|
257
|
-
}
|
258
|
-
});
|
259
|
-
|
260
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
261
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mouseup');
|
262
|
-
this.$container.find('tbody tr:eq(0) th:eq(0)').simulate('mousedown');
|
263
|
-
|
264
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseover');
|
265
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mousemove');
|
266
|
-
this.$container.find('tbody tr:eq(2) th:eq(0)').simulate('mouseup');
|
267
|
-
|
268
|
-
expect(targetParameterInsideCallback).toEqual(2);
|
269
130
|
});
|
270
131
|
});
|
271
132
|
});
|
@@ -86,10 +86,10 @@ class BaseUI {
|
|
86
86
|
* @param {Number} left New left position of the element.
|
87
87
|
*/
|
88
88
|
setPosition(top, left) {
|
89
|
-
if (top) {
|
89
|
+
if (top !== void 0) {
|
90
90
|
this._element.style.top = top + UNIT;
|
91
91
|
}
|
92
|
-
if (left) {
|
92
|
+
if (left !== void 0) {
|
93
93
|
this._element.style.left = left + UNIT;
|
94
94
|
}
|
95
95
|
}
|