handsontable 14.3.0 → 14.4.0-next-f62dd73-20240521

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
  2. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
  3. package/3rdparty/walkontable/src/core/_base.js +1 -1
  4. package/3rdparty/walkontable/src/core/_base.mjs +1 -1
  5. package/3rdparty/walkontable/src/overlay/_base.js +24 -20
  6. package/3rdparty/walkontable/src/overlay/_base.mjs +24 -20
  7. package/3rdparty/walkontable/src/overlay/bottom.js +3 -6
  8. package/3rdparty/walkontable/src/overlay/bottom.mjs +3 -6
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +22 -19
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +22 -19
  11. package/3rdparty/walkontable/src/overlay/top.js +13 -12
  12. package/3rdparty/walkontable/src/overlay/top.mjs +13 -12
  13. package/3rdparty/walkontable/src/overlays.js +46 -24
  14. package/3rdparty/walkontable/src/overlays.mjs +46 -24
  15. package/3rdparty/walkontable/src/selection/manager.js +7 -0
  16. package/3rdparty/walkontable/src/selection/manager.mjs +7 -0
  17. package/3rdparty/walkontable/src/selection/scanner.js +7 -0
  18. package/3rdparty/walkontable/src/selection/scanner.mjs +7 -0
  19. package/3rdparty/walkontable/src/table.js +10 -11
  20. package/3rdparty/walkontable/src/table.mjs +10 -11
  21. package/3rdparty/walkontable/src/utils/columnStretching.js +4 -0
  22. package/3rdparty/walkontable/src/utils/columnStretching.mjs +4 -0
  23. package/3rdparty/walkontable/src/viewport.js +18 -10
  24. package/3rdparty/walkontable/src/viewport.mjs +18 -10
  25. package/CHANGELOG.md +37 -0
  26. package/base.js +2 -2
  27. package/base.mjs +2 -2
  28. package/core.d.ts +2 -2
  29. package/core.js +93 -162
  30. package/core.mjs +93 -162
  31. package/dataMap/dataMap.js +10 -4
  32. package/dataMap/dataMap.mjs +10 -4
  33. package/dataMap/dataSource.js +16 -3
  34. package/dataMap/dataSource.mjs +16 -3
  35. package/dataMap/metaManager/lazyFactoryMap.js +7 -0
  36. package/dataMap/metaManager/lazyFactoryMap.mjs +7 -0
  37. package/dataMap/metaManager/metaSchema.js +38 -0
  38. package/dataMap/metaManager/metaSchema.mjs +38 -0
  39. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -0
  40. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -0
  41. package/dataMap/metaManager/mods/extendMetaProperties.js +44 -31
  42. package/dataMap/metaManager/mods/extendMetaProperties.mjs +44 -31
  43. package/dataMap/metaManager/utils.js +7 -0
  44. package/dataMap/metaManager/utils.mjs +7 -0
  45. package/dist/handsontable.css +4 -5
  46. package/dist/handsontable.full.css +4 -5
  47. package/dist/handsontable.full.js +5878 -4657
  48. package/dist/handsontable.full.min.css +4 -4
  49. package/dist/handsontable.full.min.js +59 -59
  50. package/dist/handsontable.js +5383 -4277
  51. package/dist/handsontable.min.css +4 -4
  52. package/dist/handsontable.min.js +20 -20
  53. package/editorManager.js +0 -67
  54. package/editorManager.mjs +0 -67
  55. package/editors/autocompleteEditor/autocompleteEditor.js +6 -4
  56. package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -4
  57. package/editors/baseEditor/baseEditor.js +1 -36
  58. package/editors/baseEditor/baseEditor.mjs +2 -37
  59. package/editors/dateEditor/dateEditor.js +4 -1
  60. package/editors/dateEditor/dateEditor.mjs +4 -1
  61. package/editors/dropdownEditor/dropdownEditor.js +8 -5
  62. package/editors/dropdownEditor/dropdownEditor.mjs +8 -5
  63. package/editors/handsontableEditor/handsontableEditor.js +2 -2
  64. package/editors/handsontableEditor/handsontableEditor.mjs +2 -2
  65. package/editors/selectEditor/selectEditor.js +1 -9
  66. package/editors/selectEditor/selectEditor.mjs +1 -9
  67. package/editors/textEditor/textEditor.js +2 -11
  68. package/editors/textEditor/textEditor.mjs +2 -11
  69. package/focusManager.js +3 -5
  70. package/focusManager.mjs +3 -5
  71. package/helpers/array.js +7 -0
  72. package/helpers/array.mjs +7 -0
  73. package/helpers/mixed.js +2 -2
  74. package/helpers/mixed.mjs +2 -2
  75. package/helpers/number.js +12 -2
  76. package/helpers/number.mjs +12 -2
  77. package/package.json +3 -3
  78. package/pluginHooks.d.ts +1 -1
  79. package/pluginHooks.js +79 -2
  80. package/pluginHooks.mjs +79 -2
  81. package/plugins/autoColumnSize/autoColumnSize.js +7 -0
  82. package/plugins/autoColumnSize/autoColumnSize.mjs +7 -0
  83. package/plugins/autoRowSize/autoRowSize.js +2 -2
  84. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  85. package/plugins/autofill/autofill.js +1 -1
  86. package/plugins/autofill/autofill.mjs +1 -1
  87. package/plugins/base/base.d.ts +1 -1
  88. package/plugins/base/base.js +6 -2
  89. package/plugins/base/base.mjs +6 -2
  90. package/plugins/collapsibleColumns/collapsibleColumns.js +1 -1
  91. package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -1
  92. package/plugins/columnSorting/sortFunction/date.js +2 -46
  93. package/plugins/columnSorting/sortFunction/date.mjs +2 -45
  94. package/plugins/columnSorting/sortFunction/time.js +17 -0
  95. package/plugins/columnSorting/sortFunction/time.mjs +13 -0
  96. package/plugins/columnSorting/sortService/registry.js +4 -2
  97. package/plugins/columnSorting/sortService/registry.mjs +3 -1
  98. package/plugins/columnSorting/utils.js +64 -0
  99. package/plugins/columnSorting/utils.mjs +62 -0
  100. package/plugins/columnSummary/columnSummary.js +27 -10
  101. package/plugins/columnSummary/columnSummary.mjs +27 -10
  102. package/plugins/columnSummary/endpoints.js +15 -0
  103. package/plugins/columnSummary/endpoints.mjs +15 -0
  104. package/plugins/comments/comments.js +2 -8
  105. package/plugins/comments/comments.mjs +2 -8
  106. package/plugins/comments/contextMenuItem/addEditComment.js +0 -1
  107. package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -1
  108. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  109. package/plugins/copyPaste/copyPaste.js +9 -2
  110. package/plugins/copyPaste/copyPaste.mjs +9 -2
  111. package/plugins/copyPaste/pasteEvent.js +1 -0
  112. package/plugins/copyPaste/pasteEvent.mjs +1 -0
  113. package/plugins/filters/filters.js +1 -1
  114. package/plugins/filters/filters.mjs +1 -1
  115. package/plugins/filters/ui/multipleSelect.js +22 -14
  116. package/plugins/filters/ui/multipleSelect.mjs +22 -14
  117. package/plugins/filters/utils.js +7 -0
  118. package/plugins/filters/utils.mjs +7 -0
  119. package/plugins/formulas/formulas.d.ts +10 -0
  120. package/plugins/formulas/formulas.js +11 -2
  121. package/plugins/formulas/formulas.mjs +11 -2
  122. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
  123. package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +1 -1
  124. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -1
  125. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +1 -1
  126. package/plugins/hiddenColumns/hiddenColumns.js +8 -1
  127. package/plugins/hiddenColumns/hiddenColumns.mjs +8 -1
  128. package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
  129. package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +1 -1
  130. package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -1
  131. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +1 -1
  132. package/plugins/hiddenRows/hiddenRows.js +7 -0
  133. package/plugins/hiddenRows/hiddenRows.mjs +7 -0
  134. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  135. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  136. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  137. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  138. package/plugins/manualColumnMove/manualColumnMove.js +1 -1
  139. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
  140. package/plugins/manualColumnResize/manualColumnResize.js +3 -3
  141. package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
  142. package/plugins/manualRowMove/manualRowMove.js +1 -1
  143. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  144. package/plugins/manualRowResize/manualRowResize.d.ts +1 -0
  145. package/plugins/manualRowResize/manualRowResize.js +11 -2
  146. package/plugins/manualRowResize/manualRowResize.mjs +11 -2
  147. package/plugins/mergeCells/cellsCollection.js +7 -0
  148. package/plugins/mergeCells/cellsCollection.mjs +7 -0
  149. package/plugins/mergeCells/mergeCells.js +7 -0
  150. package/plugins/mergeCells/mergeCells.mjs +7 -0
  151. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +7 -0
  152. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +7 -0
  153. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +7 -0
  154. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +7 -0
  155. package/plugins/nestedRows/nestedRows.js +7 -0
  156. package/plugins/nestedRows/nestedRows.mjs +7 -0
  157. package/plugins/trimRows/trimRows.js +7 -0
  158. package/plugins/trimRows/trimRows.mjs +7 -0
  159. package/selection/selection.js +163 -4
  160. package/selection/selection.mjs +163 -4
  161. package/selection/utils.js +7 -0
  162. package/selection/utils.mjs +7 -0
  163. package/settings.d.ts +1 -0
  164. package/shortcutContexts/commands/editor/closeAndSave.js +2 -3
  165. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -3
  166. package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.js +27 -0
  167. package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.mjs +24 -0
  168. package/shortcutContexts/commands/editor/closeAndSaveByEnter.js +11 -0
  169. package/shortcutContexts/commands/editor/closeAndSaveByEnter.mjs +8 -0
  170. package/shortcutContexts/commands/editor/index.js +3 -1
  171. package/shortcutContexts/commands/editor/index.mjs +3 -1
  172. package/shortcutContexts/editor.js +9 -1
  173. package/shortcutContexts/editor.mjs +9 -1
  174. package/shortcutContexts/index.js +1 -1
  175. package/shortcutContexts/index.mjs +1 -1
  176. package/shortcuts/keyObserver.js +7 -0
  177. package/shortcuts/keyObserver.mjs +7 -0
  178. package/shortcuts/utils.js +7 -0
  179. package/shortcuts/utils.mjs +7 -0
  180. package/tableView.js +1 -4
  181. package/tableView.mjs +1 -4
  182. package/translations/changesObservable/observable.js +7 -0
  183. package/translations/changesObservable/observable.mjs +7 -0
  184. package/translations/indexMapper.js +7 -0
  185. package/translations/indexMapper.mjs +8 -1
  186. package/utils/dataStructures/uniqueSet.js +7 -0
  187. package/utils/dataStructures/uniqueSet.mjs +7 -0
  188. package/utils/ghostTable.js +0 -4
  189. package/utils/ghostTable.mjs +0 -4
  190. package/utils/paginator.js +7 -0
  191. package/utils/paginator.mjs +7 -0
  192. package/validators/dateValidator/dateValidator.js +1 -3
  193. package/validators/dateValidator/dateValidator.mjs +1 -3
  194. package/validators/timeValidator/timeValidator.js +1 -3
  195. package/validators/timeValidator/timeValidator.mjs +1 -3
