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
|
@@ -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')
|
|
@@ -42683,7 +42683,7 @@ exports.CellRange = _base.CellRange;
|
|
|
42683
42683
|
var _registry = __webpack_require__(777);
|
|
42684
42684
|
var _eventManager = _interopRequireWildcard(__webpack_require__(528));
|
|
42685
42685
|
var _translations = __webpack_require__(629);
|
|
42686
|
-
var _jquery = _interopRequireDefault(__webpack_require__(
|
|
42686
|
+
var _jquery = _interopRequireDefault(__webpack_require__(1123));
|
|
42687
42687
|
var _ghostTable = _interopRequireDefault(__webpack_require__(856));
|
|
42688
42688
|
var parseTableHelpers = _interopRequireWildcard(__webpack_require__(530));
|
|
42689
42689
|
var arrayHelpers = _interopRequireWildcard(__webpack_require__(501));
|
|
@@ -42856,8 +42856,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
|
|
|
42856
42856
|
Handsontable.CellCoords = _src.CellCoords;
|
|
42857
42857
|
Handsontable.CellRange = _src.CellRange;
|
|
42858
42858
|
Handsontable.packageName = 'handsontable';
|
|
42859
|
-
Handsontable.buildDate = "
|
|
42860
|
-
Handsontable.version = "0.0.0-next-
|
|
42859
|
+
Handsontable.buildDate = "22/08/2025 10:30:06";
|
|
42860
|
+
Handsontable.version = "0.0.0-next-fce5825-20250822";
|
|
42861
42861
|
Handsontable.languages = {
|
|
42862
42862
|
dictionaryKeys: _registry.dictionaryKeys,
|
|
42863
42863
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
|
@@ -43081,6 +43081,14 @@ function Core(rootContainer, userSettings) {
|
|
|
43081
43081
|
*/
|
|
43082
43082
|
this.rootWrapperElement = undefined;
|
|
43083
43083
|
|
|
43084
|
+
/**
|
|
43085
|
+
* Reference to the grid element.
|
|
43086
|
+
*
|
|
43087
|
+
* @private
|
|
43088
|
+
* @type {HTMLElement}
|
|
43089
|
+
*/
|
|
43090
|
+
this.rootGridElement = undefined;
|
|
43091
|
+
|
|
43084
43092
|
/**
|
|
43085
43093
|
* Reference to the portal element.
|
|
43086
43094
|
*
|
|
@@ -43115,10 +43123,13 @@ function Core(rootContainer, userSettings) {
|
|
|
43115
43123
|
this.rootWindow = this.rootDocument.defaultView;
|
|
43116
43124
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
43117
43125
|
this.rootWrapperElement = this.rootDocument.createElement('div');
|
|
43126
|
+
this.rootGridElement = this.rootDocument.createElement('div');
|
|
43118
43127
|
this.rootPortalElement = this.rootDocument.createElement('div');
|
|
43119
43128
|
(0, _element.addClass)(this.rootElement, ['ht-wrapper', 'handsontable']);
|
|
43120
43129
|
(0, _element.addClass)(this.rootWrapperElement, 'ht-root-wrapper');
|
|
43121
|
-
|
|
43130
|
+
(0, _element.addClass)(this.rootGridElement, 'ht-grid');
|
|
43131
|
+
this.rootGridElement.appendChild(this.rootElement);
|
|
43132
|
+
this.rootWrapperElement.appendChild(this.rootGridElement);
|
|
43122
43133
|
this.rootContainer.appendChild(this.rootWrapperElement);
|
|
43123
43134
|
(0, _element.addClass)(this.rootPortalElement, 'ht-portal');
|
|
43124
43135
|
this.rootDocument.body.appendChild(this.rootPortalElement);
|
|
@@ -43231,9 +43242,6 @@ function Core(rootContainer, userSettings) {
|
|
|
43231
43242
|
const pluginsRegistry = (0, _uniqueMap.createUniqueMap)();
|
|
43232
43243
|
this.container = this.rootDocument.createElement('div');
|
|
43233
43244
|
this.rootElement.insertBefore(this.container, this.rootElement.firstChild);
|
|
43234
|
-
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
43235
|
-
(0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
43236
|
-
}
|
|
43237
43245
|
this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
|
|
43238
43246
|
|
|
43239
43247
|
foreignHotInstances.set(this.guid, this);
|
|
@@ -44070,6 +44078,7 @@ function Core(rootContainer, userSettings) {
|
|
|
44070
44078
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
44071
44079
|
(0, _index.installFocusCatcher)(instance);
|
|
44072
44080
|
(0, _a11yAnnouncer.install)(instance.rootPortalElement);
|
|
44081
|
+
(0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
44073
44082
|
}
|
|
44074
44083
|
instance.runHooks('init');
|
|
44075
44084
|
this.render();
|
|
@@ -54585,6 +54594,8 @@ window['DOMPurify'] = __webpack_require__(357);
|
|
|
54585
54594
|
var _interopRequireDefault = __webpack_require__(197);
|
|
54586
54595
|
exports.__esModule = true;
|
|
54587
54596
|
exports._injectProductInfo = _injectProductInfo;
|
|
54597
|
+
exports.getMostBottomEndPosition = getMostBottomEndPosition;
|
|
54598
|
+
exports.getMostTopStartPosition = getMostTopStartPosition;
|
|
54588
54599
|
exports.isDefined = isDefined;
|
|
54589
54600
|
exports.isEmpty = isEmpty;
|
|
54590
54601
|
exports.isRegExp = isRegExp;
|
|
@@ -54716,7 +54727,7 @@ const domMessages = {
|
|
|
54716
54727
|
function _injectProductInfo(key, element) {
|
|
54717
54728
|
const hasValidType = !isEmpty(key);
|
|
54718
54729
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
|
54719
|
-
const hotVersion = "0.0.0-next-
|
|
54730
|
+
const hotVersion = "0.0.0-next-fce5825-20250822";
|
|
54720
54731
|
let keyValidityDate;
|
|
54721
54732
|
let consoleMessageState = 'invalid';
|
|
54722
54733
|
let domMessageState = 'invalid';
|
|
@@ -54790,6 +54801,67 @@ function _checkKeySchema(v) {
|
|
|
54790
54801
|
}
|
|
54791
54802
|
return p === z;
|
|
54792
54803
|
}
|
|
54804
|
+
|
|
54805
|
+
/**
|
|
54806
|
+
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
54807
|
+
*
|
|
54808
|
+
* @param {Core} hot The Handsontable instance.
|
|
54809
|
+
* @returns {CellCoords|null}
|
|
54810
|
+
*/
|
|
54811
|
+
function getMostTopStartPosition(hot) {
|
|
54812
|
+
const {
|
|
54813
|
+
rowIndexMapper,
|
|
54814
|
+
columnIndexMapper
|
|
54815
|
+
} = hot;
|
|
54816
|
+
const {
|
|
54817
|
+
navigableHeaders
|
|
54818
|
+
} = hot.getSettings();
|
|
54819
|
+
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
54820
|
+
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
54821
|
+
if (topRow === 0) {
|
|
54822
|
+
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
54823
|
+
}
|
|
54824
|
+
if (startColumn === 0) {
|
|
54825
|
+
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
54826
|
+
}
|
|
54827
|
+
if (topRow === null || startColumn === null) {
|
|
54828
|
+
return null;
|
|
54829
|
+
}
|
|
54830
|
+
return hot._createCellCoords(topRow, startColumn);
|
|
54831
|
+
}
|
|
54832
|
+
|
|
54833
|
+
/**
|
|
54834
|
+
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
54835
|
+
*
|
|
54836
|
+
* @param {Core} hot The Handsontable instance.
|
|
54837
|
+
* @returns {CellCoords|null}
|
|
54838
|
+
*/
|
|
54839
|
+
function getMostBottomEndPosition(hot) {
|
|
54840
|
+
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
54841
|
+
const {
|
|
54842
|
+
rowIndexMapper,
|
|
54843
|
+
columnIndexMapper
|
|
54844
|
+
} = hot;
|
|
54845
|
+
const {
|
|
54846
|
+
navigableHeaders
|
|
54847
|
+
} = hot.getSettings();
|
|
54848
|
+
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
54849
|
+
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
54850
|
+
if (bottomRow < 0) {
|
|
54851
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
54852
|
+
return null;
|
|
54853
|
+
}
|
|
54854
|
+
bottomRow = -1;
|
|
54855
|
+
}
|
|
54856
|
+
if (endColumn < 0) {
|
|
54857
|
+
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
54858
|
+
return null;
|
|
54859
|
+
}
|
|
54860
|
+
endColumn = -1;
|
|
54861
|
+
}
|
|
54862
|
+
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);
|
|
54863
|
+
}
|
|
54864
|
+
|
|
54793
54865
|
/* eslint-enable */
|
|
54794
54866
|
|
|
54795
54867
|
/***/ }),
|
|
@@ -62143,6 +62215,8 @@ const A11Y_OPTION = () => ['role', 'option'];
|
|
|
62143
62215
|
exports.A11Y_OPTION = A11Y_OPTION;
|
|
62144
62216
|
const A11Y_CHECKBOX = () => ['role', 'checkbox'];
|
|
62145
62217
|
exports.A11Y_CHECKBOX = A11Y_CHECKBOX;
|
|
62218
|
+
const A11Y_DIALOG = () => ['role', 'dialog'];
|
|
62219
|
+
exports.A11Y_DIALOG = A11Y_DIALOG;
|
|
62146
62220
|
const A11Y_SCOPE_COL = () => ['scope', 'col'];
|
|
62147
62221
|
exports.A11Y_SCOPE_COL = A11Y_SCOPE_COL;
|
|
62148
62222
|
const A11Y_SCOPE_ROW = () => ['scope', 'row'];
|
|
@@ -62196,6 +62270,8 @@ const A11Y_SETSIZE = val => ['aria-setsize', val];
|
|
|
62196
62270
|
exports.A11Y_SETSIZE = A11Y_SETSIZE;
|
|
62197
62271
|
const A11Y_POSINSET = val => ['aria-posinset', val];
|
|
62198
62272
|
exports.A11Y_POSINSET = A11Y_POSINSET;
|
|
62273
|
+
const A11Y_MODAL = () => ['aria-modal', 'true'];
|
|
62274
|
+
exports.A11Y_MODAL = A11Y_MODAL;
|
|
62199
62275
|
|
|
62200
62276
|
/***/ }),
|
|
62201
62277
|
/* 503 */
|
|
@@ -66268,6 +66344,7 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
|
|
|
66268
66344
|
* @param {'from_above' | 'from_below'} tabActivationDir The browsers Tab navigation direction. Depending on
|
|
66269
66345
|
* whether the user activated the table from the element above or below, another cell can be selected.
|
|
66270
66346
|
* @param {CellCoords} visualCoords The coords that will be used to select a cell.
|
|
66347
|
+
* @returns {undefined|boolean} If `false` is returned, the table will not be focused.
|
|
66271
66348
|
*/
|
|
66272
66349
|
'modifyFocusOnTabNavigation',
|
|
66273
66350
|
/**
|
|
@@ -67438,6 +67515,63 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
|
|
|
67438
67515
|
* Returning `true` removes those restrictions.
|
|
67439
67516
|
*/
|
|
67440
67517
|
'beforeBeginEditing',
|
|
67518
|
+
/**
|
|
67519
|
+
* Fired by {@link Dialog} plugin after hiding the dialog. This hook is fired when {@link Options#dialog}
|
|
67520
|
+
* option is enabled.
|
|
67521
|
+
*
|
|
67522
|
+
* @since 16.1.0
|
|
67523
|
+
* @event Hooks#afterDialogHide
|
|
67524
|
+
*/
|
|
67525
|
+
'afterDialogHide',
|
|
67526
|
+
/**
|
|
67527
|
+
* Fired by {@link Dialog} plugin after showing the dialog. This hook is fired when {@link Options#dialog}
|
|
67528
|
+
* option is enabled.
|
|
67529
|
+
*
|
|
67530
|
+
* @since 16.1.0
|
|
67531
|
+
* @event Hooks#afterDialogShow
|
|
67532
|
+
*/
|
|
67533
|
+
'afterDialogShow',
|
|
67534
|
+
/**
|
|
67535
|
+
* Fired by {@link Dialog} plugin before hiding the dialog. This hook is fired when {@link Options#dialog}
|
|
67536
|
+
* option is enabled.
|
|
67537
|
+
*
|
|
67538
|
+
* @since 16.1.0
|
|
67539
|
+
* @event Hooks#beforeDialogHide
|
|
67540
|
+
*/
|
|
67541
|
+
'beforeDialogHide',
|
|
67542
|
+
/**
|
|
67543
|
+
* Fired by {@link Dialog} plugin before showing the dialog. This hook is fired when {@link Options#dialog}
|
|
67544
|
+
* option is enabled.
|
|
67545
|
+
*
|
|
67546
|
+
* @since 16.1.0
|
|
67547
|
+
* @event Hooks#beforeDialogShow
|
|
67548
|
+
*/
|
|
67549
|
+
'beforeDialogShow',
|
|
67550
|
+
/**
|
|
67551
|
+
* Fired by {@link Dialog} plugin before focusing the previous element. This hook is fired when {@link Options#dialog}
|
|
67552
|
+
* option is enabled.
|
|
67553
|
+
*
|
|
67554
|
+
* @since 16.1.0
|
|
67555
|
+
* @event Hooks#dialogFocusPreviousElement
|
|
67556
|
+
*/
|
|
67557
|
+
'dialogFocusPreviousElement',
|
|
67558
|
+
/**
|
|
67559
|
+
* Fired by {@link Dialog} plugin before focusing the next element. This hook is fired when {@link Options#dialog}
|
|
67560
|
+
* option is enabled.
|
|
67561
|
+
*
|
|
67562
|
+
* @since 16.1.0
|
|
67563
|
+
* @event Hooks#dialogFocusNextElement
|
|
67564
|
+
*/
|
|
67565
|
+
'dialogFocusNextElement',
|
|
67566
|
+
/**
|
|
67567
|
+
* Fired by {@link Dialog} plugin when the focus is set. This hook is fired when {@link Options#dialog}
|
|
67568
|
+
* option is enabled.
|
|
67569
|
+
*
|
|
67570
|
+
* @since 16.1.0
|
|
67571
|
+
* @event Hooks#afterDialogFocus
|
|
67572
|
+
* @param {'tab_from_above' | 'tab_from_below' | 'click' | 'show'} focusSource The source of the focus.
|
|
67573
|
+
*/
|
|
67574
|
+
'afterDialogFocus',
|
|
67441
67575
|
/**
|
|
67442
67576
|
* Fired after the editor is opened and rendered.
|
|
67443
67577
|
*
|
|
@@ -70042,6 +70176,7 @@ class TableView {
|
|
|
70042
70176
|
*/
|
|
70043
70177
|
registerEvents() {
|
|
70044
70178
|
const {
|
|
70179
|
+
rootWrapperElement,
|
|
70045
70180
|
rootElement,
|
|
70046
70181
|
rootDocument,
|
|
70047
70182
|
selection,
|
|
@@ -70075,15 +70210,19 @@ class TableView {
|
|
|
70075
70210
|
}
|
|
70076
70211
|
});
|
|
70077
70212
|
this.eventManager.addEventListener(documentElement, 'mouseup', event => {
|
|
70213
|
+
var _rootDocument$querySe;
|
|
70078
70214
|
if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
|
|
70079
70215
|
selection.finish();
|
|
70080
70216
|
}
|
|
70081
70217
|
_classPrivateFieldSet(_mouseDown, this, false);
|
|
70082
70218
|
const isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
|
|
70083
|
-
|
|
70219
|
+
// TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
|
|
70220
|
+
// Should be removed when the focus manager is implemented.
|
|
70221
|
+
const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
|
|
70222
|
+
if ((0, _element.isInput)(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
|
|
70084
70223
|
return;
|
|
70085
70224
|
}
|
|
70086
|
-
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
|
|
70225
|
+
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !(0, _event.isRightClick)(event)) {
|
|
70087
70226
|
this.hot.unlisten();
|
|
70088
70227
|
}
|
|
70089
70228
|
});
|
|
@@ -87779,6 +87918,7 @@ Object.keys(_highlight).forEach(function (key) {
|
|
|
87779
87918
|
var _interopRequireDefault = __webpack_require__(197);
|
|
87780
87919
|
exports.__esModule = true;
|
|
87781
87920
|
__webpack_require__(201);
|
|
87921
|
+
__webpack_require__(283);
|
|
87782
87922
|
__webpack_require__(297);
|
|
87783
87923
|
__webpack_require__(308);
|
|
87784
87924
|
__webpack_require__(310);
|
|
@@ -87808,6 +87948,15 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("C
|
|
|
87808
87948
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
87809
87949
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
87810
87950
|
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"); }
|
|
87951
|
+
/**
|
|
87952
|
+
* @typedef {object} SelectionState
|
|
87953
|
+
* @property {CellRange[]} ranges The array of all ranges.
|
|
87954
|
+
* @property {CellRange} activeRange The active range.
|
|
87955
|
+
* @property {number} activeSelectionLayer The active selection layer.
|
|
87956
|
+
* @property {number[]} selectedByRowHeader The state of the selected row headers.
|
|
87957
|
+
* @property {number[]} selectedByColumnHeader The state of the selected column headers.
|
|
87958
|
+
* @property {boolean} disableHeadersHighlight The state of the disable headers highlight.
|
|
87959
|
+
*/
|
|
87811
87960
|
/**
|
|
87812
87961
|
* @class Selection
|
|
87813
87962
|
* @util
|
|
@@ -88129,6 +88278,7 @@ class Selection {
|
|
|
88129
88278
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
|
88130
88279
|
// should be handled by next methods.
|
|
88131
88280
|
const coordsClone = coords.clone();
|
|
88281
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
88132
88282
|
_classPrivateFieldSet(_isFocusSelectionChanged, this, false);
|
|
88133
88283
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
|
88134
88284
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
|
@@ -88726,7 +88876,6 @@ class Selection {
|
|
|
88726
88876
|
focusPosition,
|
|
88727
88877
|
disableHeadersHighlight
|
|
88728
88878
|
} = options;
|
|
88729
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
88730
88879
|
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
|
88731
88880
|
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
|
88732
88881
|
}
|
|
@@ -88735,6 +88884,7 @@ class Selection {
|
|
|
88735
88884
|
this.clear();
|
|
88736
88885
|
this.runLocalHooks('beforeSelectAll', startCoords, endCoords, highlight);
|
|
88737
88886
|
this.setRangeStartOnly(startCoords, undefined, highlight);
|
|
88887
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
88738
88888
|
if (columnFrom < 0) {
|
|
88739
88889
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
|
88740
88890
|
}
|
|
@@ -88744,7 +88894,6 @@ class Selection {
|
|
|
88744
88894
|
this.setRangeEnd(endCoords);
|
|
88745
88895
|
this.runLocalHooks('afterSelectAll', startCoords, endCoords, highlight);
|
|
88746
88896
|
this.finish();
|
|
88747
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
88748
88897
|
}
|
|
88749
88898
|
|
|
88750
88899
|
/**
|
|
@@ -88911,6 +89060,57 @@ class Selection {
|
|
|
88911
89060
|
return isValid;
|
|
88912
89061
|
}
|
|
88913
89062
|
|
|
89063
|
+
/**
|
|
89064
|
+
* Allows importing the selection for all layers from the provided array of CellRange objects.
|
|
89065
|
+
* The method clears the current selection and sets the new one without triggering any
|
|
89066
|
+
* selection related hooks.
|
|
89067
|
+
*
|
|
89068
|
+
* @param {SelectionState} selectionState The selection state to import.
|
|
89069
|
+
*/
|
|
89070
|
+
importSelection(_ref) {
|
|
89071
|
+
let {
|
|
89072
|
+
ranges,
|
|
89073
|
+
activeRange,
|
|
89074
|
+
activeSelectionLayer,
|
|
89075
|
+
selectedByRowHeader,
|
|
89076
|
+
selectedByColumnHeader,
|
|
89077
|
+
disableHeadersHighlight
|
|
89078
|
+
} = _ref;
|
|
89079
|
+
if (ranges.length === 0) {
|
|
89080
|
+
return;
|
|
89081
|
+
}
|
|
89082
|
+
this.selectedRange.clear();
|
|
89083
|
+
this.highlight.clear();
|
|
89084
|
+
this.inProgress = true;
|
|
89085
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
|
89086
|
+
this.selectedByRowHeader = new Set(selectedByRowHeader);
|
|
89087
|
+
this.selectedByColumnHeader = new Set(selectedByColumnHeader);
|
|
89088
|
+
this.setActiveSelectionLayerIndex(0);
|
|
89089
|
+
ranges.forEach((cellRange, selectionLayerIndex) => {
|
|
89090
|
+
this.selectedRange.push(cellRange);
|
|
89091
|
+
this.applyAndCommit(cellRange, selectionLayerIndex);
|
|
89092
|
+
});
|
|
89093
|
+
this.setRangeFocus(activeRange.highlight, activeSelectionLayer);
|
|
89094
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
|
89095
|
+
this.inProgress = false;
|
|
89096
|
+
}
|
|
89097
|
+
|
|
89098
|
+
/**
|
|
89099
|
+
* Exports all selection layers with other properties related to the selection state.
|
|
89100
|
+
*
|
|
89101
|
+
* @returns {SelectionState}
|
|
89102
|
+
*/
|
|
89103
|
+
exportSelection() {
|
|
89104
|
+
return {
|
|
89105
|
+
ranges: Array.from(this.selectedRange).map(range => range.clone()),
|
|
89106
|
+
activeRange: this.getActiveSelectedRange(),
|
|
89107
|
+
activeSelectionLayer: this.getActiveSelectionLayerIndex(),
|
|
89108
|
+
selectedByRowHeader: Array.from(this.selectedByRowHeader),
|
|
89109
|
+
selectedByColumnHeader: Array.from(this.selectedByColumnHeader),
|
|
89110
|
+
disableHeadersHighlight: _classPrivateFieldGet(_disableHeadersHighlight, this)
|
|
89111
|
+
};
|
|
89112
|
+
}
|
|
89113
|
+
|
|
88914
89114
|
/**
|
|
88915
89115
|
* Refreshes the whole selection by clearing, reapplying and committing (calculating visual to renderable indexes)
|
|
88916
89116
|
* the selection by using already added visual ranges. The method can be useful when underneath some indexes
|
|
@@ -90078,6 +90278,17 @@ class SelectionRange {
|
|
|
90078
90278
|
return this;
|
|
90079
90279
|
}
|
|
90080
90280
|
|
|
90281
|
+
/**
|
|
90282
|
+
* Pushes a new CellRange instance to the collection.
|
|
90283
|
+
*
|
|
90284
|
+
* @param {CellRange} cellRange The CellRange instance with defined visual coordinates.
|
|
90285
|
+
* @returns {SelectionRange}
|
|
90286
|
+
*/
|
|
90287
|
+
push(cellRange) {
|
|
90288
|
+
this.ranges.push(cellRange);
|
|
90289
|
+
return this;
|
|
90290
|
+
}
|
|
90291
|
+
|
|
90081
90292
|
/**
|
|
90082
90293
|
* Removes from the stack the last added coordinates.
|
|
90083
90294
|
*
|
|
@@ -90955,9 +91166,10 @@ function normalizeSelectionFactory(type) {
|
|
|
90955
91166
|
rowEnd = Math.max(origRowStart, origRowEnd);
|
|
90956
91167
|
columnEnd = Math.max(origColumnStart, origColumnEnd);
|
|
90957
91168
|
}
|
|
91169
|
+
const highlight = isObjectType ? selection.highlight.clone() : createCellCoords(rowStart, columnStart);
|
|
90958
91170
|
const from = createCellCoords(rowStart, columnStart);
|
|
90959
91171
|
const to = createCellCoords(rowEnd, columnEnd);
|
|
90960
|
-
return createCellRange(
|
|
91172
|
+
return createCellRange(highlight, from, to);
|
|
90961
91173
|
};
|
|
90962
91174
|
}
|
|
90963
91175
|
|
|
@@ -94559,6 +94771,101 @@ var _default = () => {
|
|
|
94559
94771
|
* ```
|
|
94560
94772
|
*/
|
|
94561
94773
|
disableVisualSelection: false,
|
|
94774
|
+
/**
|
|
94775
|
+
* @description
|
|
94776
|
+
* The `dialog` option configures the [`Dialog`](@/api/dialog.md) plugin.
|
|
94777
|
+
*
|
|
94778
|
+
* You can set the `dialog` option to one of the following:
|
|
94779
|
+
*
|
|
94780
|
+
* | Setting | Description |
|
|
94781
|
+
* | --------- | --------------------------------------------------------------------------- |
|
|
94782
|
+
* | `false` | Disable the [`Dialog`](@/api/dialog.md) plugin |
|
|
94783
|
+
* | `true` | Enable the [`Dialog`](@/api/dialog.md) plugin with default options |
|
|
94784
|
+
*
|
|
94785
|
+
* ##### dialog: Additional options
|
|
94786
|
+
*
|
|
94787
|
+
* | Option | Possible settings | Description |
|
|
94788
|
+
* | ------------------------ | ------------------------------------------------------------------------------------------------------ | ----------------------------------------|
|
|
94789
|
+
* | `content` | A string, HTMLElement or DocumentFragment (default: `''`) | The content of the dialog |
|
|
94790
|
+
* | `customClassName` | A string (default: `''`) | The custom class name of the dialog |
|
|
94791
|
+
* | `background` | One of the options: `'solid'` or `'semi-transparent'` (default: `'solid'`) | The background of the dialog |
|
|
94792
|
+
* | `contentBackground` | Boolean (default: `false`) | Whether to show the content background |
|
|
94793
|
+
* | `contentDirections` | One of the options: `'row'` or `'row-reverse'` or `'column'` or `'column-reverse'` (default: `'row'`) | The direction of the content |
|
|
94794
|
+
* | `animation` | Boolean (default: `true`) | Whether to show the animation |
|
|
94795
|
+
* | `closable` | Boolean (default: `false`) | Whether to show the close button |
|
|
94796
|
+
*
|
|
94797
|
+
* Read more:
|
|
94798
|
+
* - [Plugins: `Dialog`](@/api/dialog.md)
|
|
94799
|
+
*
|
|
94800
|
+
* @since 16.1.0
|
|
94801
|
+
* @memberof Options#
|
|
94802
|
+
* @type {boolean|object}
|
|
94803
|
+
* @default false
|
|
94804
|
+
* @category Dialog
|
|
94805
|
+
*
|
|
94806
|
+
* @example
|
|
94807
|
+
* ::: only-for javascript
|
|
94808
|
+
* ```js
|
|
94809
|
+
* // enable the Dialog plugin with default option
|
|
94810
|
+
* dialog: true,
|
|
94811
|
+
*
|
|
94812
|
+
* // enable the Dialog plugin with custom configuration
|
|
94813
|
+
* dialog: {
|
|
94814
|
+
* content: 'Dialog content',
|
|
94815
|
+
* customClassName: 'custom-dialog',
|
|
94816
|
+
* background: 'semi-transparent',
|
|
94817
|
+
* contentBackground: false,
|
|
94818
|
+
* contentDirections: 'column',
|
|
94819
|
+
* animation: false,
|
|
94820
|
+
* closable: true,
|
|
94821
|
+
* }
|
|
94822
|
+
* ```
|
|
94823
|
+
* :::
|
|
94824
|
+
*
|
|
94825
|
+
* ::: only-for react
|
|
94826
|
+
* ```jsx
|
|
94827
|
+
* // enable the Dialog plugin with default option
|
|
94828
|
+
* <HotTable
|
|
94829
|
+
* dialog={true}
|
|
94830
|
+
* />
|
|
94831
|
+
*
|
|
94832
|
+
* // enable the Dialog plugin with custom configuration
|
|
94833
|
+
* <HotTable
|
|
94834
|
+
* dialog={{
|
|
94835
|
+
* content: 'Dialog content',
|
|
94836
|
+
* customClassName: 'custom-dialog',
|
|
94837
|
+
* background: 'semi-transparent',
|
|
94838
|
+
* contentBackground: false,
|
|
94839
|
+
* contentDirections: 'column',
|
|
94840
|
+
* animation: false,
|
|
94841
|
+
* closable: true,
|
|
94842
|
+
* }}
|
|
94843
|
+
* />
|
|
94844
|
+
* ```
|
|
94845
|
+
* :::
|
|
94846
|
+
*
|
|
94847
|
+
* ::: only-for angular
|
|
94848
|
+
* ```ts
|
|
94849
|
+
* settings = {
|
|
94850
|
+
* dialog: {
|
|
94851
|
+
* content: 'Dialog content',
|
|
94852
|
+
* customClassName: 'custom-dialog',
|
|
94853
|
+
* background: 'semi-transparent',
|
|
94854
|
+
* contentBackground: false,
|
|
94855
|
+
* contentDirections: 'column',
|
|
94856
|
+
* animation: false,
|
|
94857
|
+
* closable: true,
|
|
94858
|
+
* }
|
|
94859
|
+
* };
|
|
94860
|
+
* ```
|
|
94861
|
+
*
|
|
94862
|
+
* ```html
|
|
94863
|
+
* <hot-table [settings]="settings" />
|
|
94864
|
+
* ```
|
|
94865
|
+
* :::
|
|
94866
|
+
*
|
|
94867
|
+
*/
|
|
94868
|
+
dialog: false,
|
|
94562
94869
|
/**
|
|
94563
94870
|
* @description
|
|
94564
94871
|
* The `dragToScroll` option configures the [`DragToScroll`](@/api/dragToScroll.md) plugin.
|
|
@@ -99001,6 +99308,7 @@ exports.installFocusCatcher = installFocusCatcher;
|
|
|
99001
99308
|
var _shortcutContexts = __webpack_require__(694);
|
|
99002
99309
|
var _focusDetector = __webpack_require__(746);
|
|
99003
99310
|
var _utils = __webpack_require__(747);
|
|
99311
|
+
var _mixed = __webpack_require__(358);
|
|
99004
99312
|
/**
|
|
99005
99313
|
* Installs a focus catcher module. The module observes when the table is focused and depending on
|
|
99006
99314
|
* from the which side it was focused on it selects a specified cell or releases the TAB navigation
|
|
@@ -99014,22 +99322,26 @@ function installFocusCatcher(hot) {
|
|
|
99014
99322
|
const {
|
|
99015
99323
|
activate,
|
|
99016
99324
|
deactivate
|
|
99017
|
-
} = (0, _focusDetector.installFocusDetector)(hot, {
|
|
99018
|
-
|
|
99019
|
-
|
|
99020
|
-
|
|
99021
|
-
|
|
99022
|
-
|
|
99023
|
-
|
|
99024
|
-
|
|
99025
|
-
|
|
99026
|
-
|
|
99027
|
-
|
|
99028
|
-
|
|
99029
|
-
|
|
99030
|
-
|
|
99031
|
-
|
|
99032
|
-
|
|
99325
|
+
} = (0, _focusDetector.installFocusDetector)(hot, hot.rootGridElement, {
|
|
99326
|
+
onFocus(from) {
|
|
99327
|
+
if (from === 'from_above') {
|
|
99328
|
+
var _clampCoordsIfNeeded;
|
|
99329
|
+
const mostTopStartCoords = (_clampCoordsIfNeeded = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded !== void 0 ? _clampCoordsIfNeeded : (0, _mixed.getMostTopStartPosition)(hot);
|
|
99330
|
+
if (mostTopStartCoords) {
|
|
99331
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
|
99332
|
+
if (result !== false) {
|
|
99333
|
+
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
|
99334
|
+
}
|
|
99335
|
+
}
|
|
99336
|
+
} else {
|
|
99337
|
+
var _clampCoordsIfNeeded2;
|
|
99338
|
+
const mostBottomEndCoords = (_clampCoordsIfNeeded2 = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded2 !== void 0 ? _clampCoordsIfNeeded2 : (0, _mixed.getMostBottomEndPosition)(hot);
|
|
99339
|
+
if (mostBottomEndCoords) {
|
|
99340
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
|
99341
|
+
if (result !== false) {
|
|
99342
|
+
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
|
99343
|
+
}
|
|
99344
|
+
}
|
|
99033
99345
|
}
|
|
99034
99346
|
hot.listen();
|
|
99035
99347
|
}
|
|
@@ -99041,8 +99353,20 @@ function installFocusCatcher(hot) {
|
|
|
99041
99353
|
let isSavingCoordsEnabled = true;
|
|
99042
99354
|
let isTabOrShiftTabPressed = false;
|
|
99043
99355
|
let preventViewportScroll = false;
|
|
99044
|
-
hot.addHook('afterListen', () =>
|
|
99045
|
-
|
|
99356
|
+
hot.addHook('afterListen', () => {
|
|
99357
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
99358
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
99359
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
99360
|
+
deactivate();
|
|
99361
|
+
}
|
|
99362
|
+
});
|
|
99363
|
+
hot.addHook('afterUnlisten', () => {
|
|
99364
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
99365
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
99366
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
99367
|
+
activate();
|
|
99368
|
+
}
|
|
99369
|
+
});
|
|
99046
99370
|
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
|
99047
99371
|
if (isTabOrShiftTabPressed && (rowWrapState.wrapped && rowWrapState.flipped || preventViewportScroll)) {
|
|
99048
99372
|
preventViewportScroll = false;
|
|
@@ -99100,7 +99424,7 @@ function installFocusCatcher(hot) {
|
|
|
99100
99424
|
isSavingCoordsEnabled = true;
|
|
99101
99425
|
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
|
99102
99426
|
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
|
99103
|
-
recentlyAddedFocusCoords = event.shiftKey ? (0,
|
|
99427
|
+
recentlyAddedFocusCoords = event.shiftKey ? (0, _mixed.getMostTopStartPosition)(hot) : (0, _mixed.getMostBottomEndPosition)(hot);
|
|
99104
99428
|
}
|
|
99105
99429
|
deactivateTable();
|
|
99106
99430
|
return false;
|
|
@@ -99591,6 +99915,7 @@ class BaseEditor {
|
|
|
99591
99915
|
this.hot.removeHook('afterScroll', openEditor);
|
|
99592
99916
|
openEditor();
|
|
99593
99917
|
}
|
|
99918
|
+
this.addHook('beforeDialogShow', () => this.cancelChanges());
|
|
99594
99919
|
}
|
|
99595
99920
|
|
|
99596
99921
|
/**
|
|
@@ -101353,6 +101678,12 @@ exports.__esModule = true;
|
|
|
101353
101678
|
exports.installFocusDetector = installFocusDetector;
|
|
101354
101679
|
var _element = __webpack_require__(355);
|
|
101355
101680
|
var _a11y = __webpack_require__(502);
|
|
101681
|
+
/**
|
|
101682
|
+
* @typedef {object} FocusDetector
|
|
101683
|
+
* @property {function(): void} activate Activates the focus detector.
|
|
101684
|
+
* @property {function(): void} deactivate Deactivates the focus detector.
|
|
101685
|
+
* @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
|
|
101686
|
+
*/
|
|
101356
101687
|
/**
|
|
101357
101688
|
* Installs a focus detector module. The module appends two input elements into the DOM side by side.
|
|
101358
101689
|
* When the first input is focused, then it means that a user entered to the component using the TAB key
|
|
@@ -101360,19 +101691,31 @@ var _a11y = __webpack_require__(502);
|
|
|
101360
101691
|
* the element below the table. Each action, once detected, triggers the specific hook.
|
|
101361
101692
|
*
|
|
101362
101693
|
* @param {Handsontable} hot The Handsontable instance.
|
|
101363
|
-
* @param {
|
|
101364
|
-
* @
|
|
101694
|
+
* @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
|
|
101695
|
+
* @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
|
|
101696
|
+
* @returns {FocusDetector}
|
|
101365
101697
|
*/
|
|
101366
|
-
function installFocusDetector(hot) {
|
|
101367
|
-
let hooks = arguments.length >
|
|
101368
|
-
const rootElement = hot.rootElement;
|
|
101698
|
+
function installFocusDetector(hot, wrapperElement) {
|
|
101699
|
+
let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
101369
101700
|
const inputTrapTop = createInputElement(hot);
|
|
101370
101701
|
const inputTrapBottom = createInputElement(hot);
|
|
101371
|
-
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
|
101372
|
-
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
|
101373
|
-
|
|
101374
|
-
|
|
101702
|
+
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
|
|
101703
|
+
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
|
|
101704
|
+
wrapperElement.prepend(inputTrapTop);
|
|
101705
|
+
wrapperElement.append(inputTrapBottom);
|
|
101375
101706
|
return {
|
|
101707
|
+
/**
|
|
101708
|
+
* Focuses the input element in the given direction.
|
|
101709
|
+
*
|
|
101710
|
+
* @param {string} direction The direction to focus the input element in.
|
|
101711
|
+
*/
|
|
101712
|
+
focus(direction) {
|
|
101713
|
+
if (direction === 'from_above') {
|
|
101714
|
+
inputTrapTop.focus();
|
|
101715
|
+
} else {
|
|
101716
|
+
inputTrapBottom.focus();
|
|
101717
|
+
}
|
|
101718
|
+
},
|
|
101376
101719
|
/**
|
|
101377
101720
|
* Activates the detector by resetting the tabIndex of the input elements.
|
|
101378
101721
|
*/
|
|
@@ -101420,10 +101763,9 @@ function createInputElement(hot) {
|
|
|
101420
101763
|
|
|
101421
101764
|
|
|
101422
101765
|
exports.__esModule = true;
|
|
101423
|
-
exports.getMostBottomEndPosition = getMostBottomEndPosition;
|
|
101424
|
-
exports.getMostTopStartPosition = getMostTopStartPosition;
|
|
101425
101766
|
exports.normalizeCoordsIfNeeded = normalizeCoordsIfNeeded;
|
|
101426
101767
|
var _number = __webpack_require__(539);
|
|
101768
|
+
var _mixed = __webpack_require__(358);
|
|
101427
101769
|
/**
|
|
101428
101770
|
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
|
101429
101771
|
*
|
|
@@ -101442,74 +101784,14 @@ function normalizeCoordsIfNeeded(hot) {
|
|
|
101442
101784
|
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
|
101443
101785
|
return null;
|
|
101444
101786
|
}
|
|
101445
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
|
101446
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
|
101787
|
+
const mostTopStartCoords = (0, _mixed.getMostTopStartPosition)(hot);
|
|
101788
|
+
const mostBottomEndCoords = (0, _mixed.getMostBottomEndPosition)(hot);
|
|
101447
101789
|
coords.row = (0, _number.clamp)(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
|
101448
101790
|
coords.col = (0, _number.clamp)(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
|
101449
101791
|
return coords;
|
|
101450
101792
|
};
|
|
101451
101793
|
}
|
|
101452
101794
|
|
|
101453
|
-
/**
|
|
101454
|
-
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
|
101455
|
-
*
|
|
101456
|
-
* @param {Core} hot The Handsontable instance.
|
|
101457
|
-
* @returns {CellCoords|null}
|
|
101458
|
-
*/
|
|
101459
|
-
function getMostTopStartPosition(hot) {
|
|
101460
|
-
const {
|
|
101461
|
-
rowIndexMapper,
|
|
101462
|
-
columnIndexMapper
|
|
101463
|
-
} = hot;
|
|
101464
|
-
const {
|
|
101465
|
-
navigableHeaders
|
|
101466
|
-
} = hot.getSettings();
|
|
101467
|
-
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
|
101468
|
-
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
|
101469
|
-
if (topRow === 0) {
|
|
101470
|
-
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
|
101471
|
-
}
|
|
101472
|
-
if (startColumn === 0) {
|
|
101473
|
-
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
|
101474
|
-
}
|
|
101475
|
-
if (topRow === null || startColumn === null) {
|
|
101476
|
-
return null;
|
|
101477
|
-
}
|
|
101478
|
-
return hot._createCellCoords(topRow, startColumn);
|
|
101479
|
-
}
|
|
101480
|
-
|
|
101481
|
-
/**
|
|
101482
|
-
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
|
101483
|
-
*
|
|
101484
|
-
* @param {Core} hot The Handsontable instance.
|
|
101485
|
-
* @returns {CellCoords|null}
|
|
101486
|
-
*/
|
|
101487
|
-
function getMostBottomEndPosition(hot) {
|
|
101488
|
-
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
|
101489
|
-
const {
|
|
101490
|
-
rowIndexMapper,
|
|
101491
|
-
columnIndexMapper
|
|
101492
|
-
} = hot;
|
|
101493
|
-
const {
|
|
101494
|
-
navigableHeaders
|
|
101495
|
-
} = hot.getSettings();
|
|
101496
|
-
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
|
101497
|
-
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
|
101498
|
-
if (bottomRow < 0) {
|
|
101499
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
101500
|
-
return null;
|
|
101501
|
-
}
|
|
101502
|
-
bottomRow = -1;
|
|
101503
|
-
}
|
|
101504
|
-
if (endColumn < 0) {
|
|
101505
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
|
101506
|
-
return null;
|
|
101507
|
-
}
|
|
101508
|
-
endColumn = -1;
|
|
101509
|
-
}
|
|
101510
|
-
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);
|
|
101511
|
-
}
|
|
101512
|
-
|
|
101513
101795
|
/***/ }),
|
|
101514
101796
|
/* 748 */
|
|
101515
101797
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
@@ -101999,10 +102281,12 @@ const createShortcutManager = _ref => {
|
|
|
101999
102281
|
*
|
|
102000
102282
|
* @memberof ShortcutManager#
|
|
102001
102283
|
* @param {string} contextName The name of the new shortcut context
|
|
102284
|
+
* @param {string} [scope='table'] The scope of the shortcut: `'table'` or `'global'`
|
|
102002
102285
|
* @returns {object}
|
|
102003
102286
|
*/
|
|
102004
|
-
const addContext = contextName
|
|
102005
|
-
|
|
102287
|
+
const addContext = function (contextName) {
|
|
102288
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'table';
|
|
102289
|
+
const context = (0, _context.createContext)(contextName, scope);
|
|
102006
102290
|
CONTEXTS.addItem(contextName, context);
|
|
102007
102291
|
return context;
|
|
102008
102292
|
};
|
|
@@ -102102,12 +102386,24 @@ const createShortcutManager = _ref => {
|
|
|
102102
102386
|
return isExecutionCancelled;
|
|
102103
102387
|
};
|
|
102104
102388
|
|
|
102389
|
+
/**
|
|
102390
|
+
* Handle the event with the scope of the active context.
|
|
102391
|
+
*
|
|
102392
|
+
* @param {KeyboardEvent} event The keyboard event.
|
|
102393
|
+
* @returns {boolean}
|
|
102394
|
+
*/
|
|
102395
|
+
const handleEventWithScope = event => {
|
|
102396
|
+
const context = getActiveContextName();
|
|
102397
|
+
const activeContext = (0, _context.isContextObject)(context) ? context : getContext(context);
|
|
102398
|
+
return handleEvent(event, activeContext.scope);
|
|
102399
|
+
};
|
|
102400
|
+
|
|
102105
102401
|
/**
|
|
102106
102402
|
* Internal key recorder.
|
|
102107
102403
|
*
|
|
102108
102404
|
* @private
|
|
102109
102405
|
*/
|
|
102110
|
-
const keyRecorder = (0, _recorder.useRecorder)(ownerWindow,
|
|
102406
|
+
const keyRecorder = (0, _recorder.useRecorder)(ownerWindow, handleEventWithScope, beforeKeyDown, afterKeyDown, recorderCallback);
|
|
102111
102407
|
keyRecorder.mount();
|
|
102112
102408
|
return {
|
|
102113
102409
|
addContext,
|
|
@@ -102181,9 +102477,11 @@ function isContextObject(objectToCheck) {
|
|
|
102181
102477
|
* @alias ShortcutContext
|
|
102182
102478
|
* @class ShortcutContext
|
|
102183
102479
|
* @param {string} name The name of the keyboard shortcut context
|
|
102480
|
+
* @param {string} [scope='table'] The scope of the shortcut: `'table'` or `'global'`
|
|
102184
102481
|
* @returns {object}
|
|
102185
102482
|
*/
|
|
102186
|
-
const createContext = name
|
|
102483
|
+
const createContext = function (name) {
|
|
102484
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'table';
|
|
102187
102485
|
const SHORTCUTS = (0, _uniqueMap.createUniqueMap)({
|
|
102188
102486
|
errorIdExists: keys => `The "${keys}" shortcut is already registered in the "${name}" context.`
|
|
102189
102487
|
});
|
|
@@ -102359,6 +102657,7 @@ const createContext = name => {
|
|
|
102359
102657
|
};
|
|
102360
102658
|
return {
|
|
102361
102659
|
__kindOf,
|
|
102660
|
+
scope,
|
|
102362
102661
|
addShortcut,
|
|
102363
102662
|
addShortcuts,
|
|
102364
102663
|
getShortcuts,
|
|
@@ -114280,18 +114579,20 @@ var _nestedRows = __webpack_require__(1072);
|
|
|
114280
114579
|
exports.NestedRows = _nestedRows.NestedRows;
|
|
114281
114580
|
var _pagination = __webpack_require__(1080);
|
|
114282
114581
|
exports.Pagination = _pagination.Pagination;
|
|
114283
|
-
var _persistentState = __webpack_require__(
|
|
114582
|
+
var _persistentState = __webpack_require__(1088);
|
|
114284
114583
|
exports.PersistentState = _persistentState.PersistentState;
|
|
114285
|
-
var _search = __webpack_require__(
|
|
114584
|
+
var _search = __webpack_require__(1091);
|
|
114286
114585
|
exports.Search = _search.Search;
|
|
114287
|
-
var _stretchColumns = __webpack_require__(
|
|
114586
|
+
var _stretchColumns = __webpack_require__(1093);
|
|
114288
114587
|
exports.StretchColumns = _stretchColumns.StretchColumns;
|
|
114289
|
-
var _touchScroll = __webpack_require__(
|
|
114588
|
+
var _touchScroll = __webpack_require__(1099);
|
|
114290
114589
|
exports.TouchScroll = _touchScroll.TouchScroll;
|
|
114291
|
-
var _trimRows = __webpack_require__(
|
|
114590
|
+
var _trimRows = __webpack_require__(1101);
|
|
114292
114591
|
exports.TrimRows = _trimRows.TrimRows;
|
|
114293
|
-
var _undoRedo = __webpack_require__(
|
|
114592
|
+
var _undoRedo = __webpack_require__(1103);
|
|
114294
114593
|
exports.UndoRedo = _undoRedo.UndoRedo;
|
|
114594
|
+
var _dialog = __webpack_require__(1120);
|
|
114595
|
+
exports.Dialog = _dialog.Dialog;
|
|
114295
114596
|
var _registry = __webpack_require__(537);
|
|
114296
114597
|
exports.registerPlugin = _registry.registerPlugin;
|
|
114297
114598
|
exports.getPlugin = _registry.getPlugin;
|
|
@@ -114335,6 +114636,7 @@ function registerAllPlugins() {
|
|
|
114335
114636
|
(0, _registry.registerPlugin)(_touchScroll.TouchScroll);
|
|
114336
114637
|
(0, _registry.registerPlugin)(_trimRows.TrimRows);
|
|
114337
114638
|
(0, _registry.registerPlugin)(_undoRedo.UndoRedo);
|
|
114639
|
+
(0, _registry.registerPlugin)(_dialog.Dialog);
|
|
114338
114640
|
}
|
|
114339
114641
|
|
|
114340
114642
|
/***/ }),
|
|
@@ -115126,9 +115428,11 @@ var _registry3 = __webpack_require__(516);
|
|
|
115126
115428
|
var _registry4 = __webpack_require__(542);
|
|
115127
115429
|
var _registry5 = __webpack_require__(543);
|
|
115128
115430
|
var _eventManager = _interopRequireDefault(__webpack_require__(528));
|
|
115431
|
+
var _console = __webpack_require__(518);
|
|
115129
115432
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
115130
115433
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
115131
115434
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
115435
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
115132
115436
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
115133
115437
|
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"); }
|
|
115134
115438
|
const DEPS_TYPE_CHECKERS = new Map([['plugin', _registry.hasPlugin], ['cell-type', _registry2.hasCellType], ['editor', _registry3.hasEditor], ['renderer', _registry4.hasRenderer], ['validator', _registry5.hasValidator]]);
|
|
@@ -115141,6 +115445,7 @@ let initializedPlugins = null;
|
|
|
115141
115445
|
* @util
|
|
115142
115446
|
* @property {Core} hot Handsontable instance.
|
|
115143
115447
|
*/
|
|
115448
|
+
var _pluginSettings = /*#__PURE__*/new WeakMap();
|
|
115144
115449
|
var _hooks = /*#__PURE__*/new WeakMap();
|
|
115145
115450
|
var _BasePlugin_brand = /*#__PURE__*/new WeakSet();
|
|
115146
115451
|
class BasePlugin {
|
|
@@ -115171,9 +115476,18 @@ class BasePlugin {
|
|
|
115171
115476
|
}
|
|
115172
115477
|
|
|
115173
115478
|
/**
|
|
115174
|
-
*
|
|
115479
|
+
* Validators for plugin settings.
|
|
115175
115480
|
*
|
|
115176
|
-
* @type {
|
|
115481
|
+
* @type {Function|object|null}
|
|
115482
|
+
*/
|
|
115483
|
+
static get SETTINGS_VALIDATORS() {
|
|
115484
|
+
return null;
|
|
115485
|
+
}
|
|
115486
|
+
|
|
115487
|
+
/**
|
|
115488
|
+
* Plugin settings.
|
|
115489
|
+
*
|
|
115490
|
+
* @type {object|null}
|
|
115177
115491
|
*/
|
|
115178
115492
|
|
|
115179
115493
|
/**
|
|
@@ -115190,6 +115504,12 @@ class BasePlugin {
|
|
|
115190
115504
|
* @returns {boolean}
|
|
115191
115505
|
*/
|
|
115192
115506
|
_classPrivateMethodInitSpec(this, _BasePlugin_brand);
|
|
115507
|
+
_classPrivateFieldInitSpec(this, _pluginSettings, null);
|
|
115508
|
+
/**
|
|
115509
|
+
* The instance of the {@link EventManager} class.
|
|
115510
|
+
*
|
|
115511
|
+
* @type {EventManager}
|
|
115512
|
+
*/
|
|
115193
115513
|
(0, _defineProperty2.default)(this, "eventManager", new _eventManager.default(this));
|
|
115194
115514
|
/**
|
|
115195
115515
|
* @type {string}
|
|
@@ -115230,6 +115550,7 @@ class BasePlugin {
|
|
|
115230
115550
|
}
|
|
115231
115551
|
init() {
|
|
115232
115552
|
this.pluginName = this.hot.getPluginName(this);
|
|
115553
|
+
this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);
|
|
115233
115554
|
const pluginDeps = this.constructor.PLUGIN_DEPS;
|
|
115234
115555
|
const deps = Array.isArray(pluginDeps) ? pluginDeps : [];
|
|
115235
115556
|
if (deps.length > 0) {
|
|
@@ -115297,25 +115618,65 @@ class BasePlugin {
|
|
|
115297
115618
|
* @returns {*}
|
|
115298
115619
|
*/
|
|
115299
115620
|
getSetting(settingName) {
|
|
115300
|
-
const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
|
|
115301
115621
|
if (settingName === undefined) {
|
|
115302
|
-
return
|
|
115622
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
115303
115623
|
}
|
|
115304
115624
|
const defaultSettings = this.constructor.DEFAULT_SETTINGS;
|
|
115305
|
-
if ((Array.isArray(
|
|
115306
|
-
var
|
|
115307
|
-
if (Array.isArray(
|
|
115308
|
-
return
|
|
115625
|
+
if ((Array.isArray(_classPrivateFieldGet(_pluginSettings, this)) || (0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) && defaultSettings[defaultMainSettingSymbol] === settingName) {
|
|
115626
|
+
var _classPrivateFieldGet2;
|
|
115627
|
+
if (Array.isArray(_classPrivateFieldGet(_pluginSettings, this))) {
|
|
115628
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
115309
115629
|
}
|
|
115310
|
-
return (
|
|
115630
|
+
return (_classPrivateFieldGet2 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : defaultSettings[settingName];
|
|
115311
115631
|
}
|
|
115312
|
-
if ((0, _object.isObject)(
|
|
115313
|
-
var
|
|
115314
|
-
return (
|
|
115632
|
+
if ((0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) {
|
|
115633
|
+
var _classPrivateFieldGet3;
|
|
115634
|
+
return (_classPrivateFieldGet3 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : defaultSettings[settingName];
|
|
115315
115635
|
}
|
|
115316
115636
|
return defaultSettings[settingName];
|
|
115317
115637
|
}
|
|
115318
115638
|
|
|
115639
|
+
/**
|
|
115640
|
+
* Update plugin settings.
|
|
115641
|
+
*
|
|
115642
|
+
* @param {*} newSettings New settings.
|
|
115643
|
+
* @returns {object} Updated settings object.
|
|
115644
|
+
*/
|
|
115645
|
+
updatePluginSettings(newSettings) {
|
|
115646
|
+
const settingsValidators = this.constructor.SETTINGS_VALIDATORS;
|
|
115647
|
+
if (settingsValidators && typeof settingsValidators === 'function' && typeof newSettings !== 'object') {
|
|
115648
|
+
const isValid = settingsValidators(newSettings);
|
|
115649
|
+
if (isValid === false) {
|
|
115650
|
+
(0, _console.warn)(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);
|
|
115651
|
+
return;
|
|
115652
|
+
}
|
|
115653
|
+
_classPrivateFieldSet(_pluginSettings, this, newSettings);
|
|
115654
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
115655
|
+
}
|
|
115656
|
+
if (settingsValidators && typeof settingsValidators === 'object' && typeof newSettings === 'object') {
|
|
115657
|
+
if (_classPrivateFieldGet(_pluginSettings, this) === null || typeof _classPrivateFieldGet(_pluginSettings, this) !== 'object') {
|
|
115658
|
+
_classPrivateFieldSet(_pluginSettings, this, {
|
|
115659
|
+
...this.constructor.DEFAULT_SETTINGS
|
|
115660
|
+
});
|
|
115661
|
+
}
|
|
115662
|
+
Object.keys(settingsValidators).forEach(key => {
|
|
115663
|
+
if (!(key in newSettings)) {
|
|
115664
|
+
return;
|
|
115665
|
+
}
|
|
115666
|
+
const validator = settingsValidators[key];
|
|
115667
|
+
const isValid = validator ? validator(newSettings[key]) : true;
|
|
115668
|
+
if (isValid === false) {
|
|
115669
|
+
(0, _console.warn)(`${this.pluginName} Plugin: "${key}" option is not valid and it will be ignored.`);
|
|
115670
|
+
return;
|
|
115671
|
+
}
|
|
115672
|
+
_classPrivateFieldGet(_pluginSettings, this)[key] = newSettings[key];
|
|
115673
|
+
});
|
|
115674
|
+
return _classPrivateFieldGet(_pluginSettings, this);
|
|
115675
|
+
}
|
|
115676
|
+
_classPrivateFieldSet(_pluginSettings, this, newSettings);
|
|
115677
|
+
return newSettings;
|
|
115678
|
+
}
|
|
115679
|
+
|
|
115319
115680
|
/**
|
|
115320
115681
|
* Add listener to plugin hooks system.
|
|
115321
115682
|
*
|
|
@@ -115393,6 +115754,7 @@ class BasePlugin {
|
|
|
115393
115754
|
this.enablePlugin();
|
|
115394
115755
|
}
|
|
115395
115756
|
if (this.enabled && this.isEnabled() && relevantToSettings) {
|
|
115757
|
+
this.updatePluginSettings(newSettings[this.constructor.PLUGIN_KEY]);
|
|
115396
115758
|
this.updatePlugin(newSettings);
|
|
115397
115759
|
}
|
|
115398
115760
|
}
|
|
@@ -115410,6 +115772,7 @@ class BasePlugin {
|
|
|
115410
115772
|
*/
|
|
115411
115773
|
destroy() {
|
|
115412
115774
|
var _this$eventManager2;
|
|
115775
|
+
_classPrivateFieldSet(_pluginSettings, this, null);
|
|
115413
115776
|
(_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
|
|
115414
115777
|
this.clearHooks();
|
|
115415
115778
|
(0, _object.objectEach)(this, (value, property) => {
|
|
@@ -123898,6 +124261,7 @@ class ContextMenu extends _base.BasePlugin {
|
|
|
123898
124261
|
return _this.executeCommand.call(_this, ...params);
|
|
123899
124262
|
});
|
|
123900
124263
|
this.addHook('afterOnCellContextMenu', event => _assertClassBrand(_ContextMenu_brand, this, _onAfterOnCellContextMenu).call(this, event));
|
|
124264
|
+
this.addHook('beforeDialogShow', () => this.close());
|
|
123901
124265
|
this.registerShortcuts();
|
|
123902
124266
|
super.enablePlugin();
|
|
123903
124267
|
}
|
|
@@ -129214,6 +129578,7 @@ class DropdownMenu extends _base.BasePlugin {
|
|
|
129214
129578
|
}
|
|
129215
129579
|
return _assertClassBrand(_DropdownMenu_brand, _this, _onBeforeViewportScrollHorizontally).call(_this, ...args);
|
|
129216
129580
|
});
|
|
129581
|
+
this.addHook('beforeDialogShow', () => this.close());
|
|
129217
129582
|
const settings = this.hot.getSettings()[PLUGIN_KEY];
|
|
129218
129583
|
const predefinedItems = {
|
|
129219
129584
|
items: this.itemsFactory.getItems(settings)
|
|
@@ -152971,6 +153336,8 @@ var _a11yAnnouncer = __webpack_require__(766);
|
|
|
152971
153336
|
var _strategies = __webpack_require__(1084);
|
|
152972
153337
|
var _templateLiteralTag = __webpack_require__(498);
|
|
152973
153338
|
var _console = __webpack_require__(518);
|
|
153339
|
+
var _focusController2 = __webpack_require__(1087);
|
|
153340
|
+
var _focusDetector2 = __webpack_require__(746);
|
|
152974
153341
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
152975
153342
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
152976
153343
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -152979,6 +153346,8 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
|
|
|
152979
153346
|
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"); }
|
|
152980
153347
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'pagination';
|
|
152981
153348
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 900;
|
|
153349
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
153350
|
+
const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
|
|
152982
153351
|
const AUTO_PAGE_SIZE_WARNING = (0, _templateLiteralTag.toSingleLine)`The \`auto\` page size setting requires the \`autoRowSize\`\x20
|
|
152983
153352
|
plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;
|
|
152984
153353
|
|
|
@@ -153063,13 +153432,15 @@ var _ui = /*#__PURE__*/new WeakMap();
|
|
|
153063
153432
|
var _calcStrategy = /*#__PURE__*/new WeakMap();
|
|
153064
153433
|
var _internalExecutionCall = /*#__PURE__*/new WeakMap();
|
|
153065
153434
|
var _internalRenderCall = /*#__PURE__*/new WeakMap();
|
|
153435
|
+
var _focusController = /*#__PURE__*/new WeakMap();
|
|
153436
|
+
var _focusDetector = /*#__PURE__*/new WeakMap();
|
|
153066
153437
|
var _Pagination_brand = /*#__PURE__*/new WeakSet();
|
|
153067
153438
|
var _onIndexCacheUpdate = /*#__PURE__*/new WeakMap();
|
|
153068
153439
|
class Pagination extends _base.BasePlugin {
|
|
153069
153440
|
constructor() {
|
|
153070
153441
|
super(...arguments);
|
|
153071
153442
|
/**
|
|
153072
|
-
*
|
|
153443
|
+
* Bind the events used by the plugin.
|
|
153073
153444
|
*/
|
|
153074
153445
|
_classPrivateMethodInitSpec(this, _Pagination_brand);
|
|
153075
153446
|
/**
|
|
@@ -153119,6 +153490,18 @@ class Pagination extends _base.BasePlugin {
|
|
|
153119
153490
|
* @type {boolean}
|
|
153120
153491
|
*/
|
|
153121
153492
|
_classPrivateFieldInitSpec(this, _internalRenderCall, false);
|
|
153493
|
+
/**
|
|
153494
|
+
* Pagination focus controller instance.
|
|
153495
|
+
*
|
|
153496
|
+
* @type {PaginationController}
|
|
153497
|
+
*/
|
|
153498
|
+
_classPrivateFieldInitSpec(this, _focusController, null);
|
|
153499
|
+
/**
|
|
153500
|
+
* Pagination focus detector instance.
|
|
153501
|
+
*
|
|
153502
|
+
* @type {object}
|
|
153503
|
+
*/
|
|
153504
|
+
_classPrivateFieldInitSpec(this, _focusDetector, null);
|
|
153122
153505
|
/**
|
|
153123
153506
|
* IndexMapper cache update listener. Once the cache is updated, we need to recompute
|
|
153124
153507
|
* the pagination state.
|
|
@@ -153187,7 +153570,7 @@ class Pagination extends _base.BasePlugin {
|
|
|
153187
153570
|
_classPrivateFieldSet(_calcStrategy, this, (0, _strategies.createPaginatorStrategy)(_classPrivateFieldGet(_pageSize, this) === 'auto' ? 'auto' : 'fixed'));
|
|
153188
153571
|
if (!_classPrivateFieldGet(_ui, this)) {
|
|
153189
153572
|
_classPrivateFieldSet(_ui, this, new _ui2.PaginationUI({
|
|
153190
|
-
rootElement: this.hot.
|
|
153573
|
+
rootElement: this.hot.rootGridElement,
|
|
153191
153574
|
uiContainer: this.getSetting('uiContainer'),
|
|
153192
153575
|
isRtl: this.hot.isRtl(),
|
|
153193
153576
|
themeName: this.hot.getSettings().themeName,
|
|
@@ -153198,8 +153581,35 @@ class Pagination extends _base.BasePlugin {
|
|
|
153198
153581
|
a11yAnnouncer: message => (0, _a11yAnnouncer.announce)(message)
|
|
153199
153582
|
}));
|
|
153200
153583
|
_assertClassBrand(_Pagination_brand, this, _updateSectionsVisibilityState).call(this);
|
|
153201
|
-
_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))
|
|
153584
|
+
_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 => {
|
|
153585
|
+
_classPrivateFieldGet(_focusController, this).setCurrentPage(_classPrivateFieldGet(_ui, this).getFocusableElements().indexOf(element));
|
|
153586
|
+
this.hot.unlisten();
|
|
153587
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
153588
|
+
this.hot.listen();
|
|
153589
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
153590
|
+
});
|
|
153591
|
+
}
|
|
153592
|
+
if (!_classPrivateFieldGet(_focusController, this)) {
|
|
153593
|
+
_classPrivateFieldSet(_focusController, this, (0, _focusController2.createPaginationFocusController)({
|
|
153594
|
+
focusableElements: () => _classPrivateFieldGet(_ui, this).getFocusableElements()
|
|
153595
|
+
}));
|
|
153596
|
+
}
|
|
153597
|
+
if (!_classPrivateFieldGet(_focusDetector, this)) {
|
|
153598
|
+
_classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getContainer(), {
|
|
153599
|
+
onFocus: from => {
|
|
153600
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
153601
|
+
this.hot.listen();
|
|
153602
|
+
if (from === 'from_above') {
|
|
153603
|
+
_classPrivateFieldGet(_focusController, this).toFirstItem();
|
|
153604
|
+
} else {
|
|
153605
|
+
_classPrivateFieldGet(_focusController, this).toLastItem();
|
|
153606
|
+
}
|
|
153607
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
153608
|
+
}
|
|
153609
|
+
}));
|
|
153202
153610
|
}
|
|
153611
|
+
_assertClassBrand(_Pagination_brand, this, _registerEvents).call(this);
|
|
153612
|
+
_assertClassBrand(_Pagination_brand, this, _registerShortcuts).call(this);
|
|
153203
153613
|
|
|
153204
153614
|
// Place the onInit hook before others to make sure that the pagination state is computed
|
|
153205
153615
|
// and applied to the index mapper before AutoColumnSize plugin begins calculate the column sizes.
|
|
@@ -153281,6 +153691,18 @@ class Pagination extends _base.BasePlugin {
|
|
|
153281
153691
|
}
|
|
153282
153692
|
return _assertClassBrand(_Pagination_brand, _this, _onAfterSetTheme).call(_this, ...args);
|
|
153283
153693
|
});
|
|
153694
|
+
this.addHook('afterDialogShow', function () {
|
|
153695
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
153696
|
+
args[_key12] = arguments[_key12];
|
|
153697
|
+
}
|
|
153698
|
+
return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogShow).call(_this, ...args);
|
|
153699
|
+
});
|
|
153700
|
+
this.addHook('beforeDialogHide', function () {
|
|
153701
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
153702
|
+
args[_key13] = arguments[_key13];
|
|
153703
|
+
}
|
|
153704
|
+
return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogHide).call(_this, ...args);
|
|
153705
|
+
});
|
|
153284
153706
|
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this));
|
|
153285
153707
|
super.enablePlugin();
|
|
153286
153708
|
}
|
|
@@ -153302,9 +153724,9 @@ class Pagination extends _base.BasePlugin {
|
|
|
153302
153724
|
this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this)).unregisterMap(this.pluginName);
|
|
153303
153725
|
_classPrivateFieldGet(_ui, this).destroy();
|
|
153304
153726
|
_classPrivateFieldSet(_ui, this, null);
|
|
153727
|
+
_assertClassBrand(_Pagination_brand, this, _unregisterShortcuts).call(this);
|
|
153305
153728
|
super.disablePlugin();
|
|
153306
153729
|
}
|
|
153307
|
-
|
|
153308
153730
|
/**
|
|
153309
153731
|
* Gets the pagination current state. Returns an object with the following properties:
|
|
153310
153732
|
* - `currentPage`: The current page number.
|
|
@@ -153560,6 +153982,11 @@ class Pagination extends _base.BasePlugin {
|
|
|
153560
153982
|
_classPrivateFieldGet(_ui, this).setNavigationSectionVisibility(false);
|
|
153561
153983
|
this.hot.runHooks('afterPageNavigationVisibilityChange', false);
|
|
153562
153984
|
}
|
|
153985
|
+
|
|
153986
|
+
/**
|
|
153987
|
+
* Updates the visibility state of the pagination sections based on the current settings.
|
|
153988
|
+
*/
|
|
153989
|
+
|
|
153563
153990
|
/**
|
|
153564
153991
|
* Destroys the plugin instance.
|
|
153565
153992
|
*/
|
|
@@ -153573,6 +154000,59 @@ class Pagination extends _base.BasePlugin {
|
|
|
153573
154000
|
}
|
|
153574
154001
|
}
|
|
153575
154002
|
exports.Pagination = Pagination;
|
|
154003
|
+
function _registerEvents() {
|
|
154004
|
+
// TODO: move to general focus manager module
|
|
154005
|
+
this.eventManager.addEventListener(this.hot.rootDocument, 'mouseup', event => {
|
|
154006
|
+
const container = _classPrivateFieldGet(_ui, this).getContainer();
|
|
154007
|
+
if (!container.contains(event.target) && this.hot.getShortcutManager().getActiveContextName() === SHORTCUTS_CONTEXT_NAME) {
|
|
154008
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
154009
|
+
_classPrivateFieldGet(_focusController, this).clear();
|
|
154010
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
154011
|
+
}
|
|
154012
|
+
});
|
|
154013
|
+
}
|
|
154014
|
+
/**
|
|
154015
|
+
* Register shortcuts responsible for navigating through the pagination.
|
|
154016
|
+
*/
|
|
154017
|
+
function _registerShortcuts() {
|
|
154018
|
+
var _manager$getContext;
|
|
154019
|
+
const manager = this.hot.getShortcutManager();
|
|
154020
|
+
const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME, 'global');
|
|
154021
|
+
pluginContext.addShortcut({
|
|
154022
|
+
keys: [['Shift', 'Tab'], ['Tab']],
|
|
154023
|
+
preventDefault: false,
|
|
154024
|
+
callback: event => {
|
|
154025
|
+
let previousIndex = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
154026
|
+
if (event.shiftKey) {
|
|
154027
|
+
_classPrivateFieldGet(_focusController, this).toPreviousItem();
|
|
154028
|
+
const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
154029
|
+
if (currentPage >= previousIndex) {
|
|
154030
|
+
_assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
|
|
154031
|
+
return;
|
|
154032
|
+
}
|
|
154033
|
+
previousIndex = currentPage;
|
|
154034
|
+
} else {
|
|
154035
|
+
_classPrivateFieldGet(_focusController, this).toNextItem();
|
|
154036
|
+
const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
|
|
154037
|
+
if (currentPage <= previousIndex) {
|
|
154038
|
+
_assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
|
|
154039
|
+
return;
|
|
154040
|
+
}
|
|
154041
|
+
previousIndex = currentPage;
|
|
154042
|
+
}
|
|
154043
|
+
event.preventDefault();
|
|
154044
|
+
},
|
|
154045
|
+
group: SHORTCUTS_GROUP
|
|
154046
|
+
});
|
|
154047
|
+
}
|
|
154048
|
+
/**
|
|
154049
|
+
* Unregister shortcuts responsible for navigating through the pagination.
|
|
154050
|
+
*/
|
|
154051
|
+
function _unregisterShortcuts() {
|
|
154052
|
+
const shortcutManager = this.hot.getShortcutManager();
|
|
154053
|
+
const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
|
|
154054
|
+
pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
|
|
154055
|
+
}
|
|
153576
154056
|
function _updateSectionsVisibilityState() {
|
|
153577
154057
|
if (this.getSetting('showPageSize')) {
|
|
153578
154058
|
this.showPageSizeSection();
|
|
@@ -153645,10 +154125,16 @@ function _computeAndApplyState() {
|
|
|
153645
154125
|
this.hot.rowIndexMapper.updateCache(true);
|
|
153646
154126
|
}
|
|
153647
154127
|
_classPrivateFieldSet(_internalExecutionCall, this, false);
|
|
154128
|
+
const paginationData = this.getPaginationData();
|
|
153648
154129
|
_classPrivateFieldGet(_ui, this).updateState({
|
|
153649
|
-
...
|
|
154130
|
+
...paginationData,
|
|
153650
154131
|
totalRenderedRows: renderableRowsLength
|
|
153651
154132
|
});
|
|
154133
|
+
if ((this.getSetting('showPageSize') || this.getSetting('showNavigation')) && paginationData.totalPages > 1) {
|
|
154134
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
154135
|
+
} else {
|
|
154136
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
154137
|
+
}
|
|
153652
154138
|
}
|
|
153653
154139
|
/**
|
|
153654
154140
|
* Based on the external factors (like the scroll position of the table, size etc.) it computes
|
|
@@ -153799,6 +154285,24 @@ function _onAfterRender() {
|
|
|
153799
154285
|
const width = view.isHorizontallyScrollableByWindow() ? view.getTotalTableWidth() : view.getWorkspaceWidth();
|
|
153800
154286
|
_classPrivateFieldGet(_ui, this).updateWidth(width).refreshBorderState();
|
|
153801
154287
|
}
|
|
154288
|
+
/**
|
|
154289
|
+
* Called before the height of the table is changed. It adjusts the table height to fit the pagination container
|
|
154290
|
+
* in declared height.
|
|
154291
|
+
*
|
|
154292
|
+
* @param {number|string} height Table height.
|
|
154293
|
+
* @returns {string} Returns the new table height.
|
|
154294
|
+
*/
|
|
154295
|
+
function _onBeforeHeightChange(height) {
|
|
154296
|
+
if (this.getSetting('uiContainer')) {
|
|
154297
|
+
return height;
|
|
154298
|
+
}
|
|
154299
|
+
const isPixelValue = typeof height === 'number' || typeof height === 'string' && /^\d+$/.test(height) || typeof height === 'string' && height.endsWith('px');
|
|
154300
|
+
if (!isPixelValue) {
|
|
154301
|
+
return height;
|
|
154302
|
+
}
|
|
154303
|
+
const heightValue = typeof height === 'string' && height.endsWith('px') ? height : `${height}px`;
|
|
154304
|
+
return `calc(${heightValue} - ${_classPrivateFieldGet(_ui, this).getHeight()}px)`;
|
|
154305
|
+
}
|
|
153802
154306
|
/**
|
|
153803
154307
|
* Called after the initialization of the plugin. It computes the initial state of the pagination.
|
|
153804
154308
|
*/
|
|
@@ -153821,19 +154325,6 @@ function _onAfterScrollVertically() {
|
|
|
153821
154325
|
function _onAfterLanguageChange() {
|
|
153822
154326
|
_assertClassBrand(_Pagination_brand, this, _computeAndApplyState).call(this);
|
|
153823
154327
|
}
|
|
153824
|
-
/**
|
|
153825
|
-
* Called before the height of the table is changed. It adjusts the table height to fit the pagination container
|
|
153826
|
-
* in declared height.
|
|
153827
|
-
*
|
|
153828
|
-
* @param {number} height Table height.
|
|
153829
|
-
* @returns {string} Returns the new table height.
|
|
153830
|
-
*/
|
|
153831
|
-
function _onBeforeHeightChange(height) {
|
|
153832
|
-
if (this.getSetting('uiContainer')) {
|
|
153833
|
-
return height;
|
|
153834
|
-
}
|
|
153835
|
-
return `calc(${height}${/[0-9]$/.test(height) ? 'px' : ''} - ${_classPrivateFieldGet(_ui, this).getHeight()}px)`;
|
|
153836
|
-
}
|
|
153837
154328
|
/**
|
|
153838
154329
|
* Called after the theme is set. It updates the theme of the pagination container.
|
|
153839
154330
|
*
|
|
@@ -153842,6 +154333,27 @@ function _onBeforeHeightChange(height) {
|
|
|
153842
154333
|
function _onAfterSetTheme(themeName) {
|
|
153843
154334
|
_classPrivateFieldGet(_ui, this).updateTheme(themeName);
|
|
153844
154335
|
}
|
|
154336
|
+
/**
|
|
154337
|
+
* Unfocuses the pagination and sets the active context for the shortcuts.
|
|
154338
|
+
*/
|
|
154339
|
+
function _unFocusPagination() {
|
|
154340
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
154341
|
+
_classPrivateFieldGet(_focusController, this).clear();
|
|
154342
|
+
this.hot.unlisten();
|
|
154343
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
154344
|
+
}
|
|
154345
|
+
/**
|
|
154346
|
+
* Called after the dialog is shown. It sets the active context for the shortcuts.
|
|
154347
|
+
*/
|
|
154348
|
+
function _onAfterDialogShow() {
|
|
154349
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
154350
|
+
}
|
|
154351
|
+
/**
|
|
154352
|
+
* Called after the dialog is hidden. It sets the active context for the shortcuts.
|
|
154353
|
+
*/
|
|
154354
|
+
function _onAfterDialogHide() {
|
|
154355
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
154356
|
+
}
|
|
153845
154357
|
|
|
153846
154358
|
/***/ }),
|
|
153847
154359
|
/* 1082 */
|
|
@@ -153869,12 +154381,12 @@ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
|
153869
154381
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
153870
154382
|
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"); }
|
|
153871
154383
|
const TEMPLATE = `
|
|
153872
|
-
<div data-ref="container" class="ht-pagination
|
|
153873
|
-
<div class="ht-
|
|
154384
|
+
<div data-ref="container" class="ht-pagination handsontable">
|
|
154385
|
+
<div class="ht-pagination__inner">
|
|
153874
154386
|
<div data-ref="pageSizeSection" class="ht-page-size-section">
|
|
153875
154387
|
<span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span>
|
|
153876
154388
|
<div class="ht-page-size-section__select-wrapper">
|
|
153877
|
-
<select data-ref="pageSizeSelect" name="pageSize"></select>
|
|
154389
|
+
<select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select>
|
|
153878
154390
|
</div>
|
|
153879
154391
|
</div>
|
|
153880
154392
|
<div data-ref="pageCounterSection" class="ht-page-counter-section"></div>
|
|
@@ -154000,26 +154512,22 @@ class PaginationUI {
|
|
|
154000
154512
|
_classPrivateFieldSet(_refs, this, elements.refs);
|
|
154001
154513
|
container.setAttribute('dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr');
|
|
154002
154514
|
const isDisabled = event => event.currentTarget.disabled;
|
|
154003
|
-
|
|
154004
|
-
|
|
154005
|
-
|
|
154006
|
-
|
|
154007
|
-
|
|
154008
|
-
|
|
154009
|
-
|
|
154010
|
-
|
|
154011
|
-
|
|
154012
|
-
|
|
154013
|
-
|
|
154014
|
-
|
|
154015
|
-
|
|
154016
|
-
|
|
154017
|
-
|
|
154018
|
-
|
|
154019
|
-
if (!isDisabled(event)) {
|
|
154020
|
-
this.runLocalHooks('lastPageClick');
|
|
154021
|
-
}
|
|
154022
|
-
});
|
|
154515
|
+
const addClickListener = (eventName, element, callback) => {
|
|
154516
|
+
element.addEventListener(eventName, event => {
|
|
154517
|
+
if (!isDisabled(event)) {
|
|
154518
|
+
callback();
|
|
154519
|
+
}
|
|
154520
|
+
});
|
|
154521
|
+
};
|
|
154522
|
+
addClickListener('click', first, () => this.runLocalHooks('firstPageClick'));
|
|
154523
|
+
addClickListener('focus', first, () => this.runLocalHooks('focus', first));
|
|
154524
|
+
addClickListener('click', prev, () => this.runLocalHooks('prevPageClick'));
|
|
154525
|
+
addClickListener('focus', prev, () => this.runLocalHooks('focus', prev));
|
|
154526
|
+
addClickListener('click', next, () => this.runLocalHooks('nextPageClick'));
|
|
154527
|
+
addClickListener('focus', next, () => this.runLocalHooks('focus', next));
|
|
154528
|
+
addClickListener('click', last, () => this.runLocalHooks('lastPageClick'));
|
|
154529
|
+
addClickListener('focus', last, () => this.runLocalHooks('focus', last));
|
|
154530
|
+
addClickListener('focus', pageSizeSelect, () => this.runLocalHooks('focus', pageSizeSelect));
|
|
154023
154531
|
pageSizeSelect.addEventListener('change', () => {
|
|
154024
154532
|
const value = pageSizeSelect.value === 'auto' ? 'auto' : Number.parseInt(pageSizeSelect.value, 10);
|
|
154025
154533
|
this.runLocalHooks('pageSizeChange', value);
|
|
@@ -154035,6 +154543,31 @@ class PaginationUI {
|
|
|
154035
154543
|
}
|
|
154036
154544
|
}
|
|
154037
154545
|
|
|
154546
|
+
/**
|
|
154547
|
+
* Gets the pagination element.
|
|
154548
|
+
*
|
|
154549
|
+
* @returns {HTMLElement} The pagination element.
|
|
154550
|
+
*/
|
|
154551
|
+
getContainer() {
|
|
154552
|
+
return _classPrivateFieldGet(_refs, this).container;
|
|
154553
|
+
}
|
|
154554
|
+
|
|
154555
|
+
/**
|
|
154556
|
+
* Gets the focusable elements.
|
|
154557
|
+
*
|
|
154558
|
+
* @returns {HTMLElement[]} The focusable elements.
|
|
154559
|
+
*/
|
|
154560
|
+
getFocusableElements() {
|
|
154561
|
+
const {
|
|
154562
|
+
first,
|
|
154563
|
+
prev,
|
|
154564
|
+
next,
|
|
154565
|
+
last,
|
|
154566
|
+
pageSizeSelect
|
|
154567
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
154568
|
+
return [pageSizeSelect, first, prev, next, last].filter(element => !element.disabled);
|
|
154569
|
+
}
|
|
154570
|
+
|
|
154038
154571
|
/**
|
|
154039
154572
|
* Updates the width of the pagination container.
|
|
154040
154573
|
*
|
|
@@ -154085,9 +154618,9 @@ class PaginationUI {
|
|
|
154085
154618
|
container
|
|
154086
154619
|
} = _classPrivateFieldGet(_refs, this);
|
|
154087
154620
|
if (_classPrivateFieldGet(_uiContainer, this) || _classPrivateFieldGet(_shouldHaveBorder, this).call(this)) {
|
|
154088
|
-
(0, _element.addClass)(container, 'ht-pagination
|
|
154621
|
+
(0, _element.addClass)(container, 'ht-pagination--bordered');
|
|
154089
154622
|
} else {
|
|
154090
|
-
(0, _element.removeClass)(container, 'ht-pagination
|
|
154623
|
+
(0, _element.removeClass)(container, 'ht-pagination--bordered');
|
|
154091
154624
|
}
|
|
154092
154625
|
return this;
|
|
154093
154626
|
}
|
|
@@ -154143,7 +154676,7 @@ class PaginationUI {
|
|
|
154143
154676
|
pageSizeSelect.textContent = '';
|
|
154144
154677
|
pageSizeLabel.textContent = `${pageSizeLabelText}:`;
|
|
154145
154678
|
(0, _element.setAttribute)(pageNavSection, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_SECTION))]]);
|
|
154146
|
-
(0, _element.setAttribute)(pageSizeSelect, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION))]]);
|
|
154679
|
+
(0, _element.setAttribute)(pageSizeSelect, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION))], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
|
154147
154680
|
_classPrivateFieldGet(_a11yAnnouncer, this).call(this, navLabelText);
|
|
154148
154681
|
this.refreshBorderState();
|
|
154149
154682
|
pageSizeList.forEach(pageSizeItem => {
|
|
@@ -154156,40 +154689,42 @@ class PaginationUI {
|
|
|
154156
154689
|
});
|
|
154157
154690
|
const isFirstPage = currentPage === 1;
|
|
154158
154691
|
const isLastPage = currentPage === totalPages;
|
|
154159
|
-
|
|
154160
|
-
|
|
154161
|
-
(
|
|
154162
|
-
|
|
154163
|
-
|
|
154164
|
-
|
|
154165
|
-
|
|
154166
|
-
|
|
154167
|
-
|
|
154168
|
-
|
|
154169
|
-
|
|
154170
|
-
|
|
154171
|
-
|
|
154172
|
-
(
|
|
154173
|
-
|
|
154174
|
-
|
|
154175
|
-
|
|
154176
|
-
|
|
154177
|
-
|
|
154178
|
-
|
|
154179
|
-
|
|
154180
|
-
|
|
154181
|
-
|
|
154182
|
-
|
|
154183
|
-
if (prev.
|
|
154184
|
-
|
|
154185
|
-
|
|
154186
|
-
|
|
154187
|
-
|
|
154188
|
-
|
|
154189
|
-
|
|
154190
|
-
|
|
154191
|
-
(0, _element.setAttribute)(
|
|
154192
|
-
(0, _element.setAttribute)(
|
|
154692
|
+
if (pageNavSection.style.display !== 'none') {
|
|
154693
|
+
const activeElement = _classPrivateFieldGet(_rootElement, this).ownerDocument.activeElement;
|
|
154694
|
+
if (isFirstPage) {
|
|
154695
|
+
(0, _element.addClass)(first, 'ht-page-navigation-section__button--disabled');
|
|
154696
|
+
(0, _element.addClass)(prev, 'ht-page-navigation-section__button--disabled');
|
|
154697
|
+
first.disabled = true;
|
|
154698
|
+
prev.disabled = true;
|
|
154699
|
+
} else {
|
|
154700
|
+
(0, _element.removeClass)(first, 'ht-page-navigation-section__button--disabled');
|
|
154701
|
+
(0, _element.removeClass)(prev, 'ht-page-navigation-section__button--disabled');
|
|
154702
|
+
first.disabled = false;
|
|
154703
|
+
prev.disabled = false;
|
|
154704
|
+
}
|
|
154705
|
+
if (isLastPage) {
|
|
154706
|
+
(0, _element.addClass)(next, 'ht-page-navigation-section__button--disabled');
|
|
154707
|
+
(0, _element.addClass)(last, 'ht-page-navigation-section__button--disabled');
|
|
154708
|
+
next.disabled = true;
|
|
154709
|
+
last.disabled = true;
|
|
154710
|
+
} else {
|
|
154711
|
+
(0, _element.removeClass)(next, 'ht-page-navigation-section__button--disabled');
|
|
154712
|
+
(0, _element.removeClass)(last, 'ht-page-navigation-section__button--disabled');
|
|
154713
|
+
next.disabled = false;
|
|
154714
|
+
last.disabled = false;
|
|
154715
|
+
}
|
|
154716
|
+
if ([first, prev, next, last].includes(activeElement)) {
|
|
154717
|
+
if (prev.disabled) {
|
|
154718
|
+
next.focus();
|
|
154719
|
+
} else if (next.disabled) {
|
|
154720
|
+
prev.focus();
|
|
154721
|
+
}
|
|
154722
|
+
}
|
|
154723
|
+
}
|
|
154724
|
+
(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)]]);
|
|
154725
|
+
(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)]]);
|
|
154726
|
+
(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)]]);
|
|
154727
|
+
(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)]]);
|
|
154193
154728
|
return this;
|
|
154194
154729
|
}
|
|
154195
154730
|
|
|
@@ -154200,7 +154735,12 @@ class PaginationUI {
|
|
|
154200
154735
|
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
|
154201
154736
|
*/
|
|
154202
154737
|
setPageSizeSectionVisibility(isVisible) {
|
|
154203
|
-
|
|
154738
|
+
const {
|
|
154739
|
+
pageSizeSection,
|
|
154740
|
+
pageSizeSelect
|
|
154741
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
154742
|
+
pageSizeSection.style.display = isVisible ? '' : 'none';
|
|
154743
|
+
pageSizeSelect.disabled = !isVisible;
|
|
154204
154744
|
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
|
154205
154745
|
return this;
|
|
154206
154746
|
}
|
|
@@ -154224,7 +154764,18 @@ class PaginationUI {
|
|
|
154224
154764
|
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
|
154225
154765
|
*/
|
|
154226
154766
|
setNavigationSectionVisibility(isVisible) {
|
|
154227
|
-
|
|
154767
|
+
const {
|
|
154768
|
+
pageNavSection,
|
|
154769
|
+
first,
|
|
154770
|
+
prev,
|
|
154771
|
+
next,
|
|
154772
|
+
last
|
|
154773
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
154774
|
+
pageNavSection.style.display = isVisible ? '' : 'none';
|
|
154775
|
+
first.disabled = !isVisible;
|
|
154776
|
+
prev.disabled = !isVisible;
|
|
154777
|
+
next.disabled = !isVisible;
|
|
154778
|
+
last.disabled = !isVisible;
|
|
154228
154779
|
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
|
154229
154780
|
return this;
|
|
154230
154781
|
}
|
|
@@ -154250,9 +154801,9 @@ function _updateContainerVisibility() {
|
|
|
154250
154801
|
// adds or removes the corner around the Handsontable root element
|
|
154251
154802
|
if (!_classPrivateFieldGet(_uiContainer, this)) {
|
|
154252
154803
|
if (isSectionVisible) {
|
|
154253
|
-
(0, _element.addClass)(_classPrivateFieldGet(_rootElement, this), 'htPagination');
|
|
154804
|
+
(0, _element.addClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
|
154254
154805
|
} else {
|
|
154255
|
-
(0, _element.removeClass)(_classPrivateFieldGet(_rootElement, this), 'htPagination');
|
|
154806
|
+
(0, _element.removeClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
|
154256
154807
|
}
|
|
154257
154808
|
}
|
|
154258
154809
|
container.style.display = isSectionVisible ? '' : 'none';
|
|
@@ -154521,13 +155072,46 @@ exports.AutoPageSizeStrategy = AutoPageSizeStrategy;
|
|
|
154521
155072
|
|
|
154522
155073
|
|
|
154523
155074
|
exports.__esModule = true;
|
|
154524
|
-
|
|
155075
|
+
exports.createPaginationFocusController = createPaginationFocusController;
|
|
155076
|
+
var _paginator = __webpack_require__(919);
|
|
155077
|
+
/**
|
|
155078
|
+
* Creates a pagination focus controller instance.
|
|
155079
|
+
*
|
|
155080
|
+
* @private
|
|
155081
|
+
* @param {object} options The options for the pagination focus controller.
|
|
155082
|
+
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
|
155083
|
+
* @returns {PaginationController} The pagination controller instance.
|
|
155084
|
+
*/
|
|
155085
|
+
function createPaginationFocusController(_ref) {
|
|
155086
|
+
let {
|
|
155087
|
+
focusableElements
|
|
155088
|
+
} = _ref;
|
|
155089
|
+
const navigator = (0, _paginator.createPaginator)({
|
|
155090
|
+
initialPage: 0,
|
|
155091
|
+
size: () => focusableElements().length,
|
|
155092
|
+
onItemSelect: currentIndex => {
|
|
155093
|
+
const elements = focusableElements();
|
|
155094
|
+
elements[currentIndex].focus();
|
|
155095
|
+
}
|
|
155096
|
+
});
|
|
155097
|
+
return navigator;
|
|
155098
|
+
}
|
|
155099
|
+
|
|
155100
|
+
/***/ }),
|
|
155101
|
+
/* 1088 */
|
|
155102
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155103
|
+
|
|
155104
|
+
"use strict";
|
|
155105
|
+
|
|
155106
|
+
|
|
155107
|
+
exports.__esModule = true;
|
|
155108
|
+
var _persistentState = __webpack_require__(1089);
|
|
154525
155109
|
exports.PLUGIN_KEY = _persistentState.PLUGIN_KEY;
|
|
154526
155110
|
exports.PLUGIN_PRIORITY = _persistentState.PLUGIN_PRIORITY;
|
|
154527
155111
|
exports.PersistentState = _persistentState.PersistentState;
|
|
154528
155112
|
|
|
154529
155113
|
/***/ }),
|
|
154530
|
-
/*
|
|
155114
|
+
/* 1089 */
|
|
154531
155115
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
154532
155116
|
|
|
154533
155117
|
"use strict";
|
|
@@ -154537,7 +155121,7 @@ var _interopRequireDefault = __webpack_require__(197);
|
|
|
154537
155121
|
exports.__esModule = true;
|
|
154538
155122
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
154539
155123
|
var _base = __webpack_require__(854);
|
|
154540
|
-
var _storage = _interopRequireDefault(__webpack_require__(
|
|
155124
|
+
var _storage = _interopRequireDefault(__webpack_require__(1090));
|
|
154541
155125
|
var _hooks = __webpack_require__(517);
|
|
154542
155126
|
_hooks.Hooks.getSingleton().register('persistentStateSave');
|
|
154543
155127
|
_hooks.Hooks.getSingleton().register('persistentStateLoad');
|
|
@@ -154678,7 +155262,7 @@ class PersistentState extends _base.BasePlugin {
|
|
|
154678
155262
|
exports.PersistentState = PersistentState;
|
|
154679
155263
|
|
|
154680
155264
|
/***/ }),
|
|
154681
|
-
/*
|
|
155265
|
+
/* 1090 */
|
|
154682
155266
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
154683
155267
|
|
|
154684
155268
|
"use strict";
|
|
@@ -154802,20 +155386,20 @@ class Storage {
|
|
|
154802
155386
|
var _default = exports["default"] = Storage;
|
|
154803
155387
|
|
|
154804
155388
|
/***/ }),
|
|
154805
|
-
/*
|
|
155389
|
+
/* 1091 */
|
|
154806
155390
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
154807
155391
|
|
|
154808
155392
|
"use strict";
|
|
154809
155393
|
|
|
154810
155394
|
|
|
154811
155395
|
exports.__esModule = true;
|
|
154812
|
-
var _search = __webpack_require__(
|
|
155396
|
+
var _search = __webpack_require__(1092);
|
|
154813
155397
|
exports.PLUGIN_KEY = _search.PLUGIN_KEY;
|
|
154814
155398
|
exports.PLUGIN_PRIORITY = _search.PLUGIN_PRIORITY;
|
|
154815
155399
|
exports.Search = _search.Search;
|
|
154816
155400
|
|
|
154817
155401
|
/***/ }),
|
|
154818
|
-
/*
|
|
155402
|
+
/* 1092 */
|
|
154819
155403
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
154820
155404
|
|
|
154821
155405
|
"use strict";
|
|
@@ -155123,20 +155707,20 @@ function _onBeforeRenderer(TD, row, col, prop, value, cellProperties) {
|
|
|
155123
155707
|
}
|
|
155124
155708
|
|
|
155125
155709
|
/***/ }),
|
|
155126
|
-
/*
|
|
155710
|
+
/* 1093 */
|
|
155127
155711
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155128
155712
|
|
|
155129
155713
|
"use strict";
|
|
155130
155714
|
|
|
155131
155715
|
|
|
155132
155716
|
exports.__esModule = true;
|
|
155133
|
-
var _stretchColumns = __webpack_require__(
|
|
155717
|
+
var _stretchColumns = __webpack_require__(1094);
|
|
155134
155718
|
exports.PLUGIN_KEY = _stretchColumns.PLUGIN_KEY;
|
|
155135
155719
|
exports.PLUGIN_PRIORITY = _stretchColumns.PLUGIN_PRIORITY;
|
|
155136
155720
|
exports.StretchColumns = _stretchColumns.StretchColumns;
|
|
155137
155721
|
|
|
155138
155722
|
/***/ }),
|
|
155139
|
-
/*
|
|
155723
|
+
/* 1094 */
|
|
155140
155724
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155141
155725
|
|
|
155142
155726
|
"use strict";
|
|
@@ -155147,7 +155731,7 @@ __webpack_require__(201);
|
|
|
155147
155731
|
__webpack_require__(321);
|
|
155148
155732
|
__webpack_require__(341);
|
|
155149
155733
|
var _base = __webpack_require__(854);
|
|
155150
|
-
var _calculator = __webpack_require__(
|
|
155734
|
+
var _calculator = __webpack_require__(1095);
|
|
155151
155735
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
155152
155736
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
155153
155737
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -155377,7 +155961,7 @@ function _onBeforeRender(fullRender) {
|
|
|
155377
155961
|
}
|
|
155378
155962
|
|
|
155379
155963
|
/***/ }),
|
|
155380
|
-
/*
|
|
155964
|
+
/* 1095 */
|
|
155381
155965
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155382
155966
|
|
|
155383
155967
|
"use strict";
|
|
@@ -155389,8 +155973,8 @@ __webpack_require__(321);
|
|
|
155389
155973
|
__webpack_require__(341);
|
|
155390
155974
|
var _src = __webpack_require__(545);
|
|
155391
155975
|
var _element = __webpack_require__(355);
|
|
155392
|
-
var _all = __webpack_require__(
|
|
155393
|
-
var _last = __webpack_require__(
|
|
155976
|
+
var _all = __webpack_require__(1096);
|
|
155977
|
+
var _last = __webpack_require__(1098);
|
|
155394
155978
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
155395
155979
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
155396
155980
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
@@ -155550,7 +156134,7 @@ function _overwriteColumnWidthFn(columnWidth, columnVisualIndex) {
|
|
|
155550
156134
|
}
|
|
155551
156135
|
|
|
155552
156136
|
/***/ }),
|
|
155553
|
-
/*
|
|
156137
|
+
/* 1096 */
|
|
155554
156138
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155555
156139
|
|
|
155556
156140
|
"use strict";
|
|
@@ -155562,7 +156146,7 @@ __webpack_require__(321);
|
|
|
155562
156146
|
__webpack_require__(341);
|
|
155563
156147
|
__webpack_require__(499);
|
|
155564
156148
|
var _src = __webpack_require__(545);
|
|
155565
|
-
var _base = __webpack_require__(
|
|
156149
|
+
var _base = __webpack_require__(1097);
|
|
155566
156150
|
/**
|
|
155567
156151
|
* The strategy calculates the column widths by stretching all columns evenly.
|
|
155568
156152
|
*
|
|
@@ -155627,7 +156211,7 @@ class StretchAllStrategy extends _base.StretchStrategy {
|
|
|
155627
156211
|
exports.StretchAllStrategy = StretchAllStrategy;
|
|
155628
156212
|
|
|
155629
156213
|
/***/ }),
|
|
155630
|
-
/*
|
|
156214
|
+
/* 1097 */
|
|
155631
156215
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155632
156216
|
|
|
155633
156217
|
"use strict";
|
|
@@ -155716,7 +156300,7 @@ class StretchStrategy {
|
|
|
155716
156300
|
exports.StretchStrategy = StretchStrategy;
|
|
155717
156301
|
|
|
155718
156302
|
/***/ }),
|
|
155719
|
-
/*
|
|
156303
|
+
/* 1098 */
|
|
155720
156304
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155721
156305
|
|
|
155722
156306
|
"use strict";
|
|
@@ -155726,7 +156310,7 @@ exports.__esModule = true;
|
|
|
155726
156310
|
__webpack_require__(201);
|
|
155727
156311
|
__webpack_require__(321);
|
|
155728
156312
|
__webpack_require__(499);
|
|
155729
|
-
var _base = __webpack_require__(
|
|
156313
|
+
var _base = __webpack_require__(1097);
|
|
155730
156314
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
155731
156315
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
155732
156316
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
@@ -155801,20 +156385,20 @@ class StretchLastStrategy extends _base.StretchStrategy {
|
|
|
155801
156385
|
exports.StretchLastStrategy = StretchLastStrategy;
|
|
155802
156386
|
|
|
155803
156387
|
/***/ }),
|
|
155804
|
-
/*
|
|
156388
|
+
/* 1099 */
|
|
155805
156389
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155806
156390
|
|
|
155807
156391
|
"use strict";
|
|
155808
156392
|
|
|
155809
156393
|
|
|
155810
156394
|
exports.__esModule = true;
|
|
155811
|
-
var _touchScroll = __webpack_require__(
|
|
156395
|
+
var _touchScroll = __webpack_require__(1100);
|
|
155812
156396
|
exports.PLUGIN_KEY = _touchScroll.PLUGIN_KEY;
|
|
155813
156397
|
exports.PLUGIN_PRIORITY = _touchScroll.PLUGIN_PRIORITY;
|
|
155814
156398
|
exports.TouchScroll = _touchScroll.TouchScroll;
|
|
155815
156399
|
|
|
155816
156400
|
/***/ }),
|
|
155817
|
-
/*
|
|
156401
|
+
/* 1100 */
|
|
155818
156402
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
155819
156403
|
|
|
155820
156404
|
"use strict";
|
|
@@ -156003,20 +156587,20 @@ function _onAfterMomentumScroll() {
|
|
|
156003
156587
|
}
|
|
156004
156588
|
|
|
156005
156589
|
/***/ }),
|
|
156006
|
-
/*
|
|
156590
|
+
/* 1101 */
|
|
156007
156591
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156008
156592
|
|
|
156009
156593
|
"use strict";
|
|
156010
156594
|
|
|
156011
156595
|
|
|
156012
156596
|
exports.__esModule = true;
|
|
156013
|
-
var _trimRows = __webpack_require__(
|
|
156597
|
+
var _trimRows = __webpack_require__(1102);
|
|
156014
156598
|
exports.PLUGIN_KEY = _trimRows.PLUGIN_KEY;
|
|
156015
156599
|
exports.PLUGIN_PRIORITY = _trimRows.PLUGIN_PRIORITY;
|
|
156016
156600
|
exports.TrimRows = _trimRows.TrimRows;
|
|
156017
156601
|
|
|
156018
156602
|
/***/ }),
|
|
156019
|
-
/*
|
|
156603
|
+
/* 1102 */
|
|
156020
156604
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156021
156605
|
|
|
156022
156606
|
"use strict";
|
|
@@ -156409,20 +156993,20 @@ function _onMapInit() {
|
|
|
156409
156993
|
}
|
|
156410
156994
|
|
|
156411
156995
|
/***/ }),
|
|
156412
|
-
/*
|
|
156996
|
+
/* 1103 */
|
|
156413
156997
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156414
156998
|
|
|
156415
156999
|
"use strict";
|
|
156416
157000
|
|
|
156417
157001
|
|
|
156418
157002
|
exports.__esModule = true;
|
|
156419
|
-
var _undoRedo = __webpack_require__(
|
|
157003
|
+
var _undoRedo = __webpack_require__(1104);
|
|
156420
157004
|
exports.PLUGIN_KEY = _undoRedo.PLUGIN_KEY;
|
|
156421
157005
|
exports.PLUGIN_PRIORITY = _undoRedo.PLUGIN_PRIORITY;
|
|
156422
157006
|
exports.UndoRedo = _undoRedo.UndoRedo;
|
|
156423
157007
|
|
|
156424
157008
|
/***/ }),
|
|
156425
|
-
/*
|
|
157009
|
+
/* 1104 */
|
|
156426
157010
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156427
157011
|
|
|
156428
157012
|
"use strict";
|
|
@@ -156445,7 +157029,7 @@ var _hooks = __webpack_require__(517);
|
|
|
156445
157029
|
var _object = __webpack_require__(504);
|
|
156446
157030
|
var _templateLiteralTag = __webpack_require__(498);
|
|
156447
157031
|
var _console = __webpack_require__(518);
|
|
156448
|
-
var _actions = __webpack_require__(
|
|
157032
|
+
var _actions = __webpack_require__(1105);
|
|
156449
157033
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
156450
157034
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
156451
157035
|
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"); }
|
|
@@ -156815,7 +157399,7 @@ function _removeAPIFromCore() {
|
|
|
156815
157399
|
}
|
|
156816
157400
|
|
|
156817
157401
|
/***/ }),
|
|
156818
|
-
/*
|
|
157402
|
+
/* 1105 */
|
|
156819
157403
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156820
157404
|
|
|
156821
157405
|
"use strict";
|
|
@@ -156823,18 +157407,18 @@ function _removeAPIFromCore() {
|
|
|
156823
157407
|
|
|
156824
157408
|
exports.__esModule = true;
|
|
156825
157409
|
exports.registerActions = registerActions;
|
|
156826
|
-
var _cellAlignment = __webpack_require__(
|
|
156827
|
-
var _columnMove = __webpack_require__(
|
|
156828
|
-
var _columnSort = __webpack_require__(
|
|
156829
|
-
var _createColumn = __webpack_require__(
|
|
156830
|
-
var _createRow = __webpack_require__(
|
|
156831
|
-
var _dataChange = __webpack_require__(
|
|
156832
|
-
var _filters = __webpack_require__(
|
|
156833
|
-
var _mergeCells = __webpack_require__(
|
|
156834
|
-
var _removeColumn = __webpack_require__(
|
|
156835
|
-
var _removeRow = __webpack_require__(
|
|
156836
|
-
var _rowMove = __webpack_require__(
|
|
156837
|
-
var _unmergeCells = __webpack_require__(
|
|
157410
|
+
var _cellAlignment = __webpack_require__(1106);
|
|
157411
|
+
var _columnMove = __webpack_require__(1108);
|
|
157412
|
+
var _columnSort = __webpack_require__(1109);
|
|
157413
|
+
var _createColumn = __webpack_require__(1110);
|
|
157414
|
+
var _createRow = __webpack_require__(1111);
|
|
157415
|
+
var _dataChange = __webpack_require__(1112);
|
|
157416
|
+
var _filters = __webpack_require__(1113);
|
|
157417
|
+
var _mergeCells = __webpack_require__(1114);
|
|
157418
|
+
var _removeColumn = __webpack_require__(1115);
|
|
157419
|
+
var _removeRow = __webpack_require__(1117);
|
|
157420
|
+
var _rowMove = __webpack_require__(1118);
|
|
157421
|
+
var _unmergeCells = __webpack_require__(1119);
|
|
156838
157422
|
/**
|
|
156839
157423
|
* Register all undo/redo actions.
|
|
156840
157424
|
*
|
|
@@ -156846,7 +157430,7 @@ function registerActions(hot, undoRedoPlugin) {
|
|
|
156846
157430
|
}
|
|
156847
157431
|
|
|
156848
157432
|
/***/ }),
|
|
156849
|
-
/*
|
|
157433
|
+
/* 1106 */
|
|
156850
157434
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156851
157435
|
|
|
156852
157436
|
"use strict";
|
|
@@ -156855,7 +157439,7 @@ function registerActions(hot, undoRedoPlugin) {
|
|
|
156855
157439
|
var _interopRequireDefault = __webpack_require__(197);
|
|
156856
157440
|
exports.__esModule = true;
|
|
156857
157441
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
156858
|
-
var _base = __webpack_require__(
|
|
157442
|
+
var _base = __webpack_require__(1107);
|
|
156859
157443
|
var _utils = __webpack_require__(894);
|
|
156860
157444
|
var _array = __webpack_require__(501);
|
|
156861
157445
|
/**
|
|
@@ -156935,7 +157519,7 @@ class CellAlignmentAction extends _base.BaseAction {
|
|
|
156935
157519
|
exports.CellAlignmentAction = CellAlignmentAction;
|
|
156936
157520
|
|
|
156937
157521
|
/***/ }),
|
|
156938
|
-
/*
|
|
157522
|
+
/* 1107 */
|
|
156939
157523
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156940
157524
|
|
|
156941
157525
|
"use strict";
|
|
@@ -156969,7 +157553,7 @@ class BaseAction {
|
|
|
156969
157553
|
exports.BaseAction = BaseAction;
|
|
156970
157554
|
|
|
156971
157555
|
/***/ }),
|
|
156972
|
-
/*
|
|
157556
|
+
/* 1108 */
|
|
156973
157557
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
156974
157558
|
|
|
156975
157559
|
"use strict";
|
|
@@ -156980,7 +157564,7 @@ exports.__esModule = true;
|
|
|
156980
157564
|
__webpack_require__(321);
|
|
156981
157565
|
__webpack_require__(341);
|
|
156982
157566
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
156983
|
-
var _base = __webpack_require__(
|
|
157567
|
+
var _base = __webpack_require__(1107);
|
|
156984
157568
|
var _moves = __webpack_require__(1008);
|
|
156985
157569
|
/**
|
|
156986
157570
|
* Action that tracks column move changes.
|
|
@@ -157057,7 +157641,7 @@ class ColumnMoveAction extends _base.BaseAction {
|
|
|
157057
157641
|
exports.ColumnMoveAction = ColumnMoveAction;
|
|
157058
157642
|
|
|
157059
157643
|
/***/ }),
|
|
157060
|
-
/*
|
|
157644
|
+
/* 1109 */
|
|
157061
157645
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157062
157646
|
|
|
157063
157647
|
"use strict";
|
|
@@ -157066,7 +157650,7 @@ exports.ColumnMoveAction = ColumnMoveAction;
|
|
|
157066
157650
|
var _interopRequireDefault = __webpack_require__(197);
|
|
157067
157651
|
exports.__esModule = true;
|
|
157068
157652
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157069
|
-
var _base = __webpack_require__(
|
|
157653
|
+
var _base = __webpack_require__(1107);
|
|
157070
157654
|
/**
|
|
157071
157655
|
* Action that tracks column sort changes.
|
|
157072
157656
|
*
|
|
@@ -157134,7 +157718,7 @@ class ColumnSortAction extends _base.BaseAction {
|
|
|
157134
157718
|
exports.ColumnSortAction = ColumnSortAction;
|
|
157135
157719
|
|
|
157136
157720
|
/***/ }),
|
|
157137
|
-
/*
|
|
157721
|
+
/* 1110 */
|
|
157138
157722
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157139
157723
|
|
|
157140
157724
|
"use strict";
|
|
@@ -157143,7 +157727,7 @@ exports.ColumnSortAction = ColumnSortAction;
|
|
|
157143
157727
|
var _interopRequireDefault = __webpack_require__(197);
|
|
157144
157728
|
exports.__esModule = true;
|
|
157145
157729
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157146
|
-
var _base = __webpack_require__(
|
|
157730
|
+
var _base = __webpack_require__(1107);
|
|
157147
157731
|
/**
|
|
157148
157732
|
* Action that tracks column creation.
|
|
157149
157733
|
*
|
|
@@ -157198,7 +157782,7 @@ class CreateColumnAction extends _base.BaseAction {
|
|
|
157198
157782
|
exports.CreateColumnAction = CreateColumnAction;
|
|
157199
157783
|
|
|
157200
157784
|
/***/ }),
|
|
157201
|
-
/*
|
|
157785
|
+
/* 1111 */
|
|
157202
157786
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157203
157787
|
|
|
157204
157788
|
"use strict";
|
|
@@ -157207,7 +157791,7 @@ exports.CreateColumnAction = CreateColumnAction;
|
|
|
157207
157791
|
var _interopRequireDefault = __webpack_require__(197);
|
|
157208
157792
|
exports.__esModule = true;
|
|
157209
157793
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157210
|
-
var _base = __webpack_require__(
|
|
157794
|
+
var _base = __webpack_require__(1107);
|
|
157211
157795
|
/**
|
|
157212
157796
|
* Action that tracks row creation.
|
|
157213
157797
|
*
|
|
@@ -157267,7 +157851,7 @@ class CreateRowAction extends _base.BaseAction {
|
|
|
157267
157851
|
exports.CreateRowAction = CreateRowAction;
|
|
157268
157852
|
|
|
157269
157853
|
/***/ }),
|
|
157270
|
-
/*
|
|
157854
|
+
/* 1112 */
|
|
157271
157855
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157272
157856
|
|
|
157273
157857
|
"use strict";
|
|
@@ -157281,7 +157865,7 @@ __webpack_require__(525);
|
|
|
157281
157865
|
__webpack_require__(341);
|
|
157282
157866
|
__webpack_require__(499);
|
|
157283
157867
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157284
|
-
var _base = __webpack_require__(
|
|
157868
|
+
var _base = __webpack_require__(1107);
|
|
157285
157869
|
var _object = __webpack_require__(504);
|
|
157286
157870
|
/**
|
|
157287
157871
|
* Action that tracks data changes.
|
|
@@ -157394,7 +157978,7 @@ class DataChangeAction extends _base.BaseAction {
|
|
|
157394
157978
|
exports.DataChangeAction = DataChangeAction;
|
|
157395
157979
|
|
|
157396
157980
|
/***/ }),
|
|
157397
|
-
/*
|
|
157981
|
+
/* 1113 */
|
|
157398
157982
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157399
157983
|
|
|
157400
157984
|
"use strict";
|
|
@@ -157405,7 +157989,7 @@ exports.__esModule = true;
|
|
|
157405
157989
|
__webpack_require__(321);
|
|
157406
157990
|
__webpack_require__(332);
|
|
157407
157991
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157408
|
-
var _base = __webpack_require__(
|
|
157992
|
+
var _base = __webpack_require__(1107);
|
|
157409
157993
|
/**
|
|
157410
157994
|
* Action that tracks filter changes.
|
|
157411
157995
|
*
|
|
@@ -157464,7 +158048,7 @@ class FiltersAction extends _base.BaseAction {
|
|
|
157464
158048
|
exports.FiltersAction = FiltersAction;
|
|
157465
158049
|
|
|
157466
158050
|
/***/ }),
|
|
157467
|
-
/*
|
|
158051
|
+
/* 1114 */
|
|
157468
158052
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157469
158053
|
|
|
157470
158054
|
"use strict";
|
|
@@ -157473,7 +158057,7 @@ exports.FiltersAction = FiltersAction;
|
|
|
157473
158057
|
var _interopRequireDefault = __webpack_require__(197);
|
|
157474
158058
|
exports.__esModule = true;
|
|
157475
158059
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157476
|
-
var _base = __webpack_require__(
|
|
158060
|
+
var _base = __webpack_require__(1107);
|
|
157477
158061
|
/**
|
|
157478
158062
|
* Action that tracks changes in merged cells.
|
|
157479
158063
|
*
|
|
@@ -157534,7 +158118,7 @@ class MergeCellsAction extends _base.BaseAction {
|
|
|
157534
158118
|
exports.MergeCellsAction = MergeCellsAction;
|
|
157535
158119
|
|
|
157536
158120
|
/***/ }),
|
|
157537
|
-
/*
|
|
158121
|
+
/* 1115 */
|
|
157538
158122
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157539
158123
|
|
|
157540
158124
|
"use strict";
|
|
@@ -157546,8 +158130,8 @@ __webpack_require__(283);
|
|
|
157546
158130
|
__webpack_require__(321);
|
|
157547
158131
|
__webpack_require__(341);
|
|
157548
158132
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157549
|
-
var _base = __webpack_require__(
|
|
157550
|
-
var _utils = __webpack_require__(
|
|
158133
|
+
var _base = __webpack_require__(1107);
|
|
158134
|
+
var _utils = __webpack_require__(1116);
|
|
157551
158135
|
var _number = __webpack_require__(539);
|
|
157552
158136
|
var _array = __webpack_require__(501);
|
|
157553
158137
|
/**
|
|
@@ -157721,7 +158305,7 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
157721
158305
|
exports.RemoveColumnAction = RemoveColumnAction;
|
|
157722
158306
|
|
|
157723
158307
|
/***/ }),
|
|
157724
|
-
/*
|
|
158308
|
+
/* 1116 */
|
|
157725
158309
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157726
158310
|
|
|
157727
158311
|
"use strict";
|
|
@@ -157764,7 +158348,7 @@ function getCellMetas(hot, fromRow, toRow, fromColumn, toColumn) {
|
|
|
157764
158348
|
}
|
|
157765
158349
|
|
|
157766
158350
|
/***/ }),
|
|
157767
|
-
/*
|
|
158351
|
+
/* 1117 */
|
|
157768
158352
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157769
158353
|
|
|
157770
158354
|
"use strict";
|
|
@@ -157776,8 +158360,8 @@ __webpack_require__(283);
|
|
|
157776
158360
|
__webpack_require__(321);
|
|
157777
158361
|
__webpack_require__(341);
|
|
157778
158362
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157779
|
-
var _base = __webpack_require__(
|
|
157780
|
-
var _utils = __webpack_require__(
|
|
158363
|
+
var _base = __webpack_require__(1107);
|
|
158364
|
+
var _utils = __webpack_require__(1116);
|
|
157781
158365
|
var _object = __webpack_require__(504);
|
|
157782
158366
|
/**
|
|
157783
158367
|
* Action that tracks changes in row removal.
|
|
@@ -157895,7 +158479,7 @@ class RemoveRowAction extends _base.BaseAction {
|
|
|
157895
158479
|
exports.RemoveRowAction = RemoveRowAction;
|
|
157896
158480
|
|
|
157897
158481
|
/***/ }),
|
|
157898
|
-
/*
|
|
158482
|
+
/* 1118 */
|
|
157899
158483
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157900
158484
|
|
|
157901
158485
|
"use strict";
|
|
@@ -157906,7 +158490,7 @@ exports.__esModule = true;
|
|
|
157906
158490
|
__webpack_require__(321);
|
|
157907
158491
|
__webpack_require__(341);
|
|
157908
158492
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157909
|
-
var _base = __webpack_require__(
|
|
158493
|
+
var _base = __webpack_require__(1107);
|
|
157910
158494
|
var _moves = __webpack_require__(1008);
|
|
157911
158495
|
/**
|
|
157912
158496
|
* Action that tracks row move changes.
|
|
@@ -157983,7 +158567,7 @@ class RowMoveAction extends _base.BaseAction {
|
|
|
157983
158567
|
exports.RowMoveAction = RowMoveAction;
|
|
157984
158568
|
|
|
157985
158569
|
/***/ }),
|
|
157986
|
-
/*
|
|
158570
|
+
/* 1119 */
|
|
157987
158571
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
157988
158572
|
|
|
157989
158573
|
"use strict";
|
|
@@ -157992,7 +158576,7 @@ exports.RowMoveAction = RowMoveAction;
|
|
|
157992
158576
|
var _interopRequireDefault = __webpack_require__(197);
|
|
157993
158577
|
exports.__esModule = true;
|
|
157994
158578
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(510));
|
|
157995
|
-
var _base = __webpack_require__(
|
|
158579
|
+
var _base = __webpack_require__(1107);
|
|
157996
158580
|
/**
|
|
157997
158581
|
* Action that tracks changes in merged cells.
|
|
157998
158582
|
*
|
|
@@ -158046,7 +158630,741 @@ class UnmergeCellsAction extends _base.BaseAction {
|
|
|
158046
158630
|
exports.UnmergeCellsAction = UnmergeCellsAction;
|
|
158047
158631
|
|
|
158048
158632
|
/***/ }),
|
|
158049
|
-
/*
|
|
158633
|
+
/* 1120 */
|
|
158634
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
158635
|
+
|
|
158636
|
+
"use strict";
|
|
158637
|
+
|
|
158638
|
+
|
|
158639
|
+
exports.__esModule = true;
|
|
158640
|
+
var _dialog = __webpack_require__(1121);
|
|
158641
|
+
exports.PLUGIN_KEY = _dialog.PLUGIN_KEY;
|
|
158642
|
+
exports.PLUGIN_PRIORITY = _dialog.PLUGIN_PRIORITY;
|
|
158643
|
+
exports.Dialog = _dialog.Dialog;
|
|
158644
|
+
|
|
158645
|
+
/***/ }),
|
|
158646
|
+
/* 1121 */
|
|
158647
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
158648
|
+
|
|
158649
|
+
"use strict";
|
|
158650
|
+
|
|
158651
|
+
|
|
158652
|
+
exports.__esModule = true;
|
|
158653
|
+
__webpack_require__(201);
|
|
158654
|
+
var _base = __webpack_require__(854);
|
|
158655
|
+
var _ui2 = __webpack_require__(1122);
|
|
158656
|
+
var _focusDetector2 = __webpack_require__(746);
|
|
158657
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
158658
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
158659
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
158660
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
158661
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
158662
|
+
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"); }
|
|
158663
|
+
const PLUGIN_KEY = exports.PLUGIN_KEY = 'dialog';
|
|
158664
|
+
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 340;
|
|
158665
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
158666
|
+
const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
|
|
158667
|
+
|
|
158668
|
+
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
158669
|
+
/**
|
|
158670
|
+
* @plugin Dialog
|
|
158671
|
+
* @class Dialog
|
|
158672
|
+
*
|
|
158673
|
+
* @description
|
|
158674
|
+
* The dialog plugin provides a modal dialog system for Handsontable. It allows you to display custom content in modal dialogs
|
|
158675
|
+
* that overlay the table, providing a way to show notifications, error messages, loading indicators, or any other interactive content.
|
|
158676
|
+
*
|
|
158677
|
+
* In order to enable the dialog mechanism, {@link Options#dialog} option must be set to `true`.
|
|
158678
|
+
*
|
|
158679
|
+
* The plugin provides several configuration options to customize the dialog behavior and appearance:
|
|
158680
|
+
* - `content`: The string or HTMLElement content to display in the dialog (default: '')
|
|
158681
|
+
* - `customClassName`: Custom class name to apply to the dialog (default: '')
|
|
158682
|
+
* - `background`: Dialog background variant 'solid' | 'semi-transparent' (default: 'solid')
|
|
158683
|
+
* - `contentBackground`: Whether to show content background (default: false)
|
|
158684
|
+
* - `contentDirections`: Content layout direction 'row' | 'row-reverse' | 'column' | 'column-reverse' (default: 'row')
|
|
158685
|
+
* - `animation`: Whether to enable animations (default: true)
|
|
158686
|
+
* - `closable`: Whether the dialog can be closed (default: false)
|
|
158687
|
+
*
|
|
158688
|
+
* @example
|
|
158689
|
+
*
|
|
158690
|
+
* ::: only-for javascript
|
|
158691
|
+
* ```js
|
|
158692
|
+
* // Enable dialog plugin with default options
|
|
158693
|
+
* dialog: true,
|
|
158694
|
+
*
|
|
158695
|
+
* // Enable dialog plugin with custom configuration
|
|
158696
|
+
* dialog: {
|
|
158697
|
+
* content: 'Dialog content',
|
|
158698
|
+
* customClassName: 'custom-dialog',
|
|
158699
|
+
* background: 'semi-transparent',
|
|
158700
|
+
* contentBackground: false,
|
|
158701
|
+
* contentDirections: 'column',
|
|
158702
|
+
* animation: false,
|
|
158703
|
+
* closable: true,
|
|
158704
|
+
* }
|
|
158705
|
+
*
|
|
158706
|
+
* // Access to dialog plugin instance:
|
|
158707
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
|
158708
|
+
*
|
|
158709
|
+
* // Show a dialog programmatically:
|
|
158710
|
+
* dialogPlugin.show({
|
|
158711
|
+
* content: '<h2>Custom Dialog</h2><p>This is a custom dialog content.</p>',
|
|
158712
|
+
* closable: true,
|
|
158713
|
+
* contentDirections: 'column',
|
|
158714
|
+
* });
|
|
158715
|
+
*
|
|
158716
|
+
* // Hide the dialog programmatically:
|
|
158717
|
+
* dialogPlugin.hide();
|
|
158718
|
+
*
|
|
158719
|
+
* // Check if dialog is visible:
|
|
158720
|
+
* const isVisible = dialogPlugin.isVisible();
|
|
158721
|
+
* ```
|
|
158722
|
+
* :::
|
|
158723
|
+
*
|
|
158724
|
+
* ::: only-for react
|
|
158725
|
+
* ```jsx
|
|
158726
|
+
* const MyComponent = () => {
|
|
158727
|
+
* const hotRef = useRef(null);
|
|
158728
|
+
*
|
|
158729
|
+
* useEffect(() => {
|
|
158730
|
+
* const hot = hotRef.current.hotInstance;
|
|
158731
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
|
158732
|
+
*
|
|
158733
|
+
* dialogPlugin.show({
|
|
158734
|
+
* content: <div>
|
|
158735
|
+
* <h2>React Dialog</h2>
|
|
158736
|
+
* <p>Dialog content rendered with React</p>
|
|
158737
|
+
* </div>,
|
|
158738
|
+
* closable: true
|
|
158739
|
+
* });
|
|
158740
|
+
* }, []);
|
|
158741
|
+
*
|
|
158742
|
+
* return (
|
|
158743
|
+
* <HotTable
|
|
158744
|
+
* ref={hotRef}
|
|
158745
|
+
* settings={{
|
|
158746
|
+
* data: data,
|
|
158747
|
+
* dialog: {
|
|
158748
|
+
* customClassName: 'react-dialog',
|
|
158749
|
+
* contentDirections: 'column',
|
|
158750
|
+
* closable: true
|
|
158751
|
+
* }
|
|
158752
|
+
* }}
|
|
158753
|
+
* />
|
|
158754
|
+
* );
|
|
158755
|
+
* }
|
|
158756
|
+
* ```
|
|
158757
|
+
* :::
|
|
158758
|
+
*
|
|
158759
|
+
* ::: only-for angular
|
|
158760
|
+
* ```html
|
|
158761
|
+
* <hot-table
|
|
158762
|
+
* [settings]="hotSettings">
|
|
158763
|
+
* </hot-table>
|
|
158764
|
+
* ```
|
|
158765
|
+
*
|
|
158766
|
+
* ```ts
|
|
158767
|
+
* @Component({
|
|
158768
|
+
* // ... component decorator
|
|
158769
|
+
* })
|
|
158770
|
+
* export class MyComponent implements OnInit {
|
|
158771
|
+
* @ViewChild('hot') hot: HotTableComponent;
|
|
158772
|
+
*
|
|
158773
|
+
* hotSettings: Handsontable.GridSettings = {
|
|
158774
|
+
* data: data,
|
|
158775
|
+
* dialog: {
|
|
158776
|
+
* customClassName: 'angular-dialog',
|
|
158777
|
+
* contentDirections: 'column',
|
|
158778
|
+
* closable: true
|
|
158779
|
+
* }
|
|
158780
|
+
* };
|
|
158781
|
+
*
|
|
158782
|
+
* ngOnInit() {
|
|
158783
|
+
* const dialogPlugin = this.hot.hotInstance.getPlugin('dialog');
|
|
158784
|
+
*
|
|
158785
|
+
* dialogPlugin.show({
|
|
158786
|
+
* content: `
|
|
158787
|
+
* <div>
|
|
158788
|
+
* <h2>Angular Dialog</h2>
|
|
158789
|
+
* <p>Dialog content in Angular component</p>
|
|
158790
|
+
* </div>
|
|
158791
|
+
* `,
|
|
158792
|
+
* closable: true
|
|
158793
|
+
* });
|
|
158794
|
+
* }
|
|
158795
|
+
* }
|
|
158796
|
+
* ```
|
|
158797
|
+
* :::
|
|
158798
|
+
*/
|
|
158799
|
+
var _ui = /*#__PURE__*/new WeakMap();
|
|
158800
|
+
var _isVisible = /*#__PURE__*/new WeakMap();
|
|
158801
|
+
var _focusDetector = /*#__PURE__*/new WeakMap();
|
|
158802
|
+
var _selectionState = /*#__PURE__*/new WeakMap();
|
|
158803
|
+
var _Dialog_brand = /*#__PURE__*/new WeakSet();
|
|
158804
|
+
class Dialog extends _base.BasePlugin {
|
|
158805
|
+
constructor() {
|
|
158806
|
+
super(...arguments);
|
|
158807
|
+
/**
|
|
158808
|
+
* Register shortcuts responsible for closing the dialog and navigating through the dialog.
|
|
158809
|
+
*/
|
|
158810
|
+
_classPrivateMethodInitSpec(this, _Dialog_brand);
|
|
158811
|
+
/**
|
|
158812
|
+
* UI instance of the dialog plugin.
|
|
158813
|
+
*
|
|
158814
|
+
* @type {DialogUI}
|
|
158815
|
+
*/
|
|
158816
|
+
_classPrivateFieldInitSpec(this, _ui, null);
|
|
158817
|
+
/**
|
|
158818
|
+
* Flag indicating if dialog is currently visible.
|
|
158819
|
+
*
|
|
158820
|
+
* @type {boolean}
|
|
158821
|
+
*/
|
|
158822
|
+
_classPrivateFieldInitSpec(this, _isVisible, false);
|
|
158823
|
+
/**
|
|
158824
|
+
* Focus detector instance.
|
|
158825
|
+
*
|
|
158826
|
+
* @type {FocusDetector}
|
|
158827
|
+
*/
|
|
158828
|
+
_classPrivateFieldInitSpec(this, _focusDetector, null);
|
|
158829
|
+
/**
|
|
158830
|
+
* Keeps the selection state that will be restored after the dialog is closed.
|
|
158831
|
+
*
|
|
158832
|
+
* @type {SelectionState | null}
|
|
158833
|
+
*/
|
|
158834
|
+
_classPrivateFieldInitSpec(this, _selectionState, null);
|
|
158835
|
+
}
|
|
158836
|
+
static get PLUGIN_KEY() {
|
|
158837
|
+
return PLUGIN_KEY;
|
|
158838
|
+
}
|
|
158839
|
+
static get PLUGIN_PRIORITY() {
|
|
158840
|
+
return PLUGIN_PRIORITY;
|
|
158841
|
+
}
|
|
158842
|
+
static get DEFAULT_SETTINGS() {
|
|
158843
|
+
return {
|
|
158844
|
+
content: '',
|
|
158845
|
+
customClassName: '',
|
|
158846
|
+
background: 'solid',
|
|
158847
|
+
contentBackground: false,
|
|
158848
|
+
contentDirections: 'row',
|
|
158849
|
+
animation: true,
|
|
158850
|
+
closable: false
|
|
158851
|
+
};
|
|
158852
|
+
}
|
|
158853
|
+
static get SETTINGS_VALIDATORS() {
|
|
158854
|
+
return {
|
|
158855
|
+
content: value => typeof value === 'string' || typeof HTMLElement !== 'undefined' && value instanceof HTMLElement || typeof DocumentFragment !== 'undefined' && value instanceof DocumentFragment,
|
|
158856
|
+
customClassName: value => typeof value === 'string',
|
|
158857
|
+
background: value => ['solid', 'semi-transparent'].includes(value),
|
|
158858
|
+
contentBackground: value => typeof value === 'boolean',
|
|
158859
|
+
contentDirections: value => ['row', 'row-reverse', 'column', 'column-reverse'].includes(value),
|
|
158860
|
+
animation: value => typeof value === 'boolean',
|
|
158861
|
+
closable: value => typeof value === 'boolean'
|
|
158862
|
+
};
|
|
158863
|
+
}
|
|
158864
|
+
/**
|
|
158865
|
+
* Check if the plugin is enabled in the handsontable settings.
|
|
158866
|
+
*
|
|
158867
|
+
* @returns {boolean}
|
|
158868
|
+
*/
|
|
158869
|
+
isEnabled() {
|
|
158870
|
+
return !!this.hot.getSettings()[PLUGIN_KEY];
|
|
158871
|
+
}
|
|
158872
|
+
|
|
158873
|
+
/**
|
|
158874
|
+
* Enable plugin for this Handsontable instance.
|
|
158875
|
+
*/
|
|
158876
|
+
enablePlugin() {
|
|
158877
|
+
if (this.enabled) {
|
|
158878
|
+
return;
|
|
158879
|
+
}
|
|
158880
|
+
if (!_classPrivateFieldGet(_ui, this)) {
|
|
158881
|
+
_classPrivateFieldSet(_ui, this, new _ui2.DialogUI({
|
|
158882
|
+
rootElement: this.hot.rootGridElement,
|
|
158883
|
+
isRtl: this.hot.isRtl()
|
|
158884
|
+
}));
|
|
158885
|
+
_classPrivateFieldGet(_ui, this).addLocalHook('clickDialogElement', () => _assertClassBrand(_Dialog_brand, this, _onDialogClick).call(this));
|
|
158886
|
+
_classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getDialogElement(), {
|
|
158887
|
+
onFocus: from => {
|
|
158888
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
158889
|
+
this.hot.runHooks('afterDialogFocus', `tab_${from}`);
|
|
158890
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
|
158891
|
+
this.hot.listen();
|
|
158892
|
+
}
|
|
158893
|
+
}));
|
|
158894
|
+
}
|
|
158895
|
+
_assertClassBrand(_Dialog_brand, this, _registerShortcuts).call(this);
|
|
158896
|
+
this.addHook('modifyFocusOnTabNavigation', from => _assertClassBrand(_Dialog_brand, this, _onFocusTabNavigation).call(this, from), 1);
|
|
158897
|
+
this.addHook('afterViewRender', () => _assertClassBrand(_Dialog_brand, this, _onAfterRender).call(this));
|
|
158898
|
+
super.enablePlugin();
|
|
158899
|
+
}
|
|
158900
|
+
|
|
158901
|
+
/**
|
|
158902
|
+
* Update plugin state after Handsontable settings update.
|
|
158903
|
+
*/
|
|
158904
|
+
updatePlugin() {
|
|
158905
|
+
this.disablePlugin();
|
|
158906
|
+
this.enablePlugin();
|
|
158907
|
+
super.updatePlugin();
|
|
158908
|
+
}
|
|
158909
|
+
|
|
158910
|
+
/**
|
|
158911
|
+
* Disable plugin for this Handsontable instance.
|
|
158912
|
+
*/
|
|
158913
|
+
disablePlugin() {
|
|
158914
|
+
this.hide();
|
|
158915
|
+
_assertClassBrand(_Dialog_brand, this, _unregisterShortcuts).call(this);
|
|
158916
|
+
super.disablePlugin();
|
|
158917
|
+
}
|
|
158918
|
+
/**
|
|
158919
|
+
* Check if the dialog is currently visible.
|
|
158920
|
+
*
|
|
158921
|
+
* @returns {boolean} True if the dialog is visible, false otherwise.
|
|
158922
|
+
*/
|
|
158923
|
+
isVisible() {
|
|
158924
|
+
return _classPrivateFieldGet(_isVisible, this);
|
|
158925
|
+
}
|
|
158926
|
+
|
|
158927
|
+
/**
|
|
158928
|
+
* Show dialog with given configuration.
|
|
158929
|
+
* Displays the dialog with the specified content and options.
|
|
158930
|
+
*
|
|
158931
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
|
158932
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
|
158933
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
|
158934
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
|
158935
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
|
158936
|
+
* @param {'row'|'row-reverse'|'column'|'column-reverse'} options.contentDirections Content layout direction. Default: 'row'.
|
|
158937
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
|
158938
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
|
158939
|
+
*/
|
|
158940
|
+
show() {
|
|
158941
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
158942
|
+
if (!this.enabled) {
|
|
158943
|
+
return;
|
|
158944
|
+
}
|
|
158945
|
+
if (this.isVisible()) {
|
|
158946
|
+
this.update(options);
|
|
158947
|
+
return;
|
|
158948
|
+
}
|
|
158949
|
+
this.hot.runHooks('beforeDialogShow');
|
|
158950
|
+
this.update(options);
|
|
158951
|
+
_classPrivateFieldGet(_ui, this).showDialog(this.getSetting('animation'));
|
|
158952
|
+
_classPrivateFieldSet(_isVisible, this, true);
|
|
158953
|
+
_classPrivateFieldSet(_selectionState, this, this.hot.selection.exportSelection());
|
|
158954
|
+
this.hot.deselectCell();
|
|
158955
|
+
this.hot.runHooks('afterDialogShow');
|
|
158956
|
+
const {
|
|
158957
|
+
activeElement
|
|
158958
|
+
} = this.hot.rootDocument;
|
|
158959
|
+
if (this.hot.rootWrapperElement.contains(activeElement) || this.hot.rootPortalElement.contains(activeElement)) {
|
|
158960
|
+
this.hot.unlisten();
|
|
158961
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
158962
|
+
this.hot.listen();
|
|
158963
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
158964
|
+
this.hot.runHooks('afterDialogFocus', 'show');
|
|
158965
|
+
}
|
|
158966
|
+
}
|
|
158967
|
+
|
|
158968
|
+
/**
|
|
158969
|
+
* Hide the currently open dialog.
|
|
158970
|
+
* Closes the dialog and restores the focus to the table.
|
|
158971
|
+
*/
|
|
158972
|
+
hide() {
|
|
158973
|
+
if (!this.isVisible()) {
|
|
158974
|
+
return;
|
|
158975
|
+
}
|
|
158976
|
+
this.hot.runHooks('beforeDialogHide');
|
|
158977
|
+
_classPrivateFieldGet(_ui, this).hideDialog(this.getSetting('animation'));
|
|
158978
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
|
158979
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
|
158980
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
158981
|
+
if (_classPrivateFieldGet(_selectionState, this)) {
|
|
158982
|
+
this.hot.selection.importSelection(_classPrivateFieldGet(_selectionState, this));
|
|
158983
|
+
this.hot.view.render();
|
|
158984
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
|
158985
|
+
} else {
|
|
158986
|
+
this.hot.selectCell(0, 0);
|
|
158987
|
+
}
|
|
158988
|
+
this.hot.runHooks('afterDialogHide');
|
|
158989
|
+
}
|
|
158990
|
+
|
|
158991
|
+
/**
|
|
158992
|
+
* Update the dialog configuration.
|
|
158993
|
+
*
|
|
158994
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
|
158995
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
|
158996
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
|
158997
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
|
158998
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
|
158999
|
+
* @param {'row'|'row-reverse'|'column'|'column-reverse'} options.contentDirections Content layout direction. Default: 'row'.
|
|
159000
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
|
159001
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
|
159002
|
+
*/
|
|
159003
|
+
update(options) {
|
|
159004
|
+
if (!this.enabled) {
|
|
159005
|
+
return;
|
|
159006
|
+
}
|
|
159007
|
+
this.updatePluginSettings(options);
|
|
159008
|
+
_classPrivateFieldGet(_ui, this).updateDialog({
|
|
159009
|
+
isVisible: this.isVisible(),
|
|
159010
|
+
content: this.getSetting('content'),
|
|
159011
|
+
customClassName: this.getSetting('customClassName'),
|
|
159012
|
+
background: this.getSetting('background'),
|
|
159013
|
+
contentBackground: this.getSetting('contentBackground'),
|
|
159014
|
+
contentDirections: this.getSetting('contentDirections'),
|
|
159015
|
+
animation: this.getSetting('animation')
|
|
159016
|
+
});
|
|
159017
|
+
}
|
|
159018
|
+
|
|
159019
|
+
/**
|
|
159020
|
+
* Handle focus tab navigation event.
|
|
159021
|
+
*
|
|
159022
|
+
* @param {'from_above' | 'from_below'} from The direction from which the focus was modified.
|
|
159023
|
+
* @returns {boolean} Returns `false` to prevent the default focus behavior.
|
|
159024
|
+
*/
|
|
159025
|
+
|
|
159026
|
+
/**
|
|
159027
|
+
* Destroy dialog and reset plugin state.
|
|
159028
|
+
*/
|
|
159029
|
+
destroy() {
|
|
159030
|
+
var _classPrivateFieldGet2;
|
|
159031
|
+
(_classPrivateFieldGet2 = _classPrivateFieldGet(_ui, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.destroyDialog();
|
|
159032
|
+
_classPrivateFieldSet(_ui, this, null);
|
|
159033
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
|
159034
|
+
_classPrivateFieldSet(_focusDetector, this, null);
|
|
159035
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
|
159036
|
+
super.destroy();
|
|
159037
|
+
}
|
|
159038
|
+
}
|
|
159039
|
+
exports.Dialog = Dialog;
|
|
159040
|
+
function _registerShortcuts() {
|
|
159041
|
+
var _manager$getContext;
|
|
159042
|
+
const manager = this.hot.getShortcutManager();
|
|
159043
|
+
const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME);
|
|
159044
|
+
pluginContext.addShortcut({
|
|
159045
|
+
keys: [['Escape']],
|
|
159046
|
+
callback: () => {
|
|
159047
|
+
this.hide();
|
|
159048
|
+
},
|
|
159049
|
+
runOnlyIf: () => _classPrivateFieldGet(_isVisible, this) && this.getSetting('closable'),
|
|
159050
|
+
group: SHORTCUTS_GROUP
|
|
159051
|
+
});
|
|
159052
|
+
pluginContext.addShortcut({
|
|
159053
|
+
keys: [['Shift', 'Tab'], ['Tab']],
|
|
159054
|
+
preventDefault: false,
|
|
159055
|
+
callback: event => {
|
|
159056
|
+
this.hot._registerTimeout(() => {
|
|
159057
|
+
const {
|
|
159058
|
+
activeElement
|
|
159059
|
+
} = this.hot.rootDocument;
|
|
159060
|
+
if (!_classPrivateFieldGet(_ui, this).isInsideDialog(activeElement)) {
|
|
159061
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
159062
|
+
this.hot.unlisten();
|
|
159063
|
+
return;
|
|
159064
|
+
}
|
|
159065
|
+
if (event.shiftKey) {
|
|
159066
|
+
this.hot.runHooks('dialogFocusPreviousElement');
|
|
159067
|
+
} else {
|
|
159068
|
+
this.hot.runHooks('dialogFocusNextElement');
|
|
159069
|
+
}
|
|
159070
|
+
}, 0);
|
|
159071
|
+
},
|
|
159072
|
+
group: SHORTCUTS_GROUP
|
|
159073
|
+
});
|
|
159074
|
+
}
|
|
159075
|
+
/**
|
|
159076
|
+
* Unregister shortcuts responsible for closing the dialog and navigating through the dialog.
|
|
159077
|
+
*/
|
|
159078
|
+
function _unregisterShortcuts() {
|
|
159079
|
+
const shortcutManager = this.hot.getShortcutManager();
|
|
159080
|
+
const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
|
|
159081
|
+
pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
|
|
159082
|
+
}
|
|
159083
|
+
function _onFocusTabNavigation(from) {
|
|
159084
|
+
if (this.isVisible()) {
|
|
159085
|
+
_classPrivateFieldGet(_focusDetector, this).focus(from);
|
|
159086
|
+
return false;
|
|
159087
|
+
}
|
|
159088
|
+
}
|
|
159089
|
+
/**
|
|
159090
|
+
* Handle dialog click event.
|
|
159091
|
+
*/
|
|
159092
|
+
function _onDialogClick() {
|
|
159093
|
+
if (this.isVisible() && !this.hot.isListening()) {
|
|
159094
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
|
159095
|
+
this.hot.runHooks('afterDialogFocus', 'click');
|
|
159096
|
+
}
|
|
159097
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
|
159098
|
+
this.hot.listen();
|
|
159099
|
+
}
|
|
159100
|
+
/**
|
|
159101
|
+
* Called after the rendering of the table is completed. It updates the width and
|
|
159102
|
+
* height of the dialog container to the same size as the table.
|
|
159103
|
+
*/
|
|
159104
|
+
function _onAfterRender() {
|
|
159105
|
+
const {
|
|
159106
|
+
view,
|
|
159107
|
+
rootWrapperElement,
|
|
159108
|
+
rootWindow
|
|
159109
|
+
} = this.hot;
|
|
159110
|
+
const width = view.isHorizontallyScrollableByWindow() ? view.getTotalTableWidth() : view.getWorkspaceWidth();
|
|
159111
|
+
_classPrivateFieldGet(_ui, this).updateWidth(width);
|
|
159112
|
+
const dialogInfo = rootWrapperElement.querySelector('.hot-display-license-info');
|
|
159113
|
+
if (dialogInfo) {
|
|
159114
|
+
const height = dialogInfo.offsetHeight;
|
|
159115
|
+
const marginTop = parseFloat(rootWindow.getComputedStyle(dialogInfo).marginTop);
|
|
159116
|
+
_classPrivateFieldGet(_ui, this).updateHeight(height + marginTop);
|
|
159117
|
+
}
|
|
159118
|
+
}
|
|
159119
|
+
|
|
159120
|
+
/***/ }),
|
|
159121
|
+
/* 1122 */
|
|
159122
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
159123
|
+
|
|
159124
|
+
"use strict";
|
|
159125
|
+
|
|
159126
|
+
|
|
159127
|
+
var _interopRequireDefault = __webpack_require__(197);
|
|
159128
|
+
exports.__esModule = true;
|
|
159129
|
+
__webpack_require__(201);
|
|
159130
|
+
var _templateLiteralTag = __webpack_require__(498);
|
|
159131
|
+
var _object = __webpack_require__(504);
|
|
159132
|
+
var _localHooks = _interopRequireDefault(__webpack_require__(608));
|
|
159133
|
+
var _element = __webpack_require__(355);
|
|
159134
|
+
var _a11y = __webpack_require__(502);
|
|
159135
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
159136
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
159137
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
159138
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
159139
|
+
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"); }
|
|
159140
|
+
const DIALOG_CLASS_NAME = 'ht-dialog';
|
|
159141
|
+
const TEMPLATE = `
|
|
159142
|
+
<div data-ref="dialogElement" class="${DIALOG_CLASS_NAME}">
|
|
159143
|
+
<div data-ref="contentWrapperElement" class="${DIALOG_CLASS_NAME}__content-wrapper">
|
|
159144
|
+
<div data-ref="contentElement" class="${DIALOG_CLASS_NAME}__content"></div>
|
|
159145
|
+
</div>
|
|
159146
|
+
</div>
|
|
159147
|
+
`;
|
|
159148
|
+
|
|
159149
|
+
/**
|
|
159150
|
+
* DialogUI is a UI component that renders and manages dialog elements.
|
|
159151
|
+
* It handles dialog creation, content updates, visibility toggling, and styling.
|
|
159152
|
+
*
|
|
159153
|
+
* @private
|
|
159154
|
+
* @class DialogUI
|
|
159155
|
+
*/
|
|
159156
|
+
var _rootElement = /*#__PURE__*/new WeakMap();
|
|
159157
|
+
var _refs = /*#__PURE__*/new WeakMap();
|
|
159158
|
+
var _isRtl = /*#__PURE__*/new WeakMap();
|
|
159159
|
+
class DialogUI {
|
|
159160
|
+
constructor(_ref) {
|
|
159161
|
+
let {
|
|
159162
|
+
rootElement,
|
|
159163
|
+
isRtl
|
|
159164
|
+
} = _ref;
|
|
159165
|
+
/**
|
|
159166
|
+
* The root element where the dialog UI will be installed.
|
|
159167
|
+
*
|
|
159168
|
+
* @type {HTMLElement}
|
|
159169
|
+
*/
|
|
159170
|
+
_classPrivateFieldInitSpec(this, _rootElement, void 0);
|
|
159171
|
+
/**
|
|
159172
|
+
* The references to the UI elements.
|
|
159173
|
+
*
|
|
159174
|
+
* @type {object}
|
|
159175
|
+
*/
|
|
159176
|
+
_classPrivateFieldInitSpec(this, _refs, void 0);
|
|
159177
|
+
/**
|
|
159178
|
+
* Indicates if the UI is in RTL mode.
|
|
159179
|
+
*
|
|
159180
|
+
* @type {boolean}
|
|
159181
|
+
*/
|
|
159182
|
+
_classPrivateFieldInitSpec(this, _isRtl, false);
|
|
159183
|
+
_classPrivateFieldSet(_rootElement, this, rootElement);
|
|
159184
|
+
_classPrivateFieldSet(_isRtl, this, isRtl);
|
|
159185
|
+
this.install();
|
|
159186
|
+
}
|
|
159187
|
+
|
|
159188
|
+
/**
|
|
159189
|
+
* Creates the dialog UI elements and sets up the structure.
|
|
159190
|
+
*/
|
|
159191
|
+
install() {
|
|
159192
|
+
var _classPrivateFieldGet2;
|
|
159193
|
+
if ((_classPrivateFieldGet2 = _classPrivateFieldGet(_refs, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.dialogElement) {
|
|
159194
|
+
return;
|
|
159195
|
+
}
|
|
159196
|
+
const elements = (0, _templateLiteralTag.html)`${TEMPLATE}`;
|
|
159197
|
+
_classPrivateFieldSet(_refs, this, elements.refs);
|
|
159198
|
+
const {
|
|
159199
|
+
dialogElement
|
|
159200
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
159201
|
+
dialogElement.addEventListener('click', () => this.runLocalHooks('clickDialogElement'));
|
|
159202
|
+
|
|
159203
|
+
// Set ARIA attributes
|
|
159204
|
+
(0, _element.setAttribute)(dialogElement, [(0, _a11y.A11Y_DIALOG)(), (0, _a11y.A11Y_MODAL)(), (0, _a11y.A11Y_TABINDEX)(-1), ['dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr']]);
|
|
159205
|
+
|
|
159206
|
+
// Append to Handsontable after table grid element
|
|
159207
|
+
_classPrivateFieldGet(_rootElement, this).after(elements.fragment);
|
|
159208
|
+
}
|
|
159209
|
+
|
|
159210
|
+
/**
|
|
159211
|
+
* Returns the dialog element.
|
|
159212
|
+
*
|
|
159213
|
+
* @returns {HTMLElement} The dialog element.
|
|
159214
|
+
*/
|
|
159215
|
+
getDialogElement() {
|
|
159216
|
+
return _classPrivateFieldGet(_refs, this).dialogElement;
|
|
159217
|
+
}
|
|
159218
|
+
|
|
159219
|
+
/**
|
|
159220
|
+
* Checks if the given element is inside the dialog.
|
|
159221
|
+
*
|
|
159222
|
+
* @param {HTMLElement} element - The element to check.
|
|
159223
|
+
* @returns {boolean} Returns `true` if the element is inside the dialog, `false` otherwise.
|
|
159224
|
+
*/
|
|
159225
|
+
isInsideDialog(element) {
|
|
159226
|
+
return _classPrivateFieldGet(_refs, this).dialogElement.contains(element);
|
|
159227
|
+
}
|
|
159228
|
+
|
|
159229
|
+
/**
|
|
159230
|
+
* Updates the dialog content and class name.
|
|
159231
|
+
*
|
|
159232
|
+
* @param {object} options - Class name update options.
|
|
159233
|
+
* @param {boolean} options.isVisible - Whether the dialog is visible.
|
|
159234
|
+
* @param {string|HTMLElement} options.content - The content to render in the dialog.
|
|
159235
|
+
* @param {string} options.customClassName - The custom class name to add to the dialog.
|
|
159236
|
+
* @param {string} options.background - The background to add to the dialog.
|
|
159237
|
+
* @param {boolean} options.contentBackground - Whether to show content background.
|
|
159238
|
+
* @param {string} options.contentDirections - The flex direction for content layout.
|
|
159239
|
+
* @param {boolean} options.animation - Whether to add the animation class to the dialog.
|
|
159240
|
+
*
|
|
159241
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
159242
|
+
*/
|
|
159243
|
+
updateDialog(_ref2) {
|
|
159244
|
+
let {
|
|
159245
|
+
isVisible,
|
|
159246
|
+
content,
|
|
159247
|
+
customClassName,
|
|
159248
|
+
background,
|
|
159249
|
+
contentBackground,
|
|
159250
|
+
contentDirections,
|
|
159251
|
+
animation
|
|
159252
|
+
} = _ref2;
|
|
159253
|
+
const {
|
|
159254
|
+
dialogElement,
|
|
159255
|
+
contentElement
|
|
159256
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
159257
|
+
|
|
159258
|
+
// Dialog class name
|
|
159259
|
+
const customClass = customClassName ? ` ${customClassName}` : '';
|
|
159260
|
+
const backgroundClass = background ? ` ${DIALOG_CLASS_NAME}--background-${background}` : '';
|
|
159261
|
+
const animationClass = animation ? ` ${DIALOG_CLASS_NAME}--animation` : '';
|
|
159262
|
+
const showClass = isVisible ? ` ${DIALOG_CLASS_NAME}--show` : '';
|
|
159263
|
+
|
|
159264
|
+
// Update dialog class name
|
|
159265
|
+
dialogElement.className = `${DIALOG_CLASS_NAME}${customClass}${backgroundClass}${animationClass}${showClass}`;
|
|
159266
|
+
|
|
159267
|
+
// Dialog content class name
|
|
159268
|
+
const contentBackgroundClass = contentBackground ? ` ${DIALOG_CLASS_NAME}__content--background` : '';
|
|
159269
|
+
const contentDirectionsClass = contentDirections ? ` ${DIALOG_CLASS_NAME}__content--flex-${contentDirections}` : '';
|
|
159270
|
+
|
|
159271
|
+
// Update content class name
|
|
159272
|
+
contentElement.className = `${DIALOG_CLASS_NAME}__content${contentBackgroundClass}${contentDirectionsClass}`;
|
|
159273
|
+
|
|
159274
|
+
// Clear existing dialog content
|
|
159275
|
+
contentElement.innerHTML = '';
|
|
159276
|
+
|
|
159277
|
+
// Render new dialog content
|
|
159278
|
+
if (typeof content === 'string') {
|
|
159279
|
+
(0, _element.fastInnerHTML)(contentElement, content);
|
|
159280
|
+
} else if (content instanceof HTMLElement || content instanceof DocumentFragment) {
|
|
159281
|
+
contentElement.appendChild(content);
|
|
159282
|
+
}
|
|
159283
|
+
return this;
|
|
159284
|
+
}
|
|
159285
|
+
|
|
159286
|
+
/**
|
|
159287
|
+
* Shows the dialog with optional animation.
|
|
159288
|
+
*
|
|
159289
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
|
159290
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
159291
|
+
*/
|
|
159292
|
+
showDialog(animation) {
|
|
159293
|
+
const {
|
|
159294
|
+
dialogElement
|
|
159295
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
159296
|
+
dialogElement.style.display = 'block';
|
|
159297
|
+
if (animation) {
|
|
159298
|
+
// Triggers style and layout recalculation, so the display: block is fully committed before adding
|
|
159299
|
+
// the class ht-dialog--show.
|
|
159300
|
+
// eslint-disable-next-line no-unused-expressions
|
|
159301
|
+
dialogElement.offsetHeight;
|
|
159302
|
+
}
|
|
159303
|
+
(0, _element.addClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
|
159304
|
+
return this;
|
|
159305
|
+
}
|
|
159306
|
+
|
|
159307
|
+
/**
|
|
159308
|
+
* Hides the dialog with optional animation.
|
|
159309
|
+
*
|
|
159310
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
|
159311
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
159312
|
+
*/
|
|
159313
|
+
hideDialog(animation) {
|
|
159314
|
+
const {
|
|
159315
|
+
dialogElement
|
|
159316
|
+
} = _classPrivateFieldGet(_refs, this);
|
|
159317
|
+
(0, _element.removeClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
|
159318
|
+
if (animation) {
|
|
159319
|
+
dialogElement.addEventListener('transitionend', () => {
|
|
159320
|
+
if (!(0, _element.hasClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`)) {
|
|
159321
|
+
dialogElement.style.display = 'none';
|
|
159322
|
+
}
|
|
159323
|
+
}, {
|
|
159324
|
+
once: true
|
|
159325
|
+
});
|
|
159326
|
+
} else {
|
|
159327
|
+
dialogElement.style.display = 'none';
|
|
159328
|
+
}
|
|
159329
|
+
return this;
|
|
159330
|
+
}
|
|
159331
|
+
|
|
159332
|
+
/**
|
|
159333
|
+
* Updates the width of the dialog container to the same size as the table.
|
|
159334
|
+
*
|
|
159335
|
+
* @param {number} width - The width of the table.
|
|
159336
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
159337
|
+
*/
|
|
159338
|
+
updateWidth(width) {
|
|
159339
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.width = `${width}px`;
|
|
159340
|
+
return this;
|
|
159341
|
+
}
|
|
159342
|
+
|
|
159343
|
+
/**
|
|
159344
|
+
* Updates the height of the dialog container.
|
|
159345
|
+
*
|
|
159346
|
+
* @param {number} licenseInfoHeight - The height of the license info.
|
|
159347
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
|
159348
|
+
*/
|
|
159349
|
+
updateHeight(licenseInfoHeight) {
|
|
159350
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.height = `calc(100% - ${licenseInfoHeight}px)`;
|
|
159351
|
+
return this;
|
|
159352
|
+
}
|
|
159353
|
+
|
|
159354
|
+
/**
|
|
159355
|
+
* Removes the dialog UI elements from the DOM and clears the refs.
|
|
159356
|
+
*/
|
|
159357
|
+
destroyDialog() {
|
|
159358
|
+
var _classPrivateFieldGet3;
|
|
159359
|
+
(_classPrivateFieldGet3 = _classPrivateFieldGet(_refs, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.dialogElement.remove();
|
|
159360
|
+
_classPrivateFieldSet(_refs, this, null);
|
|
159361
|
+
}
|
|
159362
|
+
}
|
|
159363
|
+
exports.DialogUI = DialogUI;
|
|
159364
|
+
(0, _object.mixin)(DialogUI, _localHooks.default);
|
|
159365
|
+
|
|
159366
|
+
/***/ }),
|
|
159367
|
+
/* 1123 */
|
|
158050
159368
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
158051
159369
|
|
|
158052
159370
|
"use strict";
|