handsontable 0.0.0-next-2c41c5b-20250814 → 0.0.0-next-fce5825-20250822
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.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/autocompleteType.js +1 -4
- package/cellTypes/autocompleteType/autocompleteType.mjs +1 -4
- package/cellTypes/checkboxType/checkboxType.js +1 -3
- package/cellTypes/checkboxType/checkboxType.mjs +1 -3
- package/cellTypes/dropdownType/dropdownType.js +1 -4
- package/cellTypes/dropdownType/dropdownType.mjs +1 -4
- package/cellTypes/numericType/numericType.js +1 -3
- package/cellTypes/numericType/numericType.mjs +1 -3
- package/core/focusCatcher/index.js +37 -20
- package/core/focusCatcher/index.mjs +37 -20
- package/core/focusCatcher/utils.js +3 -64
- package/core/focusCatcher/utils.mjs +1 -60
- package/core/hooks/constants.js +58 -0
- package/core/hooks/constants.mjs +58 -0
- package/core/hooks/index.d.ts +7 -0
- package/core.d.ts +0 -1
- package/core.js +59 -55
- package/core.mjs +61 -57
- package/dataMap/dataMap.js +3 -13
- package/dataMap/dataMap.mjs +4 -14
- package/dataMap/dataSource.js +0 -16
- package/dataMap/dataSource.mjs +0 -16
- package/dataMap/metaManager/lazyFactoryMap.js +3 -4
- package/dataMap/metaManager/lazyFactoryMap.mjs +1 -2
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -3
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -3
- package/dataMap/metaManager/metaSchema.js +97 -68
- package/dataMap/metaManager/metaSchema.mjs +97 -68
- package/dataMap/metaManager/utils.js +11 -0
- package/dataMap/metaManager/utils.mjs +10 -0
- package/dist/handsontable.css +103 -5
- package/dist/handsontable.full.css +103 -5
- package/dist/handsontable.full.js +2770 -1954
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +67 -67
- package/dist/handsontable.js +2772 -1956
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +27 -27
- package/editors/autocompleteEditor/autocompleteEditor.js +8 -33
- package/editors/autocompleteEditor/autocompleteEditor.mjs +9 -34
- package/editors/baseEditor/baseEditor.js +2 -2
- package/editors/baseEditor/baseEditor.mjs +2 -2
- package/helpers/a11y.js +5 -1
- package/helpers/a11y.mjs +3 -1
- package/helpers/mixed.js +64 -1
- package/helpers/mixed.mjs +62 -1
- package/helpers/number.js +0 -28
- package/helpers/number.mjs +0 -26
- package/helpers/string.js +0 -19
- package/helpers/string.mjs +0 -18
- package/index.d.ts +9 -0
- package/package.json +6 -1
- package/plugins/autofill/autofill.js +3 -50
- package/plugins/autofill/autofill.mjs +3 -50
- package/plugins/base/base.js +75 -14
- package/plugins/base/base.mjs +75 -14
- package/plugins/contextMenu/contextMenu.js +1 -0
- package/plugins/contextMenu/contextMenu.mjs +1 -0
- package/plugins/copyPaste/copyPaste.js +28 -61
- package/plugins/copyPaste/copyPaste.mjs +29 -62
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +469 -0
- package/plugins/dialog/dialog.mjs +465 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +240 -0
- package/plugins/dialog/ui.mjs +235 -0
- package/plugins/dropdownMenu/dropdownMenu.js +1 -0
- package/plugins/dropdownMenu/dropdownMenu.mjs +1 -0
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +3 -0
- package/plugins/index.mjs +3 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/pagination.js +165 -18
- package/plugins/pagination/pagination.mjs +165 -18
- package/plugins/pagination/ui.js +101 -62
- package/plugins/pagination/ui.mjs +102 -63
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +63 -2
- package/selection/selection.mjs +63 -2
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +106 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +24 -6
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +52 -34
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +7 -2
- package/tableView.mjs +7 -2
- package/{core/focusCatcher → utils}/focusDetector.js +29 -11
- package/{core/focusCatcher → utils}/focusDetector.mjs +29 -11
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -2
- package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -2
- package/cellTypes/autocompleteType/accessors/index.js +0 -7
- package/cellTypes/autocompleteType/accessors/index.mjs +0 -2
- package/cellTypes/autocompleteType/accessors/valueGetter.js +0 -14
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +0 -10
- package/cellTypes/autocompleteType/accessors/valueSetter.js +0 -25
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +0 -21
- package/cellTypes/checkboxType/accessors/index.js +0 -5
- package/cellTypes/checkboxType/accessors/index.mjs +0 -1
- package/cellTypes/checkboxType/accessors/valueSetter.js +0 -26
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +0 -22
- package/cellTypes/dropdownType/accessors/index.js +0 -7
- package/cellTypes/dropdownType/accessors/index.mjs +0 -2
- package/cellTypes/dropdownType/accessors/valueGetter.js +0 -14
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +0 -10
- package/cellTypes/dropdownType/accessors/valueSetter.js +0 -17
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +0 -13
- package/cellTypes/numericType/accessors/index.js +0 -5
- package/cellTypes/numericType/accessors/index.mjs +0 -1
- package/cellTypes/numericType/accessors/valueSetter.js +0 -19
- package/cellTypes/numericType/accessors/valueSetter.mjs +0 -15
- package/utils/valueAccessors.js +0 -45
- package/utils/valueAccessors.mjs +0 -40
|
@@ -5,14 +5,11 @@ require("core-js/modules/es.error.cause.js");
|
|
|
5
5
|
require("core-js/modules/es.array.push.js");
|
|
6
6
|
require("core-js/modules/es.array.to-sorted.js");
|
|
7
7
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.every.js");
|
|
9
8
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
10
9
|
require("core-js/modules/esnext.iterator.find.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
12
10
|
require("core-js/modules/esnext.iterator.reduce.js");
|
|
13
11
|
var _handsontableEditor = require("../handsontableEditor");
|
|
14
12
|
var _array = require("../../helpers/array");
|
|
15
|
-
var _object = require("../../helpers/object");
|
|
16
13
|
var _element = require("../../helpers/dom/element");
|
|
17
14
|
var _mixed = require("../../helpers/mixed");
|
|
18
15
|
var _string = require("../../helpers/string");
|
|
@@ -86,14 +83,13 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
86
83
|
getValue() {
|
|
87
84
|
const selectedValue = this.rawChoices.find(value => {
|
|
88
85
|
const strippedValue = this.stripValueIfNeeded(value);
|
|
89
|
-
return
|
|
86
|
+
return strippedValue === this.TEXTAREA.value;
|
|
90
87
|
});
|
|
91
88
|
if ((0, _mixed.isDefined)(selectedValue)) {
|
|
92
89
|
return selectedValue;
|
|
93
90
|
}
|
|
94
91
|
return this.TEXTAREA.value;
|
|
95
92
|
}
|
|
96
|
-
|
|
97
93
|
/**
|
|
98
94
|
* Creates an editor's elements and adds necessary CSS classnames.
|
|
99
95
|
*/
|
|
@@ -121,10 +117,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
121
117
|
if (this.hot.getSettings().ariaTags) {
|
|
122
118
|
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false'), (0, _a11y.A11Y_CONTROLS)(`${_classPrivateFieldGet(_idPrefix, this)}-listbox-${row}-${col}`)]);
|
|
123
119
|
}
|
|
124
|
-
this.htOptions = {
|
|
125
|
-
...this.htOptions,
|
|
126
|
-
valueGetter: cellValue => _assertClassBrand(_AutocompleteEditor_brand, this, _isKeyValueObject).call(this, cellValue) ? cellValue.value : cellValue
|
|
127
|
-
};
|
|
128
120
|
}
|
|
129
121
|
|
|
130
122
|
/**
|
|
@@ -258,7 +250,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
258
250
|
const sortByRelevanceSetting = this.cellProperties.sortByRelevance;
|
|
259
251
|
const filterSetting = this.cellProperties.filter;
|
|
260
252
|
const value = this.stripValueIfNeeded(this.getValue());
|
|
261
|
-
const comparableValue = _assertClassBrand(_AutocompleteEditor_brand, this, _isKeyValueObject).call(this, value) ? value.value : value;
|
|
262
253
|
let highlightIndex = null;
|
|
263
254
|
let choices = choicesList;
|
|
264
255
|
if (!sortByRelevanceSetting) {
|
|
@@ -267,9 +258,9 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
267
258
|
const filteredChoiceIndexes = [];
|
|
268
259
|
const locale = this.cellProperties.locale;
|
|
269
260
|
const filteringCaseSensitive = this.cellProperties.filteringCaseSensitive;
|
|
270
|
-
const valueToMatch = filteringCaseSensitive ?
|
|
261
|
+
const valueToMatch = filteringCaseSensitive ? value : value.toLocaleLowerCase(locale);
|
|
271
262
|
for (let i = 0; i < choices.length; i++) {
|
|
272
|
-
const currentItem =
|
|
263
|
+
const currentItem = (0, _string.stripTags)((0, _mixed.stringify)(choices[i]));
|
|
273
264
|
const itemToMatch = filteringCaseSensitive ? currentItem : currentItem.toLocaleLowerCase(locale);
|
|
274
265
|
if (itemToMatch.indexOf(valueToMatch) !== -1) {
|
|
275
266
|
filteredChoiceIndexes.push(i);
|
|
@@ -342,7 +333,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
342
333
|
this.setDropdownHeight(tempHeight - lastRowHeight);
|
|
343
334
|
}
|
|
344
335
|
}
|
|
345
|
-
|
|
346
336
|
/**
|
|
347
337
|
* Updates width and height of the internal Handsontable's instance.
|
|
348
338
|
*
|
|
@@ -442,23 +432,17 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
|
442
432
|
*
|
|
443
433
|
* @private
|
|
444
434
|
* @param {string[]} values The value to sanitize.
|
|
445
|
-
* @returns {
|
|
435
|
+
* @returns {string[]}
|
|
446
436
|
*/
|
|
447
437
|
stripValuesIfNeeded(values) {
|
|
448
438
|
const {
|
|
449
439
|
allowHtml
|
|
450
440
|
} = this.cellProperties;
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
return {
|
|
455
|
-
key: processValue(value.key),
|
|
456
|
-
value: processValue(value.value)
|
|
457
|
-
};
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
return values.map(value => processValue(value));
|
|
441
|
+
const stringifiedValues = (0, _array.arrayMap)(values, value => (0, _mixed.stringify)(value));
|
|
442
|
+
const strippedValues = (0, _array.arrayMap)(stringifiedValues, value => allowHtml ? value : (0, _string.stripTags)(value));
|
|
443
|
+
return strippedValues;
|
|
461
444
|
}
|
|
445
|
+
|
|
462
446
|
/**
|
|
463
447
|
* OnBeforeKeyDown callback.
|
|
464
448
|
*
|
|
@@ -495,13 +479,4 @@ function _fixDropdownWidth() {
|
|
|
495
479
|
width: this.getTargetEditorWidth() + (0, _element.getScrollbarWidth)(this.hot.rootDocument)
|
|
496
480
|
});
|
|
497
481
|
}
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Checks if the value is a key/value object.
|
|
501
|
-
*
|
|
502
|
-
* @param {*} value The value to check.
|
|
503
|
-
* @returns {boolean}
|
|
504
|
-
*/
|
|
505
|
-
function _isKeyValueObject(value) {
|
|
506
|
-
return (0, _object.isObject)(value) && (0, _mixed.isDefined)(value.key) && (0, _mixed.isDefined)(value.value);
|
|
507
482
|
}
|
|
@@ -2,10 +2,8 @@ import "core-js/modules/es.error.cause.js";
|
|
|
2
2
|
import "core-js/modules/es.array.push.js";
|
|
3
3
|
import "core-js/modules/es.array.to-sorted.js";
|
|
4
4
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
5
|
-
import "core-js/modules/esnext.iterator.every.js";
|
|
6
5
|
import "core-js/modules/esnext.iterator.filter.js";
|
|
7
6
|
import "core-js/modules/esnext.iterator.find.js";
|
|
8
|
-
import "core-js/modules/esnext.iterator.map.js";
|
|
9
7
|
import "core-js/modules/esnext.iterator.reduce.js";
|
|
10
8
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
11
9
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
@@ -16,8 +14,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
16
14
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
17
15
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
18
16
|
import { HandsontableEditor } from "../handsontableEditor/index.mjs";
|
|
19
|
-
import { pivot } from "../../helpers/array.mjs";
|
|
20
|
-
import { isObject } from "../../helpers/object.mjs";
|
|
17
|
+
import { arrayMap, pivot } from "../../helpers/array.mjs";
|
|
21
18
|
import { addClass, getCaretPosition, getFractionalScalingCompensation, getScrollbarWidth, getSelectionEndPosition, outerWidth, setAttribute, setCaretPosition } from "../../helpers/dom/element.mjs";
|
|
22
19
|
import { isDefined, stringify } from "../../helpers/mixed.mjs";
|
|
23
20
|
import { stripTags } from "../../helpers/string.mjs";
|
|
@@ -83,14 +80,13 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
83
80
|
getValue() {
|
|
84
81
|
const selectedValue = this.rawChoices.find(value => {
|
|
85
82
|
const strippedValue = this.stripValueIfNeeded(value);
|
|
86
|
-
return
|
|
83
|
+
return strippedValue === this.TEXTAREA.value;
|
|
87
84
|
});
|
|
88
85
|
if (isDefined(selectedValue)) {
|
|
89
86
|
return selectedValue;
|
|
90
87
|
}
|
|
91
88
|
return this.TEXTAREA.value;
|
|
92
89
|
}
|
|
93
|
-
|
|
94
90
|
/**
|
|
95
91
|
* Creates an editor's elements and adds necessary CSS classnames.
|
|
96
92
|
*/
|
|
@@ -118,10 +114,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
118
114
|
if (this.hot.getSettings().ariaTags) {
|
|
119
115
|
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false'), A11Y_CONTROLS(`${_classPrivateFieldGet(_idPrefix, this)}-listbox-${row}-${col}`)]);
|
|
120
116
|
}
|
|
121
|
-
this.htOptions = {
|
|
122
|
-
...this.htOptions,
|
|
123
|
-
valueGetter: cellValue => _assertClassBrand(_AutocompleteEditor_brand, this, _isKeyValueObject).call(this, cellValue) ? cellValue.value : cellValue
|
|
124
|
-
};
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
/**
|
|
@@ -255,7 +247,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
255
247
|
const sortByRelevanceSetting = this.cellProperties.sortByRelevance;
|
|
256
248
|
const filterSetting = this.cellProperties.filter;
|
|
257
249
|
const value = this.stripValueIfNeeded(this.getValue());
|
|
258
|
-
const comparableValue = _assertClassBrand(_AutocompleteEditor_brand, this, _isKeyValueObject).call(this, value) ? value.value : value;
|
|
259
250
|
let highlightIndex = null;
|
|
260
251
|
let choices = choicesList;
|
|
261
252
|
if (!sortByRelevanceSetting) {
|
|
@@ -264,9 +255,9 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
264
255
|
const filteredChoiceIndexes = [];
|
|
265
256
|
const locale = this.cellProperties.locale;
|
|
266
257
|
const filteringCaseSensitive = this.cellProperties.filteringCaseSensitive;
|
|
267
|
-
const valueToMatch = filteringCaseSensitive ?
|
|
258
|
+
const valueToMatch = filteringCaseSensitive ? value : value.toLocaleLowerCase(locale);
|
|
268
259
|
for (let i = 0; i < choices.length; i++) {
|
|
269
|
-
const currentItem =
|
|
260
|
+
const currentItem = stripTags(stringify(choices[i]));
|
|
270
261
|
const itemToMatch = filteringCaseSensitive ? currentItem : currentItem.toLocaleLowerCase(locale);
|
|
271
262
|
if (itemToMatch.indexOf(valueToMatch) !== -1) {
|
|
272
263
|
filteredChoiceIndexes.push(i);
|
|
@@ -339,7 +330,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
339
330
|
this.setDropdownHeight(tempHeight - lastRowHeight);
|
|
340
331
|
}
|
|
341
332
|
}
|
|
342
|
-
|
|
343
333
|
/**
|
|
344
334
|
* Updates width and height of the internal Handsontable's instance.
|
|
345
335
|
*
|
|
@@ -439,23 +429,17 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
|
439
429
|
*
|
|
440
430
|
* @private
|
|
441
431
|
* @param {string[]} values The value to sanitize.
|
|
442
|
-
* @returns {
|
|
432
|
+
* @returns {string[]}
|
|
443
433
|
*/
|
|
444
434
|
stripValuesIfNeeded(values) {
|
|
445
435
|
const {
|
|
446
436
|
allowHtml
|
|
447
437
|
} = this.cellProperties;
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return {
|
|
452
|
-
key: processValue(value.key),
|
|
453
|
-
value: processValue(value.value)
|
|
454
|
-
};
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
return values.map(value => processValue(value));
|
|
438
|
+
const stringifiedValues = arrayMap(values, value => stringify(value));
|
|
439
|
+
const strippedValues = arrayMap(stringifiedValues, value => allowHtml ? value : stripTags(value));
|
|
440
|
+
return strippedValues;
|
|
458
441
|
}
|
|
442
|
+
|
|
459
443
|
/**
|
|
460
444
|
* OnBeforeKeyDown callback.
|
|
461
445
|
*
|
|
@@ -491,13 +475,4 @@ function _fixDropdownWidth() {
|
|
|
491
475
|
width: this.getTargetEditorWidth() + getScrollbarWidth(this.hot.rootDocument)
|
|
492
476
|
});
|
|
493
477
|
}
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Checks if the value is a key/value object.
|
|
497
|
-
*
|
|
498
|
-
* @param {*} value The value to check.
|
|
499
|
-
* @returns {boolean}
|
|
500
|
-
*/
|
|
501
|
-
function _isKeyValueObject(value) {
|
|
502
|
-
return isObject(value) && isDefined(value.key) && isDefined(value.value);
|
|
503
478
|
}
|
|
@@ -236,8 +236,7 @@ class BaseEditor {
|
|
|
236
236
|
// Set the editor value only in the full edit mode. In other mode the focusable element has to be empty,
|
|
237
237
|
// otherwise IME (editor for Asia users) doesn't work.
|
|
238
238
|
if (this.isInFullEditMode()) {
|
|
239
|
-
const
|
|
240
|
-
const stringifiedInitialValue = typeof newInitialValue === 'string' ? newInitialValue : (0, _mixed.stringify)(originalValue);
|
|
239
|
+
const stringifiedInitialValue = typeof newInitialValue === 'string' ? newInitialValue : (0, _mixed.stringify)(this.originalValue);
|
|
241
240
|
this.setValue(stringifiedInitialValue);
|
|
242
241
|
}
|
|
243
242
|
this.open(event);
|
|
@@ -254,6 +253,7 @@ class BaseEditor {
|
|
|
254
253
|
this.hot.removeHook('afterScroll', openEditor);
|
|
255
254
|
openEditor();
|
|
256
255
|
}
|
|
256
|
+
this.addHook('beforeDialogShow', () => this.cancelChanges());
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
/**
|
|
@@ -232,8 +232,7 @@ export class BaseEditor {
|
|
|
232
232
|
// Set the editor value only in the full edit mode. In other mode the focusable element has to be empty,
|
|
233
233
|
// otherwise IME (editor for Asia users) doesn't work.
|
|
234
234
|
if (this.isInFullEditMode()) {
|
|
235
|
-
const
|
|
236
|
-
const stringifiedInitialValue = typeof newInitialValue === 'string' ? newInitialValue : stringify(originalValue);
|
|
235
|
+
const stringifiedInitialValue = typeof newInitialValue === 'string' ? newInitialValue : stringify(this.originalValue);
|
|
237
236
|
this.setValue(stringifiedInitialValue);
|
|
238
237
|
}
|
|
239
238
|
this.open(event);
|
|
@@ -250,6 +249,7 @@ export class BaseEditor {
|
|
|
250
249
|
this.hot.removeHook('afterScroll', openEditor);
|
|
251
250
|
openEditor();
|
|
252
251
|
}
|
|
252
|
+
this.addHook('beforeDialogShow', () => this.cancelChanges());
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
package/helpers/a11y.js
CHANGED
|
@@ -33,6 +33,8 @@ const A11Y_OPTION = () => ['role', 'option'];
|
|
|
33
33
|
exports.A11Y_OPTION = A11Y_OPTION;
|
|
34
34
|
const A11Y_CHECKBOX = () => ['role', 'checkbox'];
|
|
35
35
|
exports.A11Y_CHECKBOX = A11Y_CHECKBOX;
|
|
36
|
+
const A11Y_DIALOG = () => ['role', 'dialog'];
|
|
37
|
+
exports.A11Y_DIALOG = A11Y_DIALOG;
|
|
36
38
|
const A11Y_SCOPE_COL = () => ['scope', 'col'];
|
|
37
39
|
exports.A11Y_SCOPE_COL = A11Y_SCOPE_COL;
|
|
38
40
|
const A11Y_SCOPE_ROW = () => ['scope', 'row'];
|
|
@@ -85,4 +87,6 @@ exports.A11Y_RELEVANT = A11Y_RELEVANT;
|
|
|
85
87
|
const A11Y_SETSIZE = val => ['aria-setsize', val];
|
|
86
88
|
exports.A11Y_SETSIZE = A11Y_SETSIZE;
|
|
87
89
|
const A11Y_POSINSET = val => ['aria-posinset', val];
|
|
88
|
-
exports.A11Y_POSINSET = A11Y_POSINSET;
|
|
90
|
+
exports.A11Y_POSINSET = A11Y_POSINSET;
|
|
91
|
+
const A11Y_MODAL = () => ['aria-modal', 'true'];
|
|
92
|
+
exports.A11Y_MODAL = A11Y_MODAL;
|
package/helpers/a11y.mjs
CHANGED
|
@@ -14,6 +14,7 @@ export const A11Y_COMBOBOX = () => ['role', 'combobox'];
|
|
|
14
14
|
export const A11Y_LISTBOX = () => ['role', 'listbox'];
|
|
15
15
|
export const A11Y_OPTION = () => ['role', 'option'];
|
|
16
16
|
export const A11Y_CHECKBOX = () => ['role', 'checkbox'];
|
|
17
|
+
export const A11Y_DIALOG = () => ['role', 'dialog'];
|
|
17
18
|
export const A11Y_SCOPE_COL = () => ['scope', 'col'];
|
|
18
19
|
export const A11Y_SCOPE_ROW = () => ['scope', 'row'];
|
|
19
20
|
export const A11Y_TEXT = () => ['type', 'text'];
|
|
@@ -41,4 +42,5 @@ export const A11Y_ACTIVEDESCENDANT = val => ['aria-activedescendant', val];
|
|
|
41
42
|
export const A11Y_LIVE = val => ['aria-live', val];
|
|
42
43
|
export const A11Y_RELEVANT = val => ['aria-relevant', val];
|
|
43
44
|
export const A11Y_SETSIZE = val => ['aria-setsize', val];
|
|
44
|
-
export const A11Y_POSINSET = val => ['aria-posinset', val];
|
|
45
|
+
export const A11Y_POSINSET = val => ['aria-posinset', val];
|
|
46
|
+
export const A11Y_MODAL = () => ['aria-modal', 'true'];
|
package/helpers/mixed.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports._injectProductInfo = _injectProductInfo;
|
|
5
|
+
exports.getMostBottomEndPosition = getMostBottomEndPosition;
|
|
6
|
+
exports.getMostTopStartPosition = getMostTopStartPosition;
|
|
5
7
|
exports.isDefined = isDefined;
|
|
6
8
|
exports.isEmpty = isEmpty;
|
|
7
9
|
exports.isRegExp = isRegExp;
|
|
@@ -134,7 +136,7 @@ const domMessages = {
|
|
|
134
136
|
function _injectProductInfo(key, element) {
|
|
135
137
|
const hasValidType = !isEmpty(key);
|
|
136
138
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
|
137
|
-
const hotVersion = "0.0.0-next-
|
|
139
|
+
const hotVersion = "0.0.0-next-fce5825-20250822";
|
|
138
140
|
let keyValidityDate;
|
|
139
141
|
let consoleMessageState = 'invalid';
|
|
140
142
|
let domMessageState = 'invalid';
|
|
@@ -208,4 +210,65 @@ function _checkKeySchema(v) {
|
|
|
208
210
|
}
|
|
209
211
|
return p === z;
|
|
210
212
|
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
216
|
+
*
|
|
217
|
+
* @param {Core} hot The Handsontable instance.
|
|
218
|
+
* @returns {CellCoords|null}
|
|
219
|
+
*/
|
|
220
|
+
function getMostTopStartPosition(hot) {
|
|
221
|
+
const {
|
|
222
|
+
rowIndexMapper,
|
|
223
|
+
columnIndexMapper
|
|
224
|
+
} = hot;
|
|
225
|
+
const {
|
|
226
|
+
navigableHeaders
|
|
227
|
+
} = hot.getSettings();
|
|
228
|
+
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
229
|
+
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
230
|
+
if (topRow === 0) {
|
|
231
|
+
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
232
|
+
}
|
|
233
|
+
if (startColumn === 0) {
|
|
234
|
+
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
235
|
+
}
|
|
236
|
+
if (topRow === null || startColumn === null) {
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
return hot._createCellCoords(topRow, startColumn);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
244
|
+
*
|
|
245
|
+
* @param {Core} hot The Handsontable instance.
|
|
246
|
+
* @returns {CellCoords|null}
|
|
247
|
+
*/
|
|
248
|
+
function getMostBottomEndPosition(hot) {
|
|
249
|
+
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
250
|
+
const {
|
|
251
|
+
rowIndexMapper,
|
|
252
|
+
columnIndexMapper
|
|
253
|
+
} = hot;
|
|
254
|
+
const {
|
|
255
|
+
navigableHeaders
|
|
256
|
+
} = hot.getSettings();
|
|
257
|
+
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
258
|
+
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
259
|
+
if (bottomRow < 0) {
|
|
260
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
bottomRow = -1;
|
|
264
|
+
}
|
|
265
|
+
if (endColumn < 0) {
|
|
266
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
endColumn = -1;
|
|
270
|
+
}
|
|
271
|
+
return hot._createCellCoords((_rowIndexMapper$getVi = rowIndexMapper.getVisualFromRenderableIndex(bottomRow)) !== null && _rowIndexMapper$getVi !== void 0 ? _rowIndexMapper$getVi : bottomRow, (_columnIndexMapper$ge = columnIndexMapper.getVisualFromRenderableIndex(endColumn)) !== null && _columnIndexMapper$ge !== void 0 ? _columnIndexMapper$ge : endColumn);
|
|
272
|
+
}
|
|
273
|
+
|
|
211
274
|
/* eslint-enable */
|
package/helpers/mixed.mjs
CHANGED
|
@@ -124,7 +124,7 @@ const domMessages = {
|
|
|
124
124
|
export function _injectProductInfo(key, element) {
|
|
125
125
|
const hasValidType = !isEmpty(key);
|
|
126
126
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
|
127
|
-
const hotVersion = "0.0.0-next-
|
|
127
|
+
const hotVersion = "0.0.0-next-fce5825-20250822";
|
|
128
128
|
let keyValidityDate;
|
|
129
129
|
let consoleMessageState = 'invalid';
|
|
130
130
|
let domMessageState = 'invalid';
|
|
@@ -198,4 +198,65 @@ function _checkKeySchema(v) {
|
|
|
198
198
|
}
|
|
199
199
|
return p === z;
|
|
200
200
|
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
204
|
+
*
|
|
205
|
+
* @param {Core} hot The Handsontable instance.
|
|
206
|
+
* @returns {CellCoords|null}
|
|
207
|
+
*/
|
|
208
|
+
export function getMostTopStartPosition(hot) {
|
|
209
|
+
const {
|
|
210
|
+
rowIndexMapper,
|
|
211
|
+
columnIndexMapper
|
|
212
|
+
} = hot;
|
|
213
|
+
const {
|
|
214
|
+
navigableHeaders
|
|
215
|
+
} = hot.getSettings();
|
|
216
|
+
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
217
|
+
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
218
|
+
if (topRow === 0) {
|
|
219
|
+
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
220
|
+
}
|
|
221
|
+
if (startColumn === 0) {
|
|
222
|
+
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
223
|
+
}
|
|
224
|
+
if (topRow === null || startColumn === null) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
return hot._createCellCoords(topRow, startColumn);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
232
|
+
*
|
|
233
|
+
* @param {Core} hot The Handsontable instance.
|
|
234
|
+
* @returns {CellCoords|null}
|
|
235
|
+
*/
|
|
236
|
+
export function getMostBottomEndPosition(hot) {
|
|
237
|
+
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
238
|
+
const {
|
|
239
|
+
rowIndexMapper,
|
|
240
|
+
columnIndexMapper
|
|
241
|
+
} = hot;
|
|
242
|
+
const {
|
|
243
|
+
navigableHeaders
|
|
244
|
+
} = hot.getSettings();
|
|
245
|
+
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
246
|
+
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
247
|
+
if (bottomRow < 0) {
|
|
248
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
bottomRow = -1;
|
|
252
|
+
}
|
|
253
|
+
if (endColumn < 0) {
|
|
254
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
endColumn = -1;
|
|
258
|
+
}
|
|
259
|
+
return hot._createCellCoords((_rowIndexMapper$getVi = rowIndexMapper.getVisualFromRenderableIndex(bottomRow)) !== null && _rowIndexMapper$getVi !== void 0 ? _rowIndexMapper$getVi : bottomRow, (_columnIndexMapper$ge = columnIndexMapper.getVisualFromRenderableIndex(endColumn)) !== null && _columnIndexMapper$ge !== void 0 ? _columnIndexMapper$ge : endColumn);
|
|
260
|
+
}
|
|
261
|
+
|
|
201
262
|
/* eslint-enable */
|
package/helpers/number.js
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.clamp = clamp;
|
|
5
|
-
exports.getParsedNumber = getParsedNumber;
|
|
6
5
|
exports.isNumeric = isNumeric;
|
|
7
6
|
exports.isNumericLike = isNumericLike;
|
|
8
|
-
exports.isUnsignedNumber = isUnsignedNumber;
|
|
9
7
|
exports.rangeEach = rangeEach;
|
|
10
8
|
exports.rangeEachReverse = rangeEachReverse;
|
|
11
9
|
exports.valueAccordingPercent = valueAccordingPercent;
|
|
@@ -143,30 +141,4 @@ function clamp(value, minValue, maxValue) {
|
|
|
143
141
|
return maxValue;
|
|
144
142
|
}
|
|
145
143
|
return value;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Get parsed number from numeric string.
|
|
150
|
-
*
|
|
151
|
-
* @param {string} numericData Float (separated by a dot or a comma) or integer.
|
|
152
|
-
* @returns {number|null} Number if we get data in parsable format, not changed value otherwise.
|
|
153
|
-
*/
|
|
154
|
-
function getParsedNumber(numericData) {
|
|
155
|
-
// Unifying "float like" string. Change from value with comma determiner to value with dot determiner,
|
|
156
|
-
// for example from `450,65` to `450.65`.
|
|
157
|
-
const unifiedNumericData = numericData.replace(',', '.');
|
|
158
|
-
if (isNaN(parseFloat(unifiedNumericData)) === false) {
|
|
159
|
-
return parseFloat(unifiedNumericData);
|
|
160
|
-
}
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Check if the provided argument is an unsigned number.
|
|
166
|
-
*
|
|
167
|
-
* @param {*} value Value to check.
|
|
168
|
-
* @returns {boolean}
|
|
169
|
-
*/
|
|
170
|
-
function isUnsignedNumber(value) {
|
|
171
|
-
return Number.isInteger(value) && value >= 0;
|
|
172
144
|
}
|
package/helpers/number.mjs
CHANGED
|
@@ -132,30 +132,4 @@ export function clamp(value, minValue, maxValue) {
|
|
|
132
132
|
return maxValue;
|
|
133
133
|
}
|
|
134
134
|
return value;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Get parsed number from numeric string.
|
|
139
|
-
*
|
|
140
|
-
* @param {string} numericData Float (separated by a dot or a comma) or integer.
|
|
141
|
-
* @returns {number|null} Number if we get data in parsable format, not changed value otherwise.
|
|
142
|
-
*/
|
|
143
|
-
export function getParsedNumber(numericData) {
|
|
144
|
-
// Unifying "float like" string. Change from value with comma determiner to value with dot determiner,
|
|
145
|
-
// for example from `450,65` to `450.65`.
|
|
146
|
-
const unifiedNumericData = numericData.replace(',', '.');
|
|
147
|
-
if (isNaN(parseFloat(unifiedNumericData)) === false) {
|
|
148
|
-
return parseFloat(unifiedNumericData);
|
|
149
|
-
}
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Check if the provided argument is an unsigned number.
|
|
155
|
-
*
|
|
156
|
-
* @param {*} value Value to check.
|
|
157
|
-
* @returns {boolean}
|
|
158
|
-
*/
|
|
159
|
-
export function isUnsignedNumber(value) {
|
|
160
|
-
return Number.isInteger(value) && value >= 0;
|
|
161
135
|
}
|
package/helpers/string.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.equalsIgnoreCase = equalsIgnoreCase;
|
|
5
|
-
exports.isJSON = isJSON;
|
|
6
5
|
exports.isPercentValue = isPercentValue;
|
|
7
6
|
exports.randomString = randomString;
|
|
8
7
|
exports.sanitize = sanitize;
|
|
@@ -60,24 +59,6 @@ function randomString() {
|
|
|
60
59
|
return s4() + s4() + s4() + s4();
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
* Checks if a string is a valid JSON object.
|
|
65
|
-
*
|
|
66
|
-
* @param {string} string The string to check.
|
|
67
|
-
* @returns {boolean}
|
|
68
|
-
*/
|
|
69
|
-
function isJSON(string) {
|
|
70
|
-
if (typeof string !== 'string') {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
const parsed = JSON.parse(string);
|
|
75
|
-
return typeof parsed === 'object' && parsed !== null;
|
|
76
|
-
} catch {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
62
|
/**
|
|
82
63
|
* Checks if value is valid percent.
|
|
83
64
|
*
|
package/helpers/string.mjs
CHANGED
|
@@ -48,24 +48,6 @@ export function randomString() {
|
|
|
48
48
|
return s4() + s4() + s4() + s4();
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* Checks if a string is a valid JSON object.
|
|
53
|
-
*
|
|
54
|
-
* @param {string} string The string to check.
|
|
55
|
-
* @returns {boolean}
|
|
56
|
-
*/
|
|
57
|
-
export function isJSON(string) {
|
|
58
|
-
if (typeof string !== 'string') {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
const parsed = JSON.parse(string);
|
|
63
|
-
return typeof parsed === 'object' && parsed !== null;
|
|
64
|
-
} catch {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
51
|
/**
|
|
70
52
|
* Checks if value is valid percent.
|
|
71
53
|
*
|
package/index.d.ts
CHANGED
|
@@ -235,6 +235,10 @@ import {
|
|
|
235
235
|
TrimRows as _TrimRows,
|
|
236
236
|
Settings as TrimRowsSettings,
|
|
237
237
|
} from './plugins/trimRows';
|
|
238
|
+
import {
|
|
239
|
+
Dialog as _Dialog,
|
|
240
|
+
Settings as DialogSettings,
|
|
241
|
+
} from './plugins/dialog';
|
|
238
242
|
import {
|
|
239
243
|
UndoRedo as _UndoRedo,
|
|
240
244
|
Settings as UndoRedoSettings,
|
|
@@ -389,6 +393,7 @@ declare namespace Handsontable {
|
|
|
389
393
|
export class Search extends _Search {}
|
|
390
394
|
export class TouchScroll extends _TouchScroll {}
|
|
391
395
|
export class TrimRows extends _TrimRows {}
|
|
396
|
+
export class Dialog extends _Dialog {}
|
|
392
397
|
export class UndoRedo extends _UndoRedo {}
|
|
393
398
|
|
|
394
399
|
export namespace AutoColumnSize {
|
|
@@ -547,6 +552,10 @@ declare namespace Handsontable {
|
|
|
547
552
|
export { TrimRowsSettings as Settings };
|
|
548
553
|
}
|
|
549
554
|
|
|
555
|
+
export namespace Dialog {
|
|
556
|
+
export { DialogSettings as Settings };
|
|
557
|
+
}
|
|
558
|
+
|
|
550
559
|
export namespace UndoRedo {
|
|
551
560
|
export { UndoRedoSettings as Settings };
|
|
552
561
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/handsontable/handsontable/issues"
|
|
11
11
|
},
|
|
12
12
|
"author": "Handsoncode <hello@handsontable.com>",
|
|
13
|
-
"version": "0.0.0-next-
|
|
13
|
+
"version": "0.0.0-next-fce5825-20250822",
|
|
14
14
|
"main": "index",
|
|
15
15
|
"module": "index.mjs",
|
|
16
16
|
"jsnext:main": "index.mjs",
|
|
@@ -388,6 +388,11 @@
|
|
|
388
388
|
"require": "./plugins/customBorders/index.js",
|
|
389
389
|
"import": "./plugins/customBorders/index.mjs"
|
|
390
390
|
},
|
|
391
|
+
"./plugins/dialog": {
|
|
392
|
+
"types": "./plugins/dialog/index.d.ts",
|
|
393
|
+
"require": "./plugins/dialog/index.js",
|
|
394
|
+
"import": "./plugins/dialog/index.mjs"
|
|
395
|
+
},
|
|
391
396
|
"./plugins/dragToScroll": {
|
|
392
397
|
"types": "./plugins/dragToScroll/index.d.ts",
|
|
393
398
|
"require": "./plugins/dragToScroll/index.js",
|