@@ -1,4 +1,12 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/es.array.push.js";
3
+ import "core-js/modules/esnext.set.difference.v2.js";
4
+ import "core-js/modules/esnext.set.intersection.v2.js";
5
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/esnext.set.union.v2.js";
2
10
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
3
11
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
4
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -414,7 +422,23 @@ class Selection {
414
422
  }
415
423
  this.runLocalHooks('beforeHighlightSet');
416
424
  this.setRangeFocus(this.selectedRange.current().highlight);
417
- const layerLevel = this.getLayerLevel();
425
+ this.applyAndCommit();
426
+ const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
427
+ this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
428
+ }
429
+
430
+ /**
431
+ * Applies and commits the selection to all layers (using the Walkontable Selection API) based on the selection (CellRanges)
432
+ * collected in the `selectedRange` module.
433
+ *
434
+ * @param {CellRange} [cellRange] The cell range to apply. If not provided, the current selection is used.
435
+ * @param {number} [layerLevel] The layer level to apply. If not provided, the current layer level is used.
436
+ */
437
+ applyAndCommit() {
438
+ let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectedRange.current();
439
+ let layerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLayerLevel();
440
+ const countRows = this.tableProps.countRows();
441
+ const countCols = this.tableProps.countCols();
418
442
 
419
443
  // If the next layer level is lower than previous then clear all area and header highlights. This is the
420
444
  // indication that the new selection is performing.
@@ -496,8 +520,6 @@ class Selection {
496
520
  activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
497
521
  }
498
522
  }
