handsontable 15.3.0 → 16.0.0-next-f486b48-20250702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/core/_base.js +0 -3
- package/3rdparty/walkontable/src/core/_base.mjs +0 -3
- package/3rdparty/walkontable/src/core/clone.js +0 -1
- package/3rdparty/walkontable/src/core/clone.mjs +0 -1
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +0 -3
- package/3rdparty/walkontable/src/facade/core.mjs +0 -3
- package/3rdparty/walkontable/src/index.js +1 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -3
- package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +17 -11
- package/3rdparty/walkontable/src/selection/border/border.mjs +17 -11
- package/3rdparty/walkontable/src/selection/border/utils.js +1 -1
- package/3rdparty/walkontable/src/selection/border/utils.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +3 -1
- package/3rdparty/walkontable/src/settings.mjs +3 -1
- package/3rdparty/walkontable/src/table.js +9 -6
- package/3rdparty/walkontable/src/table.mjs +9 -6
- package/3rdparty/walkontable/src/types.js +0 -1
- package/3rdparty/walkontable/src/types.mjs +0 -1
- package/3rdparty/walkontable/src/utils/column.js +1 -1
- package/3rdparty/walkontable/src/utils/column.mjs +1 -1
- package/3rdparty/walkontable/src/viewport.js +1 -1
- package/3rdparty/walkontable/src/viewport.mjs +1 -1
- package/CHANGELOG.md +53 -31
- package/README.md +10 -4
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/registry.js +2 -3
- package/cellTypes/registry.mjs +1 -1
- package/core/coordsMapper/rangeToRenderableMapper.js +124 -0
- package/core/coordsMapper/rangeToRenderableMapper.mjs +120 -0
- package/core/focusCatcher/focusDetector.js +2 -2
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +259 -1
- package/core/hooks/constants.mjs +259 -1
- package/core.d.ts +2 -0
- package/core.js +202 -58
- package/core.mjs +202 -58
- package/dataMap/dataMap.js +16 -30
- package/dataMap/dataMap.mjs +16 -30
- package/dataMap/metaManager/metaSchema.js +58 -0
- package/dataMap/metaManager/metaSchema.mjs +58 -0
- package/dist/handsontable.css +30 -4
- package/dist/handsontable.full.css +30 -4
- package/dist/handsontable.full.js +6073 -4352
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +206 -206
- package/dist/handsontable.js +5751 -4037
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +41 -41
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +5 -1
- package/editorManager.mjs +5 -1
- package/editors/autocompleteEditor/autocompleteEditor.d.ts +0 -12
- package/editors/autocompleteEditor/autocompleteEditor.js +42 -69
- package/editors/autocompleteEditor/autocompleteEditor.mjs +43 -70
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -8
- package/editors/dateEditor/dateEditor.mjs +3 -9
- package/editors/handsontableEditor/handsontableEditor.d.ts +8 -0
- package/editors/handsontableEditor/handsontableEditor.js +173 -17
- package/editors/handsontableEditor/handsontableEditor.mjs +173 -17
- package/editors/passwordEditor/passwordEditor.js +2 -0
- package/editors/passwordEditor/passwordEditor.mjs +2 -0
- package/editors/registry.js +2 -3
- package/editors/registry.mjs +1 -1
- package/editors/textEditor/textEditor.js +2 -0
- package/editors/textEditor/textEditor.mjs +2 -0
- package/helpers/a11y.js +2 -0
- package/helpers/a11y.mjs +1 -0
- package/helpers/dom/element.d.ts +1 -0
- package/helpers/dom/element.js +26 -1
- package/helpers/dom/element.mjs +25 -1
- package/helpers/mixed.js +4 -4
- package/helpers/mixed.mjs +4 -4
- package/i18n/languages/ar-AR.js +1 -2
- package/i18n/languages/cs-CZ.js +1 -2
- package/i18n/languages/de-CH.js +1 -2
- package/i18n/languages/de-DE.js +1 -2
- package/i18n/languages/en-US.js +1 -2
- package/i18n/languages/es-MX.js +1 -2
- package/i18n/languages/fa-IR.js +1 -2
- package/i18n/languages/fr-FR.js +1 -2
- package/i18n/languages/hr-HR.js +1 -2
- package/i18n/languages/it-IT.js +1 -2
- package/i18n/languages/ja-JP.js +1 -2
- package/i18n/languages/ko-KR.js +1 -2
- package/i18n/languages/lv-LV.js +1 -2
- package/i18n/languages/nb-NO.js +1 -2
- package/i18n/languages/nl-NL.js +1 -2
- package/i18n/languages/pl-PL.js +1 -2
- package/i18n/languages/pt-BR.js +1 -2
- package/i18n/languages/ru-RU.js +1 -2
- package/i18n/languages/sr-SP.js +1 -2
- package/i18n/languages/zh-CN.js +1 -2
- package/i18n/languages/zh-TW.js +1 -2
- package/i18n/phraseFormatters/index.js +2 -2
- package/i18n/phraseFormatters/index.mjs +1 -1
- package/i18n/registry.js +3 -4
- package/i18n/registry.mjs +1 -1
- package/index.js +1 -2
- package/package.json +10 -4
- package/plugins/autoColumnSize/autoColumnSize.js +47 -0
- package/plugins/autoColumnSize/autoColumnSize.mjs +47 -0
- package/plugins/autoRowSize/autoRowSize.js +45 -0
- package/plugins/autoRowSize/autoRowSize.mjs +45 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +13 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +13 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +31 -0
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +31 -0
- package/plugins/columnSorting/sortService/registry.js +3 -4
- package/plugins/columnSorting/sortService/registry.mjs +1 -1
- package/plugins/columnSummary/columnSummary.js +33 -0
- package/plugins/columnSummary/columnSummary.mjs +33 -0
- package/plugins/comments/commentEditor.js +8 -2
- package/plugins/comments/commentEditor.mjs +8 -2
- package/plugins/comments/comments.js +59 -15
- package/plugins/comments/comments.mjs +60 -16
- package/plugins/comments/contextMenuItem/addEditComment.js +1 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.js +1 -2
- package/plugins/comments/contextMenuItem/removeComment.js +1 -2
- package/plugins/contextMenu/contextMenu.js +1 -1
- package/plugins/contextMenu/contextMenu.mjs +1 -1
- package/plugins/contextMenu/menu/menu.js +12 -6
- package/plugins/contextMenu/menu/menu.mjs +13 -7
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -2
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -2
- package/plugins/contextMenu/predefinedItems/columnLeft.js +1 -2
- package/plugins/contextMenu/predefinedItems/columnRight.js +1 -2
- package/plugins/contextMenu/predefinedItems/index.js +1 -2
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -2
- package/plugins/contextMenu/predefinedItems/redo.js +1 -2
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -2
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -2
- package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -2
- package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -2
- package/plugins/contextMenu/predefinedItems/undo.js +1 -2
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/plugins/customBorders/contextMenuItem/bottom.js +1 -2
- package/plugins/customBorders/contextMenuItem/left.js +1 -2
- package/plugins/customBorders/contextMenuItem/noBorders.js +1 -2
- package/plugins/customBorders/contextMenuItem/right.js +1 -2
- package/plugins/customBorders/contextMenuItem/top.js +1 -2
- package/plugins/customBorders/customBorders.js +1 -2
- package/plugins/dropdownMenu/dropdownMenu.js +16 -1
- package/plugins/dropdownMenu/dropdownMenu.mjs +16 -1
- package/plugins/exportFile/exportFile.js +59 -2
- package/plugins/exportFile/exportFile.mjs +58 -0
- package/plugins/filters/component/actionBar.js +1 -2
- package/plugins/filters/component/condition.js +1 -2
- package/plugins/filters/component/value.js +1 -2
- package/plugins/filters/condition/beginsWith.js +1 -2
- package/plugins/filters/condition/between.js +1 -2
- package/plugins/filters/condition/contains.js +1 -2
- package/plugins/filters/condition/date/after.js +1 -2
- package/plugins/filters/condition/date/before.js +1 -2
- package/plugins/filters/condition/date/today.js +1 -2
- package/plugins/filters/condition/date/tomorrow.js +1 -2
- package/plugins/filters/condition/date/yesterday.js +1 -2
- package/plugins/filters/condition/empty.js +1 -2
- package/plugins/filters/condition/endsWith.js +1 -2
- package/plugins/filters/condition/equal.js +1 -2
- package/plugins/filters/condition/greaterThan.js +1 -2
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -2
- package/plugins/filters/condition/lessThan.js +1 -2
- package/plugins/filters/condition/lessThanOrEqual.js +1 -2
- package/plugins/filters/condition/none.js +1 -2
- package/plugins/filters/condition/notBetween.js +1 -2
- package/plugins/filters/condition/notContains.js +1 -2
- package/plugins/filters/condition/notEmpty.js +1 -2
- package/plugins/filters/condition/notEqual.js +1 -2
- package/plugins/filters/filters.js +76 -3
- package/plugins/filters/filters.mjs +75 -1
- package/plugins/filters/logicalOperations/conjunction.js +1 -2
- package/plugins/filters/logicalOperations/disjunction.js +1 -2
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +1 -2
- package/plugins/filters/ui/_base.js +1 -2
- package/plugins/filters/ui/multipleSelect.js +1 -7
- package/plugins/filters/ui/multipleSelect.mjs +0 -5
- package/plugins/filters/ui/select.js +1 -2
- package/plugins/formulas/engine/register.js +3 -4
- package/plugins/formulas/engine/register.mjs +1 -1
- package/plugins/formulas/formulas.js +40 -41
- package/plugins/formulas/formulas.mjs +39 -40
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -2
- package/plugins/hiddenColumns/hiddenColumns.js +64 -0
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -0
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -2
- package/plugins/hiddenRows/hiddenRows.js +64 -0
- package/plugins/hiddenRows/hiddenRows.mjs +64 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -2
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -2
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +1 -1
- package/plugins/manualRowResize/manualRowResize.mjs +1 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -2
- package/plugins/mergeCells/mergeCells.js +56 -38
- package/plugins/mergeCells/mergeCells.mjs +56 -38
- package/plugins/mergeCells/utils.js +3 -4
- package/plugins/mergeCells/utils.mjs +3 -4
- package/plugins/nestedHeaders/nestedHeaders.js +37 -12
- package/plugins/nestedHeaders/nestedHeaders.mjs +37 -12
- package/plugins/nestedRows/nestedRows.js +12 -12
- package/plugins/nestedRows/nestedRows.mjs +12 -12
- package/plugins/nestedRows/ui/contextMenu.js +1 -2
- package/plugins/nestedRows/ui/headers.js +2 -3
- package/plugins/nestedRows/ui/headers.mjs +2 -3
- package/plugins/persistentState/persistentState.js +1 -1
- package/plugins/persistentState/persistentState.mjs +1 -1
- package/plugins/stretchColumns/calculator.js +3 -2
- package/plugins/stretchColumns/calculator.mjs +3 -2
- package/plugins/stretchColumns/stretchColumns.js +13 -0
- package/plugins/stretchColumns/stretchColumns.mjs +13 -0
- package/plugins/trimRows/trimRows.js +61 -0
- package/plugins/trimRows/trimRows.mjs +61 -0
- package/renderers/baseRenderer/baseRenderer.js +4 -0
- package/renderers/baseRenderer/baseRenderer.mjs +4 -0
- package/renderers/registry.js +2 -3
- package/renderers/registry.mjs +1 -1
- package/selection/mouseEventHandler.js +48 -13
- package/selection/mouseEventHandler.mjs +47 -13
- package/selection/range.js +73 -6
- package/selection/range.mjs +73 -6
- package/selection/selection.js +46 -32
- package/selection/selection.mjs +45 -30
- package/settings.d.ts +1 -0
- package/styles/handsontable.css +131 -55
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +296 -181
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +314 -205
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +9 -20
- package/tableView.mjs +9 -20
- package/translations/indexMapper.js +9 -5
- package/translations/indexMapper.mjs +9 -5
- package/utils/paginator.js +13 -0
- package/utils/paginator.mjs +13 -0
- package/utils/staticRegister.js +24 -2
- package/utils/staticRegister.mjs +23 -2
- package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.js +16 -30
- package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.mjs +16 -30
- package/validators/registry.js +2 -3
- package/validators/registry.mjs +1 -1
package/selection/selection.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
-
require("core-js/modules/es.array.push.js");
|
6
5
|
require("core-js/modules/es.set.difference.v2.js");
|
7
6
|
require("core-js/modules/es.set.intersection.v2.js");
|
8
7
|
require("core-js/modules/es.set.is-disjoint-from.v2.js");
|
@@ -12,6 +11,7 @@ require("core-js/modules/es.set.symmetric-difference.v2.js");
|
|
12
11
|
require("core-js/modules/es.set.union.v2.js");
|
13
12
|
require("core-js/modules/esnext.iterator.constructor.js");
|
14
13
|
require("core-js/modules/esnext.iterator.for-each.js");
|
14
|
+
require("core-js/modules/esnext.iterator.map.js");
|
15
15
|
require("core-js/modules/esnext.iterator.some.js");
|
16
16
|
var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
|
17
17
|
var _range = _interopRequireDefault(require("./range"));
|
@@ -25,8 +25,7 @@ var _utils = require("./utils");
|
|
25
25
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
26
26
|
var _a11y = require("../helpers/a11y");
|
27
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
28
|
-
function
|
29
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
30
29
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
31
30
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
32
31
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
@@ -254,8 +253,8 @@ class Selection {
|
|
254
253
|
return _this.runLocalHooks('beforeModifyTransformFocus', ...args);
|
255
254
|
});
|
256
255
|
_classPrivateFieldGet(_focusTransformation, this).addLocalHook('afterTransformStart', function () {
|
257
|
-
for (var
|
258
|
-
args[
|
256
|
+
for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
257
|
+
args[_key0] = arguments[_key0];
|
259
258
|
}
|
260
259
|
return _this.runLocalHooks('afterModifyTransformFocus', ...args);
|
261
260
|
});
|
@@ -749,13 +748,15 @@ class Selection {
|
|
749
748
|
* Returns information if we have a multi-selection. This method check multi-selection only on the latest layer of
|
750
749
|
* the selection.
|
751
750
|
*
|
751
|
+
* @param {CellRange} [cellRange] The cell range to check. If not provided, the latest selection layer is used.
|
752
752
|
* @returns {boolean}
|
753
753
|
*/
|
754
754
|
isMultiple() {
|
755
|
+
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectedRange.current();
|
755
756
|
if (!this.isSelected()) {
|
756
757
|
return false;
|
757
758
|
}
|
758
|
-
const isMultipleListener = (0, _object.createObjectPropListener)(!
|
759
|
+
const isMultipleListener = (0, _object.createObjectPropListener)(!cellRange.isSingle());
|
759
760
|
this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
|
760
761
|
return isMultipleListener.value;
|
761
762
|
}
|
@@ -1159,8 +1160,10 @@ class Selection {
|
|
1159
1160
|
}
|
1160
1161
|
|
1161
1162
|
/**
|
1162
|
-
* Refreshes the whole selection by clearing, reapplying and committing
|
1163
|
-
* by using already added visual ranges.
|
1163
|
+
* Refreshes the whole selection by clearing, reapplying and committing (calculating visual to renderable indexes)
|
1164
|
+
* the selection by using already added visual ranges. The method can be useful when underneath some indexes
|
1165
|
+
* was hidden/showed or dataset size was changed or the range of the cell ranges was modified. Then, to see the
|
1166
|
+
* changes in the selection the method may be needed to be called. The method modifies the visual ranges if needed.
|
1164
1167
|
*/
|
1165
1168
|
refresh() {
|
1166
1169
|
if (!this.isSelected()) {
|
@@ -1172,35 +1175,46 @@ class Selection {
|
|
1172
1175
|
this.deselect();
|
1173
1176
|
return;
|
1174
1177
|
}
|
1175
|
-
const
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
highlight
|
1180
|
-
} = range;
|
1178
|
+
const ranges = this.selectedRange.ranges.map(range => range.clone());
|
1179
|
+
this.markSource('refresh');
|
1180
|
+
const selectedByRowHeader = new Set(this.selectedByRowHeader);
|
1181
|
+
const selectedByColumnHeader = new Set(this.selectedByColumnHeader);
|
1181
1182
|
this.clear();
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1183
|
+
this.setExpectedLayers(ranges.length);
|
1184
|
+
ranges.forEach(range => {
|
1185
|
+
const {
|
1186
|
+
from,
|
1187
|
+
to,
|
1188
|
+
highlight
|
1189
|
+
} = range;
|
1190
|
+
const maxRows = countRows - 1;
|
1191
|
+
const maxColumns = countColumns - 1;
|
1192
|
+
highlight.assign({
|
1193
|
+
row: (0, _number.clamp)(highlight.row, this.settings.navigableHeaders ? -Infinity : 0, maxRows),
|
1194
|
+
col: (0, _number.clamp)(highlight.col, this.settings.navigableHeaders ? -Infinity : 0, maxColumns)
|
1195
|
+
});
|
1196
|
+
from.assign({
|
1197
|
+
row: (0, _number.clamp)(from.row, -Infinity, maxRows),
|
1198
|
+
col: (0, _number.clamp)(from.col, -Infinity, maxColumns)
|
1199
|
+
});
|
1200
|
+
to.assign({
|
1201
|
+
row: (0, _number.clamp)(to.row, -Infinity, maxRows),
|
1202
|
+
col: (0, _number.clamp)(to.col, -Infinity, maxColumns)
|
1203
|
+
});
|
1204
|
+
this.setRangeStartOnly(from, true, highlight);
|
1205
|
+
this.setRangeEnd(to);
|
1193
1206
|
});
|
1194
|
-
this.
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
this.applyAndCommit(range);
|
1207
|
+
this.selectedByRowHeader = selectedByRowHeader;
|
1208
|
+
this.selectedByColumnHeader = selectedByColumnHeader;
|
1209
|
+
this.finish();
|
1210
|
+
this.markEndSource();
|
1199
1211
|
}
|
1200
1212
|
|
1201
1213
|
/**
|
1202
|
-
* Refreshes the whole selection by recommitting
|
1203
|
-
* that
|
1214
|
+
* Refreshes the whole selection by only recommitting values. In terms of the selection the committing
|
1215
|
+
* values means that the cell ranges are again recalculated to the renderable indexes - the visual
|
1216
|
+
* indexes are not touched. The method can be useful when underneath some indexes was hidden/showed
|
1217
|
+
* which affects the selection. In that cases the method may be needed to be called.
|
1204
1218
|
*/
|
1205
1219
|
commit() {
|
1206
1220
|
const customSelections = this.highlight.getCustomSelections();
|
package/selection/selection.mjs
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
|
-
import "core-js/modules/es.array.push.js";
|
3
2
|
import "core-js/modules/es.set.difference.v2.js";
|
4
3
|
import "core-js/modules/es.set.intersection.v2.js";
|
5
4
|
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
@@ -9,6 +8,7 @@ import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
9
8
|
import "core-js/modules/es.set.union.v2.js";
|
10
9
|
import "core-js/modules/esnext.iterator.constructor.js";
|
11
10
|
import "core-js/modules/esnext.iterator.for-each.js";
|
11
|
+
import "core-js/modules/esnext.iterator.map.js";
|
12
12
|
import "core-js/modules/esnext.iterator.some.js";
|
13
13
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
14
14
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
@@ -248,8 +248,8 @@ class Selection {
|
|
248
248
|
return _this.runLocalHooks('beforeModifyTransformFocus', ...args);
|
249
249
|
});
|
250
250
|
_classPrivateFieldGet(_focusTransformation, this).addLocalHook('afterTransformStart', function () {
|
251
|
-
for (var
|
252
|
-
args[
|
251
|
+
for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
252
|
+
args[_key0] = arguments[_key0];
|
253
253
|
}
|
254
254
|
return _this.runLocalHooks('afterModifyTransformFocus', ...args);
|
255
255
|
});
|
@@ -743,13 +743,15 @@ class Selection {
|
|
743
743
|
* Returns information if we have a multi-selection. This method check multi-selection only on the latest layer of
|
744
744
|
* the selection.
|
745
745
|
*
|
746
|
+
* @param {CellRange} [cellRange] The cell range to check. If not provided, the latest selection layer is used.
|
746
747
|
* @returns {boolean}
|
747
748
|
*/
|
748
749
|
isMultiple() {
|
750
|
+
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectedRange.current();
|
749
751
|
if (!this.isSelected()) {
|
750
752
|
return false;
|
751
753
|
}
|
752
|
-
const isMultipleListener = createObjectPropListener(!
|
754
|
+
const isMultipleListener = createObjectPropListener(!cellRange.isSingle());
|
753
755
|
this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
|
754
756
|
return isMultipleListener.value;
|
755
757
|
}
|
@@ -1153,8 +1155,10 @@ class Selection {
|
|
1153
1155
|
}
|
1154
1156
|
|
1155
1157
|
/**
|
1156
|
-
* Refreshes the whole selection by clearing, reapplying and committing
|
1157
|
-
* by using already added visual ranges.
|
1158
|
+
* Refreshes the whole selection by clearing, reapplying and committing (calculating visual to renderable indexes)
|
1159
|
+
* the selection by using already added visual ranges. The method can be useful when underneath some indexes
|
1160
|
+
* was hidden/showed or dataset size was changed or the range of the cell ranges was modified. Then, to see the
|
1161
|
+
* changes in the selection the method may be needed to be called. The method modifies the visual ranges if needed.
|
1158
1162
|
*/
|
1159
1163
|
refresh() {
|
1160
1164
|
if (!this.isSelected()) {
|
@@ -1166,35 +1170,46 @@ class Selection {
|
|
1166
1170
|
this.deselect();
|
1167
1171
|
return;
|
1168
1172
|
}
|
1169
|
-
const
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
highlight
|
1174
|
-
} = range;
|
1173
|
+
const ranges = this.selectedRange.ranges.map(range => range.clone());
|
1174
|
+
this.markSource('refresh');
|
1175
|
+
const selectedByRowHeader = new Set(this.selectedByRowHeader);
|
1176
|
+
const selectedByColumnHeader = new Set(this.selectedByColumnHeader);
|
1175
1177
|
this.clear();
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1178
|
+
this.setExpectedLayers(ranges.length);
|
1179
|
+
ranges.forEach(range => {
|
1180
|
+
const {
|
1181
|
+
from,
|
1182
|
+
to,
|
1183
|
+
highlight
|
1184
|
+
} = range;
|
1185
|
+
const maxRows = countRows - 1;
|
1186
|
+
const maxColumns = countColumns - 1;
|
1187
|
+
highlight.assign({
|
1188
|
+
row: clamp(highlight.row, this.settings.navigableHeaders ? -Infinity : 0, maxRows),
|
1189
|
+
col: clamp(highlight.col, this.settings.navigableHeaders ? -Infinity : 0, maxColumns)
|
1190
|
+
});
|
1191
|
+
from.assign({
|
1192
|
+
row: clamp(from.row, -Infinity, maxRows),
|
1193
|
+
col: clamp(from.col, -Infinity, maxColumns)
|
1194
|
+
});
|
1195
|
+
to.assign({
|
1196
|
+
row: clamp(to.row, -Infinity, maxRows),
|
1197
|
+
col: clamp(to.col, -Infinity, maxColumns)
|
1198
|
+
});
|
1199
|
+
this.setRangeStartOnly(from, true, highlight);
|
1200
|
+
this.setRangeEnd(to);
|
1187
1201
|
});
|
1188
|
-
this.
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
this.applyAndCommit(range);
|
1202
|
+
this.selectedByRowHeader = selectedByRowHeader;
|
1203
|
+
this.selectedByColumnHeader = selectedByColumnHeader;
|
1204
|
+
this.finish();
|
1205
|
+
this.markEndSource();
|
1193
1206
|
}
|
1194
1207
|
|
1195
1208
|
/**
|
1196
|
-
* Refreshes the whole selection by recommitting
|
1197
|
-
* that
|
1209
|
+
* Refreshes the whole selection by only recommitting values. In terms of the selection the committing
|
1210
|
+
* values means that the cell ranges are again recalculated to the renderable indexes - the visual
|
1211
|
+
* indexes are not touched. The method can be useful when underneath some indexes was hidden/showed
|
1212
|
+
* which affects the selection. In that cases the method may be needed to be called.
|
1198
1213
|
*/
|
1199
1214
|
commit() {
|
1200
1215
|
const customSelections = this.highlight.getCustomSelections();
|
package/settings.d.ts
CHANGED
@@ -214,6 +214,7 @@ export interface GridSettings extends Events {
|
|
214
214
|
strict?: boolean;
|
215
215
|
tableClassName?: string | string[];
|
216
216
|
tabMoves?: CellCoords | SimpleCellCoords | ((event: KeyboardEvent) => CellCoords | SimpleCellCoords);
|
217
|
+
textEllipsis?: boolean;
|
217
218
|
themeName?: string;
|
218
219
|
title?: string;
|
219
220
|
trimDropdown?: boolean;
|