handsontable 0.0.0-next-820d8a2-20221122 → 0.0.0-next-6812ce6-20221122
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/3rdparty/walkontable/src/cell/range.js +8 -0
- package/3rdparty/walkontable/src/cell/range.mjs +8 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +1 -1
- package/core.js +37 -29
- package/core.mjs +37 -29
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3135 -2444
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +62 -62
- package/dist/handsontable.js +2563 -1872
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +1 -1
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/constants.js +49 -42
- package/i18n/constants.mjs +45 -41
- package/i18n/languages/en-US.js +1 -1
- package/i18n/languages/en-US.mjs +1 -1
- package/languages/all.js +1 -1
- package/languages/en-US.js +1 -1
- package/languages/en-US.mjs +1 -1
- package/languages/index.js +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -2
- package/pluginHooks.js +23 -3
- package/pluginHooks.mjs +23 -3
- package/plugins/contextMenu/contextMenu.d.ts +4 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
- package/plugins/copyPaste/contextMenuItem/copy.mjs +4 -4
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
- package/plugins/copyPaste/copyPaste.d.ts +10 -2
- package/plugins/copyPaste/copyPaste.js +263 -173
- package/plugins/copyPaste/copyPaste.mjs +263 -173
- package/plugins/copyPaste/copyableRanges.js +260 -0
- package/plugins/copyPaste/copyableRanges.mjs +255 -0
- package/plugins/nestedHeaders/nestedHeaders.js +114 -11
- package/plugins/nestedHeaders/nestedHeaders.mjs +114 -11
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/nestedHeaders/stateManager/index.js +21 -10
- package/plugins/nestedHeaders/stateManager/index.mjs +21 -10
- package/selection/selection.js +2 -1
- package/selection/selection.mjs +2 -1
- package/tableView.js +133 -63
- package/tableView.mjs +133 -63
@@ -166,6 +166,10 @@ var CellRange = /*#__PURE__*/function () {
|
|
166
166
|
}, {
|
167
167
|
key: "getHeight",
|
168
168
|
value: function getHeight() {
|
169
|
+
// If the selection contains only rows headers return 0.
|
170
|
+
if (this.from.row < 0 && this.to.row < 0) {
|
171
|
+
return 0;
|
172
|
+
}
|
169
173
|
var fromRow = Math.max(this.from.row, 0);
|
170
174
|
var toRow = Math.max(this.to.row, 0);
|
171
175
|
return Math.max(fromRow, toRow) - Math.min(fromRow, toRow) + 1;
|
@@ -179,6 +183,10 @@ var CellRange = /*#__PURE__*/function () {
|
|
179
183
|
}, {
|
180
184
|
key: "getWidth",
|
181
185
|
value: function getWidth() {
|
186
|
+
// If the selection contains only columns headers return 0.
|
187
|
+
if (this.from.col < 0 && this.to.col < 0) {
|
188
|
+
return 0;
|
189
|
+
}
|
182
190
|
var fromCol = Math.max(this.from.col, 0);
|
183
191
|
var toCol = Math.max(this.to.col, 0);
|
184
192
|
return Math.max(fromCol, toCol) - Math.min(fromCol, toCol) + 1;
|
@@ -161,6 +161,10 @@ var CellRange = /*#__PURE__*/function () {
|
|
161
161
|
}, {
|
162
162
|
key: "getHeight",
|
163
163
|
value: function getHeight() {
|
164
|
+
// If the selection contains only rows headers return 0.
|
165
|
+
if (this.from.row < 0 && this.to.row < 0) {
|
166
|
+
return 0;
|
167
|
+
}
|
164
168
|
var fromRow = Math.max(this.from.row, 0);
|
165
169
|
var toRow = Math.max(this.to.row, 0);
|
166
170
|
return Math.max(fromRow, toRow) - Math.min(fromRow, toRow) + 1;
|
@@ -174,6 +178,10 @@ var CellRange = /*#__PURE__*/function () {
|
|
174
178
|
}, {
|
175
179
|
key: "getWidth",
|
176
180
|
value: function getWidth() {
|
181
|
+
// If the selection contains only columns headers return 0.
|
182
|
+
if (this.from.col < 0 && this.to.col < 0) {
|
183
|
+
return 0;
|
184
|
+
}
|
177
185
|
var fromCol = Math.max(this.from.col, 0);
|
178
186
|
var toCol = Math.max(this.to.col, 0);
|
179
187
|
return Math.max(fromCol, toCol) - Math.min(fromCol, toCol) + 1;
|
package/base.js
CHANGED
@@ -41,8 +41,8 @@ Handsontable.Core = function (rootElement) {
|
|
41
41
|
Handsontable.DefaultSettings = (0, _dataMap.metaSchemaFactory)();
|
42
42
|
Handsontable.hooks = _pluginHooks.default.getSingleton();
|
43
43
|
Handsontable.packageName = 'handsontable';
|
44
|
-
Handsontable.buildDate = "22/11/2022
|
45
|
-
Handsontable.version = "0.0.0-next-
|
44
|
+
Handsontable.buildDate = "22/11/2022 14:31:41";
|
45
|
+
Handsontable.version = "0.0.0-next-6812ce6-20221122";
|
46
46
|
Handsontable.languages = {
|
47
47
|
dictionaryKeys: _registry.dictionaryKeys,
|
48
48
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -32,8 +32,8 @@ Handsontable.Core = function (rootElement) {
|
|
32
32
|
Handsontable.DefaultSettings = metaSchemaFactory();
|
33
33
|
Handsontable.hooks = Hooks.getSingleton();
|
34
34
|
Handsontable.packageName = 'handsontable';
|
35
|
-
Handsontable.buildDate = "22/11/2022
|
36
|
-
Handsontable.version = "0.0.0-next-
|
35
|
+
Handsontable.buildDate = "22/11/2022 14:31:54";
|
36
|
+
Handsontable.version = "0.0.0-next-6812ce6-20221122";
|
37
37
|
Handsontable.languages = {
|
38
38
|
dictionaryKeys: dictionaryKeys,
|
39
39
|
getLanguageDictionary: getLanguageDictionary,
|
package/core.d.ts
CHANGED
@@ -62,7 +62,7 @@ export default class Core {
|
|
62
62
|
getCellValidator(cellMeta: CellMeta): BaseValidator | RegExp | undefined;
|
63
63
|
getCellValidator(row: number, col: number): BaseValidator | RegExp | undefined;
|
64
64
|
getColHeader(): Array<number | string>;
|
65
|
-
getColHeader(
|
65
|
+
getColHeader(column: number, headerLevel?: number): number | string;
|
66
66
|
getColWidth(col: number): number;
|
67
67
|
getCoords(elem: Element | null): CellCoords;
|
68
68
|
getCopyableData(row: number, column: number): string;
|
package/core.js
CHANGED
@@ -3383,51 +3383,59 @@ function Core(rootElement, userSettings) {
|
|
3383
3383
|
* Returns an array of column headers (in string format, if they are enabled). If param `column` is given, it
|
3384
3384
|
* returns the header at the given column.
|
3385
3385
|
*
|
3386
|
+
* Since the 12.3.0 the method accepts the 2nd `headerLevel` argument.
|
3387
|
+
*
|
3386
3388
|
* @memberof Core#
|
3387
3389
|
* @function getColHeader
|
3388
3390
|
* @param {number} [column] Visual column index.
|
3391
|
+
* @param {number} [headerLevel=-1] The index of header level. The header level accepts positive (0 to N)
|
3392
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
3393
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
3394
|
+
* header (the header closest to the cells).
|
3389
3395
|
* @fires Hooks#modifyColHeader
|
3396
|
+
* @fires Hooks#modifyColumnHeaderValue
|
3390
3397
|
* @returns {Array|string|number} The column header(s).
|
3391
3398
|
*/
|
3392
3399
|
this.getColHeader = function (column) {
|
3400
|
+
var headerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
3393
3401
|
var columnIndex = instance.runHooks('modifyColHeader', column);
|
3394
|
-
var result = tableMeta.colHeaders;
|
3395
3402
|
if (columnIndex === void 0) {
|
3396
3403
|
var out = [];
|
3397
3404
|
var ilen = instance.countCols();
|
3398
3405
|
for (var i = 0; i < ilen; i++) {
|
3399
3406
|
out.push(instance.getColHeader(i));
|
3400
3407
|
}
|
3401
|
-
|
3402
|
-
}
|
3403
|
-
|
3404
|
-
|
3405
|
-
|
3406
|
-
|
3407
|
-
|
3408
|
-
|
3409
|
-
|
3410
|
-
|
3408
|
+
return out;
|
3409
|
+
}
|
3410
|
+
var result = tableMeta.colHeaders;
|
3411
|
+
var translateVisualIndexToColumns = function translateVisualIndexToColumns(visualColumnIndex) {
|
3412
|
+
var arr = [];
|
3413
|
+
var columnsLen = instance.countCols();
|
3414
|
+
var index = 0;
|
3415
|
+
for (; index < columnsLen; index++) {
|
3416
|
+
if ((0, _function.isFunction)(tableMeta.columns) && tableMeta.columns(index)) {
|
3417
|
+
arr.push(index);
|
3411
3418
|
}
|
3412
|
-
return arr[visualColumnIndex];
|
3413
|
-
};
|
3414
|
-
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3415
|
-
var prop = translateVisualIndexToColumns(physicalColumn);
|
3416
|
-
if (tableMeta.colHeaders === false) {
|
3417
|
-
result = null;
|
3418
|
-
} else if (tableMeta.columns && (0, _function.isFunction)(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3419
|
-
result = tableMeta.columns(prop).title;
|
3420
|
-
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3421
|
-
result = tableMeta.columns[physicalColumn].title;
|
3422
|
-
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3423
|
-
result = tableMeta.colHeaders[physicalColumn];
|
3424
|
-
} else if ((0, _function.isFunction)(tableMeta.colHeaders)) {
|
3425
|
-
result = tableMeta.colHeaders(physicalColumn);
|
3426
|
-
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3427
|
-
result = (0, _data.spreadsheetColumnLabel)(columnIndex); // see #1458
|
3428
3419
|
}
|
3429
|
-
|
3430
|
-
|
3420
|
+
return arr[visualColumnIndex];
|
3421
|
+
};
|
3422
|
+
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3423
|
+
var prop = translateVisualIndexToColumns(physicalColumn);
|
3424
|
+
if (tableMeta.colHeaders === false) {
|
3425
|
+
result = null;
|
3426
|
+
} else if (tableMeta.columns && (0, _function.isFunction)(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3427
|
+
result = tableMeta.columns(prop).title;
|
3428
|
+
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3429
|
+
result = tableMeta.columns[physicalColumn].title;
|
3430
|
+
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3431
|
+
result = tableMeta.colHeaders[physicalColumn];
|
3432
|
+
} else if ((0, _function.isFunction)(tableMeta.colHeaders)) {
|
3433
|
+
result = tableMeta.colHeaders(physicalColumn);
|
3434
|
+
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3435
|
+
result = (0, _data.spreadsheetColumnLabel)(columnIndex); // see #1458
|
3436
|
+
}
|
3437
|
+
|
3438
|
+
result = instance.runHooks('modifyColumnHeaderValue', result, column, headerLevel);
|
3431
3439
|
return result;
|
3432
3440
|
};
|
3433
3441
|
|
package/core.mjs
CHANGED
@@ -3378,51 +3378,59 @@ export default function Core(rootElement, userSettings) {
|
|
3378
3378
|
* Returns an array of column headers (in string format, if they are enabled). If param `column` is given, it
|
3379
3379
|
* returns the header at the given column.
|
3380
3380
|
*
|
3381
|
+
* Since the 12.3.0 the method accepts the 2nd `headerLevel` argument.
|
3382
|
+
*
|
3381
3383
|
* @memberof Core#
|
3382
3384
|
* @function getColHeader
|
3383
3385
|
* @param {number} [column] Visual column index.
|
3386
|
+
* @param {number} [headerLevel=-1] The index of header level. The header level accepts positive (0 to N)
|
3387
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
3388
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
3389
|
+
* header (the header closest to the cells).
|
3384
3390
|
* @fires Hooks#modifyColHeader
|
3391
|
+
* @fires Hooks#modifyColumnHeaderValue
|
3385
3392
|
* @returns {Array|string|number} The column header(s).
|
3386
3393
|
*/
|
3387
3394
|
this.getColHeader = function (column) {
|
3395
|
+
var headerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
3388
3396
|
var columnIndex = instance.runHooks('modifyColHeader', column);
|
3389
|
-
var result = tableMeta.colHeaders;
|
3390
3397
|
if (columnIndex === void 0) {
|
3391
3398
|
var out = [];
|
3392
3399
|
var ilen = instance.countCols();
|
3393
3400
|
for (var i = 0; i < ilen; i++) {
|
3394
3401
|
out.push(instance.getColHeader(i));
|
3395
3402
|
}
|
3396
|
-
|
3397
|
-
}
|
3398
|
-
|
3399
|
-
|
3400
|
-
|
3401
|
-
|
3402
|
-
|
3403
|
-
|
3404
|
-
|
3405
|
-
|
3403
|
+
return out;
|
3404
|
+
}
|
3405
|
+
var result = tableMeta.colHeaders;
|
3406
|
+
var translateVisualIndexToColumns = function translateVisualIndexToColumns(visualColumnIndex) {
|
3407
|
+
var arr = [];
|
3408
|
+
var columnsLen = instance.countCols();
|
3409
|
+
var index = 0;
|
3410
|
+
for (; index < columnsLen; index++) {
|
3411
|
+
if (isFunction(tableMeta.columns) && tableMeta.columns(index)) {
|
3412
|
+
arr.push(index);
|
3406
3413
|
}
|
3407
|
-
return arr[visualColumnIndex];
|
3408
|
-
};
|
3409
|
-
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3410
|
-
var prop = translateVisualIndexToColumns(physicalColumn);
|
3411
|
-
if (tableMeta.colHeaders === false) {
|
3412
|
-
result = null;
|
3413
|
-
} else if (tableMeta.columns && isFunction(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3414
|
-
result = tableMeta.columns(prop).title;
|
3415
|
-
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3416
|
-
result = tableMeta.columns[physicalColumn].title;
|
3417
|
-
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3418
|
-
result = tableMeta.colHeaders[physicalColumn];
|
3419
|
-
} else if (isFunction(tableMeta.colHeaders)) {
|
3420
|
-
result = tableMeta.colHeaders(physicalColumn);
|
3421
|
-
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3422
|
-
result = spreadsheetColumnLabel(columnIndex); // see #1458
|
3423
3414
|
}
|
3424
|
-
|
3425
|
-
|
3415
|
+
return arr[visualColumnIndex];
|
3416
|
+
};
|
3417
|
+
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3418
|
+
var prop = translateVisualIndexToColumns(physicalColumn);
|
3419
|
+
if (tableMeta.colHeaders === false) {
|
3420
|
+
result = null;
|
3421
|
+
} else if (tableMeta.columns && isFunction(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3422
|
+
result = tableMeta.columns(prop).title;
|
3423
|
+
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3424
|
+
result = tableMeta.columns[physicalColumn].title;
|
3425
|
+
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3426
|
+
result = tableMeta.colHeaders[physicalColumn];
|
3427
|
+
} else if (isFunction(tableMeta.colHeaders)) {
|
3428
|
+
result = tableMeta.colHeaders(physicalColumn);
|
3429
|
+
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3430
|
+
result = spreadsheetColumnLabel(columnIndex); // see #1458
|
3431
|
+
}
|
3432
|
+
|
3433
|
+
result = instance.runHooks('modifyColumnHeaderValue', result, column, headerLevel);
|
3426
3434
|
return result;
|
3427
3435
|
};
|
3428
3436
|
|
package/dist/handsontable.css
CHANGED
@@ -25,8 +25,8 @@
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
27
27
|
*
|
28
|
-
* Version: 0.0.0-next-
|
29
|
-
* Release date: 25/10/2022 (built at 22/11/2022
|
28
|
+
* Version: 0.0.0-next-6812ce6-20221122
|
29
|
+
* Release date: 25/10/2022 (built at 22/11/2022 14:32:06)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|
@@ -25,8 +25,8 @@
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
27
27
|
*
|
28
|
-
* Version: 0.0.0-next-
|
29
|
-
* Release date: 25/10/2022 (built at 22/11/2022
|
28
|
+
* Version: 0.0.0-next-6812ce6-20221122
|
29
|
+
* Release date: 25/10/2022 (built at 22/11/2022 14:32:06)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|