handsontable 0.0.0-next-50e428d-20231026 → 0.0.0-next-42d5bd7-20231027
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/renderer/columnHeaders.js +3 -0
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +4 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +3 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +1 -1
- package/core.mjs +1 -1
- package/dist/handsontable.css +45 -63
- package/dist/handsontable.full.css +45 -63
- package/dist/handsontable.full.js +3599 -2080
- package/dist/handsontable.full.min.css +5 -5
- package/dist/handsontable.full.min.js +70 -63
- package/dist/handsontable.js +3601 -2082
- package/dist/handsontable.min.css +5 -5
- package/dist/handsontable.min.js +25 -18
- package/dist/languages/all.js +24 -2
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +12 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/pl-PL.js +12 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/helpers/a11y.js +2 -0
- package/helpers/a11y.mjs +1 -0
- package/helpers/dom/element.js +29 -0
- package/helpers/dom/element.mjs +28 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/constants.js +27 -1
- package/i18n/constants.mjs +14 -1
- package/i18n/languages/en-US.js +12 -1
- package/i18n/languages/en-US.mjs +12 -1
- package/i18n/languages/pl-PL.js +12 -1
- package/i18n/languages/pl-PL.mjs +12 -1
- package/languages/all.js +24 -2
- package/languages/en-US.js +12 -1
- package/languages/en-US.mjs +12 -1
- package/languages/index.js +24 -2
- package/languages/pl-PL.js +12 -1
- package/languages/pl-PL.mjs +12 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +28 -6
- package/pluginHooks.js +116 -62
- package/pluginHooks.mjs +116 -62
- package/plugins/collapsibleColumns/collapsibleColumns.js +3 -2
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -3
- package/plugins/columnSorting/columnSorting.js +29 -3
- package/plugins/columnSorting/columnSorting.mjs +31 -5
- package/plugins/contextMenu/menu/menuItemRenderer.js +12 -0
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +14 -2
- package/plugins/copyPaste/clipboardData/clipboardData.js +517 -0
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +512 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
- package/plugins/copyPaste/clipboardData/index.js +9 -0
- package/plugins/copyPaste/clipboardData/index.mjs +4 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
- package/plugins/copyPaste/copyPaste.js +38 -92
- package/plugins/copyPaste/copyPaste.mjs +40 -94
- package/plugins/dropdownMenu/dropdownMenu.js +2 -1
- package/plugins/dropdownMenu/dropdownMenu.mjs +3 -2
- package/plugins/filters/ui/input.js +0 -3
- package/plugins/filters/ui/input.mjs +0 -3
- package/plugins/filters/ui/select.js +6 -0
- package/plugins/filters/ui/select.mjs +6 -0
- package/plugins/hiddenColumns/hiddenColumns.js +48 -3
- package/plugins/hiddenColumns/hiddenColumns.mjs +47 -2
- package/plugins/hiddenRows/hiddenRows.js +48 -3
- package/plugins/hiddenRows/hiddenRows.mjs +47 -2
- package/plugins/multiColumnSorting/multiColumnSorting.js +21 -0
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +22 -1
- package/plugins/nestedHeaders/nestedHeaders.js +21 -22
- package/plugins/nestedHeaders/nestedHeaders.mjs +21 -22
- package/plugins/nestedRows/nestedRows.js +2 -1
- package/plugins/nestedRows/nestedRows.mjs +2 -1
- package/plugins/nestedRows/ui/headers.js +3 -3
- package/plugins/nestedRows/ui/headers.mjs +4 -4
- package/utils/parseTable.js +527 -83
- package/utils/parseTable.mjs +523 -82
- package/plugins/copyPaste/clipboardData.js +0 -18
- package/plugins/copyPaste/clipboardData.mjs +0 -14
- package/plugins/copyPaste/pasteEvent.js +0 -14
- package/plugins/copyPaste/pasteEvent.mjs +0 -9
@@ -531,45 +531,44 @@ class NestedHeaders extends _base.BasePlugin {
|
|
531
531
|
* of the column.
|
532
532
|
*
|
533
533
|
* @private
|
534
|
-
* @param {
|
535
|
-
* @param {
|
536
|
-
*
|
537
|
-
* @param {
|
538
|
-
*
|
534
|
+
* @param {object} clipboardData Information about already performed copy action.
|
535
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied/pasted dataset.
|
536
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied/pasted dataset.
|
537
|
+
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
538
|
+
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
539
|
+
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied/pasted dataset.
|
540
|
+
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied/pasted dataset.
|
541
|
+
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
542
|
+
* @param {Function} clipboardData.getMetaInfo Gets grid settings for copied data.
|
543
|
+
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
539
544
|
*/
|
540
|
-
onBeforeCopy(
|
541
|
-
|
542
|
-
|
543
|
-
} = _ref2;
|
544
|
-
if (columnHeadersCount === 0) {
|
545
|
-
return;
|
546
|
-
}
|
547
|
-
for (let rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex++) {
|
545
|
+
onBeforeCopy(clipboardData) {
|
546
|
+
const copyableRanges = clipboardData.getRanges();
|
547
|
+
for (let rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex += 1) {
|
548
548
|
const {
|
549
549
|
startRow,
|
550
550
|
startCol,
|
551
551
|
endRow,
|
552
552
|
endCol
|
553
553
|
} = copyableRanges[rangeIndex];
|
554
|
-
const rowsCount = endRow - startRow + 1;
|
555
554
|
const columnsCount = startCol - endCol + 1;
|
556
555
|
|
557
556
|
// do not process dataset ranges and column headers where only one column is copied
|
558
557
|
if (startRow >= 0 || columnsCount === 1) {
|
559
558
|
break;
|
560
559
|
}
|
561
|
-
for (let column = startCol; column <= endCol; column
|
562
|
-
for (let row = startRow; row <= endRow; row
|
563
|
-
var _classPrivateFieldGet4;
|
564
|
-
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
560
|
+
for (let column = startCol; column <= endCol; column += 1) {
|
561
|
+
for (let row = startRow; row <= endRow; row += 1) {
|
562
|
+
var _classPrivateFieldGet4, _classPrivateFieldGet5;
|
565
563
|
const zeroBasedColumnIndex = column - startCol;
|
566
564
|
if (zeroBasedColumnIndex === 0) {
|
567
565
|
continue; // eslint-disable-line no-continue
|
568
566
|
}
|
569
567
|
|
570
568
|
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
571
|
-
|
572
|
-
|
569
|
+
const collapsible = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.collapsible;
|
570
|
+
if (collapsible === true && isRoot === false) {
|
571
|
+
clipboardData.setCellAt(row, zeroBasedColumnIndex, '');
|
573
572
|
}
|
574
573
|
}
|
575
574
|
}
|
@@ -872,10 +871,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
872
871
|
* @returns {string} Returns the column header value to update.
|
873
872
|
*/
|
874
873
|
onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
875
|
-
var
|
874
|
+
var _classPrivateFieldGet6;
|
876
875
|
const {
|
877
876
|
label
|
878
|
-
} = (
|
877
|
+
} = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet6 !== void 0 ? _classPrivateFieldGet6 : {
|
879
878
|
label: ''
|
880
879
|
};
|
881
880
|
return label;
|
@@ -525,45 +525,44 @@ export class NestedHeaders extends BasePlugin {
|
|
525
525
|
* of the column.
|
526
526
|
*
|
527
527
|
* @private
|
528
|
-
* @param {
|
529
|
-
* @param {
|
530
|
-
*
|
531
|
-
* @param {
|
532
|
-
*
|
528
|
+
* @param {object} clipboardData Information about already performed copy action.
|
529
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied/pasted dataset.
|
530
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied/pasted dataset.
|
531
|
+
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
532
|
+
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
533
|
+
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied/pasted dataset.
|
534
|
+
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied/pasted dataset.
|
535
|
+
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
536
|
+
* @param {Function} clipboardData.getMetaInfo Gets grid settings for copied data.
|
537
|
+
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
533
538
|
*/
|
534
|
-
onBeforeCopy(
|
535
|
-
|
536
|
-
|
537
|
-
} = _ref2;
|
538
|
-
if (columnHeadersCount === 0) {
|
539
|
-
return;
|
540
|
-
}
|
541
|
-
for (let rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex++) {
|
539
|
+
onBeforeCopy(clipboardData) {
|
540
|
+
const copyableRanges = clipboardData.getRanges();
|
541
|
+
for (let rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex += 1) {
|
542
542
|
const {
|
543
543
|
startRow,
|
544
544
|
startCol,
|
545
545
|
endRow,
|
546
546
|
endCol
|
547
547
|
} = copyableRanges[rangeIndex];
|
548
|
-
const rowsCount = endRow - startRow + 1;
|
549
548
|
const columnsCount = startCol - endCol + 1;
|
550
549
|
|
551
550
|
// do not process dataset ranges and column headers where only one column is copied
|
552
551
|
if (startRow >= 0 || columnsCount === 1) {
|
553
552
|
break;
|
554
553
|
}
|
555
|
-
for (let column = startCol; column <= endCol; column
|
556
|
-
for (let row = startRow; row <= endRow; row
|
557
|
-
var _classPrivateFieldGet4;
|
558
|
-
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
554
|
+
for (let column = startCol; column <= endCol; column += 1) {
|
555
|
+
for (let row = startRow; row <= endRow; row += 1) {
|
556
|
+
var _classPrivateFieldGet4, _classPrivateFieldGet5;
|
559
557
|
const zeroBasedColumnIndex = column - startCol;
|
560
558
|
if (zeroBasedColumnIndex === 0) {
|
561
559
|
continue; // eslint-disable-line no-continue
|
562
560
|
}
|
563
561
|
|
564
562
|
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
565
|
-
|
566
|
-
|
563
|
+
const collapsible = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.collapsible;
|
564
|
+
if (collapsible === true && isRoot === false) {
|
565
|
+
clipboardData.setCellAt(row, zeroBasedColumnIndex, '');
|
567
566
|
}
|
568
567
|
}
|
569
568
|
}
|
@@ -866,10 +865,10 @@ export class NestedHeaders extends BasePlugin {
|
|
866
865
|
* @returns {string} Returns the column header value to update.
|
867
866
|
*/
|
868
867
|
onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
869
|
-
var
|
868
|
+
var _classPrivateFieldGet6;
|
870
869
|
const {
|
871
870
|
label
|
872
|
-
} = (
|
871
|
+
} = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet6 !== void 0 ? _classPrivateFieldGet6 : {
|
873
872
|
label: ''
|
874
873
|
};
|
875
874
|
return label;
|
@@ -167,7 +167,8 @@ class NestedRows extends _base.BasePlugin {
|
|
167
167
|
/**
|
168
168
|
* Updates the plugin's state.
|
169
169
|
*
|
170
|
-
* This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
|
170
|
+
* This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
|
171
|
+
* following configuration options:
|
171
172
|
* - [`nestedRows`](@/api/options.md#nestedrows)
|
172
173
|
*/
|
173
174
|
updatePlugin() {
|
@@ -161,7 +161,8 @@ export class NestedRows extends BasePlugin {
|
|
161
161
|
/**
|
162
162
|
* Updates the plugin's state.
|
163
163
|
*
|
164
|
-
* This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
|
164
|
+
* This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
|
165
|
+
* following configuration options:
|
165
166
|
* - [`nestedRows`](@/api/options.md#nestedrows)
|
166
167
|
*/
|
167
168
|
updatePlugin() {
|
@@ -6,6 +6,7 @@ var _number = require("../../../helpers/number");
|
|
6
6
|
var _element = require("../../../helpers/dom/element");
|
7
7
|
var _base = _interopRequireDefault(require("./_base"));
|
8
8
|
var _a11y = require("../../../helpers/a11y");
|
9
|
+
var _constants = require("../../../i18n/constants");
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
11
|
/**
|
11
12
|
* Class responsible for the UI in the Nested Rows' row headers.
|
@@ -24,7 +25,6 @@ class HeadersUI extends _base.default {
|
|
24
25
|
return {
|
25
26
|
indicatorContainer: 'ht_nestingLevels',
|
26
27
|
parent: 'ht_nestingParent',
|
27
|
-
indicator: 'ht_nestingLevel',
|
28
28
|
emptyIndicator: 'ht_nestingLevel_empty',
|
29
29
|
button: 'ht_nestingButton',
|
30
30
|
expandButton: 'ht_nestingExpand',
|
@@ -102,12 +102,12 @@ class HeadersUI extends _base.default {
|
|
102
102
|
if (this.collapsingUI.areChildrenCollapsed(rowIndex)) {
|
103
103
|
(0, _element.addClass)(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.expandButton}`);
|
104
104
|
if (ariaEnabled) {
|
105
|
-
(0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(false)]);
|
105
|
+
(0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(false), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_DESCRIPTION_EXPAND_ROW))]);
|
106
106
|
}
|
107
107
|
} else {
|
108
108
|
(0, _element.addClass)(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.collapseButton}`);
|
109
109
|
if (ariaEnabled) {
|
110
|
-
(0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(true)]);
|
110
|
+
(0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(true), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_DESCRIPTION_COLLAPSE_ROW))]);
|
111
111
|
}
|
112
112
|
}
|
113
113
|
innerDiv.appendChild(buttonsContainer);
|
@@ -2,7 +2,8 @@ import { arrayEach } from "../../../helpers/array.mjs";
|
|
2
2
|
import { rangeEach } from "../../../helpers/number.mjs";
|
3
3
|
import { addClass, setAttribute } from "../../../helpers/dom/element.mjs";
|
4
4
|
import BaseUI from "./_base.mjs";
|
5
|
-
import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../../helpers/a11y.mjs";
|
5
|
+
import { A11Y_DESCRIPTION, A11Y_EXPANDED, A11Y_HIDDEN } from "../../../helpers/a11y.mjs";
|
6
|
+
import { ROW_HEADER_DESCRIPTION_COLLAPSE_ROW, ROW_HEADER_DESCRIPTION_EXPAND_ROW } from "../../../i18n/constants.mjs";
|
6
7
|
/**
|
7
8
|
* Class responsible for the UI in the Nested Rows' row headers.
|
8
9
|
*
|
@@ -20,7 +21,6 @@ class HeadersUI extends BaseUI {
|
|
20
21
|
return {
|
21
22
|
indicatorContainer: 'ht_nestingLevels',
|
22
23
|
parent: 'ht_nestingParent',
|
23
|
-
indicator: 'ht_nestingLevel',
|
24
24
|
emptyIndicator: 'ht_nestingLevel_empty',
|
25
25
|
button: 'ht_nestingButton',
|
26
26
|
expandButton: 'ht_nestingExpand',
|
@@ -98,12 +98,12 @@ class HeadersUI extends BaseUI {
|
|
98
98
|
if (this.collapsingUI.areChildrenCollapsed(rowIndex)) {
|
99
99
|
addClass(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.expandButton}`);
|
100
100
|
if (ariaEnabled) {
|
101
|
-
setAttribute(TH, [A11Y_EXPANDED(false)]);
|
101
|
+
setAttribute(TH, [A11Y_EXPANDED(false), A11Y_DESCRIPTION(this.hot.getTranslatedPhrase(ROW_HEADER_DESCRIPTION_EXPAND_ROW))]);
|
102
102
|
}
|
103
103
|
} else {
|
104
104
|
addClass(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.collapseButton}`);
|
105
105
|
if (ariaEnabled) {
|
106
|
-
setAttribute(TH, [A11Y_EXPANDED(true)]);
|
106
|
+
setAttribute(TH, [A11Y_EXPANDED(true), A11Y_DESCRIPTION(this.hot.getTranslatedPhrase(ROW_HEADER_DESCRIPTION_COLLAPSE_ROW))]);
|
107
107
|
}
|
108
108
|
}
|
109
109
|
innerDiv.appendChild(buttonsContainer);
|