handsontable 16.1.1-next-895fbb8-20250923 → 16.2.0-next-216dbd0-20251112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/selection/border/border.js +19 -3
- package/3rdparty/walkontable/src/selection/border/border.mjs +19 -3
- package/CHANGELOG.md +40 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/coordsMapper/index.js +11 -0
- package/core/coordsMapper/index.mjs +1 -0
- package/core/hooks/bucket.js +7 -1
- package/core/hooks/bucket.mjs +7 -1
- package/core/hooks/constants.js +54 -0
- package/core/hooks/constants.mjs +54 -0
- package/core/hooks/index.d.ts +6 -0
- package/core/index.js +10 -4
- package/core/index.mjs +2 -1
- package/core.d.ts +3 -2
- package/core.js +67 -26
- package/core.mjs +56 -15
- package/dataMap/metaManager/metaSchema.js +197 -20
- package/dataMap/metaManager/metaSchema.mjs +197 -20
- package/dist/handsontable.css +175 -3
- package/dist/handsontable.full.css +175 -3
- package/dist/handsontable.full.js +10940 -8445
- package/dist/handsontable.full.min.css +5 -4
- package/dist/handsontable.full.min.js +193 -192
- package/dist/handsontable.js +6472 -4116
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +43 -42
- package/dist/languages/all.js +168 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +8 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +8 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +8 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +8 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +8 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +8 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +8 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +8 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +8 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +8 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +8 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +8 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +8 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +8 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +8 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +8 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +8 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +8 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +8 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +8 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +8 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editors/autocompleteEditor/autocompleteEditor.js +21 -1
- package/editors/autocompleteEditor/autocompleteEditor.mjs +22 -2
- package/focusManager/constants.js +25 -0
- package/focusManager/constants.mjs +22 -0
- package/focusManager/eventListener.js +107 -0
- package/focusManager/eventListener.mjs +103 -0
- package/{focusManager.d.ts → focusManager/grid.d.ts} +1 -1
- package/{focusManager.js → focusManager/grid.js} +48 -17
- package/{focusManager.mjs → focusManager/grid.mjs} +47 -16
- package/focusManager/index.d.ts +2 -0
- package/focusManager/index.js +20 -0
- package/focusManager/index.mjs +20 -0
- package/focusManager/scope.js +133 -0
- package/focusManager/scope.mjs +129 -0
- package/focusManager/scopeManager.d.ts +19 -0
- package/focusManager/scopeManager.js +268 -0
- package/focusManager/scopeManager.mjs +263 -0
- package/focusManager/scopes/grid.js +120 -0
- package/focusManager/scopes/grid.mjs +116 -0
- package/focusManager/scopes/index.js +13 -0
- package/focusManager/scopes/index.mjs +9 -0
- package/{utils → focusManager/utils}/focusDetector.js +21 -31
- package/{utils → focusManager/utils}/focusDetector.mjs +21 -31
- package/focusManager/utils/utils.js +95 -0
- package/focusManager/utils/utils.mjs +89 -0
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +2 -2
- package/helpers/dom/event.js +1 -1
- package/helpers/dom/event.mjs +1 -1
- package/helpers/mixed.js +2 -65
- package/helpers/mixed.mjs +2 -63
- package/i18n/constants.js +10 -1
- package/i18n/constants.mjs +10 -1
- package/i18n/languages/ar-AR.js +8 -1
- package/i18n/languages/ar-AR.mjs +8 -1
- package/i18n/languages/cs-CZ.js +8 -1
- package/i18n/languages/cs-CZ.mjs +8 -1
- package/i18n/languages/de-CH.js +8 -1
- package/i18n/languages/de-CH.mjs +8 -1
- package/i18n/languages/de-DE.js +8 -1
- package/i18n/languages/de-DE.mjs +8 -1
- package/i18n/languages/en-US.js +8 -1
- package/i18n/languages/en-US.mjs +8 -1
- package/i18n/languages/es-MX.js +8 -1
- package/i18n/languages/es-MX.mjs +8 -1
- package/i18n/languages/fa-IR.js +8 -1
- package/i18n/languages/fa-IR.mjs +8 -1
- package/i18n/languages/fr-FR.js +8 -1
- package/i18n/languages/fr-FR.mjs +8 -1
- package/i18n/languages/hr-HR.js +8 -1
- package/i18n/languages/hr-HR.mjs +8 -1
- package/i18n/languages/it-IT.js +8 -1
- package/i18n/languages/it-IT.mjs +8 -1
- package/i18n/languages/ja-JP.js +8 -1
- package/i18n/languages/ja-JP.mjs +8 -1
- package/i18n/languages/ko-KR.js +8 -1
- package/i18n/languages/ko-KR.mjs +8 -1
- package/i18n/languages/lv-LV.js +8 -1
- package/i18n/languages/lv-LV.mjs +8 -1
- package/i18n/languages/nb-NO.js +8 -1
- package/i18n/languages/nb-NO.mjs +8 -1
- package/i18n/languages/nl-NL.js +8 -1
- package/i18n/languages/nl-NL.mjs +8 -1
- package/i18n/languages/pl-PL.js +8 -1
- package/i18n/languages/pl-PL.mjs +8 -1
- package/i18n/languages/pt-BR.js +8 -1
- package/i18n/languages/pt-BR.mjs +8 -1
- package/i18n/languages/ru-RU.js +8 -1
- package/i18n/languages/ru-RU.mjs +8 -1
- package/i18n/languages/sr-SP.js +8 -1
- package/i18n/languages/sr-SP.mjs +8 -1
- package/i18n/languages/zh-CN.js +8 -1
- package/i18n/languages/zh-CN.mjs +8 -1
- package/i18n/languages/zh-TW.js +8 -1
- package/i18n/languages/zh-TW.mjs +8 -1
- package/index.d.ts +9 -0
- package/languages/all.js +168 -21
- package/languages/ar-AR.js +8 -1
- package/languages/ar-AR.mjs +8 -1
- package/languages/cs-CZ.js +8 -1
- package/languages/cs-CZ.mjs +8 -1
- package/languages/de-CH.js +8 -1
- package/languages/de-CH.mjs +8 -1
- package/languages/de-DE.js +8 -1
- package/languages/de-DE.mjs +8 -1
- package/languages/en-US.js +8 -1
- package/languages/en-US.mjs +8 -1
- package/languages/es-MX.js +8 -1
- package/languages/es-MX.mjs +8 -1
- package/languages/fa-IR.js +8 -1
- package/languages/fa-IR.mjs +8 -1
- package/languages/fr-FR.js +8 -1
- package/languages/fr-FR.mjs +8 -1
- package/languages/hr-HR.js +8 -1
- package/languages/hr-HR.mjs +8 -1
- package/languages/index.js +168 -21
- package/languages/it-IT.js +8 -1
- package/languages/it-IT.mjs +8 -1
- package/languages/ja-JP.js +8 -1
- package/languages/ja-JP.mjs +8 -1
- package/languages/ko-KR.js +8 -1
- package/languages/ko-KR.mjs +8 -1
- package/languages/lv-LV.js +8 -1
- package/languages/lv-LV.mjs +8 -1
- package/languages/nb-NO.js +8 -1
- package/languages/nb-NO.mjs +8 -1
- package/languages/nl-NL.js +8 -1
- package/languages/nl-NL.mjs +8 -1
- package/languages/pl-PL.js +8 -1
- package/languages/pl-PL.mjs +8 -1
- package/languages/pt-BR.js +8 -1
- package/languages/pt-BR.mjs +8 -1
- package/languages/ru-RU.js +8 -1
- package/languages/ru-RU.mjs +8 -1
- package/languages/sr-SP.js +8 -1
- package/languages/sr-SP.mjs +8 -1
- package/languages/zh-CN.js +8 -1
- package/languages/zh-CN.mjs +8 -1
- package/languages/zh-TW.js +8 -1
- package/languages/zh-TW.mjs +8 -1
- package/package.json +25 -7
- package/plugins/autoRowSize/autoRowSize.js +8 -1
- package/plugins/autoRowSize/autoRowSize.mjs +8 -1
- package/plugins/base/base.js +36 -10
- package/plugins/base/base.mjs +36 -10
- package/plugins/columnSummary/columnSummary.d.ts +2 -2
- package/plugins/columnSummary/columnSummary.js +44 -10
- package/plugins/columnSummary/columnSummary.mjs +44 -10
- package/plugins/columnSummary/endpoints.js +15 -13
- package/plugins/columnSummary/endpoints.mjs +15 -13
- package/plugins/columnSummary/utils.js +31 -0
- package/plugins/columnSummary/utils.mjs +30 -0
- package/plugins/customBorders/customBorders.d.ts +1 -0
- package/plugins/customBorders/customBorders.js +32 -2
- package/plugins/customBorders/customBorders.mjs +32 -2
- package/plugins/dialog/constants.js +7 -0
- package/plugins/dialog/constants.mjs +4 -0
- package/plugins/dialog/dialog.d.ts +22 -2
- package/plugins/dialog/dialog.js +197 -81
- package/plugins/dialog/dialog.mjs +196 -81
- package/plugins/dialog/templates/base.js +60 -0
- package/plugins/dialog/templates/base.mjs +56 -0
- package/plugins/dialog/templates/confirm.js +106 -0
- package/plugins/dialog/templates/confirm.mjs +102 -0
- package/plugins/dialog/templates/index.js +6 -0
- package/plugins/dialog/templates/index.mjs +4 -0
- package/plugins/dialog/ui.js +125 -41
- package/plugins/dialog/ui.mjs +119 -35
- package/plugins/emptyDataState/emptyDataState.d.ts +24 -0
- package/plugins/emptyDataState/emptyDataState.js +526 -0
- package/plugins/emptyDataState/emptyDataState.mjs +521 -0
- package/plugins/emptyDataState/index.d.ts +1 -0
- package/plugins/emptyDataState/index.js +7 -0
- package/plugins/emptyDataState/index.mjs +1 -0
- package/plugins/emptyDataState/ui.js +282 -0
- package/plugins/emptyDataState/ui.mjs +278 -0
- package/plugins/filters/component/value.js +16 -1
- package/plugins/filters/component/value.mjs +16 -1
- package/plugins/filters/filters.d.ts +5 -1
- package/plugins/filters/filters.js +22 -1
- package/plugins/filters/filters.mjs +22 -1
- package/plugins/filters/ui/multipleSelect.js +90 -79
- package/plugins/filters/ui/multipleSelect.mjs +90 -79
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +3 -0
- package/plugins/index.mjs +3 -1
- package/plugins/mergeCells/utils.js +1 -5
- package/plugins/mergeCells/utils.mjs +1 -5
- package/plugins/pagination/pagination.js +37 -175
- package/plugins/pagination/pagination.mjs +37 -175
- package/plugins/pagination/strategies/autoPageSize.js +2 -2
- package/plugins/pagination/strategies/autoPageSize.mjs +2 -2
- package/plugins/pagination/ui.js +6 -10
- package/plugins/pagination/ui.mjs +7 -11
- package/plugins/stretchColumns/calculator.js +3 -1
- package/plugins/stretchColumns/calculator.mjs +3 -1
- package/plugins/undoRedo/undoRedo.js +16 -6
- package/plugins/undoRedo/undoRedo.mjs +16 -5
- package/renderers/checkboxRenderer/checkboxRenderer.js +12 -15
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +12 -15
- package/selection/selection.js +1 -1
- package/selection/selection.mjs +1 -1
- package/settings.d.ts +3 -0
- package/shortcutContexts/commands/index.js +2 -1
- package/shortcutContexts/commands/index.mjs +2 -1
- package/shortcutContexts/commands/tabNavigation.js +51 -0
- package/shortcutContexts/commands/tabNavigation.mjs +48 -0
- package/shortcutContexts/constants.js +16 -1
- package/shortcutContexts/constants.mjs +16 -1
- package/shortcutContexts/editor.js +2 -2
- package/shortcutContexts/editor.mjs +3 -3
- package/shortcutContexts/grid.js +19 -3
- package/shortcutContexts/grid.mjs +20 -4
- package/shortcuts/manager.d.ts +1 -0
- package/shortcuts/manager.js +17 -2
- package/shortcuts/manager.mjs +17 -2
- package/styles/handsontable.css +192 -35
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-icons-horizon.css +233 -0
- package/styles/ht-icons-horizon.min.css +30 -0
- package/styles/ht-icons-main.css +233 -0
- package/styles/ht-icons-main.min.css +30 -0
- package/styles/ht-theme-classic-no-icons.css +399 -0
- package/styles/ht-theme-classic-no-icons.min.css +30 -0
- package/styles/ht-theme-classic.css +308 -556
- package/styles/ht-theme-classic.min.css +3 -3
- package/styles/ht-theme-horizon-no-icons.css +405 -0
- package/styles/ht-theme-horizon-no-icons.min.css +30 -0
- package/styles/ht-theme-horizon.css +312 -556
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main-no-icons.css +396 -0
- package/styles/ht-theme-main-no-icons.min.css +30 -0
- package/styles/ht-theme-main.css +303 -556
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +23 -5
- package/tableView.mjs +23 -5
- package/utils/dataStructures/uniqueMap.js +10 -0
- package/utils/dataStructures/uniqueMap.mjs +10 -0
- package/utils/ghostTable.js +0 -3
- package/utils/ghostTable.mjs +0 -3
- package/utils/stylesHandler.js +19 -4
- package/utils/stylesHandler.mjs +19 -4
- package/core/focusCatcher/index.js +0 -131
- package/core/focusCatcher/index.mjs +0 -127
- package/core/focusCatcher/utils.js +0 -31
- package/core/focusCatcher/utils.mjs +0 -27
- package/plugins/pagination/focusController.js +0 -27
- package/plugins/pagination/focusController.mjs +0 -23
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { GRID_GROUP } from "../../shortcutContexts/index.mjs";
|
|
2
|
-
import { installFocusDetector } from "../../utils/focusDetector.mjs";
|
|
3
|
-
import { normalizeCoordsIfNeeded } from "./utils.mjs";
|
|
4
|
-
import { getMostTopStartPosition, getMostBottomEndPosition } from "../../helpers/mixed.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Installs a focus catcher module. The module observes when the table is focused and depending on
|
|
7
|
-
* from the which side it was focused on it selects a specified cell or releases the TAB navigation
|
|
8
|
-
* to the browser.
|
|
9
|
-
*
|
|
10
|
-
* @param {Core} hot The Handsontable instance.
|
|
11
|
-
*/
|
|
12
|
-
export function installFocusCatcher(hot) {
|
|
13
|
-
const clampCoordsIfNeeded = normalizeCoordsIfNeeded(hot);
|
|
14
|
-
let recentlyAddedFocusCoords;
|
|
15
|
-
const {
|
|
16
|
-
activate,
|
|
17
|
-
deactivate
|
|
18
|
-
} = installFocusDetector(hot, hot.rootGridElement, {
|
|
19
|
-
onFocus(from) {
|
|
20
|
-
if (from === 'from_above') {
|
|
21
|
-
var _clampCoordsIfNeeded;
|
|
22
|
-
const mostTopStartCoords = (_clampCoordsIfNeeded = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded !== void 0 ? _clampCoordsIfNeeded : getMostTopStartPosition(hot);
|
|
23
|
-
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
|
24
|
-
if (mostTopStartCoords && result !== false) {
|
|
25
|
-
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
var _clampCoordsIfNeeded2;
|
|
29
|
-
const mostBottomEndCoords = (_clampCoordsIfNeeded2 = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded2 !== void 0 ? _clampCoordsIfNeeded2 : getMostBottomEndPosition(hot);
|
|
30
|
-
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
|
31
|
-
if (mostBottomEndCoords && result !== false) {
|
|
32
|
-
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
hot.listen();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const rowWrapState = {
|
|
39
|
-
wrapped: false,
|
|
40
|
-
flipped: false
|
|
41
|
-
};
|
|
42
|
-
let isSavingCoordsEnabled = true;
|
|
43
|
-
let isTabOrShiftTabPressed = false;
|
|
44
|
-
let preventViewportScroll = false;
|
|
45
|
-
hot.addHook('afterListen', () => {
|
|
46
|
-
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
47
|
-
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
48
|
-
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
49
|
-
deactivate();
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
hot.addHook('afterUnlisten', () => {
|
|
53
|
-
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
|
54
|
-
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
|
55
|
-
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
|
56
|
-
activate();
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
|
60
|
-
if (isTabOrShiftTabPressed && (rowWrapState.wrapped && rowWrapState.flipped || preventViewportScroll)) {
|
|
61
|
-
preventViewportScroll = false;
|
|
62
|
-
preventScrolling.value = true;
|
|
63
|
-
}
|
|
64
|
-
if (isSavingCoordsEnabled) {
|
|
65
|
-
var _hot$getSelectedRange;
|
|
66
|
-
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeActive()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
hot.addHook('beforeRowWrap', (interruptedByAutoInsertMode, newCoords, isFlipped) => {
|
|
70
|
-
rowWrapState.wrapped = true;
|
|
71
|
-
rowWrapState.flipped = isFlipped;
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Unselects the cell and deactivates the table.
|
|
76
|
-
*/
|
|
77
|
-
function deactivateTable() {
|
|
78
|
-
rowWrapState.wrapped = false;
|
|
79
|
-
rowWrapState.flipped = false;
|
|
80
|
-
hot.deselectCell();
|
|
81
|
-
hot.unlisten();
|
|
82
|
-
}
|
|
83
|
-
const shortcutOptions = {
|
|
84
|
-
keys: [['Tab'], ['Shift', 'Tab']],
|
|
85
|
-
preventDefault: false,
|
|
86
|
-
stopPropagation: false,
|
|
87
|
-
relativeToGroup: GRID_GROUP,
|
|
88
|
-
group: 'focusCatcher'
|
|
89
|
-
};
|
|
90
|
-
hot.getShortcutManager().getContext('grid').addShortcuts([{
|
|
91
|
-
...shortcutOptions,
|
|
92
|
-
callback: () => {
|
|
93
|
-
const {
|
|
94
|
-
tabNavigation
|
|
95
|
-
} = hot.getSettings();
|
|
96
|
-
isTabOrShiftTabPressed = true;
|
|
97
|
-
if (hot.getSelectedRangeActive() && !tabNavigation) {
|
|
98
|
-
isSavingCoordsEnabled = false;
|
|
99
|
-
}
|
|
100
|
-
if (!tabNavigation) {
|
|
101
|
-
preventViewportScroll = true;
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
position: 'before'
|
|
105
|
-
}, {
|
|
106
|
-
...shortcutOptions,
|
|
107
|
-
callback: event => {
|
|
108
|
-
const {
|
|
109
|
-
tabNavigation,
|
|
110
|
-
autoWrapRow
|
|
111
|
-
} = hot.getSettings();
|
|
112
|
-
isTabOrShiftTabPressed = false;
|
|
113
|
-
isSavingCoordsEnabled = true;
|
|
114
|
-
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
|
115
|
-
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
|
116
|
-
recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
|
|
117
|
-
}
|
|
118
|
-
deactivateTable();
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// if the selection is still within the table's range then prevent default action
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
},
|
|
125
|
-
position: 'after'
|
|
126
|
-
}]);
|
|
127
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.normalizeCoordsIfNeeded = normalizeCoordsIfNeeded;
|
|
5
|
-
var _number = require("../../helpers/number");
|
|
6
|
-
var _mixed = require("../../helpers/mixed");
|
|
7
|
-
/**
|
|
8
|
-
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
|
9
|
-
*
|
|
10
|
-
* @param {Core} hot The Handsontable instance.
|
|
11
|
-
* @returns {function(Coords | undefined): Coords | null}
|
|
12
|
-
*/
|
|
13
|
-
function normalizeCoordsIfNeeded(hot) {
|
|
14
|
-
return coords => {
|
|
15
|
-
if (!coords) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const {
|
|
19
|
-
rowIndexMapper,
|
|
20
|
-
columnIndexMapper
|
|
21
|
-
} = hot;
|
|
22
|
-
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const mostTopStartCoords = (0, _mixed.getMostTopStartPosition)(hot);
|
|
26
|
-
const mostBottomEndCoords = (0, _mixed.getMostBottomEndPosition)(hot);
|
|
27
|
-
coords.row = (0, _number.clamp)(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
|
28
|
-
coords.col = (0, _number.clamp)(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
|
29
|
-
return coords;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { clamp } from "../../helpers/number.mjs";
|
|
2
|
-
import { getMostTopStartPosition, getMostBottomEndPosition } from "../../helpers/mixed.mjs";
|
|
3
|
-
/**
|
|
4
|
-
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
|
5
|
-
*
|
|
6
|
-
* @param {Core} hot The Handsontable instance.
|
|
7
|
-
* @returns {function(Coords | undefined): Coords | null}
|
|
8
|
-
*/
|
|
9
|
-
export function normalizeCoordsIfNeeded(hot) {
|
|
10
|
-
return coords => {
|
|
11
|
-
if (!coords) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const {
|
|
15
|
-
rowIndexMapper,
|
|
16
|
-
columnIndexMapper
|
|
17
|
-
} = hot;
|
|
18
|
-
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
|
22
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
|
23
|
-
coords.row = clamp(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
|
24
|
-
coords.col = clamp(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
|
25
|
-
return coords;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.createPaginationFocusController = createPaginationFocusController;
|
|
5
|
-
var _paginator = require("../../utils/paginator");
|
|
6
|
-
/**
|
|
7
|
-
* Creates a pagination focus controller instance.
|
|
8
|
-
*
|
|
9
|
-
* @private
|
|
10
|
-
* @param {object} options The options for the pagination focus controller.
|
|
11
|
-
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
|
12
|
-
* @returns {PaginationController} The pagination controller instance.
|
|
13
|
-
*/
|
|
14
|
-
function createPaginationFocusController(_ref) {
|
|
15
|
-
let {
|
|
16
|
-
focusableElements
|
|
17
|
-
} = _ref;
|
|
18
|
-
const navigator = (0, _paginator.createPaginator)({
|
|
19
|
-
initialPage: 0,
|
|
20
|
-
size: () => focusableElements().length,
|
|
21
|
-
onItemSelect: currentIndex => {
|
|
22
|
-
const elements = focusableElements();
|
|
23
|
-
elements[currentIndex].focus();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return navigator;
|
|
27
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createPaginator } from "../../utils/paginator.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a pagination focus controller instance.
|
|
4
|
-
*
|
|
5
|
-
* @private
|
|
6
|
-
* @param {object} options The options for the pagination focus controller.
|
|
7
|
-
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
|
8
|
-
* @returns {PaginationController} The pagination controller instance.
|
|
9
|
-
*/
|
|
10
|
-
export function createPaginationFocusController(_ref) {
|
|
11
|
-
let {
|
|
12
|
-
focusableElements
|
|
13
|
-
} = _ref;
|
|
14
|
-
const navigator = createPaginator({
|
|
15
|
-
initialPage: 0,
|
|
16
|
-
size: () => focusableElements().length,
|
|
17
|
-
onItemSelect: currentIndex => {
|
|
18
|
-
const elements = focusableElements();
|
|
19
|
-
elements[currentIndex].focus();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return navigator;
|
|
23
|
-
}
|