handsontable 0.0.0-next-a417c2b-20231124 → 0.0.0-next-301795f-20231127
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/overlay/_base.js +2 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rows.js +1 -1
- package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/dataMap/replaceData.js +3 -1
- package/dataMap/replaceData.mjs +3 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +115 -99
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +6 -6
- package/dist/handsontable.js +115 -99
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +31 -31
- package/editors/dateEditor/dateEditor.js +0 -7
- package/editors/dateEditor/dateEditor.mjs +1 -8
- package/editors/handsontableEditor/handsontableEditor.js +0 -7
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -8
- package/editors/passwordEditor/passwordEditor.js +4 -0
- package/editors/passwordEditor/passwordEditor.mjs +5 -1
- package/focusManager.js +56 -44
- package/focusManager.mjs +56 -44
- package/helpers/a11y.js +2 -0
- package/helpers/a11y.mjs +1 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -3
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -4
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -1
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -1
- package/renderers/dateRenderer/dateRenderer.js +0 -5
- package/renderers/dateRenderer/dateRenderer.mjs +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.js +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -5
- package/renderers/selectRenderer/selectRenderer.js +0 -5
- package/renderers/selectRenderer/selectRenderer.mjs +0 -5
- package/tableView.js +31 -2
- package/tableView.mjs +31 -2
@@ -1,6 +1,4 @@
|
|
1
1
|
import { textRenderer } from "../textRenderer/index.mjs";
|
2
|
-
import { A11Y_HASPOPUP } from "../../helpers/a11y.mjs";
|
3
|
-
import { setAttribute } from "../../helpers/dom/element.mjs";
|
4
2
|
export const RENDERER_TYPE = 'select';
|
5
3
|
|
6
4
|
/**
|
@@ -15,8 +13,5 @@ export const RENDERER_TYPE = 'select';
|
|
15
13
|
*/
|
16
14
|
export function selectRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
|
17
15
|
textRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
|
18
|
-
if (hotInstance.getSettings().ariaTags) {
|
19
|
-
setAttribute(TD, ...A11Y_HASPOPUP('listbox'));
|
20
|
-
}
|
21
16
|
}
|
22
17
|
selectRenderer.RENDERER_TYPE = RENDERER_TYPE;
|
package/tableView.js
CHANGED
@@ -11,11 +11,13 @@ var _mouseEventHandler = require("./selection/mouseEventHandler");
|
|
11
11
|
var _rootInstance = require("./utils/rootInstance");
|
12
12
|
var _a11y = require("./helpers/a11y");
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
14
15
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
15
16
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
16
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
18
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
18
19
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
20
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
19
21
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
20
22
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
21
23
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -32,11 +34,25 @@ var _mouseDown = /*#__PURE__*/new WeakMap();
|
|
32
34
|
var _table = /*#__PURE__*/new WeakMap();
|
33
35
|
var _lastWidth = /*#__PURE__*/new WeakMap();
|
34
36
|
var _lastHeight = /*#__PURE__*/new WeakMap();
|
37
|
+
var _getAriaColcount = /*#__PURE__*/new WeakSet();
|
38
|
+
var _updateAriaColcount = /*#__PURE__*/new WeakSet();
|
35
39
|
class TableView {
|
36
40
|
/**
|
37
41
|
* @param {Hanstontable} hotInstance Instance of {@link Handsontable}.
|
38
42
|
*/
|
39
43
|
constructor(hotInstance) {
|
44
|
+
/**
|
45
|
+
* Update the `aria-colcount` attribute by the provided value.
|
46
|
+
*
|
47
|
+
* @param {number} delta The number of columns to add or remove to the aria tag.
|
48
|
+
*/
|
49
|
+
_classPrivateMethodInitSpec(this, _updateAriaColcount);
|
50
|
+
/**
|
51
|
+
* Return the value of the `aria-colcount` attribute.
|
52
|
+
*
|
53
|
+
* @returns {number} The value of the `aria-colcount` attribute.
|
54
|
+
*/
|
55
|
+
_classPrivateMethodInitSpec(this, _getAriaColcount);
|
40
56
|
/**
|
41
57
|
* Instance of {@link Handsontable}.
|
42
58
|
*
|
@@ -273,7 +289,7 @@ class TableView {
|
|
273
289
|
}
|
274
290
|
if (this.settings.ariaTags) {
|
275
291
|
(0, _element.setAttribute)(_classPrivateFieldGet(this, _table), [(0, _a11y.A11Y_PRESENTATION)()]);
|
276
|
-
(0, _element.setAttribute)(rootElement, [(0, _a11y.A11Y_TREEGRID)(), (0, _a11y.A11Y_ROWCOUNT)(
|
292
|
+
(0, _element.setAttribute)(rootElement, [(0, _a11y.A11Y_TREEGRID)(), (0, _a11y.A11Y_ROWCOUNT)(-1), (0, _a11y.A11Y_COLCOUNT)(this.hot.countCols()), (0, _a11y.A11Y_MULTISELECTABLE)()]);
|
277
293
|
}
|
278
294
|
this.THEAD = rootDocument.createElement('THEAD');
|
279
295
|
_classPrivateFieldGet(this, _table).appendChild(this.THEAD);
|
@@ -666,6 +682,13 @@ class TableView {
|
|
666
682
|
}
|
667
683
|
this.hot.runHooks('afterGetRowHeaderRenderers', headerRenderers);
|
668
684
|
_classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
|
685
|
+
if (this.hot.getSettings().ariaTags) {
|
686
|
+
// Update the aria-colcount attribute.
|
687
|
+
// Only needs to be done once after initialization/data update.
|
688
|
+
if (_classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) === this.hot.countCols()) {
|
689
|
+
_classPrivateMethodGet(this, _updateAriaColcount, _updateAriaColcount2).call(this, _classPrivateFieldGet(this, _rowHeadersCount));
|
690
|
+
}
|
691
|
+
}
|
669
692
|
return headerRenderers;
|
670
693
|
},
|
671
694
|
columnHeaders: () => {
|
@@ -1305,7 +1328,6 @@ class TableView {
|
|
1305
1328
|
getRowHeadersCount() {
|
1306
1329
|
return _classPrivateFieldGet(this, _rowHeadersCount);
|
1307
1330
|
}
|
1308
|
-
|
1309
1331
|
/**
|
1310
1332
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
1311
1333
|
*
|
@@ -1316,5 +1338,12 @@ class TableView {
|
|
1316
1338
|
this.eventManager.destroy();
|
1317
1339
|
}
|
1318
1340
|
}
|
1341
|
+
function _getAriaColcount2() {
|
1342
|
+
return parseInt(this.hot.rootElement.getAttribute((0, _a11y.A11Y_COLCOUNT)()[0]), 10);
|
1343
|
+
}
|
1344
|
+
function _updateAriaColcount2(delta) {
|
1345
|
+
const colCount = _classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) + delta;
|
1346
|
+
(0, _element.setAttribute)(this.hot.rootElement, ...(0, _a11y.A11Y_COLCOUNT)(colCount));
|
1347
|
+
}
|
1319
1348
|
var _default = TableView;
|
1320
1349
|
exports.default = _default;
|
package/tableView.mjs
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
2
|
import "core-js/modules/es.error.cause.js";
|
3
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
7
8
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
9
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
8
10
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
9
11
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
10
12
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -28,11 +30,25 @@ var _mouseDown = /*#__PURE__*/new WeakMap();
|
|
28
30
|
var _table = /*#__PURE__*/new WeakMap();
|
29
31
|
var _lastWidth = /*#__PURE__*/new WeakMap();
|
30
32
|
var _lastHeight = /*#__PURE__*/new WeakMap();
|
33
|
+
var _getAriaColcount = /*#__PURE__*/new WeakSet();
|
34
|
+
var _updateAriaColcount = /*#__PURE__*/new WeakSet();
|
31
35
|
class TableView {
|
32
36
|
/**
|
33
37
|
* @param {Hanstontable} hotInstance Instance of {@link Handsontable}.
|
34
38
|
*/
|
35
39
|
constructor(hotInstance) {
|
40
|
+
/**
|
41
|
+
* Update the `aria-colcount` attribute by the provided value.
|
42
|
+
*
|
43
|
+
* @param {number} delta The number of columns to add or remove to the aria tag.
|
44
|
+
*/
|
45
|
+
_classPrivateMethodInitSpec(this, _updateAriaColcount);
|
46
|
+
/**
|
47
|
+
* Return the value of the `aria-colcount` attribute.
|
48
|
+
*
|
49
|
+
* @returns {number} The value of the `aria-colcount` attribute.
|
50
|
+
*/
|
51
|
+
_classPrivateMethodInitSpec(this, _getAriaColcount);
|
36
52
|
/**
|
37
53
|
* Instance of {@link Handsontable}.
|
38
54
|
*
|
@@ -269,7 +285,7 @@ class TableView {
|
|
269
285
|
}
|
270
286
|
if (this.settings.ariaTags) {
|
271
287
|
setAttribute(_classPrivateFieldGet(this, _table), [A11Y_PRESENTATION()]);
|
272
|
-
setAttribute(rootElement, [A11Y_TREEGRID(), A11Y_ROWCOUNT(
|
288
|
+
setAttribute(rootElement, [A11Y_TREEGRID(), A11Y_ROWCOUNT(-1), A11Y_COLCOUNT(this.hot.countCols()), A11Y_MULTISELECTABLE()]);
|
273
289
|
}
|
274
290
|
this.THEAD = rootDocument.createElement('THEAD');
|
275
291
|
_classPrivateFieldGet(this, _table).appendChild(this.THEAD);
|
@@ -662,6 +678,13 @@ class TableView {
|
|
662
678
|
}
|
663
679
|
this.hot.runHooks('afterGetRowHeaderRenderers', headerRenderers);
|
664
680
|
_classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
|
681
|
+
if (this.hot.getSettings().ariaTags) {
|
682
|
+
// Update the aria-colcount attribute.
|
683
|
+
// Only needs to be done once after initialization/data update.
|
684
|
+
if (_classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) === this.hot.countCols()) {
|
685
|
+
_classPrivateMethodGet(this, _updateAriaColcount, _updateAriaColcount2).call(this, _classPrivateFieldGet(this, _rowHeadersCount));
|
686
|
+
}
|
687
|
+
}
|
665
688
|
return headerRenderers;
|
666
689
|
},
|
667
690
|
columnHeaders: () => {
|
@@ -1301,7 +1324,6 @@ class TableView {
|
|
1301
1324
|
getRowHeadersCount() {
|
1302
1325
|
return _classPrivateFieldGet(this, _rowHeadersCount);
|
1303
1326
|
}
|
1304
|
-
|
1305
1327
|
/**
|
1306
1328
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
1307
1329
|
*
|
@@ -1312,4 +1334,11 @@ class TableView {
|
|
1312
1334
|
this.eventManager.destroy();
|
1313
1335
|
}
|
1314
1336
|
}
|
1337
|
+
function _getAriaColcount2() {
|
1338
|
+
return parseInt(this.hot.rootElement.getAttribute(A11Y_COLCOUNT()[0]), 10);
|
1339
|
+
}
|
1340
|
+
function _updateAriaColcount2(delta) {
|
1341
|
+
const colCount = _classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) + delta;
|
1342
|
+
setAttribute(this.hot.rootElement, ...A11Y_COLCOUNT(colCount));
|
1343
|
+
}
|
1315
1344
|
export default TableView;
|