handsontable 0.0.0-next-f86a877-20250819 → 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/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.js +13 -4
- package/core.mjs +13 -4
- package/dataMap/metaManager/metaSchema.js +95 -0
- package/dataMap/metaManager/metaSchema.mjs +95 -0
- package/dist/handsontable.css +103 -5
- package/dist/handsontable.full.css +103 -5
- package/dist/handsontable.full.js +1600 -282
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +65 -65
- package/dist/handsontable.js +1600 -282
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +27 -27
- package/editors/baseEditor/baseEditor.js +1 -0
- package/editors/baseEditor/baseEditor.mjs +1 -0
- 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/index.d.ts +9 -0
- package/package.json +6 -1
- 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/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 +2 -0
- 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/dist/handsontable.js
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
27
|
*
|
|
28
|
-
* Version: 0.0.0-next-
|
|
29
|
-
* Release date: 10/07/2025 (built at
|
|
28
|
+
* Version: 0.0.0-next-fce5825-20250822
|
|
29
|
+
* Release date: 10/07/2025 (built at 22/08/2025 10:30:06)
|
|
30
30
|
*/
|
|
31
31
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
32
32
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -104,8 +104,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
|
|
|
104
104
|
Handsontable.CellCoords = _src.CellCoords;
|
|
105
105
|
Handsontable.CellRange = _src.CellRange;
|
|
106
106
|
Handsontable.packageName = 'handsontable';
|
|
107
|
-
Handsontable.buildDate = "
|
|
108
|
-
Handsontable.version = "0.0.0-next-
|
|
107
|
+
Handsontable.buildDate = "22/08/2025 10:30:06";
|
|
108
|
+
Handsontable.version = "0.0.0-next-fce5825-20250822";
|
|
109
109
|
Handsontable.languages = {
|
|
110
110
|
dictionaryKeys: _registry.dictionaryKeys,
|
|
111
111
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
|
@@ -332,6 +332,14 @@ function Core(rootContainer, userSettings) {
|
|
|
332
332
|
*/
|
|
333
333
|
this.rootWrapperElement = undefined;
|
|
334
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Reference to the grid element.
|
|
337
|
+
*
|
|
338
|
+
* @private
|
|
339
|
+
* @type {HTMLElement}
|
|
340
|
+
*/
|
|
341
|
+
this.rootGridElement = undefined;
|
|
342
|
+
|
|
335
343
|
/**
|
|
336
344
|
* Reference to the portal element.
|
|
337
345
|
*
|
|
@@ -366,10 +374,13 @@ function Core(rootContainer, userSettings) {
|
|
|
366
374
|
this.rootWindow = this.rootDocument.defaultView;
|
|
367
375
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
368
376
|
this.rootWrapperElement = this.rootDocument.createElement('div');
|
|
377
|
+
this.rootGridElement = this.rootDocument.createElement('div');
|
|
369
378
|
this.rootPortalElement = this.rootDocument.createElement('div');
|
|
370
379
|
(0, _element.addClass)(this.rootElement, ['ht-wrapper', 'handsontable']);
|
|
371
380
|
(0, _element.addClass)(this.rootWrapperElement, 'ht-root-wrapper');
|
|
372
|
-
|
|
381
|
+
(0, _element.addClass)(this.rootGridElement, 'ht-grid');
|
|
382
|
+
this.rootGridElement.appendChild(this.rootElement);
|
|
383
|
+
this.rootWrapperElement.appendChild(this.rootGridElement);
|
|
373
384
|
this.rootContainer.appendChild(this.rootWrapperElement);
|
|
374
385
|
(0, _element.addClass)(this.rootPortalElement, 'ht-portal');
|
|
375
386
|
this.rootDocument.body.appendChild(this.rootPortalElement);
|
|
@@ -482,9 +493,6 @@ function Core(rootContainer, userSettings) {
|
|
|
482
493
|
const pluginsRegistry = (0, _uniqueMap.createUniqueMap)();
|
|
483
494
|
this.container = this.rootDocument.createElement('div');
|
|
484
495
|
this.rootElement.insertBefore(this.container, this.rootElement.firstChild);
|
|
485
|
-
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
486
|
-
(0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
487
|
-
}
|
|
488
496
|
this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
|
|
489
497
|
|
|
490
498
|
foreignHotInstances.set(this.guid, this);
|
|
@@ -1321,6 +1329,7 @@ function Core(rootContainer, userSettings) {
|
|
|
1321
1329
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
1322
1330
|
(0, _index.installFocusCatcher)(instance);
|
|
1323
1331
|
(0, _a11yAnnouncer.install)(instance.rootPortalElement);
|
|
1332
|
+
(0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
1324
1333
|
}
|
|
1325
1334
|
instance.runHooks('init');
|
|
1326
1335
|
this.render();
|
|
@@ -10485,6 +10494,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__161__;
|
|
|
10485
10494
|
var _interopRequireDefault = __webpack_require__(1);
|
|
10486
10495
|
exports.__esModule = true;
|
|
10487
10496
|
exports._injectProductInfo = _injectProductInfo;
|
|
10497
|
+
exports.getMostBottomEndPosition = getMostBottomEndPosition;
|
|
10498
|
+
exports.getMostTopStartPosition = getMostTopStartPosition;
|
|
10488
10499
|
exports.isDefined = isDefined;
|
|
10489
10500
|
exports.isEmpty = isEmpty;
|
|
10490
10501
|
exports.isRegExp = isRegExp;
|
|
@@ -10616,7 +10627,7 @@ const domMessages = {
|
|
|
10616
10627
|
function _injectProductInfo(key, element) {
|
|
10617
10628
|
const hasValidType = !isEmpty(key);
|
|
10618
10629
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
|
10619
|
-
const hotVersion = "0.0.0-next-
|
|
10630
|
+
const hotVersion = "0.0.0-next-fce5825-20250822";
|
|
10620
10631
|
let keyValidityDate;
|
|
10621
10632
|
let consoleMessageState = 'invalid';
|
|
10622
10633
|
let domMessageState = 'invalid';
|
|
@@ -10690,6 +10701,67 @@ function _checkKeySchema(v) {
|
|
|
10690
10701
|
}
|
|
10691
10702
|
return p === z;
|
|
10692
10703
|
}
|
|
10704
|
+
|
|
10705
|
+
/**
|
|
10706
|
+
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
10707
|
+
*
|
|
10708
|
+
* @param {Core} hot The Handsontable instance.
|
|
10709
|
+
* @returns {CellCoords|null}
|
|
10710
|
+
*/
|
|
10711
|
+
function getMostTopStartPosition(hot) {
|
|
10712
|
+
const {
|
|
10713
|
+
rowIndexMapper,
|
|
10714
|
+
columnIndexMapper
|
|
10715
|
+
} = hot;
|
|
10716
|
+
const {
|
|
10717
|
+
navigableHeaders
|
|
10718
|
+
} = hot.getSettings();
|
|
10719
|
+
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
10720
|
+
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
10721
|
+
if (topRow === 0) {
|
|
10722
|
+
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
10723
|
+
}
|
|
10724
|
+
if (startColumn === 0) {
|
|
10725
|
+
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
10726
|
+
}
|
|
10727
|
+
if (topRow === null || startColumn === null) {
|
|
10728
|
+
return null;
|
|
10729
|
+
}
|
|
10730
|
+
return hot._createCellCoords(topRow, startColumn);
|
|
10731
|
+
}
|
|
10732
|
+
|
|
10733
|
+
/**
|
|
10734
|
+
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
10735
|
+
*
|
|
10736
|
+
* @param {Core} hot The Handsontable instance.
|
|
10737
|
+
* @returns {CellCoords|null}
|
|
10738
|
+
*/
|
|
10739
|
+
function getMostBottomEndPosition(hot) {
|
|
10740
|
+
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
10741
|
+
const {
|
|
10742
|
+
rowIndexMapper,
|
|
10743
|
+
columnIndexMapper
|
|
10744
|
+
} = hot;
|
|
10745
|
+
const {
|
|
10746
|
+
navigableHeaders
|
|
10747
|
+
} = hot.getSettings();
|
|
10748
|
+
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
10749
|
+
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
10750
|
+
if (bottomRow < 0) {
|
|
10751
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
10752
|
+
return null;
|
|
10753
|
+
}
|
|
10754
|
+
bottomRow = -1;
|
|
10755
|
+
}
|
|
10756
|
+
if (endColumn < 0) {
|
|
10757
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
10758
|
+
return null;
|
|
10759
|
+
}
|
|
10760
|
+
endColumn = -1;
|
|
10761
|
+
}
|
|
10762
|
+
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);
|
|
10763
|
+
}
|
|
10764
|
+
|
|
10693
10765
|
/* eslint-enable */
|
|
10694
10766
|
|
|
10695
10767
|
/***/ }),
|
|
@@ -11230,6 +11302,8 @@ const A11Y_OPTION = () => ['role', 'option'];
|
|
|
11230
11302
|
exports.A11Y_OPTION = A11Y_OPTION;
|
|
11231
11303
|
const A11Y_CHECKBOX = () => ['role', 'checkbox'];
|
|
11232
11304
|
exports.A11Y_CHECKBOX = A11Y_CHECKBOX;
|
|
11305
|
+
const A11Y_DIALOG = () => ['role', 'dialog'];
|
|
11306
|
+
exports.A11Y_DIALOG = A11Y_DIALOG;
|
|
11233
11307
|
const A11Y_SCOPE_COL = () => ['scope', 'col'];
|
|
11234
11308
|
exports.A11Y_SCOPE_COL = A11Y_SCOPE_COL;
|
|
11235
11309
|
const A11Y_SCOPE_ROW = () => ['scope', 'row'];
|
|
@@ -11283,6 +11357,8 @@ const A11Y_SETSIZE = val => ['aria-setsize', val];
|
|
|
11283
11357
|
exports.A11Y_SETSIZE = A11Y_SETSIZE;
|
|
11284
11358
|
const A11Y_POSINSET = val => ['aria-posinset', val];
|
|
11285
11359
|
exports.A11Y_POSINSET = A11Y_POSINSET;
|
|
11360
|
+
const A11Y_MODAL = () => ['aria-modal', 'true'];
|
|
11361
|
+
exports.A11Y_MODAL = A11Y_MODAL;
|
|
11286
11362
|
|
|
11287
11363
|
/***/ }),
|
|
11288
11364
|
/* 169 */
|
|
@@ -15355,6 +15431,7 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
|
|
|
15355
15431
|
* @param {'from_above' | 'from_below'} tabActivationDir The browsers Tab navigation direction. Depending on
|
|
15356
15432
|
* whether the user activated the table from the element above or below, another cell can be selected.
|
|
15357
15433
|
* @param {CellCoords} visualCoords The coords that will be used to select a cell.
|
|
15434
|
+
* @returns {undefined|boolean} If `false` is returned, the table will not be focused.
|
|
15358
15435
|
*/
|
|
15359
15436
|
'modifyFocusOnTabNavigation',
|
|
15360
15437
|
/**
|
|
@@ -16525,6 +16602,63 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
|
|
|
16525
16602
|
* Returning `true` removes those restrictions.
|
|
16526
16603
|
*/
|
|
16527
16604
|
'beforeBeginEditing',
|
|
16605
|
+
/**
|
|
16606
|
+
* Fired by {@link Dialog} plugin after hiding the dialog. This hook is fired when {@link Options#dialog}
|
|
16607
|
+
* option is enabled.
|
|
16608
|
+
*
|
|
16609
|
+
* @since 16.1.0
|
|
16610
|
+
* @event Hooks#afterDialogHide
|
|
16611
|
+
*/
|
|
16612
|
+
'afterDialogHide',
|
|
16613
|
+
/**
|
|
16614
|
+
* Fired by {@link Dialog} plugin after showing the dialog. This hook is fired when {@link Options#dialog}
|
|
16615
|
+
* option is enabled.
|
|
16616
|
+
*
|
|
16617
|
+
* @since 16.1.0
|
|
16618
|
+
* @event Hooks#afterDialogShow
|
|
16619
|
+
*/
|
|
16620
|
+
'afterDialogShow',
|
|
16621
|
+
/**
|
|
16622
|
+
* Fired by {@link Dialog} plugin before hiding the dialog. This hook is fired when {@link Options#dialog}
|
|
16623
|
+
* option is enabled.
|
|
16624
|
+
*
|
|
16625
|
+
* @since 16.1.0
|
|
16626
|
+
* @event Hooks#beforeDialogHide
|
|
16627
|
+
*/
|
|
16628
|
+
'beforeDialogHide',
|
|
16629
|
+
/**
|
|
16630
|
+
* Fired by {@link Dialog} plugin before showing the dialog. This hook is fired when {@link Options#dialog}
|
|
16631
|
+
* option is enabled.
|
|
16632
|
+
*
|
|
16633
|
+
* @since 16.1.0
|
|
16634
|
+
* @event Hooks#beforeDialogShow
|
|
16635
|
+
*/
|
|
16636
|
+
'beforeDialogShow',
|
|
16637
|
+
/**
|
|
16638
|
+
* Fired by {@link Dialog} plugin before focusing the previous element. This hook is fired when {@link Options#dialog}
|
|
16639
|
+
* option is enabled.
|
|
16640
|
+
*
|
|
16641
|
+
* @since 16.1.0
|
|
16642
|
+
* @event Hooks#dialogFocusPreviousElement
|
|
16643
|
+
*/
|
|
16644
|
+
'dialogFocusPreviousElement',
|
|
16645
|
+
/**
|
|
16646
|
+
* Fired by {@link Dialog} plugin before focusing the next element. This hook is fired when {@link Options#dialog}
|
|
16647
|
+
* option is enabled.
|
|
16648
|
+
*
|
|
16649
|
+
* @since 16.1.0
|
|
16650
|
+
* @event Hooks#dialogFocusNextElement
|
|
16651
|
+
*/
|
|
16652
|
+
'dialogFocusNextElement',
|
|
16653
|
+
/**
|
|
16654
|
+
* Fired by {@link Dialog} plugin when the focus is set. This hook is fired when {@link Options#dialog}
|
|
16655
|
+
* option is enabled.
|
|
16656
|
+
*
|
|
16657
|
+
* @since 16.1.0
|
|
16658
|
+
* @event Hooks#afterDialogFocus
|
|
16659
|
+
* @param {'tab_from_above' | 'tab_from_below' | 'click' | 'show'} focusSource The source of the focus.
|
|
16660
|
+
*/
|
|
16661
|
+
'afterDialogFocus',
|
|
16528
16662
|
/**
|
|
16529
16663
|
* Fired after the editor is opened and rendered.
|
|
16530
16664
|
*
|
|
@@ -19129,6 +19263,7 @@ class TableView {
|
|
|
19129
19263
|
*/
|
|
19130
19264
|
registerEvents() {
|
|
19131
19265
|
const {
|
|
19266
|
+
rootWrapperElement,
|
|
19132
19267
|
rootElement,
|
|
19133
19268
|
rootDocument,
|
|
19134
19269
|
selection,
|
|
@@ -19162,15 +19297,19 @@ class TableView {
|
|
|
19162
19297
|
}
|
|
19163
19298
|
});
|
|
19164
19299
|
this.eventManager.addEventListener(documentElement, 'mouseup', event => {
|
|
19300
|
+
var _rootDocument$querySe;
|
|
19165
19301
|
if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
|
|
19166
19302
|
selection.finish();
|
|
19167
19303
|
}
|
|
19168
19304
|
_classPrivateFieldSet(_mouseDown, this, false);
|
|
19169
19305
|
const isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
|
|
19170
|
-
|
|
19306
|
+
// TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
|
|
19307
|
+
// Should be removed when the focus manager is implemented.
|
|
19308
|
+
const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
|
|
19309
|
+
if ((0, _element.isInput)(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
|
|
19171
19310
|
return;
|
|
19172
19311
|
}
|
|
19173
|
-
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
|
|
19312
|
+
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !(0, _event.isRightClick)(event)) {
|
|
19174
19313
|
this.hot.unlisten();
|
|
19175
19314
|
}
|
|
19176
19315
|
});
|
|
@@ -36866,6 +37005,7 @@ Object.keys(_highlight).forEach(function (key) {
|
|
|
36866
37005
|
var _interopRequireDefault = __webpack_require__(1);
|
|
36867
37006
|
exports.__esModule = true;
|
|
36868
37007
|
__webpack_require__(5);
|
|
37008
|
+
__webpack_require__(87);
|
|
36869
37009
|
__webpack_require__(101);
|
|
36870
37010
|
__webpack_require__(112);
|
|
36871
37011
|
__webpack_require__(114);
|
|
@@ -36895,6 +37035,15 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("C
|
|
|
36895
37035
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
36896
37036
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
36897
37037
|
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"); }
|
|
37038
|
+
/**
|
|
37039
|
+
* @typedef {object} SelectionState
|
|
37040
|
+
* @property {CellRange[]} ranges The array of all ranges.
|
|
37041
|
+
* @property {CellRange} activeRange The active range.
|
|
37042
|
+
* @property {number} activeSelectionLayer The active selection layer.
|
|
37043
|
+
* @property {number[]} selectedByRowHeader The state of the selected row headers.
|
|
37044
|
+
* @property {number[]} selectedByColumnHeader The state of the selected column headers.
|
|
37045
|
+
* @property {boolean} disableHeadersHighlight The state of the disable headers highlight.
|
|
37046
|
+
*/
|
|
36898
37047
|
/**
|
|
36899
37048
|
* @class Selection
|
|
36900
37049
|
* @util
|
|
@@ -37216,6 +37365,7 @@ class Selection {
|
|
|
37216
37365
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
|
37217
37366
|
// should be handled by next methods.
|
|
37218
37367
|
const coordsClone = coords.clone();
|
|
37368
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
37219
37369
|
_classPrivateFieldSet(_isFocusSelectionChanged, this, false);
|
|
37220
37370
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
|
37221
37371
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
|
@@ -37813,7 +37963,6 @@ class Selection {
|
|
|
37813
37963
|
focusPosition,
|
|
37814
37964
|
disableHeadersHighlight
|
|
37815
37965
|
} = options;
|
|
37816
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
37817
37966
|
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
|
37818
37967
|
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
|
37819
37968
|
}
|
|
@@ -37822,6 +37971,7 @@ class Selection {
|
|
|
37822
37971
|
this.clear();
|
|
37823
37972
|
this.runLocalHooks('beforeSelectAll', startCoords, endCoords, highlight);
|
|
37824
37973
|
this.setRangeStartOnly(startCoords, undefined, highlight);
|
|
37974
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
37825
37975
|
if (columnFrom < 0) {
|
|
37826
37976
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
|
37827
37977
|
}
|
|
@@ -37831,7 +37981,6 @@ class Selection {
|
|
|
37831
37981
|
this.setRangeEnd(endCoords);
|
|
37832
37982
|
this.runLocalHooks('afterSelectAll', startCoords, endCoords, highlight);
|
|
37833
37983
|
this.finish();
|
|
37834
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
37835
37984
|
}
|
|
37836
37985
|
|
|
37837
37986
|
/**
|
|
@@ -37998,6 +38147,57 @@ class Selection {
|
|
|
37998
38147
|
return isValid;
|
|
37999
38148
|
}
|
|
38000
38149
|
|
|
38150
|
+
/**
|
|
38151
|
+
* Allows importing the selection for all layers from the provided array of CellRange objects.
|
|
38152
|
+
* The method clears the current selection and sets the new one without triggering any
|
|
38153
|
+
* selection related hooks.
|
|
38154
|
+
*
|
|
38155
|
+
* @param {SelectionState} selectionState The selection state to import.
|
|
38156
|
+
*/
|
|
38157
|
+
importSelection(_ref) {
|
|
38158
|
+
let {
|
|
38159
|
+
ranges,
|
|
38160
|
+
activeRange,
|
|
38161
|
+
activeSelectionLayer,
|
|
38162
|
+
selectedByRowHeader,
|
|
38163
|
+
selectedByColumnHeader,
|
|
38164
|
+
disableHeadersHighlight
|
|
38165
|
+
} = _ref;
|
|
38166
|
+
if (ranges.length === 0) {
|
|
38167
|
+
return;
|
|
38168
|
+
}
|
|
38169
|
+
this.selectedRange.clear();
|
|
38170
|
+
this.highlight.clear();
|
|
38171
|
+
this.inProgress = true;
|
|
38172
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
38173
|
+
this.selectedByRowHeader = new Set(selectedByRowHeader);
|
|
38174
|
+
this.selectedByColumnHeader = new Set(selectedByColumnHeader);
|
|
38175
|
+
this.setActiveSelectionLayerIndex(0);
|
|
38176
|
+
ranges.forEach((cellRange, selectionLayerIndex) => {
|
|
38177
|
+
this.selectedRange.push(cellRange);
|
|
38178
|
+
this.applyAndCommit(cellRange, selectionLayerIndex);
|
|
38179
|
+
});
|
|
38180
|
+
this.setRangeFocus(activeRange.highlight, activeSelectionLayer);
|
|
38181
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
38182
|
+
this.inProgress = false;
|
|
38183
|
+
}
|
|
38184
|
+
|
|
38185
|
+
/**
|
|
38186
|
+
* Exports all selection layers with other properties related to the selection state.
|
|
38187
|
+
*
|
|
38188
|
+
* @returns {SelectionState}
|
|
38189
|
+
*/
|
|
38190
|
+
exportSelection() {
|
|
38191
|
+
return {
|
|
38192
|
+
ranges: Array.from(this.selectedRange).map(range => range.clone()),
|
|
38193
|
+
activeRange: this.getActiveSelectedRange(),
|
|
38194
|
+
activeSelectionLayer: this.getActiveSelectionLayerIndex(),
|
|
38195
|
+
selectedByRowHeader: Array.from(this.selectedByRowHeader),
|
|
38196
|
+
selectedByColumnHeader: Array.from(this.selectedByColumnHeader),
|
|
38197
|
+
disableHeadersHighlight: _classPrivateFieldGet(_disableHeadersHighlight, this)
|
|
38198
|
+
};
|
|
38199
|
+
}
|
|
38200
|
+
|
|
38001
38201
|
/**
|
|
38002
38202
|
* Refreshes the whole selection by clearing, reapplying and committing (calculating visual to renderable indexes)
|
|
38003
38203
|
* the selection by using already added visual ranges. The method can be useful when underneath some indexes
|
|
@@ -39165,6 +39365,17 @@ class SelectionRange {
|
|
|
39165
39365
|
return this;
|
|
39166
39366
|
}
|
|
39167
39367
|
|
|
39368
|
+
/**
|
|
39369
|
+
* Pushes a new CellRange instance to the collection.
|
|
39370
|
+
*
|
|
39371
|
+
* @param {CellRange} cellRange The CellRange instance with defined visual coordinates.
|
|
39372
|
+
* @returns {SelectionRange}
|
|
39373
|
+
*/
|
|
39374
|
+
push(cellRange) {
|
|
39375
|
+
this.ranges.push(cellRange);
|
|
39376
|
+
return this;
|
|
39377
|
+
}
|
|
39378
|
+
|
|
39168
39379
|
/**
|
|
39169
39380
|
* Removes from the stack the last added coordinates.
|
|
39170
39381
|
*
|
|
@@ -40042,9 +40253,10 @@ function normalizeSelectionFactory(type) {
|
|
|
40042
40253
|
rowEnd = Math.max(origRowStart, origRowEnd);
|
|
40043
40254
|
columnEnd = Math.max(origColumnStart, origColumnEnd);
|
|
40044
40255
|
}
|
|
40256
|
+
const highlight = isObjectType ? selection.highlight.clone() : createCellCoords(rowStart, columnStart);
|
|
40045
40257
|
const from = createCellCoords(rowStart, columnStart);
|
|
40046
40258
|
const to = createCellCoords(rowEnd, columnEnd);
|
|
40047
|
-
return createCellRange(
|
|
40259
|
+
return createCellRange(highlight, from, to);
|
|
40048
40260
|
};
|
|
40049
40261
|
}
|
|
40050
40262
|
|
|
@@ -43646,6 +43858,101 @@ var _default = () => {
|
|
|
43646
43858
|
* ```
|
|
43647
43859
|
*/
|
|
43648
43860
|
disableVisualSelection: false,
|
|
43861
|
+
/**
|
|
43862
|
+
* @description
|
|
43863
|
+
* The `dialog` option configures the [`Dialog`](@/api/dialog.md) plugin.
|
|
43864
|
+
*
|
|
43865
|
+
* You can set the `dialog` option to one of the following:
|
|
43866
|
+
*
|
|
43867
|
+
* | Setting | Description |
|
|
43868
|
+
* | --------- | --------------------------------------------------------------------------- |
|
|
43869
|
+
* | `false` | Disable the [`Dialog`](@/api/dialog.md) plugin |
|
|
43870
|
+
* | `true` | Enable the [`Dialog`](@/api/dialog.md) plugin with default options |
|
|
43871
|
+
*
|
|
43872
|
+
* ##### dialog: Additional options
|
|
43873
|
+
*
|
|
43874
|
+
* | Option | Possible settings | Description |
|
|
43875
|
+
* | ------------------------ | ------------------------------------------------------------------------------------------------------ | ----------------------------------------|
|
|
43876
|
+
* | `content` | A string, HTMLElement or DocumentFragment (default: `''`) | The content of the dialog |
|
|
43877
|
+
* | `customClassName` | A string (default: `''`) | The custom class name of the dialog |
|
|
43878
|
+
* | `background` | One of the options: `'solid'` or `'semi-transparent'` (default: `'solid'`) | The background of the dialog |
|
|
43879
|
+
* | `contentBackground` | Boolean (default: `false`) | Whether to show the content background |
|
|
43880
|
+
* | `contentDirections` | One of the options: `'row'` or `'row-reverse'` or `'column'` or `'column-reverse'` (default: `'row'`) | The direction of the content |
|
|
43881
|
+
* | `animation` | Boolean (default: `true`) | Whether to show the animation |
|
|
43882
|
+
* | `closable` | Boolean (default: `false`) | Whether to show the close button |
|
|
43883
|
+
*
|
|
43884
|
+
* Read more:
|
|
43885
|
+
* - [Plugins: `Dialog`](@/api/dialog.md)
|
|
43886
|
+
*
|
|
43887
|
+
* @since 16.1.0
|
|
43888
|
+
* @memberof Options#
|
|
43889
|
+
* @type {boolean|object}
|
|
43890
|
+
* @default false
|
|
43891
|
+
* @category Dialog
|
|
43892
|
+
*
|
|
43893
|
+
* @example
|
|
43894
|
+
* ::: only-for javascript
|
|
43895
|
+
* ```js
|
|
43896
|
+
* // enable the Dialog plugin with default option
|
|
43897
|
+
* dialog: true,
|
|
43898
|
+
*
|
|
43899
|
+
* // enable the Dialog plugin with custom configuration
|
|
43900
|
+
* dialog: {
|
|
43901
|
+
* content: 'Dialog content',
|
|
43902
|
+
* customClassName: 'custom-dialog',
|
|
43903
|
+
* background: 'semi-transparent',
|
|
43904
|
+
* contentBackground: false,
|
|
43905
|
+
* contentDirections: 'column',
|
|
43906
|
+
* animation: false,
|
|
43907
|
+
* closable: true,
|
|
43908
|
+
* }
|
|
43909
|
+
* ```
|
|
43910
|
+
* :::
|
|
43911
|
+
*
|
|
43912
|
+
* ::: only-for react
|
|
43913
|
+
* ```jsx
|
|
43914
|
+
* // enable the Dialog plugin with default option
|
|
43915
|
+
* <HotTable
|
|
43916
|
+
* dialog={true}
|
|
43917
|
+
* />
|
|
43918
|
+
*
|
|
43919
|
+
* // enable the Dialog plugin with custom configuration
|
|
43920
|
+
* <HotTable
|
|
43921
|
+
* dialog={{
|
|
43922
|
+
* content: 'Dialog content',
|
|
43923
|
+
* customClassName: 'custom-dialog',
|
|
43924
|
+
* background: 'semi-transparent',
|
|
43925
|
+
* contentBackground: false,
|
|
43926
|
+
* contentDirections: 'column',
|
|
43927
|
+
* animation: false,
|
|
43928
|
+
* closable: true,
|
|
43929
|
+
* }}
|
|
43930
|
+
* />
|
|
43931
|
+
* ```
|
|
43932
|
+
* :::
|
|
43933
|
+
*
|
|
43934
|
+
* ::: only-for angular
|
|
43935
|
+
* ```ts
|
|
43936
|
+
* settings = {
|
|
43937
|
+
* dialog: {
|
|
43938
|
+
* content: 'Dialog content',
|
|
43939
|
+
* customClassName: 'custom-dialog',
|
|
43940
|
+
* background: 'semi-transparent',
|
|
43941
|
+
* contentBackground: false,
|
|
43942
|
+
* contentDirections: 'column',
|
|
43943
|
+
* animation: false,
|
|
43944
|
+
* closable: true,
|
|
43945
|
+
* }
|
|
43946
|
+
* };
|
|
43947
|
+
* ```
|
|
43948
|
+
*
|
|
43949
|
+
* ```html
|
|
43950
|
+
* <hot-table [settings]="settings" />
|
|
43951
|
+
* ```
|
|
43952
|
+
* :::
|
|
43953
|
+
*
|
|
43954
|
+
*/
|
|
43955
|
+
dialog: false,
|
|
43649
43956
|
/**
|
|
43650
43957
|
* @description
|
|
43651
43958
|
* The `dragToScroll` option configures the [`DragToScroll`](@/api/dragToScroll.md) plugin.
|
|
@@ -48088,6 +48395,7 @@ exports.installFocusCatcher = installFocusCatcher;
|
|
|
48088
48395
|
var _shortcutContexts = __webpack_require__(360);
|
|
48089
48396
|
var _focusDetector = __webpack_require__(412);
|
|
48090
48397
|
var _utils = __webpack_require__(413);
|
|
48398
|
+
var _mixed = __webpack_require__(162);
|
|
48091
48399
|
/**
|
|
48092
48400
|
* Installs a focus catcher module. The module observes when the table is focused and depending on
|
|
48093
48401
|
* from the which side it was focused on it selects a specified cell or releases the TAB navigation
|
|
@@ -48101,22 +48409,26 @@ function installFocusCatcher(hot) {
|
|
|
48101
48409
|
const {
|
|
48102
48410
|
activate,
|
|
48103
48411
|
deactivate
|
|
48104
|
-
} = (0, _focusDetector.installFocusDetector)(hot, {
|
|
48105
|
-
|
|
48106
|
-
|
|
48107
|
-
|
|
48108
|
-
|
|
48109
|
-
|
|
48110
|
-
|
|
48111
|
-
|
|
48112
|
-
|
|
48113
|
-
|
|
48114
|
-
|
|
48115
|
-
|
|
48116
|
-
|
|
48117
|
-
|
|
48118
|
-
|
|
48119
|
-
|
|
48412
|
+
} = (0, _focusDetector.installFocusDetector)(hot, hot.rootGridElement, {
|
|
48413
|
+
onFocus(from) {
|
|
48414
|
+
if (from === 'from_above') {
|
|
48415
|
+
var _clampCoordsIfNeeded;
|
|
48416
|
+
const mostTopStartCoords = (_clampCoordsIfNeeded = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded !== void 0 ? _clampCoordsIfNeeded : (0, _mixed.getMostTopStartPosition)(hot);
|
|
48417
|
+
if (mostTopStartCoords) {
|
|
48418
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
|
48419
|
+
if (result !== false) {
|
|
48420
|
+
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
|
48421
|
+
}
|
|
48422
|
+
}
|
|
48423
|
+
} else {
|
|
48424
|
+
var _clampCoordsIfNeeded2;
|
|
48425
|
+
const mostBottomEndCoords = (_clampCoordsIfNeeded2 = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded2 !== void 0 ? _clampCoordsIfNeeded2 : (0, _mixed.getMostBottomEndPosition)(hot);
|
|
48426
|
+
if (mostBottomEndCoords) {
|
|
48427
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
|
48428
|
+
if (result !== false) {
|
|
48429
|
+
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
|
48430
|
+
}
|
|
48431
|
+
}
|
|
48120
48432
|
}
|
|
48121
48433
|
hot.listen();
|
|
48122
48434
|
}
|
|
@@ -48128,8 +48440,20 @@ function installFocusCatcher(hot) {
|
|
|
48128
48440
|
let isSavingCoordsEnabled = true;
|
|
48129
48441
|
let isTabOrShiftTabPressed = false;
|
|
48130
48442
|
let preventViewportScroll = false;
|
|
48131
|
-
hot.addHook('afterListen', () =>
|
|
48132
|
-
|
|
48443
|
+
hot.addHook('afterListen', () => {
|
|
48444
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
48445
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
48446
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
48447
|
+
deactivate();
|
|
48448
|
+
}
|
|
48449
|
+
});
|
|
48450
|
+
hot.addHook('afterUnlisten', () => {
|
|
48451
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
48452
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
48453
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
48454
|
+
activate();
|
|
48455
|
+
}
|
|
48456
|
+
});
|
|
48133
48457
|
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
|
48134
48458
|
if (isTabOrShiftTabPressed && (rowWrapState.wrapped && rowWrapState.flipped || preventViewportScroll)) {
|
|
48135
48459
|
preventViewportScroll = false;
|
|
@@ -48187,7 +48511,7 @@ function installFocusCatcher(hot) {
|
|
|
48187
48511
|
isSavingCoordsEnabled = true;
|
|
48188
48512
|
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
|
48189
48513
|
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
|
48190
|
-
recentlyAddedFocusCoords = event.shiftKey ? (0,
|
|
48514
|
+
recentlyAddedFocusCoords = event.shiftKey ? (0, _mixed.getMostTopStartPosition)(hot) : (0, _mixed.getMostBottomEndPosition)(hot);
|
|
48191
48515
|
}
|
|
48192
48516
|
deactivateTable();
|
|
48193
48517
|
return false;
|
|
@@ -48678,6 +49002,7 @@ class BaseEditor {
|
|
|
48678
49002
|
this.hot.removeHook('afterScroll', openEditor);
|
|
48679
49003
|
openEditor();
|
|
48680
49004
|
}
|
|
49005
|
+
this.addHook('beforeDialogShow', () => this.cancelChanges());
|
|
48681
49006
|
}
|
|
48682
49007
|
|
|
48683
49008
|
/**
|
|
@@ -50440,6 +50765,12 @@ exports.__esModule = true;
|
|
|
50440
50765
|
exports.installFocusDetector = installFocusDetector;
|
|
50441
50766
|
var _element = __webpack_require__(159);
|
|
50442
50767
|
var _a11y = __webpack_require__(168);
|
|
50768
|
+
/**
|
|
50769
|
+
* @typedef {object} FocusDetector
|
|
50770
|
+
* @property {function(): void} activate Activates the focus detector.
|
|
50771
|
+
* @property {function(): void} deactivate Deactivates the focus detector.
|
|
50772
|
+
* @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
|
|
50773
|
+
*/
|
|
50443
50774
|
/**
|
|
50444
50775
|
* Installs a focus detector module. The module appends two input elements into the DOM side by side.
|
|
50445
50776
|
* When the first input is focused, then it means that a user entered to the component using the TAB key
|
|
@@ -50447,19 +50778,31 @@ var _a11y = __webpack_require__(168);
|
|
|
50447
50778
|
* the element below the table. Each action, once detected, triggers the specific hook.
|
|
50448
50779
|
*
|
|
50449
50780
|
* @param {Handsontable} hot The Handsontable instance.
|
|
50450
|
-
* @param {
|
|
50451
|
-
* @
|
|
50781
|
+
* @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
|
|
50782
|
+
* @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
|
|
50783
|
+
* @returns {FocusDetector}
|
|
50452
50784
|
*/
|
|
50453
|
-
function installFocusDetector(hot) {
|
|
50454
|
-
let hooks = arguments.length >
|
|
50455
|
-
const rootElement = hot.rootElement;
|
|
50785
|
+
function installFocusDetector(hot, wrapperElement) {
|
|
50786
|
+
let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50456
50787
|
const inputTrapTop = createInputElement(hot);
|
|
50457
50788
|
const inputTrapBottom = createInputElement(hot);
|
|
50458
|
-
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
|
50459
|
-
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
|
50460
|
-
|
|
50461
|
-
|
|
50789
|
+
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
|
|
50790
|
+
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
|
|
50791
|
+
wrapperElement.prepend(inputTrapTop);
|
|
50792
|
+
wrapperElement.append(inputTrapBottom);
|
|
50462
50793
|
return {
|
|
50794
|
+
/**
|
|
50795
|
+
* Focuses the input element in the given direction.
|
|
50796
|
+
*
|
|
50797
|
+
* @param {string} direction The direction to focus the input element in.
|
|
50798
|
+
*/
|
|
50799
|
+
focus(direction) {
|
|
50800
|
+
if (direction === 'from_above') {
|
|
50801
|
+
inputTrapTop.focus();
|
|
50802
|
+
} else {
|
|
50803
|
+
inputTrapBottom.focus();
|
|
50804
|
+
}
|
|
50805
|
+
},
|
|
50463
50806
|
/**
|
|
50464
50807
|
* Activates the detector by resetting the tabIndex of the input elements.
|
|
50465
50808
|
*/
|
|
@@ -50507,10 +50850,9 @@ function createInputElement(hot) {
|
|
|
50507
50850
|
|
|
50508
50851
|
|
|
50509
50852
|
exports.__esModule = true;
|
|
50510
|
-
exports.getMostBottomEndPosition = getMostBottomEndPosition;
|
|
50511
|
-
exports.getMostTopStartPosition = getMostTopStartPosition;
|
|
50512
50853
|
exports.normalizeCoordsIfNeeded = normalizeCoordsIfNeeded;
|
|
50513
50854
|
var _number = __webpack_require__(205);
|
|
50855
|
+
var _mixed = __webpack_require__(162);
|
|
50514
50856
|
/**
|
|
50515
50857
|
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
|
50516
50858
|
*
|
|
@@ -50529,74 +50871,14 @@ function normalizeCoordsIfNeeded(hot) {
|
|
|
50529
50871
|
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
|
50530
50872
|
return null;
|
|
50531
50873
|
}
|
|
50532
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
|
50533
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
|
50874
|
+
const mostTopStartCoords = (0, _mixed.getMostTopStartPosition)(hot);
|
|
50875
|
+
const mostBottomEndCoords = (0, _mixed.getMostBottomEndPosition)(hot);
|
|
50534
50876
|
coords.row = (0, _number.clamp)(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
|
50535
50877
|
coords.col = (0, _number.clamp)(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
|
50536
50878
|
return coords;
|
|
50537
50879
|
};
|
|
50538
50880
|
}
|
|
50539
50881
|
|
|
50540
|
-
/**
|
|
50541
|
-
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
50542
|
-
*
|
|
50543
|
-
* @param {Core} hot The Handsontable instance.
|
|
50544
|
-
* @returns {CellCoords|null}
|
|
50545
|
-
*/
|
|
50546
|
-
function getMostTopStartPosition(hot) {
|
|
50547
|
-
const {
|
|
50548
|
-
rowIndexMapper,
|
|
50549
|
-
columnIndexMapper
|
|
50550
|
-
} = hot;
|
|
50551
|
-
const {
|
|
50552
|
-
navigableHeaders
|
|
50553
|
-
} = hot.getSettings();
|
|
50554
|
-
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
50555
|
-
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
50556
|
-
if (topRow === 0) {
|
|
50557
|
-
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
50558
|
-
}
|
|
50559
|
-
if (startColumn === 0) {
|
|
50560
|
-
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
50561
|
-
}
|
|
50562
|
-
if (topRow === null || startColumn === null) {
|
|
50563
|
-
return null;
|
|
50564
|
-
}
|
|
50565
|
-
return hot._createCellCoords(topRow, startColumn);
|
|
50566
|
-
}
|
|
50567
|
-
|
|
50568
|
-
/**
|
|
50569
|
-
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
50570
|
-
*
|
|
50571
|
-
* @param {Core} hot The Handsontable instance.
|
|
50572
|
-
* @returns {CellCoords|null}
|
|
50573
|
-
*/
|
|
50574
|
-
function getMostBottomEndPosition(hot) {
|
|
50575
|
-
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
50576
|
-
const {
|
|
50577
|
-
rowIndexMapper,
|
|
50578
|
-
columnIndexMapper
|
|
50579
|
-
} = hot;
|
|
50580
|
-
const {
|
|
50581
|
-
navigableHeaders
|
|
50582
|
-
} = hot.getSettings();
|
|
50583
|
-
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
50584
|
-
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
50585
|
-
if (bottomRow < 0) {
|
|
50586
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
50587
|
-
return null;
|
|
50588
|
-
}
|
|
50589
|
-
bottomRow = -1;
|
|
50590
|
-
}
|
|
50591
|
-
if (endColumn < 0) {
|
|
50592
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
50593
|
-
return null;
|
|
50594
|
-
}
|
|
50595
|
-
endColumn = -1;
|
|
50596
|
-
}
|
|
50597
|
-
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);
|
|
50598
|
-
}
|
|
50599
|
-
|
|
50600
50882
|
/***/ }),
|
|
50601
50883
|
/* 414 */
|
|
50602
50884
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
@@ -51086,10 +51368,12 @@ const createShortcutManager = _ref => {
|
|
|
51086
51368
|
*
|
|
51087
51369
|
* @memberof ShortcutManager#
|
|
51088
51370
|
* @param {string} contextName The name of the new shortcut context
|
|
51371
|
+
* @param {string} [scope='table'] The scope of the shortcut: `'table'` or `'global'`
|
|
51089
51372
|
* @returns {object}
|
|
51090
51373
|
*/
|
|
51091
|
-
const addContext = contextName
|
|
51092
|
-
|
|
51374
|
+
const addContext = function (contextName) {
|
|
51375
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'table';
|
|
51376
|
+
const context = (0, _context.createContext)(contextName, scope);
|
|
51093
51377
|
CONTEXTS.addItem(contextName, context);
|
|
51094
51378
|
return context;
|
|
51095
51379
|
};
|
|
@@ -51189,12 +51473,24 @@ const createShortcutManager = _ref => {
|
|
|
51189
51473
|
return isExecutionCancelled;
|
|
51190
51474
|
};
|
|
51191
51475
|
|
|
51476
|
+
/**
|
|
51477
|
+
* Handle the event with the scope of the active context.
|
|
51478
|
+
*
|
|
51479
|
+
* @param {KeyboardEvent} event The keyboard event.
|
|
51480
|
+
* @returns {boolean}
|
|
51481
|
+
*/
|
|
51482
|
+
const handleEventWithScope = event => {
|
|
51483
|
+
const context = getActiveContextName();
|
|
51484
|
+
const activeContext = (0, _context.isContextObject)(context) ? context : getContext(context);
|
|
51485
|
+
return handleEvent(event, activeContext.scope);
|
|
51486
|
+
};
|
|
51487
|
+
|
|
51192
51488
|
/**
|
|
51193
51489
|
* Internal key recorder.
|
|
51194
51490
|
*
|
|
51195
51491
|
* @private
|
|
51196
51492
|
*/
|
|
51197
|
-
const keyRecorder = (0, _recorder.useRecorder)(ownerWindow,
|
|
51493
|
+
const keyRecorder = (0, _recorder.useRecorder)(ownerWindow, handleEventWithScope, beforeKeyDown, afterKeyDown, recorderCallback);
|
|
51198
51494
|
keyRecorder.mount();
|
|
51199
51495
|
return {
|
|
51200
51496
|
addContext,
|
|
@@ -51268,9 +51564,11 @@ function isContextObject(objectToCheck) {
|
|
|
51268
51564
|
* @alias ShortcutContext
|
|
51269
51565
|
* @class ShortcutContext
|
|
51270
51566
|
* @param {string} name The name of the keyboard shortcut context
|
|
51567
|
+
* @param {string} [scope='table'] The scope of the shortcut: `'table'` or `'global'`
|
|
51271
51568
|
* @returns {object}
|
|
51272
51569
|
*/
|
|
51273
|
-
const createContext = name
|
|
51570
|
+
const createContext = function (name) {
|
|
51571
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'table';
|
|
51274
51572
|
const SHORTCUTS = (0, _uniqueMap.createUniqueMap)({
|
|
51275
51573
|
errorIdExists: keys => `The "${keys}" shortcut is already registered in the "${name}" context.`
|
|
51276
51574
|
});
|
|
@@ -51446,6 +51744,7 @@ const createContext = name => {
|
|
|
51446
51744
|
};
|
|
51447
51745
|
return {
|
|
51448
51746
|
__kindOf,
|
|
51747
|
+
scope,
|
|
51449
51748
|
addShortcut,
|
|
51450
51749
|
addShortcuts,
|
|
51451
51750
|
getShortcuts,
|
|
@@ -56961,18 +57260,20 @@ var _nestedRows = __webpack_require__(738);
|
|
|
56961
57260
|
exports.NestedRows = _nestedRows.NestedRows;
|
|
56962
57261
|
var _pagination = __webpack_require__(746);
|
|
56963
57262
|
exports.Pagination = _pagination.Pagination;
|
|
56964
|
-
var _persistentState = __webpack_require__(
|
|
57263
|
+
var _persistentState = __webpack_require__(754);
|
|
56965
57264
|
exports.PersistentState = _persistentState.PersistentState;
|
|
56966
|
-
var _search = __webpack_require__(
|
|
57265
|
+
var _search = __webpack_require__(757);
|
|
56967
57266
|
exports.Search = _search.Search;
|
|
56968
|
-
var _stretchColumns = __webpack_require__(
|
|
57267
|
+
var _stretchColumns = __webpack_require__(759);
|
|
56969
57268
|
exports.StretchColumns = _stretchColumns.StretchColumns;
|
|
56970
|
-
var _touchScroll = __webpack_require__(
|
|
57269
|
+
var _touchScroll = __webpack_require__(765);
|
|
56971
57270
|
exports.TouchScroll = _touchScroll.TouchScroll;
|
|
56972
|
-
var _trimRows = __webpack_require__(
|
|
57271
|
+
var _trimRows = __webpack_require__(767);
|
|
56973
57272
|
exports.TrimRows = _trimRows.TrimRows;
|
|
56974
|
-
var _undoRedo = __webpack_require__(
|
|
57273
|
+
var _undoRedo = __webpack_require__(769);
|
|
56975
57274
|
exports.UndoRedo = _undoRedo.UndoRedo;
|
|
57275
|
+
var _dialog = __webpack_require__(786);
|
|
57276
|
+
exports.Dialog = _dialog.Dialog;
|
|
56976
57277
|
var _registry = __webpack_require__(203);
|
|
56977
57278
|
exports.registerPlugin = _registry.registerPlugin;
|
|
56978
57279
|
exports.getPlugin = _registry.getPlugin;
|
|
@@ -57016,6 +57317,7 @@ function registerAllPlugins() {
|
|
|
57016
57317
|
(0, _registry.registerPlugin)(_touchScroll.TouchScroll);
|
|
57017
57318
|
(0, _registry.registerPlugin)(_trimRows.TrimRows);
|
|
57018
57319
|
(0, _registry.registerPlugin)(_undoRedo.UndoRedo);
|
|
57320
|
+
(0, _registry.registerPlugin)(_dialog.Dialog);
|
|
57019
57321
|
}
|
|
57020
57322
|
|
|
57021
57323
|
/***/ }),
|
|
@@ -57807,9 +58109,11 @@ var _registry3 = __webpack_require__(182);
|
|
|
57807
58109
|
var _registry4 = __webpack_require__(208);
|
|
57808
58110
|
var _registry5 = __webpack_require__(209);
|
|
57809
58111
|
var _eventManager = _interopRequireDefault(__webpack_require__(194));
|
|
58112
|
+
var _console = __webpack_require__(184);
|
|
57810
58113
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
57811
58114
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
57812
58115
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
58116
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
57813
58117
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
57814
58118
|
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"); }
|
|
57815
58119
|
const DEPS_TYPE_CHECKERS = new Map([['plugin', _registry.hasPlugin], ['cell-type', _registry2.hasCellType], ['editor', _registry3.hasEditor], ['renderer', _registry4.hasRenderer], ['validator', _registry5.hasValidator]]);
|
|
@@ -57822,6 +58126,7 @@ let initializedPlugins = null;
|
|
|
57822
58126
|
* @util
|
|
57823
58127
|
* @property {Core} hot Handsontable instance.
|
|
57824
58128
|
*/
|
|
58129
|
+
var _pluginSettings = /*#__PURE__*/new WeakMap();
|
|
57825
58130
|
var _hooks = /*#__PURE__*/new WeakMap();
|
|
57826
58131
|
var _BasePlugin_brand = /*#__PURE__*/new WeakSet();
|
|
57827
58132
|
class BasePlugin {
|
|
@@ -57852,9 +58157,18 @@ class BasePlugin {
|
|
|
57852
58157
|
}
|
|
57853
58158
|
|
|
57854
58159
|
/**
|
|
57855
|
-
*
|
|
58160
|
+
* Validators for plugin settings.
|
|
57856
58161
|
*
|
|
57857
|
-
* @type {
|
|
58162
|
+
* @type {Function|object|null}
|
|
58163
|
+
*/
|
|
58164
|
+
static get SETTINGS_VALIDATORS() {
|
|
58165
|
+
return null;
|
|
58166
|
+
}
|
|
58167
|
+
|
|
58168
|
+
/**
|
|
58169
|
+
* Plugin settings.
|
|
58170
|
+
*
|
|
58171
|
+
* @type {object|null}
|
|
57858
58172
|
*/
|
|
57859
58173
|
|
|
57860
58174
|
/**
|
|
@@ -57871,6 +58185,12 @@ class BasePlugin {
|
|
|
57871
58185
|
* @returns {boolean}
|
|
57872
58186
|
*/
|
|
57873
58187
|
_classPrivateMethodInitSpec(this, _BasePlugin_brand);
|
|
58188
|
+
_classPrivateFieldInitSpec(this, _pluginSettings, null);
|
|
58189
|
+
/**
|
|
58190
|
+
* The instance of the {@link EventManager} class.
|
|
58191
|
+
*
|
|
58192
|
+
* @type {EventManager}
|
|
58193
|
+
*/
|
|
57874
58194
|
(0, _defineProperty2.default)(this, "eventManager", new _eventManager.default(this));
|
|
57875
58195
|
/**
|
|
57876
58196
|
* @type {string}
|
|
@@ -57911,6 +58231,7 @@ class BasePlugin {
|
|
|
57911
58231
|
}
|
|
57912
58232
|
init() {
|
|
57913
58233
|
this.pluginName = this.hot.getPluginName(this);
|
|
58234
|
+
this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);
|
|
57914
58235
|
const pluginDeps = this.constructor.PLUGIN_DEPS;
|
|
57915
58236
|
const deps = Array.isArray(pluginDeps) ? pluginDeps : [];
|
|
57916
58237
|
if (deps.length > 0) {
|
|
@@ -57978,25 +58299,65 @@ class BasePlugin {
|
|
|
57978
58299
|
* @returns {*}
|
|
57979
58300
|
*/
|
|
57980
58301
|
getSetting(settingName) {
|
|
57981
|
-
const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
|
|
57982
58302
|
if (settingName === undefined) {
|
|
57983
|
-
return
|
|
58303
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
57984
58304
|
}
|
|
57985
58305
|
const defaultSettings = this.constructor.DEFAULT_SETTINGS;
|
|
57986
|
-
if ((Array.isArray(
|
|
57987
|
-
var
|
|
57988
|
-
if (Array.isArray(
|
|
57989
|
-
return
|
|
58306
|
+
if ((Array.isArray(_classPrivateFieldGet(_pluginSettings, this)) || (0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) && defaultSettings[defaultMainSettingSymbol] === settingName) {
|
|
58307
|
+
var _classPrivateFieldGet2;
|
|
58308
|
+
if (Array.isArray(_classPrivateFieldGet(_pluginSettings, this))) {
|
|
58309
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
57990
58310
|
}
|
|
57991
|
-
return (
|
|
58311
|
+
return (_classPrivateFieldGet2 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : defaultSettings[settingName];
|
|
57992
58312
|
}
|
|
57993
|
-
if ((0, _object.isObject)(
|
|
57994
|
-
var
|
|
57995
|
-
return (
|
|
58313
|
+
if ((0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) {
|
|
58314
|
+
var _classPrivateFieldGet3;
|
|
58315
|
+
return (_classPrivateFieldGet3 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : defaultSettings[settingName];
|
|
57996
58316
|
}
|
|
57997
58317
|
return defaultSettings[settingName];
|
|
57998
58318
|
}
|
|
57999
58319
|
|
|
58320
|
+
/**
|
|
58321
|
+
* Update plugin settings.
|
|
58322
|
+
*
|
|
58323
|
+
* @param {*} newSettings New settings.
|
|
58324
|
+
* @returns {object} Updated settings object.
|
|
58325
|
+
*/
|
|
58326
|
+
updatePluginSettings(newSettings) {
|
|
58327
|
+
const settingsValidators = this.constructor.SETTINGS_VALIDATORS;
|
|
58328
|
+
if (settingsValidators && typeof settingsValidators === 'function' && typeof newSettings !== 'object') {
|
|
58329
|
+
const isValid = settingsValidators(newSettings);
|
|
58330
|
+
if (isValid === false) {
|
|
58331
|
+
(0, _console.warn)(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);
|
|
58332
|
+
return;
|
|
58333
|
+
}
|
|
58334
|
+
_classPrivateFieldSet(_pluginSettings, this, newSettings);
|
|
58335
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
58336
|
+
}
|
|
58337
|
+
if (settingsValidators && typeof settingsValidators === 'object' && typeof newSettings === 'object') {
|
|
58338
|
+
if (_classPrivateFieldGet(_pluginSettings, this) === null || typeof _classPrivateFieldGet(_pluginSettings, this) !== 'object') {
|
|
58339
|
+
_classPrivateFieldSet(_pluginSettings, this, {
|
|
58340
|
+
...this.constructor.DEFAULT_SETTINGS
|
|
58341
|
+
});
|
|
58342
|
+
}
|
|
58343
|
+
Object.keys(settingsValidators).forEach(key => {
|
|
58344
|
+
if (!(key in newSettings)) {
|
|
58345
|
+
return;
|
|
58346
|
+
}
|
|
58347
|
+
const validator = settingsValidators[key];
|
|
58348
|
+
const isValid = validator ? validator(newSettings[key]) : true;
|
|
58349
|
+
if (isValid === false) {
|
|
58350
|
+
(0, _console.warn)(`${this.pluginName} Plugin: "${key}" option is not valid and it will be ignored.`);
|
|
58351
|
+
return;
|
|
58352
|
+
}
|
|
58353
|
+
_classPrivateFieldGet(_pluginSettings, this)[key] = newSettings[key];
|
|
58354
|
+
});
|
|
58355
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
58356
|
+
}
|
|
58357
|
+
_classPrivateFieldSet(_pluginSettings, this, newSettings);
|
|
58358
|
+
return newSettings;
|
|
58359
|
+
}
|
|
58360
|
+
|
|
58000
58361
|
/**
|
|
58001
58362
|
* Add listener to plugin hooks system.
|
|
58002
58363
|
*
|
|
@@ -58074,6 +58435,7 @@ class BasePlugin {
|
|
|
58074
58435
|
this.enablePlugin();
|
|
58075
58436
|
}
|
|
58076
58437
|
if (this.enabled && this.isEnabled() && relevantToSettings) {
|
|
58438
|
+
this.updatePluginSettings(newSettings[this.constructor.PLUGIN_KEY]);
|
|
58077
58439
|
this.updatePlugin(newSettings);
|
|
58078
58440
|
}
|
|
58079
58441
|
}
|
|
@@ -58091,6 +58453,7 @@ class BasePlugin {
|
|
|
58091
58453
|
*/
|
|
58092
58454
|
destroy() {
|
|
58093
58455
|
var _this$eventManager2;
|
|
58456
|
+
_classPrivateFieldSet(_pluginSettings, this, null);
|
|
58094
58457
|
(_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
|
|
58095
58458
|
this.clearHooks();
|
|
58096
58459
|
(0, _object.objectEach)(this, (value, property) => {
|
|
@@ -66579,6 +66942,7 @@ class ContextMenu extends _base.BasePlugin {
|
|
|
66579
66942
|
return _this.executeCommand.call(_this, ...params);
|
|
66580
66943
|
});
|
|
66581
66944
|
this.addHook('afterOnCellContextMenu', event => _assertClassBrand(_ContextMenu_brand, this, _onAfterOnCellContextMenu).call(this, event));
|
|
66945
|
+
this.addHook('beforeDialogShow', () => this.close());
|
|
66582
66946
|
this.registerShortcuts();
|
|
66583
66947
|
super.enablePlugin();
|
|
66584
66948
|
}
|
|
@@ -71895,6 +72259,7 @@ class DropdownMenu extends _base.BasePlugin {
|
|
|
71895
72259
|
}
|
|
71896
72260
|
return _assertClassBrand(_DropdownMenu_brand, _this, _onBeforeViewportScrollHorizontally).call(_this, ...args);
|
|
71897
72261
|
});
|
|
72262
|
+
this.addHook('beforeDialogShow', () => this.close());
|
|
71898
72263
|
const settings = this.hot.getSettings()[PLUGIN_KEY];
|
|
71899
72264
|
const predefinedItems = {
|
|
71900
72265
|
items: this.itemsFactory.getItems(settings)
|
|
@@ -95652,6 +96017,8 @@ var _a11yAnnouncer = __webpack_require__(432);
|
|
|
95652
96017
|
var _strategies = __webpack_require__(750);
|
|
95653
96018
|
var _templateLiteralTag = __webpack_require__(164);
|
|
95654
96019
|
var _console = __webpack_require__(184);
|
|
96020
|
+
var _focusController2 = __webpack_require__(753);
|
|
96021
|
+
var _focusDetector2 = __webpack_require__(412);
|
|
95655
96022
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
95656
96023
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
95657
96024
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -95660,6 +96027,8 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
|
|
|
95660
96027
|
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"); }
|
|
95661
96028
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'pagination';
|
|
95662
96029
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 900;
|
|
96030
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
96031
|
+
const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
|
|
95663
96032
|
const AUTO_PAGE_SIZE_WARNING = (0, _templateLiteralTag.toSingleLine)`The \`auto\` page size setting requires the \`autoRowSize\`\x20
|
|
95664
96033
|
plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;
|
|
95665
96034
|
|
|
@@ -95744,13 +96113,15 @@ var _ui = /*#__PURE__*/new WeakMap();
|
|
|
95744
96113
|
var _calcStrategy = /*#__PURE__*/new WeakMap();
|
|
95745
96114
|
var _internalExecutionCall = /*#__PURE__*/new WeakMap();
|
|
95746
96115
|
var _internalRenderCall = /*#__PURE__*/new WeakMap();
|
|
96116
|
+
var _focusController = /*#__PURE__*/new WeakMap();
|
|
96117
|
+
var _focusDetector = /*#__PURE__*/new WeakMap();
|
|
95747
96118
|
var _Pagination_brand = /*#__PURE__*/new WeakSet();
|
|
95748
96119
|
var _onIndexCacheUpdate = /*#__PURE__*/new WeakMap();
|
|
95749
96120
|
class Pagination extends _base.BasePlugin {
|
|
95750
96121
|
constructor() {
|
|
95751
96122
|
super(...arguments);
|
|
95752
96123
|
/**
|
|
95753
|
-
*
|
|
96124
|
+
* Bind the events used by the plugin.
|
|
95754
96125
|
*/
|
|
95755
96126
|
_classPrivateMethodInitSpec(this, _Pagination_brand);
|
|
95756
96127
|
/**
|
|
@@ -95800,6 +96171,18 @@ class Pagination extends _base.BasePlugin {
|
|
|
95800
96171
|
* @type {boolean}
|
|
95801
96172
|
*/
|
|
95802
96173
|
_classPrivateFieldInitSpec(this, _internalRenderCall, false);
|
|
96174
|
+
/**
|
|
96175
|
+
* Pagination focus controller instance.
|
|
96176
|
+
*
|
|
96177
|
+
* @type {PaginationController}
|
|
96178
|
+
*/
|
|
96179
|
+
_classPrivateFieldInitSpec(this, _focusController, null);
|
|
96180
|
+
/**
|
|
96181
|
+
* Pagination focus detector instance.
|
|
96182
|
+
*
|
|
96183
|
+
* @type {object}
|
|
96184
|
+
*/
|
|
96185
|
+
_classPrivateFieldInitSpec(this, _focusDetector, null);
|
|
95803
96186
|
/**
|
|
95804
96187
|
* IndexMapper cache update listener. Once the cache is updated, we need to recompute
|
|
95805
96188
|
* the pagination state.
|
|
@@ -95868,7 +96251,7 @@ class Pagination extends _base.BasePlugin {
|
|
|
95868
96251
|
_classPrivateFieldSet(_calcStrategy, this, (0, _strategies.createPaginatorStrategy)(_classPrivateFieldGet(_pageSize, this) === 'auto' ? 'auto' : 'fixed'));
|
|
95869
96252
|
if (!_classPrivateFieldGet(_ui, this)) {
|
|
95870
96253
|
_classPrivateFieldSet(_ui, this, new _ui2.PaginationUI({
|
|
95871
|
-
rootElement: this.hot.
|
|
96254
|
+
rootElement: this.hot.rootGridElement,
|
|
95872
96255
|
uiContainer: this.getSetting('uiContainer'),
|
|
95873
96256
|
isRtl: this.hot.isRtl(),
|
|
95874
96257
|
themeName: this.hot.getSettings().themeName,
|
|
@@ -95879,8 +96262,35 @@ class Pagination extends _base.BasePlugin {
|
|
|
95879
96262
|
a11yAnnouncer: message => (0, _a11yAnnouncer.announce)(message)
|
|
95880
96263
|
}));
|
|
95881
96264
|
_assertClassBrand(_Pagination_brand, this, _updateSectionsVisibilityState).call(this);
|
|
95882
|
-
_classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize))
|
|
96265
|
+
_classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize)).addLocalHook('focus', element => {
|
|
96266
|
+
_classPrivateFieldGet(_focusController, this).setCurrentPage(_classPrivateFieldGet(_ui, this).getFocusableElements().indexOf(element));
|
|
96267
|
+
this.hot.unlisten();
|
|
96268
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
96269
|
+
this.hot.listen();
|
|
96270
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
96271
|
+
});
|
|
96272
|
+
}
|
|
96273
|
+
if (!_classPrivateFieldGet(_focusController, this)) {
|
|
96274
|
+
_classPrivateFieldSet(_focusController, this, (0, _focusController2.createPaginationFocusController)({
|
|
96275
|
+
focusableElements: () => _classPrivateFieldGet(_ui, this).getFocusableElements()
|
|
96276
|
+
}));
|
|
96277
|
+
}
|
|
96278
|
+
if (!_classPrivateFieldGet(_focusDetector, this)) {
|
|
96279
|
+
_classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getContainer(), {
|
|
96280
|
+
onFocus: from => {
|
|
96281
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
96282
|
+
this.hot.listen();
|
|
96283
|
+
if (from === 'from_above') {
|
|
96284
|
+
_classPrivateFieldGet(_focusController, this).toFirstItem();
|
|
96285
|
+
} else {
|
|
96286
|
+
_classPrivateFieldGet(_focusController, this).toLastItem();
|
|
96287
|
+
}
|
|
96288
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
96289
|
+
}
|
|
96290
|
+
}));
|
|
95883
96291
|
}
|
|
96292
|
+
_assertClassBrand(_Pagination_brand, this, _registerEvents).call(this);
|
|
96293
|
+
_assertClassBrand(_Pagination_brand, this, _registerShortcuts).call(this);
|
|
95884
96294
|
|
|
95885
96295
|
// Place the onInit hook before others to make sure that the pagination state is computed
|
|
95886
96296
|
// and applied to the index mapper before AutoColumnSize plugin begins calculate the column sizes.
|
|
@@ -95962,6 +96372,18 @@ class Pagination extends _base.BasePlugin {
|
|
|
95962
96372
|
}
|
|
95963
96373
|
return _assertClassBrand(_Pagination_brand, _this, _onAfterSetTheme).call(_this, ...args);
|
|
95964
96374
|
});
|
|
96375
|
+
this.addHook('afterDialogShow', function () {
|
|
96376
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
96377
|
+
args[_key12] = arguments[_key12];
|
|
96378
|
+
}
|
|
96379
|
+
return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogShow).call(_this, ...args);
|
|
96380
|
+
});
|
|
96381
|
+
this.addHook('beforeDialogHide', function () {
|
|
96382
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
96383
|
+
args[_key13] = arguments[_key13];
|
|
96384
|
+
}
|
|
96385
|
+
return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogHide).call(_this, ...args);
|
|
96386
|
+
});
|
|
95965
96387
|
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this));
|
|
95966
96388
|
super.enablePlugin();
|
|
95967
96389
|
}
|
|
@@ -95983,9 +96405,9 @@ class Pagination extends _base.BasePlugin {
|
|
|
95983
96405
|
this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this)).unregisterMap(this.pluginName);
|
|
95984
96406
|
_classPrivateFieldGet(_ui, this).destroy();
|
|
95985
96407
|
_classPrivateFieldSet(_ui, this, null);
|
|
96408
|
+
_assertClassBrand(_Pagination_brand, this, _unregisterShortcuts).call(this);
|
|
95986
96409
|
super.disablePlugin();
|
|
95987
96410
|
}
|
|
95988
|
-
|
|
95989
96411
|
/**
|
|
95990
96412
|
* Gets the pagination current state. Returns an object with the following properties:
|
|
95991
96413
|
* - `currentPage`: The current page number.
|
|
@@ -96241,6 +96663,11 @@ class Pagination extends _base.BasePlugin {
|
|
|
96241
96663
|
_classPrivateFieldGet(_ui, this).setNavigationSectionVisibility(false);
|
|
96242
96664
|
this.hot.runHooks('afterPageNavigationVisibilityChange', false);
|
|
96243
96665
|
}
|
|
96666
|
+
|
|
96667
|
+
/**
|
|
96668
|
+
* Updates the visibility state of the pagination sections based on the current settings.
|
|
96669
|
+
*/
|
|
96670
|
+
|
|
96244
96671
|
/**
|
|
96245
96672
|
* Destroys the plugin instance.
|
|
96246
96673
|
*/
|
|
@@ -96254,6 +96681,59 @@ class Pagination extends _base.BasePlugin {
|
|
|
96254
96681
|
}
|
|
96255
96682
|
}
|
|
96256
96683
|
exports.Pagination = Pagination;
|
|
96684
|
+
function _registerEvents() {
|
|
96685
|
+
// TODO: move to general focus manager module
|
|
96686
|
+
this.eventManager.addEventListener(this.hot.rootDocument, 'mouseup', event => {
|
|
96687
|
+
const container = _classPrivateFieldGet(_ui, this).getContainer();
|
|
96688
|
+
if (!container.contains(event.target) && this.hot.getShortcutManager().getActiveContextName() === SHORTCUTS_CONTEXT_NAME) {
|
|
96689
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
96690
|
+
_classPrivateFieldGet(_focusController, this).clear();
|
|
96691
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
96692
|
+
}
|
|
96693
|
+
});
|
|
96694
|
+
}
|
|
96695
|
+
/**
|
|
96696
|
+
* Register shortcuts responsible for navigating through the pagination.
|
|
96697
|
+
*/
|
|
96698
|
+
function _registerShortcuts() {
|
|
96699
|
+
var _manager$getContext;
|
|
96700
|
+
const manager = this.hot.getShortcutManager();
|
|
96701
|
+
const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME, 'global');
|
|
96702
|
+
pluginContext.addShortcut({
|
|
96703
|
+
keys: [['Shift', 'Tab'], ['Tab']],
|
|
96704
|
+
preventDefault: false,
|
|
96705
|
+
callback: event => {
|
|
96706
|
+
let previousIndex = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
96707
|
+
if (event.shiftKey) {
|
|
96708
|
+
_classPrivateFieldGet(_focusController, this).toPreviousItem();
|
|
96709
|
+
const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
96710
|
+
if (currentPage >= previousIndex) {
|
|
96711
|
+
_assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
|
|
96712
|
+
return;
|
|
96713
|
+
}
|
|
96714
|
+
previousIndex = currentPage;
|
|
96715
|
+
} else {
|
|
96716
|
+
_classPrivateFieldGet(_focusController, this).toNextItem();
|
|
96717
|
+
const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
96718
|
+
if (currentPage <= previousIndex) {
|
|
96719
|
+
_assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
|
|
96720
|
+
return;
|
|
96721
|
+
}
|
|
96722
|
+
previousIndex = currentPage;
|
|
96723
|
+
}
|
|
96724
|
+
event.preventDefault();
|
|
96725
|
+
},
|
|
96726
|
+
group: SHORTCUTS_GROUP
|
|
96727
|
+
});
|
|
96728
|
+
}
|
|
96729
|
+
/**
|
|
96730
|
+
* Unregister shortcuts responsible for navigating through the pagination.
|
|
96731
|
+
*/
|
|
96732
|
+
function _unregisterShortcuts() {
|
|
96733
|
+
const shortcutManager = this.hot.getShortcutManager();
|
|
96734
|
+
const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
|
|
96735
|
+
pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
|
|
96736
|
+
}
|
|
96257
96737
|
function _updateSectionsVisibilityState() {
|
|
96258
96738
|
if (this.getSetting('showPageSize')) {
|
|
96259
96739
|
this.showPageSizeSection();
|
|
@@ -96326,10 +96806,16 @@ function _computeAndApplyState() {
|
|
|
96326
96806
|
this.hot.rowIndexMapper.updateCache(true);
|
|
96327
96807
|
}
|
|
96328
96808
|
_classPrivateFieldSet(_internalExecutionCall, this, false);
|
|
96809
|
+
const paginationData = this.getPaginationData();
|
|
96329
96810
|
_classPrivateFieldGet(_ui, this).updateState({
|
|
96330
|
-
...
|
|
96811
|
+
...paginationData,
|
|
96331
96812
|
totalRenderedRows: renderableRowsLength
|
|
96332
96813
|
});
|
|
96814
|
+
if ((this.getSetting('showPageSize') || this.getSetting('showNavigation')) && paginationData.totalPages > 1) {
|
|
96815
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
96816
|
+
} else {
|
|
96817
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
96818
|
+
}
|
|
96333
96819
|
}
|
|
96334
96820
|
/**
|
|
96335
96821
|
* Based on the external factors (like the scroll position of the table, size etc.) it computes
|
|
@@ -96480,6 +96966,24 @@ function _onAfterRender() {
|
|
|
96480
96966
|
const width = view.isHorizontallyScrollableByWindow() ? view.getTotalTableWidth() : view.getWorkspaceWidth();
|
|
96481
96967
|
_classPrivateFieldGet(_ui, this).updateWidth(width).refreshBorderState();
|
|
96482
96968
|
}
|
|
96969
|
+
/**
|
|
96970
|
+
* Called before the height of the table is changed. It adjusts the table height to fit the pagination container
|
|
96971
|
+
* in declared height.
|
|
96972
|
+
*
|
|
96973
|
+
* @param {number|string} height Table height.
|
|
96974
|
+
* @returns {string} Returns the new table height.
|
|
96975
|
+
*/
|
|
96976
|
+
function _onBeforeHeightChange(height) {
|
|
96977
|
+
if (this.getSetting('uiContainer')) {
|
|
96978
|
+
return height;
|
|
96979
|
+
}
|
|
96980
|
+
const isPixelValue = typeof height === 'number' || typeof height === 'string' && /^\d+$/.test(height) || typeof height === 'string' && height.endsWith('px');
|
|
96981
|
+
if (!isPixelValue) {
|
|
96982
|
+
return height;
|
|
96983
|
+
}
|
|
96984
|
+
const heightValue = typeof height === 'string' && height.endsWith('px') ? height : `${height}px`;
|
|
96985
|
+
return `calc(${heightValue} - ${_classPrivateFieldGet(_ui, this).getHeight()}px)`;
|
|
96986
|
+
}
|
|
96483
96987
|
/**
|
|
96484
96988
|
* Called after the initialization of the plugin. It computes the initial state of the pagination.
|
|
96485
96989
|
*/
|
|
@@ -96502,19 +97006,6 @@ function _onAfterScrollVertically() {
|
|
|
96502
97006
|
function _onAfterLanguageChange() {
|
|
96503
97007
|
_assertClassBrand(_Pagination_brand, this, _computeAndApplyState).call(this);
|
|
96504
97008
|
}
|
|
96505
|
-
/**
|
|
96506
|
-
* Called before the height of the table is changed. It adjusts the table height to fit the pagination container
|
|
96507
|
-
* in declared height.
|
|
96508
|
-
*
|
|
96509
|
-
* @param {number} height Table height.
|
|
96510
|
-
* @returns {string} Returns the new table height.
|
|
96511
|
-
*/
|
|
96512
|
-
function _onBeforeHeightChange(height) {
|
|
96513
|
-
if (this.getSetting('uiContainer')) {
|
|
96514
|
-
return height;
|
|
96515
|
-
}
|
|
96516
|
-
return `calc(${height}${/[0-9]$/.test(height) ? 'px' : ''} - ${_classPrivateFieldGet(_ui, this).getHeight()}px)`;
|
|
96517
|
-
}
|
|
96518
97009
|
/**
|
|
96519
97010
|
* Called after the theme is set. It updates the theme of the pagination container.
|
|
96520
97011
|
*
|
|
@@ -96523,6 +97014,27 @@ function _onBeforeHeightChange(height) {
|
|
|
96523
97014
|
function _onAfterSetTheme(themeName) {
|
|
96524
97015
|
_classPrivateFieldGet(_ui, this).updateTheme(themeName);
|
|
96525
97016
|
}
|
|
97017
|
+
/**
|
|
97018
|
+
* Unfocuses the pagination and sets the active context for the shortcuts.
|
|
97019
|
+
*/
|
|
97020
|
+
function _unFocusPagination() {
|
|
97021
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
97022
|
+
_classPrivateFieldGet(_focusController, this).clear();
|
|
97023
|
+
this.hot.unlisten();
|
|
97024
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
97025
|
+
}
|
|
97026
|
+
/**
|
|
97027
|
+
* Called after the dialog is shown. It sets the active context for the shortcuts.
|
|
97028
|
+
*/
|
|
97029
|
+
function _onAfterDialogShow() {
|
|
97030
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
97031
|
+
}
|
|
97032
|
+
/**
|
|
97033
|
+
* Called after the dialog is hidden. It sets the active context for the shortcuts.
|
|
97034
|
+
*/
|
|
97035
|
+
function _onAfterDialogHide() {
|
|
97036
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
97037
|
+
}
|
|
96526
97038
|
|
|
96527
97039
|
/***/ }),
|
|
96528
97040
|
/* 748 */
|
|
@@ -96550,12 +97062,12 @@ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
|
96550
97062
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
96551
97063
|
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"); }
|
|
96552
97064
|
const TEMPLATE = `
|
|
96553
|
-
<div data-ref="container" class="ht-pagination
|
|
96554
|
-
<div class="ht-
|
|
97065
|
+
<div data-ref="container" class="ht-pagination handsontable">
|
|
97066
|
+
<div class="ht-pagination__inner">
|
|
96555
97067
|
<div data-ref="pageSizeSection" class="ht-page-size-section">
|
|
96556
97068
|
<span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span>
|
|
96557
97069
|
<div class="ht-page-size-section__select-wrapper">
|
|
96558
|
-
<select data-ref="pageSizeSelect" name="pageSize"></select>
|
|
97070
|
+
<select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select>
|
|
96559
97071
|
</div>
|
|
96560
97072
|
</div>
|
|
96561
97073
|
<div data-ref="pageCounterSection" class="ht-page-counter-section"></div>
|
|
@@ -96681,26 +97193,22 @@ class PaginationUI {
|
|
|
96681
97193
|
_classPrivateFieldSet(_refs, this, elements.refs);
|
|
96682
97194
|
container.setAttribute('dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr');
|
|
96683
97195
|
const isDisabled = event => event.currentTarget.disabled;
|
|
96684
|
-
|
|
96685
|
-
|
|
96686
|
-
|
|
96687
|
-
|
|
96688
|
-
|
|
96689
|
-
|
|
96690
|
-
|
|
96691
|
-
|
|
96692
|
-
|
|
96693
|
-
|
|
96694
|
-
|
|
96695
|
-
|
|
96696
|
-
|
|
96697
|
-
|
|
96698
|
-
|
|
96699
|
-
|
|
96700
|
-
if (!isDisabled(event)) {
|
|
96701
|
-
this.runLocalHooks('lastPageClick');
|
|
96702
|
-
}
|
|
96703
|
-
});
|
|
97196
|
+
const addClickListener = (eventName, element, callback) => {
|
|
97197
|
+
element.addEventListener(eventName, event => {
|
|
97198
|
+
if (!isDisabled(event)) {
|
|
97199
|
+
callback();
|
|
97200
|
+
}
|
|
97201
|
+
});
|
|
97202
|
+
};
|
|
97203
|
+
addClickListener('click', first, () => this.runLocalHooks('firstPageClick'));
|
|
97204
|
+
addClickListener('focus', first, () => this.runLocalHooks('focus', first));
|
|
97205
|
+
addClickListener('click', prev, () => this.runLocalHooks('prevPageClick'));
|
|
97206
|
+
addClickListener('focus', prev, () => this.runLocalHooks('focus', prev));
|
|
97207
|
+
addClickListener('click', next, () => this.runLocalHooks('nextPageClick'));
|
|
97208
|
+
addClickListener('focus', next, () => this.runLocalHooks('focus', next));
|
|
97209
|
+
addClickListener('click', last, () => this.runLocalHooks('lastPageClick'));
|
|
97210
|
+
addClickListener('focus', last, () => this.runLocalHooks('focus', last));
|
|
97211
|
+
addClickListener('focus', pageSizeSelect, () => this.runLocalHooks('focus', pageSizeSelect));
|
|
96704
97212
|
pageSizeSelect.addEventListener('change', () => {
|
|
96705
97213
|
const value = pageSizeSelect.value === 'auto' ? 'auto' : Number.parseInt(pageSizeSelect.value, 10);
|
|
96706
97214
|
this.runLocalHooks('pageSizeChange', value);
|
|
@@ -96716,6 +97224,31 @@ class PaginationUI {
|
|
|
96716
97224
|
}
|
|
96717
97225
|
}
|
|
96718
97226
|
|
|
97227
|
+
/**
|
|
97228
|
+
* Gets the pagination element.
|
|
97229
|
+
*
|
|
97230
|
+
* @returns {HTMLElement} The pagination element.
|
|
97231
|
+
*/
|
|
97232
|
+
getContainer() {
|
|
97233
|
+
return _classPrivateFieldGet(_refs, this).container;
|
|
97234
|
+
}
|
|
97235
|
+
|
|
97236
|
+
/**
|
|
97237
|
+
* Gets the focusable elements.
|
|
97238
|
+
*
|
|
97239
|
+
* @returns {HTMLElement[]} The focusable elements.
|
|
97240
|
+
*/
|
|
97241
|
+
getFocusableElements() {
|
|
97242
|
+
const {
|
|
97243
|
+
first,
|
|
97244
|
+
prev,
|
|
97245
|
+
next,
|
|
97246
|
+
last,
|
|
97247
|
+
pageSizeSelect
|
|
97248
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
97249
|
+
return [pageSizeSelect, first, prev, next, last].filter(element => !element.disabled);
|
|
97250
|
+
}
|
|
97251
|
+
|
|
96719
97252
|
/**
|
|
96720
97253
|
* Updates the width of the pagination container.
|
|
96721
97254
|
*
|
|
@@ -96766,9 +97299,9 @@ class PaginationUI {
|
|
|
96766
97299
|
container
|
|
96767
97300
|
} = _classPrivateFieldGet(_refs, this);
|
|
96768
97301
|
if (_classPrivateFieldGet(_uiContainer, this) || _classPrivateFieldGet(_shouldHaveBorder, this).call(this)) {
|
|
96769
|
-
(0, _element.addClass)(container, 'ht-pagination
|
|
97302
|
+
(0, _element.addClass)(container, 'ht-pagination--bordered');
|
|
96770
97303
|
} else {
|
|
96771
|
-
(0, _element.removeClass)(container, 'ht-pagination
|
|
97304
|
+
(0, _element.removeClass)(container, 'ht-pagination--bordered');
|
|
96772
97305
|
}
|
|
96773
97306
|
return this;
|
|
96774
97307
|
}
|
|
@@ -96824,7 +97357,7 @@ class PaginationUI {
|
|
|
96824
97357
|
pageSizeSelect.textContent = '';
|
|
96825
97358
|
pageSizeLabel.textContent = `${pageSizeLabelText}:`;
|
|
96826
97359
|
(0, _element.setAttribute)(pageNavSection, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_SECTION))]]);
|
|
96827
|
-
(0, _element.setAttribute)(pageSizeSelect, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION))]]);
|
|
97360
|
+
(0, _element.setAttribute)(pageSizeSelect, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION))], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
96828
97361
|
_classPrivateFieldGet(_a11yAnnouncer, this).call(this, navLabelText);
|
|
96829
97362
|
this.refreshBorderState();
|
|
96830
97363
|
pageSizeList.forEach(pageSizeItem => {
|
|
@@ -96837,40 +97370,42 @@ class PaginationUI {
|
|
|
96837
97370
|
});
|
|
96838
97371
|
const isFirstPage = currentPage === 1;
|
|
96839
97372
|
const isLastPage = currentPage === totalPages;
|
|
96840
|
-
|
|
96841
|
-
|
|
96842
|
-
(
|
|
96843
|
-
|
|
96844
|
-
|
|
96845
|
-
|
|
96846
|
-
|
|
96847
|
-
|
|
96848
|
-
|
|
96849
|
-
|
|
96850
|
-
|
|
96851
|
-
|
|
96852
|
-
|
|
96853
|
-
(
|
|
96854
|
-
|
|
96855
|
-
|
|
96856
|
-
|
|
96857
|
-
|
|
96858
|
-
|
|
96859
|
-
|
|
96860
|
-
|
|
96861
|
-
|
|
96862
|
-
|
|
96863
|
-
|
|
96864
|
-
if (prev.
|
|
96865
|
-
|
|
96866
|
-
|
|
96867
|
-
|
|
96868
|
-
|
|
96869
|
-
|
|
96870
|
-
|
|
96871
|
-
|
|
96872
|
-
(0, _element.setAttribute)(
|
|
96873
|
-
(0, _element.setAttribute)(
|
|
97373
|
+
if (pageNavSection.style.display !== 'none') {
|
|
97374
|
+
const activeElement = _classPrivateFieldGet(_rootElement, this).ownerDocument.activeElement;
|
|
97375
|
+
if (isFirstPage) {
|
|
97376
|
+
(0, _element.addClass)(first, 'ht-page-navigation-section__button--disabled');
|
|
97377
|
+
(0, _element.addClass)(prev, 'ht-page-navigation-section__button--disabled');
|
|
97378
|
+
first.disabled = true;
|
|
97379
|
+
prev.disabled = true;
|
|
97380
|
+
} else {
|
|
97381
|
+
(0, _element.removeClass)(first, 'ht-page-navigation-section__button--disabled');
|
|
97382
|
+
(0, _element.removeClass)(prev, 'ht-page-navigation-section__button--disabled');
|
|
97383
|
+
first.disabled = false;
|
|
97384
|
+
prev.disabled = false;
|
|
97385
|
+
}
|
|
97386
|
+
if (isLastPage) {
|
|
97387
|
+
(0, _element.addClass)(next, 'ht-page-navigation-section__button--disabled');
|
|
97388
|
+
(0, _element.addClass)(last, 'ht-page-navigation-section__button--disabled');
|
|
97389
|
+
next.disabled = true;
|
|
97390
|
+
last.disabled = true;
|
|
97391
|
+
} else {
|
|
97392
|
+
(0, _element.removeClass)(next, 'ht-page-navigation-section__button--disabled');
|
|
97393
|
+
(0, _element.removeClass)(last, 'ht-page-navigation-section__button--disabled');
|
|
97394
|
+
next.disabled = false;
|
|
97395
|
+
last.disabled = false;
|
|
97396
|
+
}
|
|
97397
|
+
if ([first, prev, next, last].includes(activeElement)) {
|
|
97398
|
+
if (prev.disabled) {
|
|
97399
|
+
next.focus();
|
|
97400
|
+
} else if (next.disabled) {
|
|
97401
|
+
prev.focus();
|
|
97402
|
+
}
|
|
97403
|
+
}
|
|
97404
|
+
}
|
|
97405
|
+
(0, _element.setAttribute)(first, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_FIRST_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isFirstPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
97406
|
+
(0, _element.setAttribute)(prev, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PREV_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isFirstPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
97407
|
+
(0, _element.setAttribute)(next, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_NEXT_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isLastPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
97408
|
+
(0, _element.setAttribute)(last, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_LAST_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isLastPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
96874
97409
|
return this;
|
|
96875
97410
|
}
|
|
96876
97411
|
|
|
@@ -96881,7 +97416,12 @@ class PaginationUI {
|
|
|
96881
97416
|
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
|
96882
97417
|
*/
|
|
96883
97418
|
setPageSizeSectionVisibility(isVisible) {
|
|
96884
|
-
|
|
97419
|
+
const {
|
|
97420
|
+
pageSizeSection,
|
|
97421
|
+
pageSizeSelect
|
|
97422
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
97423
|
+
pageSizeSection.style.display = isVisible ? '' : 'none';
|
|
97424
|
+
pageSizeSelect.disabled = !isVisible;
|
|
96885
97425
|
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
|
96886
97426
|
return this;
|
|
96887
97427
|
}
|
|
@@ -96905,7 +97445,18 @@ class PaginationUI {
|
|
|
96905
97445
|
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
|
96906
97446
|
*/
|
|
96907
97447
|
setNavigationSectionVisibility(isVisible) {
|
|
96908
|
-
|
|
97448
|
+
const {
|
|
97449
|
+
pageNavSection,
|
|
97450
|
+
first,
|
|
97451
|
+
prev,
|
|
97452
|
+
next,
|
|
97453
|
+
last
|
|
97454
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
97455
|
+
pageNavSection.style.display = isVisible ? '' : 'none';
|
|
97456
|
+
first.disabled = !isVisible;
|
|
97457
|
+
prev.disabled = !isVisible;
|
|
97458
|
+
next.disabled = !isVisible;
|
|
97459
|
+
last.disabled = !isVisible;
|
|
96909
97460
|
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
|
96910
97461
|
return this;
|
|
96911
97462
|
}
|
|
@@ -96931,9 +97482,9 @@ function _updateContainerVisibility() {
|
|
|
96931
97482
|
// adds or removes the corner around the Handsontable root element
|
|
96932
97483
|
if (!_classPrivateFieldGet(_uiContainer, this)) {
|
|
96933
97484
|
if (isSectionVisible) {
|
|
96934
|
-
(0, _element.addClass)(_classPrivateFieldGet(_rootElement, this), 'htPagination');
|
|
97485
|
+
(0, _element.addClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
|
96935
97486
|
} else {
|
|
96936
|
-
(0, _element.removeClass)(_classPrivateFieldGet(_rootElement, this), 'htPagination');
|
|
97487
|
+
(0, _element.removeClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
|
96937
97488
|
}
|
|
96938
97489
|
}
|
|
96939
97490
|
container.style.display = isSectionVisible ? '' : 'none';
|
|
@@ -97202,13 +97753,46 @@ exports.AutoPageSizeStrategy = AutoPageSizeStrategy;
|
|
|
97202
97753
|
|
|
97203
97754
|
|
|
97204
97755
|
exports.__esModule = true;
|
|
97205
|
-
|
|
97756
|
+
exports.createPaginationFocusController = createPaginationFocusController;
|
|
97757
|
+
var _paginator = __webpack_require__(585);
|
|
97758
|
+
/**
|
|
97759
|
+
* Creates a pagination focus controller instance.
|
|
97760
|
+
*
|
|
97761
|
+
* @private
|
|
97762
|
+
* @param {object} options The options for the pagination focus controller.
|
|
97763
|
+
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
|
97764
|
+
* @returns {PaginationController} The pagination controller instance.
|
|
97765
|
+
*/
|
|
97766
|
+
function createPaginationFocusController(_ref) {
|
|
97767
|
+
let {
|
|
97768
|
+
focusableElements
|
|
97769
|
+
} = _ref;
|
|
97770
|
+
const navigator = (0, _paginator.createPaginator)({
|
|
97771
|
+
initialPage: 0,
|
|
97772
|
+
size: () => focusableElements().length,
|
|
97773
|
+
onItemSelect: currentIndex => {
|
|
97774
|
+
const elements = focusableElements();
|
|
97775
|
+
elements[currentIndex].focus();
|
|
97776
|
+
}
|
|
97777
|
+
});
|
|
97778
|
+
return navigator;
|
|
97779
|
+
}
|
|
97780
|
+
|
|
97781
|
+
/***/ }),
|
|
97782
|
+
/* 754 */
|
|
97783
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97784
|
+
|
|
97785
|
+
"use strict";
|
|
97786
|
+
|
|
97787
|
+
|
|
97788
|
+
exports.__esModule = true;
|
|
97789
|
+
var _persistentState = __webpack_require__(755);
|
|
97206
97790
|
exports.PLUGIN_KEY = _persistentState.PLUGIN_KEY;
|
|
97207
97791
|
exports.PLUGIN_PRIORITY = _persistentState.PLUGIN_PRIORITY;
|
|
97208
97792
|
exports.PersistentState = _persistentState.PersistentState;
|
|
97209
97793
|
|
|
97210
97794
|
/***/ }),
|
|
97211
|
-
/*
|
|
97795
|
+
/* 755 */
|
|
97212
97796
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97213
97797
|
|
|
97214
97798
|
"use strict";
|
|
@@ -97218,7 +97802,7 @@ var _interopRequireDefault = __webpack_require__(1);
|
|
|
97218
97802
|
exports.__esModule = true;
|
|
97219
97803
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
97220
97804
|
var _base = __webpack_require__(520);
|
|
97221
|
-
var _storage = _interopRequireDefault(__webpack_require__(
|
|
97805
|
+
var _storage = _interopRequireDefault(__webpack_require__(756));
|
|
97222
97806
|
var _hooks = __webpack_require__(183);
|
|
97223
97807
|
_hooks.Hooks.getSingleton().register('persistentStateSave');
|
|
97224
97808
|
_hooks.Hooks.getSingleton().register('persistentStateLoad');
|
|
@@ -97359,7 +97943,7 @@ class PersistentState extends _base.BasePlugin {
|
|
|
97359
97943
|
exports.PersistentState = PersistentState;
|
|
97360
97944
|
|
|
97361
97945
|
/***/ }),
|
|
97362
|
-
/*
|
|
97946
|
+
/* 756 */
|
|
97363
97947
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97364
97948
|
|
|
97365
97949
|
"use strict";
|
|
@@ -97483,20 +98067,20 @@ class Storage {
|
|
|
97483
98067
|
var _default = exports["default"] = Storage;
|
|
97484
98068
|
|
|
97485
98069
|
/***/ }),
|
|
97486
|
-
/*
|
|
98070
|
+
/* 757 */
|
|
97487
98071
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97488
98072
|
|
|
97489
98073
|
"use strict";
|
|
97490
98074
|
|
|
97491
98075
|
|
|
97492
98076
|
exports.__esModule = true;
|
|
97493
|
-
var _search = __webpack_require__(
|
|
98077
|
+
var _search = __webpack_require__(758);
|
|
97494
98078
|
exports.PLUGIN_KEY = _search.PLUGIN_KEY;
|
|
97495
98079
|
exports.PLUGIN_PRIORITY = _search.PLUGIN_PRIORITY;
|
|
97496
98080
|
exports.Search = _search.Search;
|
|
97497
98081
|
|
|
97498
98082
|
/***/ }),
|
|
97499
|
-
/*
|
|
98083
|
+
/* 758 */
|
|
97500
98084
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97501
98085
|
|
|
97502
98086
|
"use strict";
|
|
@@ -97804,20 +98388,20 @@ function _onBeforeRenderer(TD, row, col, prop, value, cellProperties) {
|
|
|
97804
98388
|
}
|
|
97805
98389
|
|
|
97806
98390
|
/***/ }),
|
|
97807
|
-
/*
|
|
98391
|
+
/* 759 */
|
|
97808
98392
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97809
98393
|
|
|
97810
98394
|
"use strict";
|
|
97811
98395
|
|
|
97812
98396
|
|
|
97813
98397
|
exports.__esModule = true;
|
|
97814
|
-
var _stretchColumns = __webpack_require__(
|
|
98398
|
+
var _stretchColumns = __webpack_require__(760);
|
|
97815
98399
|
exports.PLUGIN_KEY = _stretchColumns.PLUGIN_KEY;
|
|
97816
98400
|
exports.PLUGIN_PRIORITY = _stretchColumns.PLUGIN_PRIORITY;
|
|
97817
98401
|
exports.StretchColumns = _stretchColumns.StretchColumns;
|
|
97818
98402
|
|
|
97819
98403
|
/***/ }),
|
|
97820
|
-
/*
|
|
98404
|
+
/* 760 */
|
|
97821
98405
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
97822
98406
|
|
|
97823
98407
|
"use strict";
|
|
@@ -97828,7 +98412,7 @@ __webpack_require__(5);
|
|
|
97828
98412
|
__webpack_require__(125);
|
|
97829
98413
|
__webpack_require__(145);
|
|
97830
98414
|
var _base = __webpack_require__(520);
|
|
97831
|
-
var _calculator = __webpack_require__(
|
|
98415
|
+
var _calculator = __webpack_require__(761);
|
|
97832
98416
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
97833
98417
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
97834
98418
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -98058,7 +98642,7 @@ function _onBeforeRender(fullRender) {
|
|
|
98058
98642
|
}
|
|
98059
98643
|
|
|
98060
98644
|
/***/ }),
|
|
98061
|
-
/*
|
|
98645
|
+
/* 761 */
|
|
98062
98646
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98063
98647
|
|
|
98064
98648
|
"use strict";
|
|
@@ -98070,8 +98654,8 @@ __webpack_require__(125);
|
|
|
98070
98654
|
__webpack_require__(145);
|
|
98071
98655
|
var _src = __webpack_require__(211);
|
|
98072
98656
|
var _element = __webpack_require__(159);
|
|
98073
|
-
var _all = __webpack_require__(
|
|
98074
|
-
var _last = __webpack_require__(
|
|
98657
|
+
var _all = __webpack_require__(762);
|
|
98658
|
+
var _last = __webpack_require__(764);
|
|
98075
98659
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
98076
98660
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
98077
98661
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -98231,7 +98815,7 @@ function _overwriteColumnWidthFn(columnWidth, columnVisualIndex) {
|
|
|
98231
98815
|
}
|
|
98232
98816
|
|
|
98233
98817
|
/***/ }),
|
|
98234
|
-
/*
|
|
98818
|
+
/* 762 */
|
|
98235
98819
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98236
98820
|
|
|
98237
98821
|
"use strict";
|
|
@@ -98243,7 +98827,7 @@ __webpack_require__(125);
|
|
|
98243
98827
|
__webpack_require__(145);
|
|
98244
98828
|
__webpack_require__(165);
|
|
98245
98829
|
var _src = __webpack_require__(211);
|
|
98246
|
-
var _base = __webpack_require__(
|
|
98830
|
+
var _base = __webpack_require__(763);
|
|
98247
98831
|
/**
|
|
98248
98832
|
* The strategy calculates the column widths by stretching all columns evenly.
|
|
98249
98833
|
*
|
|
@@ -98308,7 +98892,7 @@ class StretchAllStrategy extends _base.StretchStrategy {
|
|
|
98308
98892
|
exports.StretchAllStrategy = StretchAllStrategy;
|
|
98309
98893
|
|
|
98310
98894
|
/***/ }),
|
|
98311
|
-
/*
|
|
98895
|
+
/* 763 */
|
|
98312
98896
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98313
98897
|
|
|
98314
98898
|
"use strict";
|
|
@@ -98397,7 +98981,7 @@ class StretchStrategy {
|
|
|
98397
98981
|
exports.StretchStrategy = StretchStrategy;
|
|
98398
98982
|
|
|
98399
98983
|
/***/ }),
|
|
98400
|
-
/*
|
|
98984
|
+
/* 764 */
|
|
98401
98985
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98402
98986
|
|
|
98403
98987
|
"use strict";
|
|
@@ -98407,7 +98991,7 @@ exports.__esModule = true;
|
|
|
98407
98991
|
__webpack_require__(5);
|
|
98408
98992
|
__webpack_require__(125);
|
|
98409
98993
|
__webpack_require__(165);
|
|
98410
|
-
var _base = __webpack_require__(
|
|
98994
|
+
var _base = __webpack_require__(763);
|
|
98411
98995
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
98412
98996
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
98413
98997
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
@@ -98482,20 +99066,20 @@ class StretchLastStrategy extends _base.StretchStrategy {
|
|
|
98482
99066
|
exports.StretchLastStrategy = StretchLastStrategy;
|
|
98483
99067
|
|
|
98484
99068
|
/***/ }),
|
|
98485
|
-
/*
|
|
99069
|
+
/* 765 */
|
|
98486
99070
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98487
99071
|
|
|
98488
99072
|
"use strict";
|
|
98489
99073
|
|
|
98490
99074
|
|
|
98491
99075
|
exports.__esModule = true;
|
|
98492
|
-
var _touchScroll = __webpack_require__(
|
|
99076
|
+
var _touchScroll = __webpack_require__(766);
|
|
98493
99077
|
exports.PLUGIN_KEY = _touchScroll.PLUGIN_KEY;
|
|
98494
99078
|
exports.PLUGIN_PRIORITY = _touchScroll.PLUGIN_PRIORITY;
|
|
98495
99079
|
exports.TouchScroll = _touchScroll.TouchScroll;
|
|
98496
99080
|
|
|
98497
99081
|
/***/ }),
|
|
98498
|
-
/*
|
|
99082
|
+
/* 766 */
|
|
98499
99083
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98500
99084
|
|
|
98501
99085
|
"use strict";
|
|
@@ -98684,20 +99268,20 @@ function _onAfterMomentumScroll() {
|
|
|
98684
99268
|
}
|
|
98685
99269
|
|
|
98686
99270
|
/***/ }),
|
|
98687
|
-
/*
|
|
99271
|
+
/* 767 */
|
|
98688
99272
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98689
99273
|
|
|
98690
99274
|
"use strict";
|
|
98691
99275
|
|
|
98692
99276
|
|
|
98693
99277
|
exports.__esModule = true;
|
|
98694
|
-
var _trimRows = __webpack_require__(
|
|
99278
|
+
var _trimRows = __webpack_require__(768);
|
|
98695
99279
|
exports.PLUGIN_KEY = _trimRows.PLUGIN_KEY;
|
|
98696
99280
|
exports.PLUGIN_PRIORITY = _trimRows.PLUGIN_PRIORITY;
|
|
98697
99281
|
exports.TrimRows = _trimRows.TrimRows;
|
|
98698
99282
|
|
|
98699
99283
|
/***/ }),
|
|
98700
|
-
/*
|
|
99284
|
+
/* 768 */
|
|
98701
99285
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98702
99286
|
|
|
98703
99287
|
"use strict";
|
|
@@ -99090,20 +99674,20 @@ function _onMapInit() {
|
|
|
99090
99674
|
}
|
|
99091
99675
|
|
|
99092
99676
|
/***/ }),
|
|
99093
|
-
/*
|
|
99677
|
+
/* 769 */
|
|
99094
99678
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99095
99679
|
|
|
99096
99680
|
"use strict";
|
|
99097
99681
|
|
|
99098
99682
|
|
|
99099
99683
|
exports.__esModule = true;
|
|
99100
|
-
var _undoRedo = __webpack_require__(
|
|
99684
|
+
var _undoRedo = __webpack_require__(770);
|
|
99101
99685
|
exports.PLUGIN_KEY = _undoRedo.PLUGIN_KEY;
|
|
99102
99686
|
exports.PLUGIN_PRIORITY = _undoRedo.PLUGIN_PRIORITY;
|
|
99103
99687
|
exports.UndoRedo = _undoRedo.UndoRedo;
|
|
99104
99688
|
|
|
99105
99689
|
/***/ }),
|
|
99106
|
-
/*
|
|
99690
|
+
/* 770 */
|
|
99107
99691
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99108
99692
|
|
|
99109
99693
|
"use strict";
|
|
@@ -99126,7 +99710,7 @@ var _hooks = __webpack_require__(183);
|
|
|
99126
99710
|
var _object = __webpack_require__(170);
|
|
99127
99711
|
var _templateLiteralTag = __webpack_require__(164);
|
|
99128
99712
|
var _console = __webpack_require__(184);
|
|
99129
|
-
var _actions = __webpack_require__(
|
|
99713
|
+
var _actions = __webpack_require__(771);
|
|
99130
99714
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
99131
99715
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
99132
99716
|
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"); }
|
|
@@ -99496,7 +100080,7 @@ function _removeAPIFromCore() {
|
|
|
99496
100080
|
}
|
|
99497
100081
|
|
|
99498
100082
|
/***/ }),
|
|
99499
|
-
/*
|
|
100083
|
+
/* 771 */
|
|
99500
100084
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99501
100085
|
|
|
99502
100086
|
"use strict";
|
|
@@ -99504,18 +100088,18 @@ function _removeAPIFromCore() {
|
|
|
99504
100088
|
|
|
99505
100089
|
exports.__esModule = true;
|
|
99506
100090
|
exports.registerActions = registerActions;
|
|
99507
|
-
var _cellAlignment = __webpack_require__(
|
|
99508
|
-
var _columnMove = __webpack_require__(
|
|
99509
|
-
var _columnSort = __webpack_require__(
|
|
99510
|
-
var _createColumn = __webpack_require__(
|
|
99511
|
-
var _createRow = __webpack_require__(
|
|
99512
|
-
var _dataChange = __webpack_require__(
|
|
99513
|
-
var _filters = __webpack_require__(
|
|
99514
|
-
var _mergeCells = __webpack_require__(
|
|
99515
|
-
var _removeColumn = __webpack_require__(
|
|
99516
|
-
var _removeRow = __webpack_require__(
|
|
99517
|
-
var _rowMove = __webpack_require__(
|
|
99518
|
-
var _unmergeCells = __webpack_require__(
|
|
100091
|
+
var _cellAlignment = __webpack_require__(772);
|
|
100092
|
+
var _columnMove = __webpack_require__(774);
|
|
100093
|
+
var _columnSort = __webpack_require__(775);
|
|
100094
|
+
var _createColumn = __webpack_require__(776);
|
|
100095
|
+
var _createRow = __webpack_require__(777);
|
|
100096
|
+
var _dataChange = __webpack_require__(778);
|
|
100097
|
+
var _filters = __webpack_require__(779);
|
|
100098
|
+
var _mergeCells = __webpack_require__(780);
|
|
100099
|
+
var _removeColumn = __webpack_require__(781);
|
|
100100
|
+
var _removeRow = __webpack_require__(783);
|
|
100101
|
+
var _rowMove = __webpack_require__(784);
|
|
100102
|
+
var _unmergeCells = __webpack_require__(785);
|
|
99519
100103
|
/**
|
|
99520
100104
|
* Register all undo/redo actions.
|
|
99521
100105
|
*
|
|
@@ -99527,7 +100111,7 @@ function registerActions(hot, undoRedoPlugin) {
|
|
|
99527
100111
|
}
|
|
99528
100112
|
|
|
99529
100113
|
/***/ }),
|
|
99530
|
-
/*
|
|
100114
|
+
/* 772 */
|
|
99531
100115
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99532
100116
|
|
|
99533
100117
|
"use strict";
|
|
@@ -99536,7 +100120,7 @@ function registerActions(hot, undoRedoPlugin) {
|
|
|
99536
100120
|
var _interopRequireDefault = __webpack_require__(1);
|
|
99537
100121
|
exports.__esModule = true;
|
|
99538
100122
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99539
|
-
var _base = __webpack_require__(
|
|
100123
|
+
var _base = __webpack_require__(773);
|
|
99540
100124
|
var _utils = __webpack_require__(560);
|
|
99541
100125
|
var _array = __webpack_require__(167);
|
|
99542
100126
|
/**
|
|
@@ -99616,7 +100200,7 @@ class CellAlignmentAction extends _base.BaseAction {
|
|
|
99616
100200
|
exports.CellAlignmentAction = CellAlignmentAction;
|
|
99617
100201
|
|
|
99618
100202
|
/***/ }),
|
|
99619
|
-
/*
|
|
100203
|
+
/* 773 */
|
|
99620
100204
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99621
100205
|
|
|
99622
100206
|
"use strict";
|
|
@@ -99650,7 +100234,7 @@ class BaseAction {
|
|
|
99650
100234
|
exports.BaseAction = BaseAction;
|
|
99651
100235
|
|
|
99652
100236
|
/***/ }),
|
|
99653
|
-
/*
|
|
100237
|
+
/* 774 */
|
|
99654
100238
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99655
100239
|
|
|
99656
100240
|
"use strict";
|
|
@@ -99661,7 +100245,7 @@ exports.__esModule = true;
|
|
|
99661
100245
|
__webpack_require__(125);
|
|
99662
100246
|
__webpack_require__(145);
|
|
99663
100247
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99664
|
-
var _base = __webpack_require__(
|
|
100248
|
+
var _base = __webpack_require__(773);
|
|
99665
100249
|
var _moves = __webpack_require__(674);
|
|
99666
100250
|
/**
|
|
99667
100251
|
* Action that tracks column move changes.
|
|
@@ -99738,7 +100322,7 @@ class ColumnMoveAction extends _base.BaseAction {
|
|
|
99738
100322
|
exports.ColumnMoveAction = ColumnMoveAction;
|
|
99739
100323
|
|
|
99740
100324
|
/***/ }),
|
|
99741
|
-
/*
|
|
100325
|
+
/* 775 */
|
|
99742
100326
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99743
100327
|
|
|
99744
100328
|
"use strict";
|
|
@@ -99747,7 +100331,7 @@ exports.ColumnMoveAction = ColumnMoveAction;
|
|
|
99747
100331
|
var _interopRequireDefault = __webpack_require__(1);
|
|
99748
100332
|
exports.__esModule = true;
|
|
99749
100333
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99750
|
-
var _base = __webpack_require__(
|
|
100334
|
+
var _base = __webpack_require__(773);
|
|
99751
100335
|
/**
|
|
99752
100336
|
* Action that tracks column sort changes.
|
|
99753
100337
|
*
|
|
@@ -99815,7 +100399,7 @@ class ColumnSortAction extends _base.BaseAction {
|
|
|
99815
100399
|
exports.ColumnSortAction = ColumnSortAction;
|
|
99816
100400
|
|
|
99817
100401
|
/***/ }),
|
|
99818
|
-
/*
|
|
100402
|
+
/* 776 */
|
|
99819
100403
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99820
100404
|
|
|
99821
100405
|
"use strict";
|
|
@@ -99824,7 +100408,7 @@ exports.ColumnSortAction = ColumnSortAction;
|
|
|
99824
100408
|
var _interopRequireDefault = __webpack_require__(1);
|
|
99825
100409
|
exports.__esModule = true;
|
|
99826
100410
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99827
|
-
var _base = __webpack_require__(
|
|
100411
|
+
var _base = __webpack_require__(773);
|
|
99828
100412
|
/**
|
|
99829
100413
|
* Action that tracks column creation.
|
|
99830
100414
|
*
|
|
@@ -99879,7 +100463,7 @@ class CreateColumnAction extends _base.BaseAction {
|
|
|
99879
100463
|
exports.CreateColumnAction = CreateColumnAction;
|
|
99880
100464
|
|
|
99881
100465
|
/***/ }),
|
|
99882
|
-
/*
|
|
100466
|
+
/* 777 */
|
|
99883
100467
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99884
100468
|
|
|
99885
100469
|
"use strict";
|
|
@@ -99888,7 +100472,7 @@ exports.CreateColumnAction = CreateColumnAction;
|
|
|
99888
100472
|
var _interopRequireDefault = __webpack_require__(1);
|
|
99889
100473
|
exports.__esModule = true;
|
|
99890
100474
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99891
|
-
var _base = __webpack_require__(
|
|
100475
|
+
var _base = __webpack_require__(773);
|
|
99892
100476
|
/**
|
|
99893
100477
|
* Action that tracks row creation.
|
|
99894
100478
|
*
|
|
@@ -99948,7 +100532,7 @@ class CreateRowAction extends _base.BaseAction {
|
|
|
99948
100532
|
exports.CreateRowAction = CreateRowAction;
|
|
99949
100533
|
|
|
99950
100534
|
/***/ }),
|
|
99951
|
-
/*
|
|
100535
|
+
/* 778 */
|
|
99952
100536
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
99953
100537
|
|
|
99954
100538
|
"use strict";
|
|
@@ -99962,7 +100546,7 @@ __webpack_require__(191);
|
|
|
99962
100546
|
__webpack_require__(145);
|
|
99963
100547
|
__webpack_require__(165);
|
|
99964
100548
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
99965
|
-
var _base = __webpack_require__(
|
|
100549
|
+
var _base = __webpack_require__(773);
|
|
99966
100550
|
var _object = __webpack_require__(170);
|
|
99967
100551
|
/**
|
|
99968
100552
|
* Action that tracks data changes.
|
|
@@ -100075,7 +100659,7 @@ class DataChangeAction extends _base.BaseAction {
|
|
|
100075
100659
|
exports.DataChangeAction = DataChangeAction;
|
|
100076
100660
|
|
|
100077
100661
|
/***/ }),
|
|
100078
|
-
/*
|
|
100662
|
+
/* 779 */
|
|
100079
100663
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100080
100664
|
|
|
100081
100665
|
"use strict";
|
|
@@ -100086,7 +100670,7 @@ exports.__esModule = true;
|
|
|
100086
100670
|
__webpack_require__(125);
|
|
100087
100671
|
__webpack_require__(136);
|
|
100088
100672
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100089
|
-
var _base = __webpack_require__(
|
|
100673
|
+
var _base = __webpack_require__(773);
|
|
100090
100674
|
/**
|
|
100091
100675
|
* Action that tracks filter changes.
|
|
100092
100676
|
*
|
|
@@ -100145,7 +100729,7 @@ class FiltersAction extends _base.BaseAction {
|
|
|
100145
100729
|
exports.FiltersAction = FiltersAction;
|
|
100146
100730
|
|
|
100147
100731
|
/***/ }),
|
|
100148
|
-
/*
|
|
100732
|
+
/* 780 */
|
|
100149
100733
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100150
100734
|
|
|
100151
100735
|
"use strict";
|
|
@@ -100154,7 +100738,7 @@ exports.FiltersAction = FiltersAction;
|
|
|
100154
100738
|
var _interopRequireDefault = __webpack_require__(1);
|
|
100155
100739
|
exports.__esModule = true;
|
|
100156
100740
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100157
|
-
var _base = __webpack_require__(
|
|
100741
|
+
var _base = __webpack_require__(773);
|
|
100158
100742
|
/**
|
|
100159
100743
|
* Action that tracks changes in merged cells.
|
|
100160
100744
|
*
|
|
@@ -100215,7 +100799,7 @@ class MergeCellsAction extends _base.BaseAction {
|
|
|
100215
100799
|
exports.MergeCellsAction = MergeCellsAction;
|
|
100216
100800
|
|
|
100217
100801
|
/***/ }),
|
|
100218
|
-
/*
|
|
100802
|
+
/* 781 */
|
|
100219
100803
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100220
100804
|
|
|
100221
100805
|
"use strict";
|
|
@@ -100227,8 +100811,8 @@ __webpack_require__(87);
|
|
|
100227
100811
|
__webpack_require__(125);
|
|
100228
100812
|
__webpack_require__(145);
|
|
100229
100813
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100230
|
-
var _base = __webpack_require__(
|
|
100231
|
-
var _utils = __webpack_require__(
|
|
100814
|
+
var _base = __webpack_require__(773);
|
|
100815
|
+
var _utils = __webpack_require__(782);
|
|
100232
100816
|
var _number = __webpack_require__(205);
|
|
100233
100817
|
var _array = __webpack_require__(167);
|
|
100234
100818
|
/**
|
|
@@ -100402,7 +100986,7 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
100402
100986
|
exports.RemoveColumnAction = RemoveColumnAction;
|
|
100403
100987
|
|
|
100404
100988
|
/***/ }),
|
|
100405
|
-
/*
|
|
100989
|
+
/* 782 */
|
|
100406
100990
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100407
100991
|
|
|
100408
100992
|
"use strict";
|
|
@@ -100445,7 +101029,7 @@ function getCellMetas(hot, fromRow, toRow, fromColumn, toColumn) {
|
|
|
100445
101029
|
}
|
|
100446
101030
|
|
|
100447
101031
|
/***/ }),
|
|
100448
|
-
/*
|
|
101032
|
+
/* 783 */
|
|
100449
101033
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100450
101034
|
|
|
100451
101035
|
"use strict";
|
|
@@ -100457,8 +101041,8 @@ __webpack_require__(87);
|
|
|
100457
101041
|
__webpack_require__(125);
|
|
100458
101042
|
__webpack_require__(145);
|
|
100459
101043
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100460
|
-
var _base = __webpack_require__(
|
|
100461
|
-
var _utils = __webpack_require__(
|
|
101044
|
+
var _base = __webpack_require__(773);
|
|
101045
|
+
var _utils = __webpack_require__(782);
|
|
100462
101046
|
var _object = __webpack_require__(170);
|
|
100463
101047
|
/**
|
|
100464
101048
|
* Action that tracks changes in row removal.
|
|
@@ -100576,7 +101160,7 @@ class RemoveRowAction extends _base.BaseAction {
|
|
|
100576
101160
|
exports.RemoveRowAction = RemoveRowAction;
|
|
100577
101161
|
|
|
100578
101162
|
/***/ }),
|
|
100579
|
-
/*
|
|
101163
|
+
/* 784 */
|
|
100580
101164
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100581
101165
|
|
|
100582
101166
|
"use strict";
|
|
@@ -100587,7 +101171,7 @@ exports.__esModule = true;
|
|
|
100587
101171
|
__webpack_require__(125);
|
|
100588
101172
|
__webpack_require__(145);
|
|
100589
101173
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100590
|
-
var _base = __webpack_require__(
|
|
101174
|
+
var _base = __webpack_require__(773);
|
|
100591
101175
|
var _moves = __webpack_require__(674);
|
|
100592
101176
|
/**
|
|
100593
101177
|
* Action that tracks row move changes.
|
|
@@ -100664,7 +101248,7 @@ class RowMoveAction extends _base.BaseAction {
|
|
|
100664
101248
|
exports.RowMoveAction = RowMoveAction;
|
|
100665
101249
|
|
|
100666
101250
|
/***/ }),
|
|
100667
|
-
/*
|
|
101251
|
+
/* 785 */
|
|
100668
101252
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100669
101253
|
|
|
100670
101254
|
"use strict";
|
|
@@ -100673,7 +101257,7 @@ exports.RowMoveAction = RowMoveAction;
|
|
|
100673
101257
|
var _interopRequireDefault = __webpack_require__(1);
|
|
100674
101258
|
exports.__esModule = true;
|
|
100675
101259
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(176));
|
|
100676
|
-
var _base = __webpack_require__(
|
|
101260
|
+
var _base = __webpack_require__(773);
|
|
100677
101261
|
/**
|
|
100678
101262
|
* Action that tracks changes in merged cells.
|
|
100679
101263
|
*
|
|
@@ -100727,7 +101311,741 @@ class UnmergeCellsAction extends _base.BaseAction {
|
|
|
100727
101311
|
exports.UnmergeCellsAction = UnmergeCellsAction;
|
|
100728
101312
|
|
|
100729
101313
|
/***/ }),
|
|
100730
|
-
/*
|
|
101314
|
+
/* 786 */
|
|
101315
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
101316
|
+
|
|
101317
|
+
"use strict";
|
|
101318
|
+
|
|
101319
|
+
|
|
101320
|
+
exports.__esModule = true;
|
|
101321
|
+
var _dialog = __webpack_require__(787);
|
|
101322
|
+
exports.PLUGIN_KEY = _dialog.PLUGIN_KEY;
|
|
101323
|
+
exports.PLUGIN_PRIORITY = _dialog.PLUGIN_PRIORITY;
|
|
101324
|
+
exports.Dialog = _dialog.Dialog;
|
|
101325
|
+
|
|
101326
|
+
/***/ }),
|
|
101327
|
+
/* 787 */
|
|
101328
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
101329
|
+
|
|
101330
|
+
"use strict";
|
|
101331
|
+
|
|
101332
|
+
|
|
101333
|
+
exports.__esModule = true;
|
|
101334
|
+
__webpack_require__(5);
|
|
101335
|
+
var _base = __webpack_require__(520);
|
|
101336
|
+
var _ui2 = __webpack_require__(788);
|
|
101337
|
+
var _focusDetector2 = __webpack_require__(412);
|
|
101338
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
101339
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
101340
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
101341
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
101342
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
101343
|
+
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"); }
|
|
101344
|
+
const PLUGIN_KEY = exports.PLUGIN_KEY = 'dialog';
|
|
101345
|
+
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 340;
|
|
101346
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
101347
|
+
const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
|
|
101348
|
+
|
|
101349
|
+
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
101350
|
+
/**
|
|
101351
|
+
* @plugin Dialog
|
|
101352
|
+
* @class Dialog
|
|
101353
|
+
*
|
|
101354
|
+
* @description
|
|
101355
|
+
* The dialog plugin provides a modal dialog system for Handsontable. It allows you to display custom content in modal dialogs
|
|
101356
|
+
* that overlay the table, providing a way to show notifications, error messages, loading indicators, or any other interactive content.
|
|
101357
|
+
*
|
|
101358
|
+
* In order to enable the dialog mechanism, {@link Options#dialog} option must be set to `true`.
|
|
101359
|
+
*
|
|
101360
|
+
* The plugin provides several configuration options to customize the dialog behavior and appearance:
|
|
101361
|
+
* - `content`: The string or HTMLElement content to display in the dialog (default: '')
|
|
101362
|
+
* - `customClassName`: Custom class name to apply to the dialog (default: '')
|
|
101363
|
+
* - `background`: Dialog background variant 'solid' | 'semi-transparent' (default: 'solid')
|
|
101364
|
+
* - `contentBackground`: Whether to show content background (default: false)
|
|
101365
|
+
* - `contentDirections`: Content layout direction 'row' | 'row-reverse' | 'column' | 'column-reverse' (default: 'row')
|
|
101366
|
+
* - `animation`: Whether to enable animations (default: true)
|
|
101367
|
+
* - `closable`: Whether the dialog can be closed (default: false)
|
|
101368
|
+
*
|
|
101369
|
+
* @example
|
|
101370
|
+
*
|
|
101371
|
+
* ::: only-for javascript
|
|
101372
|
+
* ```js
|
|
101373
|
+
* // Enable dialog plugin with default options
|
|
101374
|
+
* dialog: true,
|
|
101375
|
+
*
|
|
101376
|
+
* // Enable dialog plugin with custom configuration
|
|
101377
|
+
* dialog: {
|
|
101378
|
+
* content: 'Dialog content',
|
|
101379
|
+
* customClassName: 'custom-dialog',
|
|
101380
|
+
* background: 'semi-transparent',
|
|
101381
|
+
* contentBackground: false,
|
|
101382
|
+
* contentDirections: 'column',
|
|
101383
|
+
* animation: false,
|
|
101384
|
+
* closable: true,
|
|
101385
|
+
* }
|
|
101386
|
+
*
|
|
101387
|
+
* // Access to dialog plugin instance:
|
|
101388
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
|
101389
|
+
*
|
|
101390
|
+
* // Show a dialog programmatically:
|
|
101391
|
+
* dialogPlugin.show({
|
|
101392
|
+
* content: '<h2>Custom Dialog</h2><p>This is a custom dialog content.</p>',
|
|
101393
|
+
* closable: true,
|
|
101394
|
+
* contentDirections: 'column',
|
|
101395
|
+
* });
|
|
101396
|
+
*
|
|
101397
|
+
* // Hide the dialog programmatically:
|
|
101398
|
+
* dialogPlugin.hide();
|
|
101399
|
+
*
|
|
101400
|
+
* // Check if dialog is visible:
|
|
101401
|
+
* const isVisible = dialogPlugin.isVisible();
|
|
101402
|
+
* ```
|
|
101403
|
+
* :::
|
|
101404
|
+
*
|
|
101405
|
+
* ::: only-for react
|
|
101406
|
+
* ```jsx
|
|
101407
|
+
* const MyComponent = () => {
|
|
101408
|
+
* const hotRef = useRef(null);
|
|
101409
|
+
*
|
|
101410
|
+
* useEffect(() => {
|
|
101411
|
+
* const hot = hotRef.current.hotInstance;
|
|
101412
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
|
101413
|
+
*
|
|
101414
|
+
* dialogPlugin.show({
|
|
101415
|
+
* content: <div>
|
|
101416
|
+
* <h2>React Dialog</h2>
|
|
101417
|
+
* <p>Dialog content rendered with React</p>
|
|
101418
|
+
* </div>,
|
|
101419
|
+
* closable: true
|
|
101420
|
+
* });
|
|
101421
|
+
* }, []);
|
|
101422
|
+
*
|
|
101423
|
+
* return (
|
|
101424
|
+
* <HotTable
|
|
101425
|
+
* ref={hotRef}
|
|
101426
|
+
* settings={{
|
|
101427
|
+
* data: data,
|
|
101428
|
+
* dialog: {
|
|
101429
|
+
* customClassName: 'react-dialog',
|
|
101430
|
+
* contentDirections: 'column',
|
|
101431
|
+
* closable: true
|
|
101432
|
+
* }
|
|
101433
|
+
* }}
|
|
101434
|
+
* />
|
|
101435
|
+
* );
|
|
101436
|
+
* }
|
|
101437
|
+
* ```
|
|
101438
|
+
* :::
|
|
101439
|
+
*
|
|
101440
|
+
* ::: only-for angular
|
|
101441
|
+
* ```html
|
|
101442
|
+
* <hot-table
|
|
101443
|
+
* [settings]="hotSettings">
|
|
101444
|
+
* </hot-table>
|
|
101445
|
+
* ```
|
|
101446
|
+
*
|
|
101447
|
+
* ```ts
|
|
101448
|
+
* @Component({
|
|
101449
|
+
* // ... component decorator
|
|
101450
|
+
* })
|
|
101451
|
+
* export class MyComponent implements OnInit {
|
|
101452
|
+
* @ViewChild('hot') hot: HotTableComponent;
|
|
101453
|
+
*
|
|
101454
|
+
* hotSettings: Handsontable.GridSettings = {
|
|
101455
|
+
* data: data,
|
|
101456
|
+
* dialog: {
|
|
101457
|
+
* customClassName: 'angular-dialog',
|
|
101458
|
+
* contentDirections: 'column',
|
|
101459
|
+
* closable: true
|
|
101460
|
+
* }
|
|
101461
|
+
* };
|
|
101462
|
+
*
|
|
101463
|
+
* ngOnInit() {
|
|
101464
|
+
* const dialogPlugin = this.hot.hotInstance.getPlugin('dialog');
|
|
101465
|
+
*
|
|
101466
|
+
* dialogPlugin.show({
|
|
101467
|
+
* content: `
|
|
101468
|
+
* <div>
|
|
101469
|
+
* <h2>Angular Dialog</h2>
|
|
101470
|
+
* <p>Dialog content in Angular component</p>
|
|
101471
|
+
* </div>
|
|
101472
|
+
* `,
|
|
101473
|
+
* closable: true
|
|
101474
|
+
* });
|
|
101475
|
+
* }
|
|
101476
|
+
* }
|
|
101477
|
+
* ```
|
|
101478
|
+
* :::
|
|
101479
|
+
*/
|
|
101480
|
+
var _ui = /*#__PURE__*/new WeakMap();
|
|
101481
|
+
var _isVisible = /*#__PURE__*/new WeakMap();
|
|
101482
|
+
var _focusDetector = /*#__PURE__*/new WeakMap();
|
|
101483
|
+
var _selectionState = /*#__PURE__*/new WeakMap();
|
|
101484
|
+
var _Dialog_brand = /*#__PURE__*/new WeakSet();
|
|
101485
|
+
class Dialog extends _base.BasePlugin {
|
|
101486
|
+
constructor() {
|
|
101487
|
+
super(...arguments);
|
|
101488
|
+
/**
|
|
101489
|
+
* Register shortcuts responsible for closing the dialog and navigating through the dialog.
|
|
101490
|
+
*/
|
|
101491
|
+
_classPrivateMethodInitSpec(this, _Dialog_brand);
|
|
101492
|
+
/**
|
|
101493
|
+
* UI instance of the dialog plugin.
|
|
101494
|
+
*
|
|
101495
|
+
* @type {DialogUI}
|
|
101496
|
+
*/
|
|
101497
|
+
_classPrivateFieldInitSpec(this, _ui, null);
|
|
101498
|
+
/**
|
|
101499
|
+
* Flag indicating if dialog is currently visible.
|
|
101500
|
+
*
|
|
101501
|
+
* @type {boolean}
|
|
101502
|
+
*/
|
|
101503
|
+
_classPrivateFieldInitSpec(this, _isVisible, false);
|
|
101504
|
+
/**
|
|
101505
|
+
* Focus detector instance.
|
|
101506
|
+
*
|
|
101507
|
+
* @type {FocusDetector}
|
|
101508
|
+
*/
|
|
101509
|
+
_classPrivateFieldInitSpec(this, _focusDetector, null);
|
|
101510
|
+
/**
|
|
101511
|
+
* Keeps the selection state that will be restored after the dialog is closed.
|
|
101512
|
+
*
|
|
101513
|
+
* @type {SelectionState | null}
|
|
101514
|
+
*/
|
|
101515
|
+
_classPrivateFieldInitSpec(this, _selectionState, null);
|
|
101516
|
+
}
|
|
101517
|
+
static get PLUGIN_KEY() {
|
|
101518
|
+
return PLUGIN_KEY;
|
|
101519
|
+
}
|
|
101520
|
+
static get PLUGIN_PRIORITY() {
|
|
101521
|
+
return PLUGIN_PRIORITY;
|
|
101522
|
+
}
|
|
101523
|
+
static get DEFAULT_SETTINGS() {
|
|
101524
|
+
return {
|
|
101525
|
+
content: '',
|
|
101526
|
+
customClassName: '',
|
|
101527
|
+
background: 'solid',
|
|
101528
|
+
contentBackground: false,
|
|
101529
|
+
contentDirections: 'row',
|
|
101530
|
+
animation: true,
|
|
101531
|
+
closable: false
|
|
101532
|
+
};
|
|
101533
|
+
}
|
|
101534
|
+
static get SETTINGS_VALIDATORS() {
|
|
101535
|
+
return {
|
|
101536
|
+
content: value => typeof value === 'string' || typeof HTMLElement !== 'undefined' && value instanceof HTMLElement || typeof DocumentFragment !== 'undefined' && value instanceof DocumentFragment,
|
|
101537
|
+
customClassName: value => typeof value === 'string',
|
|
101538
|
+
background: value => ['solid', 'semi-transparent'].includes(value),
|
|
101539
|
+
contentBackground: value => typeof value === 'boolean',
|
|
101540
|
+
contentDirections: value => ['row', 'row-reverse', 'column', 'column-reverse'].includes(value),
|
|
101541
|
+
animation: value => typeof value === 'boolean',
|
|
101542
|
+
closable: value => typeof value === 'boolean'
|
|
101543
|
+
};
|
|
101544
|
+
}
|
|
101545
|
+
/**
|
|
101546
|
+
* Check if the plugin is enabled in the handsontable settings.
|
|
101547
|
+
*
|
|
101548
|
+
* @returns {boolean}
|
|
101549
|
+
*/
|
|
101550
|
+
isEnabled() {
|
|
101551
|
+
return !!this.hot.getSettings()[PLUGIN_KEY];
|
|
101552
|
+
}
|
|
101553
|
+
|
|
101554
|
+
/**
|
|
101555
|
+
* Enable plugin for this Handsontable instance.
|
|
101556
|
+
*/
|
|
101557
|
+
enablePlugin() {
|
|
101558
|
+
if (this.enabled) {
|
|
101559
|
+
return;
|
|
101560
|
+
}
|
|
101561
|
+
if (!_classPrivateFieldGet(_ui, this)) {
|
|
101562
|
+
_classPrivateFieldSet(_ui, this, new _ui2.DialogUI({
|
|
101563
|
+
rootElement: this.hot.rootGridElement,
|
|
101564
|
+
isRtl: this.hot.isRtl()
|
|
101565
|
+
}));
|
|
101566
|
+
_classPrivateFieldGet(_ui, this).addLocalHook('clickDialogElement', () => _assertClassBrand(_Dialog_brand, this, _onDialogClick).call(this));
|
|
101567
|
+
_classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getDialogElement(), {
|
|
101568
|
+
onFocus: from => {
|
|
101569
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
101570
|
+
this.hot.runHooks('afterDialogFocus', `tab_${from}`);
|
|
101571
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
101572
|
+
this.hot.listen();
|
|
101573
|
+
}
|
|
101574
|
+
}));
|
|
101575
|
+
}
|
|
101576
|
+
_assertClassBrand(_Dialog_brand, this, _registerShortcuts).call(this);
|
|
101577
|
+
this.addHook('modifyFocusOnTabNavigation', from => _assertClassBrand(_Dialog_brand, this, _onFocusTabNavigation).call(this, from), 1);
|
|
101578
|
+
this.addHook('afterViewRender', () => _assertClassBrand(_Dialog_brand, this, _onAfterRender).call(this));
|
|
101579
|
+
super.enablePlugin();
|
|
101580
|
+
}
|
|
101581
|
+
|
|
101582
|
+
/**
|
|
101583
|
+
* Update plugin state after Handsontable settings update.
|
|
101584
|
+
*/
|
|
101585
|
+
updatePlugin() {
|
|
101586
|
+
this.disablePlugin();
|
|
101587
|
+
this.enablePlugin();
|
|
101588
|
+
super.updatePlugin();
|
|
101589
|
+
}
|
|
101590
|
+
|
|
101591
|
+
/**
|
|
101592
|
+
* Disable plugin for this Handsontable instance.
|
|
101593
|
+
*/
|
|
101594
|
+
disablePlugin() {
|
|
101595
|
+
this.hide();
|
|
101596
|
+
_assertClassBrand(_Dialog_brand, this, _unregisterShortcuts).call(this);
|
|
101597
|
+
super.disablePlugin();
|
|
101598
|
+
}
|
|
101599
|
+
/**
|
|
101600
|
+
* Check if the dialog is currently visible.
|
|
101601
|
+
*
|
|
101602
|
+
* @returns {boolean} True if the dialog is visible, false otherwise.
|
|
101603
|
+
*/
|
|
101604
|
+
isVisible() {
|
|
101605
|
+
return _classPrivateFieldGet(_isVisible, this);
|
|
101606
|
+
}
|
|
101607
|
+
|
|
101608
|
+
/**
|
|
101609
|
+
* Show dialog with given configuration.
|
|
101610
|
+
* Displays the dialog with the specified content and options.
|
|
101611
|
+
*
|
|
101612
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
|
101613
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
|
101614
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
|
101615
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
|
101616
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
|
101617
|
+
* @param {'row'|'row-reverse'|'column'|'column-reverse'} options.contentDirections Content layout direction. Default: 'row'.
|
|
101618
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
|
101619
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
|
101620
|
+
*/
|
|
101621
|
+
show() {
|
|
101622
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
101623
|
+
if (!this.enabled) {
|
|
101624
|
+
return;
|
|
101625
|
+
}
|
|
101626
|
+
if (this.isVisible()) {
|
|
101627
|
+
this.update(options);
|
|
101628
|
+
return;
|
|
101629
|
+
}
|
|
101630
|
+
this.hot.runHooks('beforeDialogShow');
|
|
101631
|
+
this.update(options);
|
|
101632
|
+
_classPrivateFieldGet(_ui, this).showDialog(this.getSetting('animation'));
|
|
101633
|
+
_classPrivateFieldSet(_isVisible, this, true);
|
|
101634
|
+
_classPrivateFieldSet(_selectionState, this, this.hot.selection.exportSelection());
|
|
101635
|
+
this.hot.deselectCell();
|
|
101636
|
+
this.hot.runHooks('afterDialogShow');
|
|
101637
|
+
const {
|
|
101638
|
+
activeElement
|
|
101639
|
+
} = this.hot.rootDocument;
|
|
101640
|
+
if (this.hot.rootWrapperElement.contains(activeElement) || this.hot.rootPortalElement.contains(activeElement)) {
|
|
101641
|
+
this.hot.unlisten();
|
|
101642
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
101643
|
+
this.hot.listen();
|
|
101644
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
101645
|
+
this.hot.runHooks('afterDialogFocus', 'show');
|
|
101646
|
+
}
|
|
101647
|
+
}
|
|
101648
|
+
|
|
101649
|
+
/**
|
|
101650
|
+
* Hide the currently open dialog.
|
|
101651
|
+
* Closes the dialog and restores the focus to the table.
|
|
101652
|
+
*/
|
|
101653
|
+
hide() {
|
|
101654
|
+
if (!this.isVisible()) {
|
|
101655
|
+
return;
|
|
101656
|
+
}
|
|
101657
|
+
this.hot.runHooks('beforeDialogHide');
|
|
101658
|
+
_classPrivateFieldGet(_ui, this).hideDialog(this.getSetting('animation'));
|
|
101659
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
101660
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
|
101661
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
101662
|
+
if (_classPrivateFieldGet(_selectionState, this)) {
|
|
101663
|
+
this.hot.selection.importSelection(_classPrivateFieldGet(_selectionState, this));
|
|
101664
|
+
this.hot.view.render();
|
|
101665
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
|
101666
|
+
} else {
|
|
101667
|
+
this.hot.selectCell(0, 0);
|
|
101668
|
+
}
|
|
101669
|
+
this.hot.runHooks('afterDialogHide');
|
|
101670
|
+
}
|
|
101671
|
+
|
|
101672
|
+
/**
|
|
101673
|
+
* Update the dialog configuration.
|
|
101674
|
+
*
|
|
101675
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
|
101676
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
|
101677
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
|
101678
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
|
101679
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
|
101680
|
+
* @param {'row'|'row-reverse'|'column'|'column-reverse'} options.contentDirections Content layout direction. Default: 'row'.
|
|
101681
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
|
101682
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
|
101683
|
+
*/
|
|
101684
|
+
update(options) {
|
|
101685
|
+
if (!this.enabled) {
|
|
101686
|
+
return;
|
|
101687
|
+
}
|
|
101688
|
+
this.updatePluginSettings(options);
|
|
101689
|
+
_classPrivateFieldGet(_ui, this).updateDialog({
|
|
101690
|
+
isVisible: this.isVisible(),
|
|
101691
|
+
content: this.getSetting('content'),
|
|
101692
|
+
customClassName: this.getSetting('customClassName'),
|
|
101693
|
+
background: this.getSetting('background'),
|
|
101694
|
+
contentBackground: this.getSetting('contentBackground'),
|
|
101695
|
+
contentDirections: this.getSetting('contentDirections'),
|
|
101696
|
+
animation: this.getSetting('animation')
|
|
101697
|
+
});
|
|
101698
|
+
}
|
|
101699
|
+
|
|
101700
|
+
/**
|
|
101701
|
+
* Handle focus tab navigation event.
|
|
101702
|
+
*
|
|
101703
|
+
* @param {'from_above' | 'from_below'} from The direction from which the focus was modified.
|
|
101704
|
+
* @returns {boolean} Returns `false` to prevent the default focus behavior.
|
|
101705
|
+
*/
|
|
101706
|
+
|
|
101707
|
+
/**
|
|
101708
|
+
* Destroy dialog and reset plugin state.
|
|
101709
|
+
*/
|
|
101710
|
+
destroy() {
|
|
101711
|
+
var _classPrivateFieldGet2;
|
|
101712
|
+
(_classPrivateFieldGet2 = _classPrivateFieldGet(_ui, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.destroyDialog();
|
|
101713
|
+
_classPrivateFieldSet(_ui, this, null);
|
|
101714
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
|
101715
|
+
_classPrivateFieldSet(_focusDetector, this, null);
|
|
101716
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
|
101717
|
+
super.destroy();
|
|
101718
|
+
}
|
|
101719
|
+
}
|
|
101720
|
+
exports.Dialog = Dialog;
|
|
101721
|
+
function _registerShortcuts() {
|
|
101722
|
+
var _manager$getContext;
|
|
101723
|
+
const manager = this.hot.getShortcutManager();
|
|
101724
|
+
const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME);
|
|
101725
|
+
pluginContext.addShortcut({
|
|
101726
|
+
keys: [['Escape']],
|
|
101727
|
+
callback: () => {
|
|
101728
|
+
this.hide();
|
|
101729
|
+
},
|
|
101730
|
+
runOnlyIf: () => _classPrivateFieldGet(_isVisible, this) && this.getSetting('closable'),
|
|
101731
|
+
group: SHORTCUTS_GROUP
|
|
101732
|
+
});
|
|
101733
|
+
pluginContext.addShortcut({
|
|
101734
|
+
keys: [['Shift', 'Tab'], ['Tab']],
|
|
101735
|
+
preventDefault: false,
|
|
101736
|
+
callback: event => {
|
|
101737
|
+
this.hot._registerTimeout(() => {
|
|
101738
|
+
const {
|
|
101739
|
+
activeElement
|
|
101740
|
+
} = this.hot.rootDocument;
|
|
101741
|
+
if (!_classPrivateFieldGet(_ui, this).isInsideDialog(activeElement)) {
|
|
101742
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
101743
|
+
this.hot.unlisten();
|
|
101744
|
+
return;
|
|
101745
|
+
}
|
|
101746
|
+
if (event.shiftKey) {
|
|
101747
|
+
this.hot.runHooks('dialogFocusPreviousElement');
|
|
101748
|
+
} else {
|
|
101749
|
+
this.hot.runHooks('dialogFocusNextElement');
|
|
101750
|
+
}
|
|
101751
|
+
}, 0);
|
|
101752
|
+
},
|
|
101753
|
+
group: SHORTCUTS_GROUP
|
|
101754
|
+
});
|
|
101755
|
+
}
|
|
101756
|
+
/**
|
|
101757
|
+
* Unregister shortcuts responsible for closing the dialog and navigating through the dialog.
|
|
101758
|
+
*/
|
|
101759
|
+
function _unregisterShortcuts() {
|
|
101760
|
+
const shortcutManager = this.hot.getShortcutManager();
|
|
101761
|
+
const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
|
|
101762
|
+
pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
|
|
101763
|
+
}
|
|
101764
|
+
function _onFocusTabNavigation(from) {
|
|
101765
|
+
if (this.isVisible()) {
|
|
101766
|
+
_classPrivateFieldGet(_focusDetector, this).focus(from);
|
|
101767
|
+
return false;
|
|
101768
|
+
}
|
|
101769
|
+
}
|
|
101770
|
+
/**
|
|
101771
|
+
* Handle dialog click event.
|
|
101772
|
+
*/
|
|
101773
|
+
function _onDialogClick() {
|
|
101774
|
+
if (this.isVisible() && !this.hot.isListening()) {
|
|
101775
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
101776
|
+
this.hot.runHooks('afterDialogFocus', 'click');
|
|
101777
|
+
}
|
|
101778
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
101779
|
+
this.hot.listen();
|
|
101780
|
+
}
|
|
101781
|
+
/**
|
|
101782
|
+
* Called after the rendering of the table is completed. It updates the width and
|
|
101783
|
+
* height of the dialog container to the same size as the table.
|
|
101784
|
+
*/
|
|
101785
|
+
function _onAfterRender() {
|
|
101786
|
+
const {
|
|
101787
|
+
view,
|
|
101788
|
+
rootWrapperElement,
|
|
101789
|
+
rootWindow
|
|
101790
|
+
} = this.hot;
|
|
101791
|
+
const width = view.isHorizontallyScrollableByWindow() ? view.getTotalTableWidth() : view.getWorkspaceWidth();
|
|
101792
|
+
_classPrivateFieldGet(_ui, this).updateWidth(width);
|
|
101793
|
+
const dialogInfo = rootWrapperElement.querySelector('.hot-display-license-info');
|
|
101794
|
+
if (dialogInfo) {
|
|
101795
|
+
const height = dialogInfo.offsetHeight;
|
|
101796
|
+
const marginTop = parseFloat(rootWindow.getComputedStyle(dialogInfo).marginTop);
|
|
101797
|
+
_classPrivateFieldGet(_ui, this).updateHeight(height + marginTop);
|
|
101798
|
+
}
|
|
101799
|
+
}
|
|
101800
|
+
|
|
101801
|
+
/***/ }),
|
|
101802
|
+
/* 788 */
|
|
101803
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
101804
|
+
|
|
101805
|
+
"use strict";
|
|
101806
|
+
|
|
101807
|
+
|
|
101808
|
+
var _interopRequireDefault = __webpack_require__(1);
|
|
101809
|
+
exports.__esModule = true;
|
|
101810
|
+
__webpack_require__(5);
|
|
101811
|
+
var _templateLiteralTag = __webpack_require__(164);
|
|
101812
|
+
var _object = __webpack_require__(170);
|
|
101813
|
+
var _localHooks = _interopRequireDefault(__webpack_require__(274));
|
|
101814
|
+
var _element = __webpack_require__(159);
|
|
101815
|
+
var _a11y = __webpack_require__(168);
|
|
101816
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
101817
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
101818
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
101819
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
101820
|
+
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"); }
|
|
101821
|
+
const DIALOG_CLASS_NAME = 'ht-dialog';
|
|
101822
|
+
const TEMPLATE = `
|
|
101823
|
+
<div data-ref="dialogElement" class="${DIALOG_CLASS_NAME}">
|
|
101824
|
+
<div data-ref="contentWrapperElement" class="${DIALOG_CLASS_NAME}__content-wrapper">
|
|
101825
|
+
<div data-ref="contentElement" class="${DIALOG_CLASS_NAME}__content"></div>
|
|
101826
|
+
</div>
|
|
101827
|
+
</div>
|
|
101828
|
+
`;
|
|
101829
|
+
|
|
101830
|
+
/**
|
|
101831
|
+
* DialogUI is a UI component that renders and manages dialog elements.
|
|
101832
|
+
* It handles dialog creation, content updates, visibility toggling, and styling.
|
|
101833
|
+
*
|
|
101834
|
+
* @private
|
|
101835
|
+
* @class DialogUI
|
|
101836
|
+
*/
|
|
101837
|
+
var _rootElement = /*#__PURE__*/new WeakMap();
|
|
101838
|
+
var _refs = /*#__PURE__*/new WeakMap();
|
|
101839
|
+
var _isRtl = /*#__PURE__*/new WeakMap();
|
|
101840
|
+
class DialogUI {
|
|
101841
|
+
constructor(_ref) {
|
|
101842
|
+
let {
|
|
101843
|
+
rootElement,
|
|
101844
|
+
isRtl
|
|
101845
|
+
} = _ref;
|
|
101846
|
+
/**
|
|
101847
|
+
* The root element where the dialog UI will be installed.
|
|
101848
|
+
*
|
|
101849
|
+
* @type {HTMLElement}
|
|
101850
|
+
*/
|
|
101851
|
+
_classPrivateFieldInitSpec(this, _rootElement, void 0);
|
|
101852
|
+
/**
|
|
101853
|
+
* The references to the UI elements.
|
|
101854
|
+
*
|
|
101855
|
+
* @type {object}
|
|
101856
|
+
*/
|
|
101857
|
+
_classPrivateFieldInitSpec(this, _refs, void 0);
|
|
101858
|
+
/**
|
|
101859
|
+
* Indicates if the UI is in RTL mode.
|
|
101860
|
+
*
|
|
101861
|
+
* @type {boolean}
|
|
101862
|
+
*/
|
|
101863
|
+
_classPrivateFieldInitSpec(this, _isRtl, false);
|
|
101864
|
+
_classPrivateFieldSet(_rootElement, this, rootElement);
|
|
101865
|
+
_classPrivateFieldSet(_isRtl, this, isRtl);
|
|
101866
|
+
this.install();
|
|
101867
|
+
}
|
|
101868
|
+
|
|
101869
|
+
/**
|
|
101870
|
+
* Creates the dialog UI elements and sets up the structure.
|
|
101871
|
+
*/
|
|
101872
|
+
install() {
|
|
101873
|
+
var _classPrivateFieldGet2;
|
|
101874
|
+
if ((_classPrivateFieldGet2 = _classPrivateFieldGet(_refs, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.dialogElement) {
|
|
101875
|
+
return;
|
|
101876
|
+
}
|
|
101877
|
+
const elements = (0, _templateLiteralTag.html)`${TEMPLATE}`;
|
|
101878
|
+
_classPrivateFieldSet(_refs, this, elements.refs);
|
|
101879
|
+
const {
|
|
101880
|
+
dialogElement
|
|
101881
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
101882
|
+
dialogElement.addEventListener('click', () => this.runLocalHooks('clickDialogElement'));
|
|
101883
|
+
|
|
101884
|
+
// Set ARIA attributes
|
|
101885
|
+
(0, _element.setAttribute)(dialogElement, [(0, _a11y.A11Y_DIALOG)(), (0, _a11y.A11Y_MODAL)(), (0, _a11y.A11Y_TABINDEX)(-1), ['dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr']]);
|
|
101886
|
+
|
|
101887
|
+
// Append to Handsontable after table grid element
|
|
101888
|
+
_classPrivateFieldGet(_rootElement, this).after(elements.fragment);
|
|
101889
|
+
}
|
|
101890
|
+
|
|
101891
|
+
/**
|
|
101892
|
+
* Returns the dialog element.
|
|
101893
|
+
*
|
|
101894
|
+
* @returns {HTMLElement} The dialog element.
|
|
101895
|
+
*/
|
|
101896
|
+
getDialogElement() {
|
|
101897
|
+
return _classPrivateFieldGet(_refs, this).dialogElement;
|
|
101898
|
+
}
|
|
101899
|
+
|
|
101900
|
+
/**
|
|
101901
|
+
* Checks if the given element is inside the dialog.
|
|
101902
|
+
*
|
|
101903
|
+
* @param {HTMLElement} element - The element to check.
|
|
101904
|
+
* @returns {boolean} Returns `true` if the element is inside the dialog, `false` otherwise.
|
|
101905
|
+
*/
|
|
101906
|
+
isInsideDialog(element) {
|
|
101907
|
+
return _classPrivateFieldGet(_refs, this).dialogElement.contains(element);
|
|
101908
|
+
}
|
|
101909
|
+
|
|
101910
|
+
/**
|
|
101911
|
+
* Updates the dialog content and class name.
|
|
101912
|
+
*
|
|
101913
|
+
* @param {object} options - Class name update options.
|
|
101914
|
+
* @param {boolean} options.isVisible - Whether the dialog is visible.
|
|
101915
|
+
* @param {string|HTMLElement} options.content - The content to render in the dialog.
|
|
101916
|
+
* @param {string} options.customClassName - The custom class name to add to the dialog.
|
|
101917
|
+
* @param {string} options.background - The background to add to the dialog.
|
|
101918
|
+
* @param {boolean} options.contentBackground - Whether to show content background.
|
|
101919
|
+
* @param {string} options.contentDirections - The flex direction for content layout.
|
|
101920
|
+
* @param {boolean} options.animation - Whether to add the animation class to the dialog.
|
|
101921
|
+
*
|
|
101922
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
101923
|
+
*/
|
|
101924
|
+
updateDialog(_ref2) {
|
|
101925
|
+
let {
|
|
101926
|
+
isVisible,
|
|
101927
|
+
content,
|
|
101928
|
+
customClassName,
|
|
101929
|
+
background,
|
|
101930
|
+
contentBackground,
|
|
101931
|
+
contentDirections,
|
|
101932
|
+
animation
|
|
101933
|
+
} = _ref2;
|
|
101934
|
+
const {
|
|
101935
|
+
dialogElement,
|
|
101936
|
+
contentElement
|
|
101937
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
101938
|
+
|
|
101939
|
+
// Dialog class name
|
|
101940
|
+
const customClass = customClassName ? ` ${customClassName}` : '';
|
|
101941
|
+
const backgroundClass = background ? ` ${DIALOG_CLASS_NAME}--background-${background}` : '';
|
|
101942
|
+
const animationClass = animation ? ` ${DIALOG_CLASS_NAME}--animation` : '';
|
|
101943
|
+
const showClass = isVisible ? ` ${DIALOG_CLASS_NAME}--show` : '';
|
|
101944
|
+
|
|
101945
|
+
// Update dialog class name
|
|
101946
|
+
dialogElement.className = `${DIALOG_CLASS_NAME}${customClass}${backgroundClass}${animationClass}${showClass}`;
|
|
101947
|
+
|
|
101948
|
+
// Dialog content class name
|
|
101949
|
+
const contentBackgroundClass = contentBackground ? ` ${DIALOG_CLASS_NAME}__content--background` : '';
|
|
101950
|
+
const contentDirectionsClass = contentDirections ? ` ${DIALOG_CLASS_NAME}__content--flex-${contentDirections}` : '';
|
|
101951
|
+
|
|
101952
|
+
// Update content class name
|
|
101953
|
+
contentElement.className = `${DIALOG_CLASS_NAME}__content${contentBackgroundClass}${contentDirectionsClass}`;
|
|
101954
|
+
|
|
101955
|
+
// Clear existing dialog content
|
|
101956
|
+
contentElement.innerHTML = '';
|
|
101957
|
+
|
|
101958
|
+
// Render new dialog content
|
|
101959
|
+
if (typeof content === 'string') {
|
|
101960
|
+
(0, _element.fastInnerHTML)(contentElement, content);
|
|
101961
|
+
} else if (content instanceof HTMLElement || content instanceof DocumentFragment) {
|
|
101962
|
+
contentElement.appendChild(content);
|
|
101963
|
+
}
|
|
101964
|
+
return this;
|
|
101965
|
+
}
|
|
101966
|
+
|
|
101967
|
+
/**
|
|
101968
|
+
* Shows the dialog with optional animation.
|
|
101969
|
+
*
|
|
101970
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
|
101971
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
101972
|
+
*/
|
|
101973
|
+
showDialog(animation) {
|
|
101974
|
+
const {
|
|
101975
|
+
dialogElement
|
|
101976
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
101977
|
+
dialogElement.style.display = 'block';
|
|
101978
|
+
if (animation) {
|
|
101979
|
+
// Triggers style and layout recalculation, so the display: block is fully committed before adding
|
|
101980
|
+
// the class ht-dialog--show.
|
|
101981
|
+
// eslint-disable-next-line no-unused-expressions
|
|
101982
|
+
dialogElement.offsetHeight;
|
|
101983
|
+
}
|
|
101984
|
+
(0, _element.addClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
|
101985
|
+
return this;
|
|
101986
|
+
}
|
|
101987
|
+
|
|
101988
|
+
/**
|
|
101989
|
+
* Hides the dialog with optional animation.
|
|
101990
|
+
*
|
|
101991
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
|
101992
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
101993
|
+
*/
|
|
101994
|
+
hideDialog(animation) {
|
|
101995
|
+
const {
|
|
101996
|
+
dialogElement
|
|
101997
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
101998
|
+
(0, _element.removeClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
|
101999
|
+
if (animation) {
|
|
102000
|
+
dialogElement.addEventListener('transitionend', () => {
|
|
102001
|
+
if (!(0, _element.hasClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`)) {
|
|
102002
|
+
dialogElement.style.display = 'none';
|
|
102003
|
+
}
|
|
102004
|
+
}, {
|
|
102005
|
+
once: true
|
|
102006
|
+
});
|
|
102007
|
+
} else {
|
|
102008
|
+
dialogElement.style.display = 'none';
|
|
102009
|
+
}
|
|
102010
|
+
return this;
|
|
102011
|
+
}
|
|
102012
|
+
|
|
102013
|
+
/**
|
|
102014
|
+
* Updates the width of the dialog container to the same size as the table.
|
|
102015
|
+
*
|
|
102016
|
+
* @param {number} width - The width of the table.
|
|
102017
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
102018
|
+
*/
|
|
102019
|
+
updateWidth(width) {
|
|
102020
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.width = `${width}px`;
|
|
102021
|
+
return this;
|
|
102022
|
+
}
|
|
102023
|
+
|
|
102024
|
+
/**
|
|
102025
|
+
* Updates the height of the dialog container.
|
|
102026
|
+
*
|
|
102027
|
+
* @param {number} licenseInfoHeight - The height of the license info.
|
|
102028
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
102029
|
+
*/
|
|
102030
|
+
updateHeight(licenseInfoHeight) {
|
|
102031
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.height = `calc(100% - ${licenseInfoHeight}px)`;
|
|
102032
|
+
return this;
|
|
102033
|
+
}
|
|
102034
|
+
|
|
102035
|
+
/**
|
|
102036
|
+
* Removes the dialog UI elements from the DOM and clears the refs.
|
|
102037
|
+
*/
|
|
102038
|
+
destroyDialog() {
|
|
102039
|
+
var _classPrivateFieldGet3;
|
|
102040
|
+
(_classPrivateFieldGet3 = _classPrivateFieldGet(_refs, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.dialogElement.remove();
|
|
102041
|
+
_classPrivateFieldSet(_refs, this, null);
|
|
102042
|
+
}
|
|
102043
|
+
}
|
|
102044
|
+
exports.DialogUI = DialogUI;
|
|
102045
|
+
(0, _object.mixin)(DialogUI, _localHooks.default);
|
|
102046
|
+
|
|
102047
|
+
/***/ }),
|
|
102048
|
+
/* 789 */
|
|
100731
102049
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
100732
102050
|
|
|
100733
102051
|
"use strict";
|
|
@@ -100836,7 +102154,7 @@ exports.CellRange = _base.CellRange;
|
|
|
100836
102154
|
var _registry = __webpack_require__(443);
|
|
100837
102155
|
var _eventManager = _interopRequireWildcard(__webpack_require__(194));
|
|
100838
102156
|
var _translations = __webpack_require__(295);
|
|
100839
|
-
var _jquery = _interopRequireDefault(__webpack_require__(
|
|
102157
|
+
var _jquery = _interopRequireDefault(__webpack_require__(789));
|
|
100840
102158
|
var _ghostTable = _interopRequireDefault(__webpack_require__(522));
|
|
100841
102159
|
var parseTableHelpers = _interopRequireWildcard(__webpack_require__(196));
|
|
100842
102160
|
var arrayHelpers = _interopRequireWildcard(__webpack_require__(167));
|