499
- const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
500
- this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
501
523
  }
502
524
 
503
525
  /**
@@ -594,6 +616,104 @@ class Selection {
594
616
  this.setRangeFocus(focusCoords.normalize());
595
617
  }
596
618
 
619
+ /**
620
+ * Transforms the last selection layer down or up by the index count.
621
+ *
622
+ * @param {number} visualRowIndex Visual row index from which the selection will be shifted.
623
+ * @param {number} amount The number of rows to shift the selection.
624
+ */
625
+ shiftRows(visualRowIndex, amount) {
626
+ if (!this.isSelected()) {
627
+ return;
628
+ }
629
+ const range = this.selectedRange.current();
630
+ if (this.isSelectedByCorner()) {
631
+ this.selectAll(true, true, {
632
+ disableHeadersHighlight: true
633
+ });
634
+ } else if (this.isSelectedByColumnHeader() || range.getOuterTopStartCorner().row >= visualRowIndex) {
635
+ const {
636
+ from,
637
+ to,
638
+ highlight
639
+ } = range;
640
+ const countRows = this.tableProps.countRows();
641
+ const isSelectedByRowHeader = this.isSelectedByRowHeader();
642
+ const isSelectedByColumnHeader = this.isSelectedByColumnHeader();
643
+ const minRow = isSelectedByColumnHeader ? -1 : 0;
644
+ const coordsStartAmount = isSelectedByColumnHeader ? 0 : amount;
645
+
646
+ // Remove from the stack the last added selection as that selection below will be
647
+ // replaced by new transformed selection.
648
+ this.getSelectedRange().pop();
649
+ const coordsStart = this.tableProps.createCellCoords(clamp(from.row + coordsStartAmount, minRow, countRows - 1), from.col);
650
+ const coordsEnd = this.tableProps.createCellCoords(clamp(to.row + amount, minRow, countRows - 1), to.col);
651
+ this.markSource('shift');
652
+ if (highlight.row >= visualRowIndex) {
653
+ this.setRangeStartOnly(coordsStart, true, this.tableProps.createCellCoords(clamp(highlight.row + amount, 0, countRows - 1), highlight.col));
654
+ } else {
655
+ this.setRangeStartOnly(coordsStart, true);
656
+ }
657
+ if (isSelectedByRowHeader) {
658
+ this.selectedByRowHeader.add(this.getLayerLevel());
659
+ }
660
+ if (isSelectedByColumnHeader) {
661
+ this.selectedByColumnHeader.add(this.getLayerLevel());
662
+ }
663
+ this.setRangeEnd(coordsEnd);
664
+ this.markEndSource();
665
+ }
666
+ }
667
+
668
+ /**
669
+ * Transforms the last selection layer left or right by the index count.
670
+ *
671
+ * @param {number} visualColumnIndex Visual column index from which the selection will be shifted.
672
+ * @param {number} amount The number of columns to shift the selection.
673
+ */
674
+ shiftColumns(visualColumnIndex, amount) {
675
+ if (!this.isSelected()) {
676
+ return;
677
+ }
678
+ const range = this.selectedRange.current();
679
+ if (this.isSelectedByCorner()) {
680
+ this.selectAll(true, true, {
681
+ disableHeadersHighlight: true
682
+ });
683
+ } else if (this.isSelectedByRowHeader() || range.getOuterTopStartCorner().col >= visualColumnIndex) {
684
+ const {
685
+ from,
686
+ to,
687
+ highlight
688
+ } = range;
689
+ const countCols = this.tableProps.countCols();
690
+ const isSelectedByRowHeader = this.isSelectedByRowHeader();
691
+ const isSelectedByColumnHeader = this.isSelectedByColumnHeader();
692
+ const minColumn = isSelectedByRowHeader ? -1 : 0;
693
+ const coordsStartAmount = isSelectedByRowHeader ? 0 : amount;
694
+
695
+ // Remove from the stack the last added selection as that selection below will be
696
+ // replaced by new transformed selection.
697
+ this.getSelectedRange().pop();
698
+ const coordsStart = this.tableProps.createCellCoords(from.row, clamp(from.col + coordsStartAmount, minColumn, countCols - 1));
699
+ const coordsEnd = this.tableProps.createCellCoords(to.row, clamp(to.col + amount, minColumn, countCols - 1));
700
+ this.markSource('shift');
701
+ if (highlight.col >= visualColumnIndex) {
702
+ this.setRangeStartOnly(coordsStart, true, this.tableProps.createCellCoords(highlight.row, clamp(highlight.col + amount, 0, countCols - 1)));
703
+ } else {
704
+ this.setRangeStartOnly(coordsStart, true);
705
+ }
706
+ if (isSelectedByRowHeader) {
707
+ this.selectedByRowHeader.add(this.getLayerLevel());
708
+ }
709
+ if (isSelectedByColumnHeader) {
710
+ this.selectedByColumnHeader.add(this.getLayerLevel());
711
+ }
712
+ this.setRangeEnd(coordsEnd);
713
+ this.markEndSource();
714
+ }
715
+ }
716
+
597
717
  /**
598
718
  * Returns currently used layer level.
599
719
  *
@@ -1026,9 +1146,48 @@ class Selection {
1026
1146
  }
1027
1147
 
1028
1148
  /**
1029
- * Rewrite the rendered state of the selection as visual selection may have a new representation in the DOM.
1149
+ * Refreshes the whole selection by clearing, reapplying and committing the renderable selection (Walkontable Selection API)
1150
+ * by using already added visual ranges.
1030
1151
  */
