handsontable 0.0.0-next-b96fb9f-20231207 → 0.0.0-next-3d099da-20231208
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 +6 -11
- package/3rdparty/walkontable/src/calculator/index.mjs +3 -5
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +122 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +124 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -2
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/core/core.js +2 -0
- package/3rdparty/walkontable/src/core/core.mjs +2 -0
- package/3rdparty/walkontable/src/facade/core.js +9 -0
- package/3rdparty/walkontable/src/facade/core.mjs +9 -0
- package/3rdparty/walkontable/src/index.js +4 -3
- package/3rdparty/walkontable/src/index.mjs +2 -1
- package/3rdparty/walkontable/src/overlays.js +3 -0
- package/3rdparty/walkontable/src/overlays.mjs +4 -0
- package/3rdparty/walkontable/src/renderer/colGroup.js +0 -10
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +0 -10
- package/3rdparty/walkontable/src/renderer/rows.js +3 -4
- package/3rdparty/walkontable/src/renderer/rows.mjs +3 -4
- package/3rdparty/walkontable/src/selection/manager.js +1 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +1 -0
- package/3rdparty/walkontable/src/settings.js +0 -3
- package/3rdparty/walkontable/src/settings.mjs +0 -2
- package/3rdparty/walkontable/src/table.js +1 -0
- package/3rdparty/walkontable/src/table.mjs +1 -0
- package/3rdparty/walkontable/src/utils/column.js +12 -27
- package/3rdparty/walkontable/src/utils/column.mjs +12 -27
- package/3rdparty/walkontable/src/viewport.js +17 -22
- package/3rdparty/walkontable/src/viewport.mjs +18 -23
- package/base.js +2 -4
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +6 -44
- package/core/focusCatcher/index.mjs +6 -44
- package/core.js +11 -0
- package/core.mjs +11 -0
- package/dataMap/dataMap.js +0 -1
- package/dataMap/metaManager/metaSchema.js +2 -28
- package/dataMap/metaManager/metaSchema.mjs +2 -28
- package/dataMap/metaManager/mods/extendMetaProperties.js +0 -12
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +0 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3903 -2640
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +70 -66
- package/dist/handsontable.js +3906 -2643
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +39 -35
- package/editorManager.js +4 -3
- package/editorManager.mjs +4 -3
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -0
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -0
- package/editors/handsontableEditor/handsontableEditor.js +1 -0
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -0
- package/editors/textEditor/textEditor.js +4 -0
- package/editors/textEditor/textEditor.mjs +4 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +29 -6
- package/pluginHooks.js +123 -65
- package/pluginHooks.mjs +122 -62
- package/plugins/copyPaste/clipboardData/clipboardData.js +588 -0
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +584 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
- package/plugins/copyPaste/clipboardData/index.js +9 -0
- package/plugins/copyPaste/clipboardData/index.mjs +4 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
- package/plugins/copyPaste/copyPaste.js +51 -129
- package/plugins/copyPaste/copyPaste.mjs +54 -132
- package/plugins/copyPaste/copyableRanges.js +7 -43
- package/plugins/copyPaste/copyableRanges.mjs +7 -42
- package/plugins/copyPaste/pasteEvent.mjs +1 -1
- package/plugins/customBorders/customBorders.js +5 -0
- package/plugins/customBorders/customBorders.mjs +5 -0
- package/plugins/customBorders/utils.js +1 -0
- package/plugins/customBorders/utils.mjs +1 -0
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.js +2 -0
- package/plugins/formulas/formulas.mjs +2 -0
- package/plugins/formulas/indexSyncer/axisSyncer.js +1 -0
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +1 -0
- package/plugins/manualColumnResize/manualColumnResize.js +1 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +1 -0
- package/plugins/mergeCells/mergeCells.js +127 -1
- package/plugins/mergeCells/mergeCells.mjs +127 -1
- package/plugins/nestedHeaders/nestedHeaders.js +87 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +88 -42
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -0
- package/plugins/undoRedo/undoRedo.mjs +2 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -0
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +2 -0
- package/selection/highlight/highlight.js +1 -0
- package/selection/highlight/highlight.mjs +1 -0
- package/selection/index.js +3 -1
- package/selection/index.mjs +2 -2
- package/selection/utils.js +34 -0
- package/selection/utils.mjs +33 -0
- package/settings.d.ts +0 -1
- package/tableView.js +2 -1
- package/tableView.mjs +2 -1
- package/translations/indexMapper.js +1 -2
- package/utils/parseTable.js +538 -84
- package/utils/parseTable.mjs +534 -83
- package/validators/timeValidator/timeValidator.js +1 -0
- package/validators/timeValidator/timeValidator.mjs +1 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +0 -46
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +0 -46
- package/3rdparty/walkontable/src/utils/columnStretching.js +0 -219
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -215
- package/plugins/copyPaste/clipboardData.js +0 -18
- package/plugins/copyPaste/clipboardData.mjs +0 -14
@@ -1,50 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
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
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
7
|
-
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); }
|
8
|
-
/**
|
9
|
-
* @typedef {object} RenderAllColumnsCalculatorOptions
|
10
|
-
* @property {number} totalColumns Total number of columns.
|
11
|
-
*/
|
12
|
-
/**
|
13
|
-
* Holds all calculations needed to perform rendering of the all columns.
|
14
|
-
*
|
15
|
-
* @class RenderAllColumnsCalculator
|
16
|
-
*/
|
17
|
-
class RenderAllColumnsCalculator {
|
18
|
-
/**
|
19
|
-
* @param {RenderAllColumnsCalculatorOptions} options Object with all options specified for column viewport calculation.
|
20
|
-
*/
|
21
|
-
constructor(options) {
|
22
|
-
/**
|
23
|
-
* Number of rendered/visible columns.
|
24
|
-
*
|
25
|
-
* @type {number}
|
26
|
-
*/
|
27
|
-
_defineProperty(this, "count", 0);
|
28
|
-
/**
|
29
|
-
* Index of the first rendered/visible column.
|
30
|
-
*
|
31
|
-
* @type {number}
|
32
|
-
*/
|
33
|
-
_defineProperty(this, "startColumn", 0);
|
34
|
-
/**
|
35
|
-
* Index of the last rendered/visible column.
|
36
|
-
*
|
37
|
-
* @type {number}
|
38
|
-
*/
|
39
|
-
_defineProperty(this, "endColumn", 0);
|
40
|
-
/**
|
41
|
-
* Position of the first rendered/visible column (in px).
|
42
|
-
*
|
43
|
-
* @type {number}
|
44
|
-
*/
|
45
|
-
_defineProperty(this, "startPosition", 0);
|
46
|
-
this.count = options.totalColumns;
|
47
|
-
this.endColumn = this.count - 1;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
exports.RenderAllColumnsCalculator = RenderAllColumnsCalculator;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
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; }
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
4
|
-
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); }
|
5
|
-
/**
|
6
|
-
* @typedef {object} RenderAllColumnsCalculatorOptions
|
7
|
-
* @property {number} totalColumns Total number of columns.
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* Holds all calculations needed to perform rendering of the all columns.
|
11
|
-
*
|
12
|
-
* @class RenderAllColumnsCalculator
|
13
|
-
*/
|
14
|
-
export class RenderAllColumnsCalculator {
|
15
|
-
/**
|
16
|
-
* @param {RenderAllColumnsCalculatorOptions} options Object with all options specified for column viewport calculation.
|
17
|
-
*/
|
18
|
-
constructor(options) {
|
19
|
-
/**
|
20
|
-
* Number of rendered/visible columns.
|
21
|
-
*
|
22
|
-
* @type {number}
|
23
|
-
*/
|
24
|
-
_defineProperty(this, "count", 0);
|
25
|
-
/**
|
26
|
-
* Index of the first rendered/visible column.
|
27
|
-
*
|
28
|
-
* @type {number}
|
29
|
-
*/
|
30
|
-
_defineProperty(this, "startColumn", 0);
|
31
|
-
/**
|
32
|
-
* Index of the last rendered/visible column.
|
33
|
-
*
|
34
|
-
* @type {number}
|
35
|
-
*/
|
36
|
-
_defineProperty(this, "endColumn", 0);
|
37
|
-
/**
|
38
|
-
* Position of the first rendered/visible column (in px).
|
39
|
-
*
|
40
|
-
* @type {number}
|
41
|
-
*/
|
42
|
-
_defineProperty(this, "startPosition", 0);
|
43
|
-
this.count = options.totalColumns;
|
44
|
-
this.endColumn = this.count - 1;
|
45
|
-
}
|
46
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
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
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
7
|
-
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); }
|
8
|
-
/**
|
9
|
-
* @typedef {object} RenderAllRowsCalculatorOptions
|
10
|
-
* @property {number} totalRows Total number of rows.
|
11
|
-
*/
|
12
|
-
/**
|
13
|
-
* Holds all calculations needed to perform rendering of the all rows.
|
14
|
-
*
|
15
|
-
* @class RenderAllRowsCalculator
|
16
|
-
*/
|
17
|
-
class RenderAllRowsCalculator {
|
18
|
-
/**
|
19
|
-
* @param {RenderAllRowsCalculatorOptions} options Object with all options specified for row viewport calculation.
|
20
|
-
*/
|
21
|
-
constructor(options) {
|
22
|
-
/**
|
23
|
-
* Number of rendered/visible rows.
|
24
|
-
*
|
25
|
-
* @type {number}
|
26
|
-
*/
|
27
|
-
_defineProperty(this, "count", 0);
|
28
|
-
/**
|
29
|
-
* Index of the first rendered/visible row.
|
30
|
-
*
|
31
|
-
* @type {number}
|
32
|
-
*/
|
33
|
-
_defineProperty(this, "startRow", 0);
|
34
|
-
/**
|
35
|
-
* Index of the last rendered/visible row.
|
36
|
-
*
|
37
|
-
* @type {number}
|
38
|
-
*/
|
39
|
-
_defineProperty(this, "endRow", 0);
|
40
|
-
/**
|
41
|
-
* Position of the first rendered/visible row (in px).
|
42
|
-
*
|
43
|
-
* @type {number}
|
44
|
-
*/
|
45
|
-
_defineProperty(this, "startPosition", 0);
|
46
|
-
this.count = options.totalRows;
|
47
|
-
this.endRow = this.count - 1;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
exports.RenderAllRowsCalculator = RenderAllRowsCalculator;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
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; }
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
4
|
-
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); }
|
5
|
-
/**
|
6
|
-
* @typedef {object} RenderAllRowsCalculatorOptions
|
7
|
-
* @property {number} totalRows Total number of rows.
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* Holds all calculations needed to perform rendering of the all rows.
|
11
|
-
*
|
12
|
-
* @class RenderAllRowsCalculator
|
13
|
-
*/
|
14
|
-
export class RenderAllRowsCalculator {
|
15
|
-
/**
|
16
|
-
* @param {RenderAllRowsCalculatorOptions} options Object with all options specified for row viewport calculation.
|
17
|
-
*/
|
18
|
-
constructor(options) {
|
19
|
-
/**
|
20
|
-
* Number of rendered/visible rows.
|
21
|
-
*
|
22
|
-
* @type {number}
|
23
|
-
*/
|
24
|
-
_defineProperty(this, "count", 0);
|
25
|
-
/**
|
26
|
-
* Index of the first rendered/visible row.
|
27
|
-
*
|
28
|
-
* @type {number}
|
29
|
-
*/
|
30
|
-
_defineProperty(this, "startRow", 0);
|
31
|
-
/**
|
32
|
-
* Index of the last rendered/visible row.
|
33
|
-
*
|
34
|
-
* @type {number}
|
35
|
-
*/
|
36
|
-
_defineProperty(this, "endRow", 0);
|
37
|
-
/**
|
38
|
-
* Position of the first rendered/visible row (in px).
|
39
|
-
*
|
40
|
-
* @type {number}
|
41
|
-
*/
|
42
|
-
_defineProperty(this, "startPosition", 0);
|
43
|
-
this.count = options.totalRows;
|
44
|
-
this.endRow = this.count - 1;
|
45
|
-
}
|
46
|
-
}
|
@@ -1,219 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
6
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
7
|
-
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; }
|
8
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
9
|
-
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); }
|
10
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
13
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
15
|
-
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
16
|
-
var _totalColumns = /*#__PURE__*/new WeakMap();
|
17
|
-
var _stretchingColumnWidthFn = /*#__PURE__*/new WeakMap();
|
18
|
-
var _columnWidthFn = /*#__PURE__*/new WeakMap();
|
19
|
-
var _stretchMode = /*#__PURE__*/new WeakMap();
|
20
|
-
/**
|
21
|
-
* @typedef {object} ColumnStretchingOptions
|
22
|
-
* @property {number} totalColumns Total number of columns.
|
23
|
-
* @property {Function} columnWidthFn Function that returns the width of the column at a given index (in px).
|
24
|
-
* @property {'all' | 'last' | 'none'} stretchMode Stretch mode 'all', 'last' or 'none'.
|
25
|
-
* @property {Function} stretchingColumnWidthFn Function that returns the new width of the stretched column.
|
26
|
-
*/
|
27
|
-
/**
|
28
|
-
* @class ColumnStretching
|
29
|
-
*/
|
30
|
-
class ColumnStretching {
|
31
|
-
/**
|
32
|
-
* Default column width.
|
33
|
-
*
|
34
|
-
* @type {number}
|
35
|
-
*/
|
36
|
-
static get DEFAULT_WIDTH() {
|
37
|
-
return 50;
|
38
|
-
}
|
39
|
-
|
40
|
-
/**
|
41
|
-
* @type {number}
|
42
|
-
*/
|
43
|
-
|
44
|
-
/**
|
45
|
-
* @param {ColumnStretchingOptions} options Object with all options specified for column viewport calculation.
|
46
|
-
*/
|
47
|
-
constructor(_ref) {
|
48
|
-
let {
|
49
|
-
totalColumns,
|
50
|
-
stretchMode,
|
51
|
-
stretchingColumnWidthFn,
|
52
|
-
columnWidthFn
|
53
|
-
} = _ref;
|
54
|
-
_defineProperty(this, "stretchAllRatio", 0);
|
55
|
-
/**
|
56
|
-
* @type {number}
|
57
|
-
*/
|
58
|
-
_defineProperty(this, "stretchLastWidth", 0);
|
59
|
-
/**
|
60
|
-
* @type {number[]}
|
61
|
-
*/
|
62
|
-
_defineProperty(this, "stretchAllColumnsWidth", []);
|
63
|
-
/**
|
64
|
-
* @type {number}
|
65
|
-
*/
|
66
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
67
|
-
writable: true,
|
68
|
-
value: 0
|
69
|
-
});
|
70
|
-
/**
|
71
|
-
* @type {boolean}
|
72
|
-
*/
|
73
|
-
_defineProperty(this, "needVerifyLastColumnWidth", true);
|
74
|
-
/**
|
75
|
-
* The total number of columns.
|
76
|
-
*
|
77
|
-
* @type {function(): number}
|
78
|
-
*/
|
79
|
-
_classPrivateFieldInitSpec(this, _totalColumns, {
|
80
|
-
writable: true,
|
81
|
-
value: () => 0
|
82
|
-
});
|
83
|
-
/**
|
84
|
-
* Function that returns the width of the stretched column at a given index (in px).
|
85
|
-
*
|
86
|
-
* @type {function(): number}
|
87
|
-
*/
|
88
|
-
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn, {
|
89
|
-
writable: true,
|
90
|
-
value: width => width
|
91
|
-
});
|
92
|
-
/**
|
93
|
-
* Function that returns the width of the column at a given index (in px).
|
94
|
-
*
|
95
|
-
* @type {function(): number}
|
96
|
-
*/
|
97
|
-
_classPrivateFieldInitSpec(this, _columnWidthFn, {
|
98
|
-
writable: true,
|
99
|
-
value: width => width
|
100
|
-
});
|
101
|
-
/**
|
102
|
-
* Stretch mode.
|
103
|
-
*
|
104
|
-
* @type {function(): 'all' | 'last' | 'none'}
|
105
|
-
*/
|
106
|
-
_classPrivateFieldInitSpec(this, _stretchMode, {
|
107
|
-
writable: true,
|
108
|
-
value: () => 'none'
|
109
|
-
});
|
110
|
-
_classPrivateFieldSet(this, _totalColumns, totalColumns);
|
111
|
-
_classPrivateFieldSet(this, _stretchMode, stretchMode);
|
112
|
-
_classPrivateFieldSet(this, _stretchingColumnWidthFn, stretchingColumnWidthFn !== null && stretchingColumnWidthFn !== void 0 ? stretchingColumnWidthFn : _classPrivateFieldGet(this, _stretchingColumnWidthFn));
|
113
|
-
_classPrivateFieldSet(this, _columnWidthFn, columnWidthFn !== null && columnWidthFn !== void 0 ? columnWidthFn : _classPrivateFieldGet(this, _columnWidthFn));
|
114
|
-
}
|
115
|
-
|
116
|
-
/**
|
117
|
-
* Recalculate columns stretching.
|
118
|
-
*
|
119
|
-
* @param {number} totalWidth The total width of the table.
|
120
|
-
*/
|
121
|
-
refreshStretching(totalWidth) {
|
122
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'none') {
|
123
|
-
return;
|
124
|
-
}
|
125
|
-
_classPrivateFieldSet(this, _totalTargetWidth, totalWidth);
|
126
|
-
let sumAll = 0;
|
127
|
-
for (let i = 0; i < _classPrivateFieldGet(this, _totalColumns).call(this); i++) {
|
128
|
-
const columnWidth = this._getColumnWidth(i);
|
129
|
-
const permanentColumnWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, undefined, i);
|
130
|
-
if (typeof permanentColumnWidth === 'number') {
|
131
|
-
totalWidth -= permanentColumnWidth;
|
132
|
-
} else {
|
133
|
-
sumAll += columnWidth;
|
134
|
-
}
|
135
|
-
}
|
136
|
-
const remainingSize = totalWidth - sumAll;
|
137
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && remainingSize > 0) {
|
138
|
-
this.stretchAllRatio = totalWidth / sumAll;
|
139
|
-
this.stretchAllColumnsWidth = [];
|
140
|
-
this.needVerifyLastColumnWidth = true;
|
141
|
-
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && totalWidth !== Infinity) {
|
142
|
-
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(this, _totalColumns).call(this) - 1);
|
143
|
-
const lastColumnWidth = remainingSize + columnWidth;
|
144
|
-
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
145
|
-
}
|
146
|
-
}
|
147
|
-
|
148
|
-
/**
|
149
|
-
* Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
|
150
|
-
*
|
151
|
-
* @param {number} column The visual column index.
|
152
|
-
* @param {number} baseWidth The default column width.
|
153
|
-
* @returns {number|null}
|
154
|
-
*/
|
155
|
-
getStretchedColumnWidth(column, baseWidth) {
|
156
|
-
let result = null;
|
157
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && this.stretchAllRatio !== 0) {
|
158
|
-
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
159
|
-
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && this.stretchLastWidth !== 0) {
|
160
|
-
result = this._getStretchedLastColumnWidth(column);
|
161
|
-
}
|
162
|
-
return result;
|
163
|
-
}
|
164
|
-
|
165
|
-
/**
|
166
|
-
* @param {number} column The visual column index.
|
167
|
-
* @param {number} baseWidth The default column width.
|
168
|
-
* @returns {number}
|
169
|
-
* @private
|
170
|
-
*/
|
171
|
-
_getStretchedAllColumnWidth(column, baseWidth) {
|
172
|
-
let sumRatioWidth = 0;
|
173
|
-
if (!this.stretchAllColumnsWidth[column]) {
|
174
|
-
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
175
|
-
const newStretchedWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, stretchedWidth, column);
|
176
|
-
if (newStretchedWidth === undefined) {
|
177
|
-
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
178
|
-
} else {
|
179
|
-
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
180
|
-
}
|
181
|
-
}
|
182
|
-
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(this, _totalColumns).call(this) && this.needVerifyLastColumnWidth) {
|
183
|
-
this.needVerifyLastColumnWidth = false;
|
184
|
-
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
185
|
-
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
186
|
-
}
|
187
|
-
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
188
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
189
|
-
}
|
190
|
-
}
|
191
|
-
return this.stretchAllColumnsWidth[column];
|
192
|
-
}
|
193
|
-
|
194
|
-
/**
|
195
|
-
* @param {number} column The visual column index.
|
196
|
-
* @returns {number|null}
|
197
|
-
* @private
|
198
|
-
*/
|
199
|
-
_getStretchedLastColumnWidth(column) {
|
200
|
-
if (column === _classPrivateFieldGet(this, _totalColumns).call(this) - 1) {
|
201
|
-
return this.stretchLastWidth;
|
202
|
-
}
|
203
|
-
return null;
|
204
|
-
}
|
205
|
-
|
206
|
-
/**
|
207
|
-
* @param {number} column The visual column index.
|
208
|
-
* @returns {number}
|
209
|
-
* @private
|
210
|
-
*/
|
211
|
-
_getColumnWidth(column) {
|
212
|
-
let width = _classPrivateFieldGet(this, _columnWidthFn).call(this, column);
|
213
|
-
if (isNaN(width)) {
|
214
|
-
width = ColumnStretching.DEFAULT_WIDTH;
|
215
|
-
}
|
216
|
-
return width;
|
217
|
-
}
|
218
|
-
}
|
219
|
-
exports.ColumnStretching = ColumnStretching;
|
@@ -1,215 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
3
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
4
|
-
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; }
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
6
|
-
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); }
|
7
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
12
|
-
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
13
|
-
var _totalColumns = /*#__PURE__*/new WeakMap();
|
14
|
-
var _stretchingColumnWidthFn = /*#__PURE__*/new WeakMap();
|
15
|
-
var _columnWidthFn = /*#__PURE__*/new WeakMap();
|
16
|
-
var _stretchMode = /*#__PURE__*/new WeakMap();
|
17
|
-
/**
|
18
|
-
* @typedef {object} ColumnStretchingOptions
|
19
|
-
* @property {number} totalColumns Total number of columns.
|
20
|
-
* @property {Function} columnWidthFn Function that returns the width of the column at a given index (in px).
|
21
|
-
* @property {'all' | 'last' | 'none'} stretchMode Stretch mode 'all', 'last' or 'none'.
|
22
|
-
* @property {Function} stretchingColumnWidthFn Function that returns the new width of the stretched column.
|
23
|
-
*/
|
24
|
-
/**
|
25
|
-
* @class ColumnStretching
|
26
|
-
*/
|
27
|
-
export class ColumnStretching {
|
28
|
-
/**
|
29
|
-
* Default column width.
|
30
|
-
*
|
31
|
-
* @type {number}
|
32
|
-
*/
|
33
|
-
static get DEFAULT_WIDTH() {
|
34
|
-
return 50;
|
35
|
-
}
|
36
|
-
|
37
|
-
/**
|
38
|
-
* @type {number}
|
39
|
-
*/
|
40
|
-
|
41
|
-
/**
|
42
|
-
* @param {ColumnStretchingOptions} options Object with all options specified for column viewport calculation.
|
43
|
-
*/
|
44
|
-
constructor(_ref) {
|
45
|
-
let {
|
46
|
-
totalColumns,
|
47
|
-
stretchMode,
|
48
|
-
stretchingColumnWidthFn,
|
49
|
-
columnWidthFn
|
50
|
-
} = _ref;
|
51
|
-
_defineProperty(this, "stretchAllRatio", 0);
|
52
|
-
/**
|
53
|
-
* @type {number}
|
54
|
-
*/
|
55
|
-
_defineProperty(this, "stretchLastWidth", 0);
|
56
|
-
/**
|
57
|
-
* @type {number[]}
|
58
|
-
*/
|
59
|
-
_defineProperty(this, "stretchAllColumnsWidth", []);
|
60
|
-
/**
|
61
|
-
* @type {number}
|
62
|
-
*/
|
63
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
64
|
-
writable: true,
|
65
|
-
value: 0
|
66
|
-
});
|
67
|
-
/**
|
68
|
-
* @type {boolean}
|
69
|
-
*/
|
70
|
-
_defineProperty(this, "needVerifyLastColumnWidth", true);
|
71
|
-
/**
|
72
|
-
* The total number of columns.
|
73
|
-
*
|
74
|
-
* @type {function(): number}
|
75
|
-
*/
|
76
|
-
_classPrivateFieldInitSpec(this, _totalColumns, {
|
77
|
-
writable: true,
|
78
|
-
value: () => 0
|
79
|
-
});
|
80
|
-
/**
|
81
|
-
* Function that returns the width of the stretched column at a given index (in px).
|
82
|
-
*
|
83
|
-
* @type {function(): number}
|
84
|
-
*/
|
85
|
-
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn, {
|
86
|
-
writable: true,
|
87
|
-
value: width => width
|
88
|
-
});
|
89
|
-
/**
|
90
|
-
* Function that returns the width of the column at a given index (in px).
|
91
|
-
*
|
92
|
-
* @type {function(): number}
|
93
|
-
*/
|
94
|
-
_classPrivateFieldInitSpec(this, _columnWidthFn, {
|
95
|
-
writable: true,
|
96
|
-
value: width => width
|
97
|
-
});
|
98
|
-
/**
|
99
|
-
* Stretch mode.
|
100
|
-
*
|
101
|
-
* @type {function(): 'all' | 'last' | 'none'}
|
102
|
-
*/
|
103
|
-
_classPrivateFieldInitSpec(this, _stretchMode, {
|
104
|
-
writable: true,
|
105
|
-
value: () => 'none'
|
106
|
-
});
|
107
|
-
_classPrivateFieldSet(this, _totalColumns, totalColumns);
|
108
|
-
_classPrivateFieldSet(this, _stretchMode, stretchMode);
|
109
|
-
_classPrivateFieldSet(this, _stretchingColumnWidthFn, stretchingColumnWidthFn !== null && stretchingColumnWidthFn !== void 0 ? stretchingColumnWidthFn : _classPrivateFieldGet(this, _stretchingColumnWidthFn));
|
110
|
-
_classPrivateFieldSet(this, _columnWidthFn, columnWidthFn !== null && columnWidthFn !== void 0 ? columnWidthFn : _classPrivateFieldGet(this, _columnWidthFn));
|
111
|
-
}
|
112
|
-
|
113
|
-
/**
|
114
|
-
* Recalculate columns stretching.
|
115
|
-
*
|
116
|
-
* @param {number} totalWidth The total width of the table.
|
117
|
-
*/
|
118
|
-
refreshStretching(totalWidth) {
|
119
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'none') {
|
120
|
-
return;
|
121
|
-
}
|
122
|
-
_classPrivateFieldSet(this, _totalTargetWidth, totalWidth);
|
123
|
-
let sumAll = 0;
|
124
|
-
for (let i = 0; i < _classPrivateFieldGet(this, _totalColumns).call(this); i++) {
|
125
|
-
const columnWidth = this._getColumnWidth(i);
|
126
|
-
const permanentColumnWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, undefined, i);
|
127
|
-
if (typeof permanentColumnWidth === 'number') {
|
128
|
-
totalWidth -= permanentColumnWidth;
|
129
|
-
} else {
|
130
|
-
sumAll += columnWidth;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
const remainingSize = totalWidth - sumAll;
|
134
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && remainingSize > 0) {
|
135
|
-
this.stretchAllRatio = totalWidth / sumAll;
|
136
|
-
this.stretchAllColumnsWidth = [];
|
137
|
-
this.needVerifyLastColumnWidth = true;
|
138
|
-
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && totalWidth !== Infinity) {
|
139
|
-
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(this, _totalColumns).call(this) - 1);
|
140
|
-
const lastColumnWidth = remainingSize + columnWidth;
|
141
|
-
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
142
|
-
}
|
143
|
-
}
|
144
|
-
|
145
|
-
/**
|
146
|
-
* Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
|
147
|
-
*
|
148
|
-
* @param {number} column The visual column index.
|
149
|
-
* @param {number} baseWidth The default column width.
|
150
|
-
* @returns {number|null}
|
151
|
-
*/
|
152
|
-
getStretchedColumnWidth(column, baseWidth) {
|
153
|
-
let result = null;
|
154
|
-
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && this.stretchAllRatio !== 0) {
|
155
|
-
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
156
|
-
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && this.stretchLastWidth !== 0) {
|
157
|
-
result = this._getStretchedLastColumnWidth(column);
|
158
|
-
}
|
159
|
-
return result;
|
160
|
-
}
|
161
|
-
|
162
|
-
/**
|
163
|
-
* @param {number} column The visual column index.
|
164
|
-
* @param {number} baseWidth The default column width.
|
165
|
-
* @returns {number}
|
166
|
-
* @private
|
167
|
-
*/
|
168
|
-
_getStretchedAllColumnWidth(column, baseWidth) {
|
169
|
-
let sumRatioWidth = 0;
|
170
|
-
if (!this.stretchAllColumnsWidth[column]) {
|
171
|
-
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
172
|
-
const newStretchedWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, stretchedWidth, column);
|
173
|
-
if (newStretchedWidth === undefined) {
|
174
|
-
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
175
|
-
} else {
|
176
|
-
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(this, _totalColumns).call(this) && this.needVerifyLastColumnWidth) {
|
180
|
-
this.needVerifyLastColumnWidth = false;
|
181
|
-
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
182
|
-
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
183
|
-
}
|
184
|
-
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
185
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
186
|
-
}
|
187
|
-
}
|
188
|
-
return this.stretchAllColumnsWidth[column];
|
189
|
-
}
|
190
|
-
|
191
|
-
/**
|
192
|
-
* @param {number} column The visual column index.
|
193
|
-
* @returns {number|null}
|
194
|
-
* @private
|
195
|
-
*/
|
196
|
-
_getStretchedLastColumnWidth(column) {
|
197
|
-
if (column === _classPrivateFieldGet(this, _totalColumns).call(this) - 1) {
|
198
|
-
return this.stretchLastWidth;
|
199
|
-
}
|
200
|
-
return null;
|
201
|
-
}
|
202
|
-
|
203
|
-
/**
|
204
|
-
* @param {number} column The visual column index.
|
205
|
-
* @returns {number}
|
206
|
-
* @private
|
207
|
-
*/
|
208
|
-
_getColumnWidth(column) {
|
209
|
-
let width = _classPrivateFieldGet(this, _columnWidthFn).call(this, column);
|
210
|
-
if (isNaN(width)) {
|
211
|
-
width = ColumnStretching.DEFAULT_WIDTH;
|
212
|
-
}
|
213
|
-
return width;
|
214
|
-
}
|
215
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
/**
|
5
|
-
* @private
|
6
|
-
*/
|
7
|
-
class ClipboardData {
|
8
|
-
constructor() {
|
9
|
-
this.data = {};
|
10
|
-
}
|
11
|
-
setData(type, value) {
|
12
|
-
this.data[type] = value;
|
13
|
-
}
|
14
|
-
getData(type) {
|
15
|
-
return this.data[type] || void 0;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
exports.default = ClipboardData;
|