handsontable 0.0.0-next-fd9f817-20241125 → 0.0.0-next-fcb9b77-20241126
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/index.js +2 -1
- package/3rdparty/walkontable/src/calculator/index.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
- package/3rdparty/walkontable/src/core/_base.js +19 -26
- package/3rdparty/walkontable/src/core/_base.mjs +19 -26
- package/3rdparty/walkontable/src/core/clone.js +0 -1
- package/3rdparty/walkontable/src/core/clone.mjs +0 -1
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +6 -9
- package/3rdparty/walkontable/src/facade/core.mjs +6 -9
- package/3rdparty/walkontable/src/index.js +1 -0
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -3
- package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/index.js +2 -4
- package/3rdparty/walkontable/src/renderer/index.mjs +2 -4
- package/3rdparty/walkontable/src/renderer/table.js +3 -12
- package/3rdparty/walkontable/src/renderer/table.mjs +3 -12
- package/3rdparty/walkontable/src/scroll.js +46 -37
- package/3rdparty/walkontable/src/scroll.mjs +46 -37
- package/3rdparty/walkontable/src/settings.js +2 -0
- package/3rdparty/walkontable/src/settings.mjs +2 -0
- package/3rdparty/walkontable/src/table.js +9 -17
- package/3rdparty/walkontable/src/table.mjs +9 -17
- package/3rdparty/walkontable/src/types.js +0 -1
- package/3rdparty/walkontable/src/types.mjs +0 -1
- package/3rdparty/walkontable/src/utils/column.js +1 -1
- package/3rdparty/walkontable/src/utils/column.mjs +1 -1
- package/3rdparty/walkontable/src/viewport.js +0 -1
- package/3rdparty/walkontable/src/viewport.mjs +0 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/hooks/constants.js +7 -9
- package/core/hooks/constants.mjs +7 -9
- package/core/hooks/index.d.ts +2 -3
- package/core.d.ts +0 -2
- package/core.js +3 -64
- package/core.mjs +3 -64
- package/dataMap/metaManager/metaSchema.js +3 -23
- package/dataMap/metaManager/metaSchema.mjs +3 -23
- package/dist/handsontable.css +9 -17
- package/dist/handsontable.full.css +240 -249
- package/dist/handsontable.full.js +4386 -4760
- package/dist/handsontable.full.min.css +9 -11
- package/dist/handsontable.full.min.js +53 -53
- package/dist/handsontable.js +4087 -4467
- package/dist/handsontable.min.css +4 -5
- package/dist/handsontable.min.js +33 -33
- package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
- package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +0 -9
- package/editors/dateEditor/dateEditor.mjs +1 -10
- package/editors/handsontableEditor/handsontableEditor.js +1 -7
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -7
- package/editors/selectEditor/selectEditor.js +9 -20
- package/editors/selectEditor/selectEditor.mjs +9 -20
- package/editors/textEditor/textEditor.js +11 -4
- package/editors/textEditor/textEditor.mjs +11 -4
- package/helpers/dom/element.js +1 -32
- package/helpers/dom/element.mjs +1 -31
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +3 -10
- package/plugins/comments/commentEditor.js +0 -9
- package/plugins/comments/commentEditor.mjs +0 -9
- package/plugins/comments/comments.js +0 -14
- package/plugins/comments/comments.mjs +1 -15
- package/plugins/contextMenu/menu/menu.js +4 -9
- package/plugins/contextMenu/menu/menu.mjs +4 -9
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -84
- package/plugins/contextMenu/predefinedItems/alignment.mjs +8 -85
- package/plugins/contextMenu/utils.js +0 -10
- package/plugins/contextMenu/utils.mjs +0 -9
- package/plugins/filters/ui/multipleSelect.js +0 -6
- package/plugins/filters/ui/multipleSelect.mjs +0 -6
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +2 -1
- package/plugins/manualRowResize/manualRowResize.mjs +3 -2
- package/plugins/mergeCells/mergeCells.js +1 -1
- package/plugins/mergeCells/mergeCells.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +60 -15
- package/plugins/nestedHeaders/nestedHeaders.mjs +60 -15
- package/plugins/nestedRows/ui/headers.js +1 -7
- package/plugins/nestedRows/ui/headers.mjs +1 -7
- package/plugins/stretchColumns/calculator.js +1 -2
- package/plugins/stretchColumns/calculator.mjs +2 -3
- package/selection/selection.js +4 -2
- package/selection/selection.mjs +4 -2
- package/settings.d.ts +0 -1
- package/tableView.js +23 -64
- package/tableView.mjs +24 -65
- package/utils/autoResize.js +1 -4
- package/utils/autoResize.mjs +1 -4
- package/utils/ghostTable.js +3 -5
- package/utils/ghostTable.mjs +3 -5
- package/3rdparty/walkontable/src/utils/stylesHandler.js +0 -287
- package/3rdparty/walkontable/src/utils/stylesHandler.mjs +0 -283
- package/helpers/themes.js +0 -17
- package/helpers/themes.mjs +0 -13
- package/styles/handsontable.css +0 -2187
- package/styles/handsontable.min.css +0 -30
- package/styles/ht-theme-horizon.css +0 -607
- package/styles/ht-theme-horizon.min.css +0 -30
- package/styles/ht-theme-main.css +0 -613
- package/styles/ht-theme-main.min.css +0 -30
@@ -158,12 +158,6 @@ export class Menu {
|
|
158
158
|
return _this.parentMenu.runLocalHooks('afterSelectionChange', ...args);
|
159
159
|
});
|
160
160
|
}
|
161
|
-
this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
|
162
|
-
if (!firstRun) {
|
163
|
-
var _this$hotMenu;
|
164
|
-
(_this$hotMenu = this.hotMenu) === null || _this$hotMenu === void 0 || _this$hotMenu.useTheme(themeName);
|
165
|
-
}
|
166
|
-
});
|
167
161
|
}
|
168
162
|
|
169
163
|
/**
|
@@ -288,7 +282,6 @@ export class Menu {
|
|
288
282
|
disableVisualSelection: 'area',
|
289
283
|
layoutDirection: this.hot.isRtl() ? 'rtl' : 'ltr',
|
290
284
|
ariaTags: false,
|
291
|
-
themeName: this.hot.getCurrentThemeName(),
|
292
285
|
beforeOnCellMouseOver: (event, coords) => {
|
293
286
|
_classPrivateFieldGet(_navigator, this).setCurrentPage(coords.row);
|
294
287
|
},
|
@@ -582,8 +575,10 @@ export class Menu {
|
|
582
575
|
const currentRowHeight = itemCell ? outerHeight(this.hotMenu.getCell(index, 0)) : 0;
|
583
576
|
return accumulator + (value.name === SEPARATOR ? 1 : currentRowHeight);
|
584
577
|
}, 0);
|
585
|
-
|
586
|
-
|
578
|
+
|
579
|
+
// Additional 3px to menu's size because of additional border around its `table.htCore`.
|
580
|
+
holderStyle.width = `${currentHiderWidth + 3}px`;
|
581
|
+
holderStyle.height = `${realHeight + 3}px`;
|
587
582
|
hiderStyle.height = holderStyle.height;
|
588
583
|
}
|
589
584
|
|
@@ -34,19 +34,8 @@ function alignmentItem() {
|
|
34
34
|
submenu: {
|
35
35
|
items: [{
|
36
36
|
key: `${KEY}:left`,
|
37
|
-
checkable: true,
|
38
|
-
ariaLabel() {
|
39
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT);
|
40
|
-
},
|
41
|
-
ariaChecked() {
|
42
|
-
return (0, _utils.hasSelectionAClass)(this, 'htLeft');
|
43
|
-
},
|
44
37
|
name() {
|
45
|
-
|
46
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htLeft')) {
|
47
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
48
|
-
}
|
49
|
-
return label;
|
38
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT);
|
50
39
|
},
|
51
40
|
callback() {
|
52
41
|
const selectedRange = this.getSelectedRange();
|
@@ -60,19 +49,8 @@ function alignmentItem() {
|
|
60
49
|
disabled: false
|
61
50
|
}, {
|
62
51
|
key: `${KEY}:center`,
|
63
|
-
checkable: true,
|
64
|
-
ariaLabel() {
|
65
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER);
|
66
|
-
},
|
67
|
-
ariaChecked() {
|
68
|
-
return (0, _utils.hasSelectionAClass)(this, 'htCenter');
|
69
|
-
},
|
70
52
|
name() {
|
71
|
-
|
72
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htCenter')) {
|
73
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
74
|
-
}
|
75
|
-
return label;
|
53
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER);
|
76
54
|
},
|
77
55
|
callback() {
|
78
56
|
const selectedRange = this.getSelectedRange();
|
@@ -86,19 +64,8 @@ function alignmentItem() {
|
|
86
64
|
disabled: false
|
87
65
|
}, {
|
88
66
|
key: `${KEY}:right`,
|
89
|
-
checkable: true,
|
90
|
-
ariaLabel() {
|
91
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT);
|
92
|
-
},
|
93
|
-
ariaChecked() {
|
94
|
-
return (0, _utils.hasSelectionAClass)(this, 'htRight');
|
95
|
-
},
|
96
67
|
name() {
|
97
|
-
|
98
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htRight')) {
|
99
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
100
|
-
}
|
101
|
-
return label;
|
68
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT);
|
102
69
|
},
|
103
70
|
callback() {
|
104
71
|
const selectedRange = this.getSelectedRange();
|
@@ -112,19 +79,8 @@ function alignmentItem() {
|
|
112
79
|
disabled: false
|
113
80
|
}, {
|
114
81
|
key: `${KEY}:justify`,
|
115
|
-
checkable: true,
|
116
|
-
ariaLabel() {
|
117
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY);
|
118
|
-
},
|
119
|
-
ariaChecked() {
|
120
|
-
return (0, _utils.hasSelectionAClass)(this, 'htJustify');
|
121
|
-
},
|
122
82
|
name() {
|
123
|
-
|
124
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htJustify')) {
|
125
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
126
|
-
}
|
127
|
-
return label;
|
83
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY);
|
128
84
|
},
|
129
85
|
callback() {
|
130
86
|
const selectedRange = this.getSelectedRange();
|
@@ -140,19 +96,8 @@ function alignmentItem() {
|
|
140
96
|
name: _separator.KEY
|
141
97
|
}, {
|
142
98
|
key: `${KEY}:top`,
|
143
|
-
checkable: true,
|
144
|
-
ariaLabel() {
|
145
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP);
|
146
|
-
},
|
147
|
-
ariaChecked() {
|
148
|
-
return (0, _utils.hasSelectionAClass)(this, 'htTop');
|
149
|
-
},
|
150
99
|
name() {
|
151
|
-
|
152
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htTop')) {
|
153
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
154
|
-
}
|
155
|
-
return label;
|
100
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP);
|
156
101
|
},
|
157
102
|
callback() {
|
158
103
|
const selectedRange = this.getSelectedRange();
|
@@ -166,19 +111,8 @@ function alignmentItem() {
|
|
166
111
|
disabled: false
|
167
112
|
}, {
|
168
113
|
key: `${KEY}:middle`,
|
169
|
-
checkable: true,
|
170
|
-
ariaLabel() {
|
171
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE);
|
172
|
-
},
|
173
|
-
ariaChecked() {
|
174
|
-
return (0, _utils.hasSelectionAClass)(this, 'htMiddle');
|
175
|
-
},
|
176
114
|
name() {
|
177
|
-
|
178
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htMiddle')) {
|
179
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
180
|
-
}
|
181
|
-
return label;
|
115
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE);
|
182
116
|
},
|
183
117
|
callback() {
|
184
118
|
const selectedRange = this.getSelectedRange();
|
@@ -192,19 +126,8 @@ function alignmentItem() {
|
|
192
126
|
disabled: false
|
193
127
|
}, {
|
194
128
|
key: `${KEY}:bottom`,
|
195
|
-
checkable: true,
|
196
|
-
ariaLabel() {
|
197
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM);
|
198
|
-
},
|
199
|
-
ariaChecked() {
|
200
|
-
return (0, _utils.hasSelectionAClass)(this, 'htBottom');
|
201
|
-
},
|
202
129
|
name() {
|
203
|
-
|
204
|
-
if ((0, _utils.hasSelectionAClass)(this, 'htBottom')) {
|
205
|
-
label = (0, _utils.markLabelAsSelected)(label);
|
206
|
-
}
|
207
|
-
return label;
|
130
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM);
|
208
131
|
},
|
209
132
|
callback() {
|
210
133
|
const selectedRange = this.getSelectedRange();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { align, getAlignmentClasses
|
1
|
+
import { align, getAlignmentClasses } from "../utils.mjs";
|
2
2
|
import { KEY as SEPARATOR } from "./separator.mjs";
|
3
3
|
import * as C from "../../../i18n/constants.mjs";
|
4
4
|
export const KEY = 'alignment';
|
@@ -28,19 +28,8 @@ export default function alignmentItem() {
|
|
28
28
|
submenu: {
|
29
29
|
items: [{
|
30
30
|
key: `${KEY}:left`,
|
31
|
-
checkable: true,
|
32
|
-
ariaLabel() {
|
33
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT);
|
34
|
-
},
|
35
|
-
ariaChecked() {
|
36
|
-
return hasSelectionAClass(this, 'htLeft');
|
37
|
-
},
|
38
31
|
name() {
|
39
|
-
|
40
|
-
if (hasSelectionAClass(this, 'htLeft')) {
|
41
|
-
label = markLabelAsSelected(label);
|
42
|
-
}
|
43
|
-
return label;
|
32
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT);
|
44
33
|
},
|
45
34
|
callback() {
|
46
35
|
const selectedRange = this.getSelectedRange();
|
@@ -54,19 +43,8 @@ export default function alignmentItem() {
|
|
54
43
|
disabled: false
|
55
44
|
}, {
|
56
45
|
key: `${KEY}:center`,
|
57
|
-
checkable: true,
|
58
|
-
ariaLabel() {
|
59
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER);
|
60
|
-
},
|
61
|
-
ariaChecked() {
|
62
|
-
return hasSelectionAClass(this, 'htCenter');
|
63
|
-
},
|
64
46
|
name() {
|
65
|
-
|
66
|
-
if (hasSelectionAClass(this, 'htCenter')) {
|
67
|
-
label = markLabelAsSelected(label);
|
68
|
-
}
|
69
|
-
return label;
|
47
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER);
|
70
48
|
},
|
71
49
|
callback() {
|
72
50
|
const selectedRange = this.getSelectedRange();
|
@@ -80,19 +58,8 @@ export default function alignmentItem() {
|
|
80
58
|
disabled: false
|
81
59
|
}, {
|
82
60
|
key: `${KEY}:right`,
|
83
|
-
checkable: true,
|
84
|
-
ariaLabel() {
|
85
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT);
|
86
|
-
},
|
87
|
-
ariaChecked() {
|
88
|
-
return hasSelectionAClass(this, 'htRight');
|
89
|
-
},
|
90
61
|
name() {
|
91
|
-
|
92
|
-
if (hasSelectionAClass(this, 'htRight')) {
|
93
|
-
label = markLabelAsSelected(label);
|
94
|
-
}
|
95
|
-
return label;
|
62
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT);
|
96
63
|
},
|
97
64
|
callback() {
|
98
65
|
const selectedRange = this.getSelectedRange();
|
@@ -106,19 +73,8 @@ export default function alignmentItem() {
|
|
106
73
|
disabled: false
|
107
74
|
}, {
|
108
75
|
key: `${KEY}:justify`,
|
109
|
-
checkable: true,
|
110
|
-
ariaLabel() {
|
111
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY);
|
112
|
-
},
|
113
|
-
ariaChecked() {
|
114
|
-
return hasSelectionAClass(this, 'htJustify');
|
115
|
-
},
|
116
76
|
name() {
|
117
|
-
|
118
|
-
if (hasSelectionAClass(this, 'htJustify')) {
|
119
|
-
label = markLabelAsSelected(label);
|
120
|
-
}
|
121
|
-
return label;
|
77
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY);
|
122
78
|
},
|
123
79
|
callback() {
|
124
80
|
const selectedRange = this.getSelectedRange();
|
@@ -134,19 +90,8 @@ export default function alignmentItem() {
|
|
134
90
|
name: SEPARATOR
|
135
91
|
}, {
|
136
92
|
key: `${KEY}:top`,
|
137
|
-
checkable: true,
|
138
|
-
ariaLabel() {
|
139
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP);
|
140
|
-
},
|
141
|
-
ariaChecked() {
|
142
|
-
return hasSelectionAClass(this, 'htTop');
|
143
|
-
},
|
144
93
|
name() {
|
145
|
-
|
146
|
-
if (hasSelectionAClass(this, 'htTop')) {
|
147
|
-
label = markLabelAsSelected(label);
|
148
|
-
}
|
149
|
-
return label;
|
94
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP);
|
150
95
|
},
|
151
96
|
callback() {
|
152
97
|
const selectedRange = this.getSelectedRange();
|
@@ -160,19 +105,8 @@ export default function alignmentItem() {
|
|
160
105
|
disabled: false
|
161
106
|
}, {
|
162
107
|
key: `${KEY}:middle`,
|
163
|
-
checkable: true,
|
164
|
-
ariaLabel() {
|
165
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE);
|
166
|
-
},
|
167
|
-
ariaChecked() {
|
168
|
-
return hasSelectionAClass(this, 'htMiddle');
|
169
|
-
},
|
170
108
|
name() {
|
171
|
-
|
172
|
-
if (hasSelectionAClass(this, 'htMiddle')) {
|
173
|
-
label = markLabelAsSelected(label);
|
174
|
-
}
|
175
|
-
return label;
|
109
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE);
|
176
110
|
},
|
177
111
|
callback() {
|
178
112
|
const selectedRange = this.getSelectedRange();
|
@@ -186,19 +120,8 @@ export default function alignmentItem() {
|
|
186
120
|
disabled: false
|
187
121
|
}, {
|
188
122
|
key: `${KEY}:bottom`,
|
189
|
-
checkable: true,
|
190
|
-
ariaLabel() {
|
191
|
-
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM);
|
192
|
-
},
|
193
|
-
ariaChecked() {
|
194
|
-
return hasSelectionAClass(this, 'htBottom');
|
195
|
-
},
|
196
123
|
name() {
|
197
|
-
|
198
|
-
if (hasSelectionAClass(this, 'htBottom')) {
|
199
|
-
label = markLabelAsSelected(label);
|
200
|
-
}
|
201
|
-
return label;
|
124
|
+
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM);
|
202
125
|
},
|
203
126
|
callback() {
|
204
127
|
const selectedRange = this.getSelectedRange();
|
@@ -6,7 +6,6 @@ exports.checkSelectionConsistency = checkSelectionConsistency;
|
|
6
6
|
exports.getAlignmentClasses = getAlignmentClasses;
|
7
7
|
exports.getAlignmentComparatorByClass = getAlignmentComparatorByClass;
|
8
8
|
exports.getDocumentOffsetByElement = getDocumentOffsetByElement;
|
9
|
-
exports.hasSelectionAClass = hasSelectionAClass;
|
10
9
|
exports.markLabelAsSelected = markLabelAsSelected;
|
11
10
|
exports.prepareHorizontalAlignClass = prepareHorizontalAlignClass;
|
12
11
|
exports.prepareVerticalAlignClass = prepareVerticalAlignClass;
|
@@ -168,13 +167,4 @@ function getAlignmentComparatorByClass(htClassName) {
|
|
168
167
|
const className = this.getCellMeta(row, col).className;
|
169
168
|
return className && className.indexOf(htClassName) !== -1;
|
170
169
|
};
|
171
|
-
}
|
172
|
-
|
173
|
-
/**
|
174
|
-
* @param {object} hot Handsontable instance.
|
175
|
-
* @param {string} htClassName The class name to check.
|
176
|
-
* @returns {boolean} Returns true if at least one cell has the provided class name.
|
177
|
-
*/
|
178
|
-
function hasSelectionAClass(hot, htClassName) {
|
179
|
-
return checkSelectionConsistency(hot.getSelectedRange(), getAlignmentComparatorByClass(htClassName).bind(hot));
|
180
170
|
}
|
@@ -156,13 +156,4 @@ export function getAlignmentComparatorByClass(htClassName) {
|
|
156
156
|
const className = this.getCellMeta(row, col).className;
|
157
157
|
return className && className.indexOf(htClassName) !== -1;
|
158
158
|
};
|
159
|
-
}
|
160
|
-
|
161
|
-
/**
|
162
|
-
* @param {object} hot Handsontable instance.
|
163
|
-
* @param {string} htClassName The class name to check.
|
164
|
-
* @returns {boolean} Returns true if at least one cell has the provided class name.
|
165
|
-
*/
|
166
|
-
export function hasSelectionAClass(hot, htClassName) {
|
167
|
-
return checkSelectionConsistency(hot.getSelectedRange(), getAlignmentComparatorByClass(htClassName).bind(hot));
|
168
159
|
}
|
@@ -265,15 +265,9 @@ class MultipleSelectUI extends _base.BaseUI {
|
|
265
265
|
row: 1,
|
266
266
|
col: 0
|
267
267
|
},
|
268
|
-
themeName: this.hot.getCurrentThemeName(),
|
269
268
|
layoutDirection: this.hot.isRtl() ? 'rtl' : 'ltr'
|
270
269
|
}));
|
271
270
|
_classPrivateFieldGet(_itemsBox, this).init();
|
272
|
-
this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
|
273
|
-
if (!firstRun) {
|
274
|
-
_classPrivateFieldGet(_itemsBox, this).useTheme(themeName);
|
275
|
-
}
|
276
|
-
});
|
277
271
|
const shortcutManager = _classPrivateFieldGet(_itemsBox, this).getShortcutManager();
|
278
272
|
const gridContext = shortcutManager.getContext('grid');
|
279
273
|
gridContext.removeShortcutsByKeys(['Tab']);
|
@@ -260,15 +260,9 @@ export class MultipleSelectUI extends BaseUI {
|
|
260
260
|
row: 1,
|
261
261
|
col: 0
|
262
262
|
},
|
263
|
-
themeName: this.hot.getCurrentThemeName(),
|
264
263
|
layoutDirection: this.hot.isRtl() ? 'rtl' : 'ltr'
|
265
264
|
}));
|
266
265
|
_classPrivateFieldGet(_itemsBox, this).init();
|
267
|
-
this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
|
268
|
-
if (!firstRun) {
|
269
|
-
_classPrivateFieldGet(_itemsBox, this).useTheme(themeName);
|
270
|
-
}
|
271
|
-
});
|
272
266
|
const shortcutManager = _classPrivateFieldGet(_itemsBox, this).getShortcutManager();
|
273
267
|
const gridContext = shortcutManager.getContext('grid');
|
274
268
|
gridContext.removeShortcutsByKeys(['Tab']);
|
@@ -319,7 +319,7 @@ class ManualRowMove extends _base.BasePlugin {
|
|
319
319
|
for (let visualRowIndex = fromRow; visualRowIndex <= toRow; visualRowIndex++) {
|
320
320
|
const renderableIndex = rowMapper.getRenderableFromVisualIndex(visualRowIndex);
|
321
321
|
if (renderableIndex !== null) {
|
322
|
-
rowsHeight += this.hot.view._wt.wtTable.getRowHeight(renderableIndex) ||
|
322
|
+
rowsHeight += this.hot.view._wt.wtTable.getRowHeight(renderableIndex) || 23;
|
323
323
|
}
|
324
324
|
}
|
325
325
|
return rowsHeight;
|
@@ -315,7 +315,7 @@ export class ManualRowMove extends BasePlugin {
|
|
315
315
|
for (let visualRowIndex = fromRow; visualRowIndex <= toRow; visualRowIndex++) {
|
316
316
|
const renderableIndex = rowMapper.getRenderableFromVisualIndex(visualRowIndex);
|
317
317
|
if (renderableIndex !== null) {
|
318
|
-
rowsHeight += this.hot.view._wt.wtTable.getRowHeight(renderableIndex) ||
|
318
|
+
rowsHeight += this.hot.view._wt.wtTable.getRowHeight(renderableIndex) || 23;
|
319
319
|
}
|
320
320
|
}
|
321
321
|
return rowsHeight;
|
@@ -10,6 +10,7 @@ var _element = require("../../helpers/dom/element");
|
|
10
10
|
var _array = require("../../helpers/array");
|
11
11
|
var _number = require("../../helpers/number");
|
12
12
|
var _translations = require("../../translations");
|
13
|
+
var _src = require("../../3rdparty/walkontable/src");
|
13
14
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
14
15
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
15
16
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
@@ -228,7 +229,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
228
229
|
*/
|
229
230
|
setManualSize(row, height) {
|
230
231
|
const physicalRow = this.hot.toPhysicalRow(row);
|
231
|
-
const newHeight = Math.max(height,
|
232
|
+
const newHeight = Math.max(height, _src.DEFAULT_ROW_HEIGHT);
|
232
233
|
_classPrivateFieldGet(_rowHeightsMap, this).setValueAtIndex(physicalRow, newHeight);
|
233
234
|
return newHeight;
|
234
235
|
}
|
@@ -12,7 +12,8 @@ import { BasePlugin } from "../base/index.mjs";
|
|
12
12
|
import { addClass, closest, hasClass, removeClass, outerWidth, isDetached } from "../../helpers/dom/element.mjs";
|
13
13
|
import { arrayEach } from "../../helpers/array.mjs";
|
14
14
|
import { rangeEach } from "../../helpers/number.mjs";
|
15
|
-
import { PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
|
15
|
+
import { PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
|
16
|
+
import { DEFAULT_ROW_HEIGHT } from "../../3rdparty/walkontable/src/index.mjs"; // Developer note! Whenever you make a change in this file, make an analogous change in manualColumnResize.js
|
16
17
|
export const PLUGIN_KEY = 'manualRowResize';
|
17
18
|
export const PLUGIN_PRIORITY = 30;
|
18
19
|
const PERSISTENT_STATE_KEY = 'manualRowHeights';
|
@@ -223,7 +224,7 @@ export class ManualRowResize extends BasePlugin {
|
|
223
224
|
*/
|
224
225
|
setManualSize(row, height) {
|
225
226
|
const physicalRow = this.hot.toPhysicalRow(row);
|
226
|
-
const newHeight = Math.max(height,
|
227
|
+
const newHeight = Math.max(height, DEFAULT_ROW_HEIGHT);
|
227
228
|
_classPrivateFieldGet(_rowHeightsMap, this).setValueAtIndex(physicalRow, newHeight);
|
228
229
|
return newHeight;
|
229
230
|
}
|
@@ -1496,7 +1496,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1496
1496
|
* @returns {number}
|
1497
1497
|
*/
|
1498
1498
|
function _sumCellsHeights(row, rowspan) {
|
1499
|
-
const defaultHeight = this.hot.view.
|
1499
|
+
const defaultHeight = this.hot.view._wt.wtSettings.getSettingPure('defaultRowHeight');
|
1500
1500
|
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
1501
1501
|
let height = 0;
|
1502
1502
|
for (let i = row; i < row + rowspan; i++) {
|
@@ -1491,7 +1491,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1491
1491
|
* @returns {number}
|
1492
1492
|
*/
|
1493
1493
|
function _sumCellsHeights(row, rowspan) {
|
1494
|
-
const defaultHeight = this.hot.view.
|
1494
|
+
const defaultHeight = this.hot.view._wt.wtSettings.getSettingPure('defaultRowHeight');
|
1495
1495
|
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
1496
1496
|
let height = 0;
|
1497
1497
|
for (let i = row; i < row + rowspan; i++) {
|
@@ -77,6 +77,7 @@ var _stateManager = /*#__PURE__*/new WeakMap();
|
|
77
77
|
var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
78
78
|
var _focusInitialCoords = /*#__PURE__*/new WeakMap();
|
79
79
|
var _isColumnsSelectionInProgress = /*#__PURE__*/new WeakMap();
|
80
|
+
var _recentlyHighlightCoords = /*#__PURE__*/new WeakMap();
|
80
81
|
var _NestedHeaders_brand = /*#__PURE__*/new WeakSet();
|
81
82
|
class NestedHeaders extends _base.BasePlugin {
|
82
83
|
constructor() {
|
@@ -111,6 +112,14 @@ class NestedHeaders extends _base.BasePlugin {
|
|
111
112
|
* @type {boolean}
|
112
113
|
*/
|
113
114
|
_classPrivateFieldInitSpec(this, _isColumnsSelectionInProgress, false);
|
115
|
+
/**
|
116
|
+
* Keeps the last highlight position made by column selection. The coords are necessary to scroll
|
117
|
+
* the viewport to the correct position when the nested header is clicked when the `navigableHeaders`
|
118
|
+
* option is disabled.
|
119
|
+
*
|
120
|
+
* @type {CellCoords | null}
|
121
|
+
*/
|
122
|
+
_classPrivateFieldInitSpec(this, _recentlyHighlightCoords, null);
|
114
123
|
/**
|
115
124
|
* Custom helper for getting widths of the nested headers.
|
116
125
|
*
|
@@ -531,9 +540,13 @@ function _updateFocusHighlightPosition() {
|
|
531
540
|
* indexes are used.
|
532
541
|
*
|
533
542
|
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
543
|
+
* @param {{ value: 'auto' | 'start' | 'end' }} snapping If `'start'`, viewport is scrolled to show
|
544
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
545
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
534
546
|
* @returns {number}
|
535
547
|
*/
|
536
|
-
function _onBeforeViewportScrollHorizontally(visualColumn) {
|
548
|
+
function _onBeforeViewportScrollHorizontally(visualColumn, snapping) {
|
549
|
+
var _classPrivateFieldGet4;
|
537
550
|
const selection = this.hot.getSelectedRangeLast();
|
538
551
|
if (!selection) {
|
539
552
|
return visualColumn;
|
@@ -541,20 +554,50 @@ function _onBeforeViewportScrollHorizontally(visualColumn) {
|
|
541
554
|
const {
|
542
555
|
highlight
|
543
556
|
} = selection;
|
544
|
-
const
|
557
|
+
const {
|
558
|
+
navigableHeaders
|
559
|
+
} = this.hot.getSettings();
|
560
|
+
const isSelectedByColumnHeader = this.hot.selection.isSelectedByColumnHeader();
|
561
|
+
const highlightRow = navigableHeaders ? highlight.row : (_classPrivateFieldGet4 = _classPrivateFieldGet(_recentlyHighlightCoords, this)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.row;
|
562
|
+
const highlightColumn = isSelectedByColumnHeader ? visualColumn : highlight.col;
|
563
|
+
const isNestedHeadersRange = highlightRow < 0 && highlightColumn >= 0;
|
564
|
+
_classPrivateFieldSet(_recentlyHighlightCoords, this, null);
|
545
565
|
if (!isNestedHeadersRange) {
|
546
566
|
return visualColumn;
|
547
567
|
}
|
548
|
-
const
|
549
|
-
const
|
550
|
-
const
|
551
|
-
const
|
568
|
+
const firstVisibleColumn = this.hot.getFirstFullyVisibleColumn();
|
569
|
+
const lastVisibleColumn = this.hot.getLastFullyVisibleColumn();
|
570
|
+
const viewportWidth = lastVisibleColumn - firstVisibleColumn + 1;
|
571
|
+
const mostLeftColumnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlightRow, highlightColumn);
|
572
|
+
const mostRightColumnIndex = _classPrivateFieldGet(_stateManager, this).findRightMostColumnIndex(highlightRow, highlightColumn);
|
573
|
+
const headerWidth = mostRightColumnIndex - mostLeftColumnIndex + 1;
|
552
574
|
|
553
|
-
//
|
554
|
-
if (mostLeftColumnIndex <
|
555
|
-
return
|
575
|
+
// scroll the viewport always to the left when the header is wider than the viewport
|
576
|
+
if (mostLeftColumnIndex < firstVisibleColumn && mostRightColumnIndex > lastVisibleColumn) {
|
577
|
+
return mostLeftColumnIndex;
|
578
|
+
}
|
579
|
+
if (isSelectedByColumnHeader) {
|
580
|
+
let scrollColumnIndex = null;
|
581
|
+
if (mostLeftColumnIndex >= firstVisibleColumn && mostRightColumnIndex > lastVisibleColumn) {
|
582
|
+
if (headerWidth > viewportWidth) {
|
583
|
+
snapping.value = 'start';
|
584
|
+
scrollColumnIndex = mostLeftColumnIndex;
|
585
|
+
} else {
|
586
|
+
snapping.value = 'end';
|
587
|
+
scrollColumnIndex = mostRightColumnIndex;
|
588
|
+
}
|
589
|
+
} else if (mostLeftColumnIndex < firstVisibleColumn && mostRightColumnIndex <= lastVisibleColumn) {
|
590
|
+
if (headerWidth > viewportWidth) {
|
591
|
+
snapping.value = 'end';
|
592
|
+
scrollColumnIndex = mostRightColumnIndex;
|
593
|
+
} else {
|
594
|
+
snapping.value = 'start';
|
595
|
+
scrollColumnIndex = mostLeftColumnIndex;
|
596
|
+
}
|
597
|
+
}
|
598
|
+
return scrollColumnIndex;
|
556
599
|
}
|
557
|
-
return mostLeftColumnIndex
|
600
|
+
return mostLeftColumnIndex <= firstVisibleColumn ? mostLeftColumnIndex : mostRightColumnIndex;
|
558
601
|
}
|
559
602
|
/**
|
560
603
|
* Allows to control which header DOM element will be used to highlight.
|
@@ -625,13 +668,13 @@ function _onBeforeCopy(data, copyableRanges, _ref2) {
|
|
625
668
|
}
|
626
669
|
for (let column = startCol; column <= endCol; column++) {
|
627
670
|
for (let row = startRow; row <= endRow; row++) {
|
628
|
-
var
|
671
|
+
var _classPrivateFieldGet5;
|
629
672
|
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
630
673
|
const zeroBasedColumnIndex = column - startCol;
|
631
674
|
if (zeroBasedColumnIndex === 0) {
|
632
675
|
continue; // eslint-disable-line no-continue
|
633
676
|
}
|
634
|
-
const isRoot = (
|
677
|
+
const isRoot = (_classPrivateFieldGet5 = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.isRoot;
|
635
678
|
if (isRoot === false) {
|
636
679
|
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
637
680
|
}
|
@@ -817,8 +860,9 @@ function _onModifyTransformStart(delta) {
|
|
817
860
|
*
|
818
861
|
* @param {CellCoords} from The coords object where the selection starts.
|
819
862
|
* @param {CellCoords} to The coords object where the selection ends.
|
863
|
+
* @param {CellCoords} highlight The coords object where the focus is.
|
820
864
|
*/
|
821
|
-
function _onBeforeSelectColumns(from, to) {
|
865
|
+
function _onBeforeSelectColumns(from, to, highlight) {
|
822
866
|
const headerLevel = from.row;
|
823
867
|
const startNodeData = this._getHeaderTreeNodeDataByCoords({
|
824
868
|
row: headerLevel,
|
@@ -828,6 +872,7 @@ function _onBeforeSelectColumns(from, to) {
|
|
828
872
|
row: headerLevel,
|
829
873
|
col: to.col
|
830
874
|
});
|
875
|
+
_classPrivateFieldSet(_recentlyHighlightCoords, this, highlight.clone());
|
831
876
|
if (to.col < from.col) {
|
832
877
|
// Column selection from right to left
|
833
878
|
if (startNodeData) {
|
@@ -912,10 +957,10 @@ function _onModifyColWidth(width, column) {
|
|
912
957
|
* @returns {string} Returns the column header value to update.
|
913
958
|
*/
|
914
959
|
function _onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
915
|
-
var
|
960
|
+
var _classPrivateFieldGet6;
|
916
961
|
const {
|
917
962
|
label
|
918
|
-
} = (
|
963
|
+
} = (_classPrivateFieldGet6 = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet6 !== void 0 ? _classPrivateFieldGet6 : {
|
919
964
|
label: ''
|
920
965
|
};
|
921
966
|
return label;
|