1031
1152
  refresh() {
1153
+ if (!this.isSelected()) {
1154
+ return;
1155
+ }
1156
+ const countRows = this.tableProps.countRows();
1157
+ const countColumns = this.tableProps.countCols();
1158
+ if (countRows === 0 || countColumns === 0) {
1159
+ this.deselect();
1160
+ return;
1161
+ }
1162
+ const range = this.selectedRange.peekByIndex(this.selectedRange.size() - 1);
1163
+ const {
1164
+ from,
1165
+ to,
1166
+ highlight
1167
+ } = range;
1168
+ this.clear();
1169
+ highlight.assign({
1170
+ row: clamp(highlight.row, -Infinity, countRows - 1),
1171
+ col: clamp(highlight.col, -Infinity, countColumns - 1)
1172
+ });
1173
+ from.assign({
1174
+ row: clamp(from.row, -Infinity, countRows - 1),
1175
+ col: clamp(from.col, -Infinity, countColumns - 1)
1176
+ });
1177
+ to.assign({
1178
+ row: clamp(to.row, 0, countRows - 1),
1179
+ col: clamp(to.col, 0, countColumns - 1)
1180
+ });
1181
+ this.selectedRange.ranges.push(range);
1182
+ this.highlight.getFocus().add(highlight).commit().syncWith(range);
1183
+ this.applyAndCommit(range);
1184
+ }
1185
+
1186
+ /**
1187
+ * Refreshes the whole selection by recommitting (recalculating visual indexes to renderable ones) the renderable selection
1188
+ * that was already added.
1189
+ */
1190
+ commit() {
1032
1191
  const customSelections = this.highlight.getCustomSelections();
1033
1192
  customSelections.forEach(customSelection => {
1034
1193
  customSelection.commit();
@@ -7,6 +7,13 @@ exports.transformSelectionToColumnDistance = transformSelectionToColumnDistance;
7
7
  exports.transformSelectionToRowDistance = transformSelectionToRowDistance;
8
8
  require("core-js/modules/es.error.cause.js");
9
9
  require("core-js/modules/es.array.push.js");
10
+ require("core-js/modules/esnext.set.difference.v2.js");
11
+ require("core-js/modules/esnext.set.intersection.v2.js");
12
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
13
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
14
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
15
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
16
+ require("core-js/modules/esnext.set.union.v2.js");
10
17
  var _src = require("./../3rdparty/walkontable/src");
11
18
  var _array = require("./../helpers/array");
12
19
  var _mixed = require("./../helpers/mixed");
@@ -1,5 +1,12 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
+ import "core-js/modules/esnext.set.difference.v2.js";
4
+ import "core-js/modules/esnext.set.intersection.v2.js";
5
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/esnext.set.union.v2.js";
3
10
  import { CellRange } from "./../3rdparty/walkontable/src/index.mjs";
4
11
  import { arrayEach, arrayReduce } from "./../helpers/array.mjs";
5
12
  import { isUndefined } from "./../helpers/mixed.mjs";
package/settings.d.ts CHANGED
@@ -133,6 +133,7 @@ export interface GridSettings extends Events {
133
133
  currentRowClassName?: string;
134
134
  customBorders?: CustomBordersSettings;
135
135
  data?: CellValue[][] | RowObject[];
136
+ dataDotNotation?: boolean;
136
137
  dataSchema?: RowObject | CellValue[] | ((row: number) => RowObject | CellValue[]);
137
138
  dateFormat?: string;
138
139
  datePickerConfig?: PikadayOptions;
@@ -3,9 +3,8 @@
3
3
  exports.__esModule = true;
4
4
  const command = exports.command = {
5
5
  name: 'editorCloseAndSave',
6
- callback(hot, event) {
6
+ callback(hot) {
7
7
  const editorManager = hot._getEditorManager();
8
- editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
9
- editorManager.moveSelectionAfterEnter(event);
8
+ editorManager.closeEditorAndSaveChanges();
10
9
  }
11
10
  };
@@ -1,8 +1,7 @@
1
1
  export const command = {
2
2
  name: 'editorCloseAndSave',
3
- callback(hot, event) {
3
+ callback(hot) {
4
4
  const editorManager = hot._getEditorManager();
5
- editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
6
- editorManager.moveSelectionAfterEnter(event);
5
+ editorManager.closeEditorAndSaveChanges();
7
6
  }
8
7
  };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var _baseEditor = require("../../../editors/baseEditor");
5
+ const command = exports.command = {
6
+ name: 'editorCloseAndSaveByArrowKeys',
7
+ callback(hot, event, keys) {
8
+ const editorManager = hot._getEditorManager();
9
+ const activeEditor = editorManager.getActiveEditor();
10
+ if (activeEditor.isInFullEditMode() && activeEditor.state === _baseEditor.EDITOR_STATE.EDITING) {
11
+ return;
12
+ }
13
+ editorManager.closeEditorAndSaveChanges();
14
+ if (hot.getSelected()) {
15
+ if (keys.includes('arrowdown')) {
16
+ hot.selection.transformStart(1, 0);
17
+ } else if (keys.includes('arrowup')) {
18
+ hot.selection.transformStart(-1, 0);
19
+ } else if (keys.includes('arrowleft')) {
20
+ hot.selection.transformStart(0, -1 * hot.getDirectionFactor());
21
+ } else if (keys.includes('arrowright')) {
22
+ hot.selection.transformStart(0, hot.getDirectionFactor());
23
+ }
24
+ }
25
+ event.preventDefault();
26
+ }
27
+ };
@@ -0,0 +1,24 @@
1
+ import { EDITOR_STATE } from "../../../editors/baseEditor/index.mjs";
2
+ export const command = {
3
+ name: 'editorCloseAndSaveByArrowKeys',
4
+ callback(hot, event, keys) {
5
+ const editorManager = hot._getEditorManager();
6
+ const activeEditor = editorManager.getActiveEditor();
7
+ if (activeEditor.isInFullEditMode() && activeEditor.state === EDITOR_STATE.EDITING) {
8
+ return;
9
+ }
10
+ editorManager.closeEditorAndSaveChanges();
11
+ if (hot.getSelected()) {
12
+ if (keys.includes('arrowdown')) {
13
+ hot.selection.transformStart(1, 0);
14
+ } else if (keys.includes('arrowup')) {
15
+ hot.selection.transformStart(-1, 0);
16
+ } else if (keys.includes('arrowleft')) {
17
+ hot.selection.transformStart(0, -1 * hot.getDirectionFactor());
18
+ } else if (keys.includes('arrowright')) {
19
+ hot.selection.transformStart(0, hot.getDirectionFactor());
20
+ }
21
+ }
22
+ event.preventDefault();
23
+ }
24
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ const command = exports.command = {
5
+ name: 'editorCloseAndSaveByEnter',
6
+ callback(hot, event) {
7
+ const editorManager = hot._getEditorManager();
8
+ editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
9
+ editorManager.moveSelectionAfterEnter(event);
10
+ }
11
+ };
@@ -0,0 +1,8 @@
1
+ export const command = {
2
+ name: 'editorCloseAndSaveByEnter',
3
+ callback(hot, event) {
4
+ const editorManager = hot._getEditorManager();
5
+ editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
6
+ editorManager.moveSelectionAfterEnter(event);
7
+ }
8
+ };
@@ -3,6 +3,8 @@
3
3
  exports.__esModule = true;
4
4
  exports.getAllCommands = getAllCommands;
5
5
  var _closeAndSave = require("./closeAndSave");
6
+ var _closeAndSaveByArrowKeys = require("./closeAndSaveByArrowKeys");
7
+ var _closeAndSaveByEnter = require("./closeAndSaveByEnter");
6
8
  var _closeWithoutSaving = require("./closeWithoutSaving");
7
9
  var _fastOpen = require("./fastOpen");
8
10
  var _open = require("./open");
@@ -12,5 +14,5 @@ var _open = require("./open");
12
14
  * @returns {Function[]}
13
15
  */
14
16
  function getAllCommands() {
15
- return [_closeAndSave.command, _closeWithoutSaving.command, _fastOpen.command, _open.command];
17
+ return [_closeAndSave.command, _closeAndSaveByArrowKeys.command, _closeAndSaveByEnter.command, _closeWithoutSaving.command, _fastOpen.command, _open.command];
16
18
  }
@@ -1,4 +1,6 @@
1
1
  import { command as closeAndSave } from "./closeAndSave.mjs";
2
+ import { command as closeAndSaveByArrowKeys } from "./closeAndSaveByArrowKeys.mjs";
3
+ import { command as closeAndSaveByEnter } from "./closeAndSaveByEnter.mjs";
2
4
  import { command as closeWithoutSaving } from "./closeWithoutSaving.mjs";
3
5
  import { command as fastOpen } from "./fastOpen.mjs";
4
6
  import { command as open } from "./open.mjs";
@@ -8,5 +10,5 @@ import { command as open } from "./open.mjs";
8
10
  * @returns {Function[]}
9
11
  */
10
12
  export function getAllCommands() {
11
- return [closeAndSave, closeWithoutSaving, fastOpen, open];
13
+ return [closeAndSave, closeAndSaveByArrowKeys, closeAndSaveByEnter, closeWithoutSaving, fastOpen, open];
12
14
  }
@@ -17,11 +17,19 @@ function shortcutsEditorContext(hot) {
17
17
  };
18
18
  context.addShortcuts([{
19
19
  keys: [['Enter'], ['Enter', 'Shift']],
20
- callback: (event, keys) => commandsPool.editorCloseAndSave(event, keys)
20
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByEnter(event, keys)
21
21
  }, {
22
22
  keys: [['Enter', 'Control/Meta'], ['Enter', 'Control/Meta', 'Shift']],
23
23
  captureCtrl: true,
24
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByEnter(event, keys)
25
+ }, {
26
+ keys: [['Tab'], ['Tab', 'Shift'], ['PageDown'], ['PageUp']],
27
+ forwardToContext: hot.getShortcutManager().getContext('grid'),
24
28
  callback: (event, keys) => commandsPool.editorCloseAndSave(event, keys)
29
+ }, {
30
+ keys: [['ArrowDown'], ['ArrowUp'], ['ArrowLeft'], ['ArrowRight']],
31
+ preventDefault: false,
32
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByArrowKeys(event, keys)
25
33
  }, {
26
34
  keys: [['Escape'], ['Escape', 'Control/Meta']],
27
35
  callback: () => commandsPool.editorCloseWithoutSaving()
@@ -13,11 +13,19 @@ export function shortcutsEditorContext(hot) {
13
13
  };
14
14
  context.addShortcuts([{
15
15
  keys: [['Enter'], ['Enter', 'Shift']],
16
- callback: (event, keys) => commandsPool.editorCloseAndSave(event, keys)
16
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByEnter(event, keys)
17
17
  }, {
18
18
  keys: [['Enter', 'Control/Meta'], ['Enter', 'Control/Meta', 'Shift']],
19
19
  captureCtrl: true,
20
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByEnter(event, keys)
21
+ }, {
22
+ keys: [['Tab'], ['Tab', 'Shift'], ['PageDown'], ['PageUp']],
23
+ forwardToContext: hot.getShortcutManager().getContext('grid'),
20
24
  callback: (event, keys) => commandsPool.editorCloseAndSave(event, keys)
25
+ }, {
26
+ keys: [['ArrowDown'], ['ArrowUp'], ['ArrowLeft'], ['ArrowRight']],
27
+ preventDefault: false,
28
+ callback: (event, keys) => commandsPool.editorCloseAndSaveByArrowKeys(event, keys)
21
29
  }, {
22
30
  keys: [['Escape'], ['Escape', 'Control/Meta']],
23
31
  callback: () => commandsPool.editorCloseWithoutSaving()
@@ -20,5 +20,5 @@ Object.keys(_constants).forEach(function (key) {
20
20
  * @param {Handsontable} hotInstance The Handsontable instance.
21
21
  */
22
22
  function registerAllShortcutContexts(hotInstance) {
23
- [_editor.shortcutsEditorContext, _grid.shortcutsGridContext].forEach(context => context(hotInstance));
23
+ [_grid.shortcutsGridContext, _editor.shortcutsEditorContext].forEach(context => context(hotInstance));
24
24
  }
@@ -7,5 +7,5 @@ export * from "./constants.mjs";
7
7
  * @param {Handsontable} hotInstance The Handsontable instance.
8
8
  */
9
9
  export function registerAllShortcutContexts(hotInstance) {
10
- [shortcutsEditorContext, shortcutsGridContext].forEach(context => context(hotInstance));
10
+ [shortcutsGridContext, shortcutsEditorContext].forEach(context => context(hotInstance));
11
11
  }
@@ -2,6 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.createKeysObserver = createKeysObserver;
5
+ require("core-js/modules/esnext.set.difference.v2.js");
6
+ require("core-js/modules/esnext.set.intersection.v2.js");
7
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/esnext.set.union.v2.js");
5
12
  /* eslint-disable jsdoc/require-description-complete-sentence */
6
13
 
7
14
  /**
@@ -1,3 +1,10 @@
1
+ import "core-js/modules/esnext.set.difference.v2.js";
2
+ import "core-js/modules/esnext.set.intersection.v2.js";
3
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/esnext.set.union.v2.js";
1
8
  /* eslint-disable jsdoc/require-description-complete-sentence */
2
9
 
3
10
  /**
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/esnext.set.difference.v2.js");
5
+ require("core-js/modules/esnext.set.intersection.v2.js");
6
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
7
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
8
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
9
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
10
+ require("core-js/modules/esnext.set.union.v2.js");
4
11
  // This file handles key-name discrepancies between browsers.
5
12
  // For the list of discrepancies, go to: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.
6
13
  const mappings = new Map([[' ', 'space'],
@@ -1,3 +1,10 @@
1
+ import "core-js/modules/esnext.set.difference.v2.js";
2
+ import "core-js/modules/esnext.set.intersection.v2.js";
3
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/esnext.set.union.v2.js";
1
8
  // This file handles key-name discrepancies between browsers.
2
9
  // For the list of discrepancies, go to: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.
3
10
  const mappings = new Map([[' ', 'space'],
package/tableView.js CHANGED
@@ -169,15 +169,12 @@ class TableView {
169
169
 
170
170
  /**
171
171
  * Adjust overlays elements size and master table size.
172
- *
173
- * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.
174
172
  */
175
173
  adjustElementsSize() {
176
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
177
174
  if (this.hot.isRenderSuspended()) {
178
175
  this.postponedAdjustElementsSize = true;
179
176
  } else {
180
- this._wt.wtOverlays.adjustElementsSize(force);
177
+ this._wt.wtOverlays.adjustElementsSize();
181
178
  }
182
179
  }
183
180
 
package/tableView.mjs CHANGED
@@ -165,15 +165,12 @@ class TableView {
165
165
 
166
166
  /**
167
167
  * Adjust overlays elements size and master table size.
168
- *
169
- * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.
170
168
  */
171
169
  adjustElementsSize() {
172
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
173
170
  if (this.hot.isRenderSuspended()) {
174
171
  this.postponedAdjustElementsSize = true;
175
172
  } else {
176
- this._wt.wtOverlays.adjustElementsSize(force);
173
+ this._wt.wtOverlays.adjustElementsSize();
177
174
  }
178
175
  }
179
176
 
@@ -2,6 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
+ require("core-js/modules/esnext.set.difference.v2.js");
6
+ require("core-js/modules/esnext.set.intersection.v2.js");
7
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/esnext.set.union.v2.js");
5
12
  var _observer = require("./observer");
6
13
  var _utils = require("./utils");
7
14
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
@@ -1,4 +1,11 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/esnext.set.difference.v2.js";
3
+ import "core-js/modules/esnext.set.intersection.v2.js";
4
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
5
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
6
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
7
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
8
+ import "core-js/modules/esnext.set.union.v2.js";
2
9
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
3
10
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
4
11
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
@@ -2,6 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
+ require("core-js/modules/esnext.set.difference.v2.js");
6
+ require("core-js/modules/esnext.set.intersection.v2.js");
7
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/esnext.set.union.v2.js");
5
12
  var _array = require("../helpers/array");
6
13
  var _maps = require("./maps");
7
14
  var _mapCollections = require("./mapCollections");
@@ -1,7 +1,14 @@
1
- import "core-js/modules/es.error.cause.js";
2
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import "core-js/modules/es.error.cause.js";
5
+ import "core-js/modules/esnext.set.difference.v2.js";
6
+ import "core-js/modules/esnext.set.intersection.v2.js";
7
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
8
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
9
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
10
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
11
+ import "core-js/modules/esnext.set.union.v2.js";
5
12
  import { arrayMap } from "../helpers/array.mjs";
6
13
  import { createIndexMap, getListWithInsertedItems, getListWithRemovedItems, HidingMap, IndexesSequence, TrimmingMap } from "./maps/index.mjs";
7
14
  import { AggregatedCollection, MapCollection } from "./mapCollections/index.mjs";
@@ -3,6 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  exports.createUniqueSet = createUniqueSet;
5
5
  require("core-js/modules/es.error.cause.js");
6
+ require("core-js/modules/esnext.set.difference.v2.js");
7
+ require("core-js/modules/esnext.set.intersection.v2.js");
8
+ require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
+ require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
+ require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/esnext.set.union.v2.js");
6
13
  var _function = require("../../helpers/function");
7
14
  const DEFAULT_ERROR_ITEM_EXISTS = item => `'${item}' value is already declared in a unique set.`;
8
15
 
@@ -1,4 +1,11 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/esnext.set.difference.v2.js";
3
+ import "core-js/modules/esnext.set.intersection.v2.js";
4
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
5
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
6
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
7
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
8
+ import "core-js/modules/esnext.set.union.v2.js";
2
9
  import { isFunction } from "../../helpers/function.mjs";
3
10
  const DEFAULT_ERROR_ITEM_EXISTS = item => `'${item}' value is already declared in a unique set.`;
4
11
 
@@ -261,8 +261,6 @@ class GhostTable {
261
261
  (0, _array.arrayEach)(sample.strings, string => {
262
262
  const column = string.col;
263
263
  const cellProperties = this.hot.getCellMeta(row, column);
264
- cellProperties.col = column;
265
- cellProperties.row = row;
266
264
  const renderer = this.hot.getCellRenderer(cellProperties);
267
265
  const td = rootDocument.createElement('td');
268
266
 
@@ -324,8 +322,6 @@ class GhostTable {
324
322
  (0, _array.arrayEach)(sample.strings, string => {
325
323
  const row = string.row;
326
324
  const cellProperties = this.hot.getCellMeta(row, column);
327
- cellProperties.col = column;
328
- cellProperties.row = row;
329
325
  const renderer = this.hot.getCellRenderer(cellProperties);
330
326
  const td = rootDocument.createElement('td');
331
327
  const tr = rootDocument.createElement('tr');
@@ -258,8 +258,6 @@ class GhostTable {
258
258
  arrayEach(sample.strings, string => {
259
259
  const column = string.col;
260
260
  const cellProperties = this.hot.getCellMeta(row, column);
261
- cellProperties.col = column;
262
- cellProperties.row = row;
263
261
  const renderer = this.hot.getCellRenderer(cellProperties);
264
262
  const td = rootDocument.createElement('td');
265
263
 
@@ -321,8 +319,6 @@ class GhostTable {
321
319
  arrayEach(sample.strings, string => {
322
320
  const row = string.row;
323
321
  const cellProperties = this.hot.getCellMeta(row, column);
324
- cellProperties.col = column;
325
- cellProperties.row = row;
326
322
  const renderer = this.hot.getCellRenderer(cellProperties);
327
323
  const td = rootDocument.createElement('td');
328
324
  const tr = rootDocument.createElement('tr');