handsontable 14.0.0-next-c22ab6f-20231030 → 14.0.0-next-f88c253-20231106
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/base.js +2 -2
- package/base.mjs +2 -2
- package/dist/handsontable.css +8 -2
- package/dist/handsontable.full.css +8 -2
- package/dist/handsontable.full.js +2084 -3359
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +59 -66
- package/dist/handsontable.js +2086 -3361
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +16 -23
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +1 -1
- package/pluginHooks.d.ts +6 -28
- package/pluginHooks.js +63 -117
- package/pluginHooks.mjs +63 -117
- package/plugins/copyPaste/clipboardData.js +18 -0
- package/plugins/copyPaste/clipboardData.mjs +14 -0
- package/plugins/copyPaste/copyPaste.js +92 -38
- package/plugins/copyPaste/copyPaste.mjs +94 -40
- package/plugins/copyPaste/pasteEvent.js +14 -0
- package/plugins/copyPaste/pasteEvent.mjs +9 -0
- package/plugins/mergeCells/mergeCells.js +14 -0
- package/plugins/mergeCells/mergeCells.mjs +14 -0
- package/plugins/nestedHeaders/nestedHeaders.js +22 -21
- package/plugins/nestedHeaders/nestedHeaders.mjs +22 -21
- package/utils/parseTable.js +83 -527
- package/utils/parseTable.mjs +82 -523
- package/plugins/copyPaste/clipboardData/clipboardData.js +0 -516
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +0 -512
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +0 -69
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +0 -65
- package/plugins/copyPaste/clipboardData/index.js +0 -9
- package/plugins/copyPaste/clipboardData/index.mjs +0 -4
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +0 -81
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +0 -77
@@ -1,81 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
var _clipboardData = require("./clipboardData");
|
6
|
-
var _parseTable = require("../../../utils/parseTable");
|
7
|
-
var _SheetClip = require("../../../3rdparty/SheetClip");
|
8
|
-
var _mixed = require("../../../helpers/mixed");
|
9
|
-
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; }
|
10
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
11
|
-
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); }
|
12
|
-
/**
|
13
|
-
* Creates an object containing information about paste action.
|
14
|
-
*
|
15
|
-
* @private
|
16
|
-
*/
|
17
|
-
class PasteClipboardData extends _clipboardData.ClipboardData {
|
18
|
-
/**
|
19
|
-
* @param {string} data Data of "text/plain" type inside the clipboard.
|
20
|
-
* @param {string} html Sanitized data of "text/html" type inside the clipboard.
|
21
|
-
*/
|
22
|
-
constructor(data, html) {
|
23
|
-
super();
|
24
|
-
/**
|
25
|
-
* Sanitized data of "text/html" type inside the clipboard.
|
26
|
-
*
|
27
|
-
* @private
|
28
|
-
* @type {string}
|
29
|
-
*/
|
30
|
-
_defineProperty(this, "html", void 0);
|
31
|
-
/**
|
32
|
-
* Copied data stored as array of arrays.
|
33
|
-
*
|
34
|
-
* @private
|
35
|
-
* @type {string[][]}
|
36
|
-
*/
|
37
|
-
_defineProperty(this, "data", void 0);
|
38
|
-
this.html = html;
|
39
|
-
if (this.isSerializedTable()) {
|
40
|
-
this.data = (0, _parseTable.getDataWithHeadersByConfig)(this.getMetaInfo());
|
41
|
-
} else {
|
42
|
-
this.data = (0, _SheetClip.parse)(data);
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
/**
|
47
|
-
* Checks whether pasted data is an array.
|
48
|
-
*
|
49
|
-
* @private
|
50
|
-
* @returns {boolean}
|
51
|
-
*/
|
52
|
-
isSerializedTable() {
|
53
|
-
return (0, _mixed.isDefined)(this.html) && /(<table)|(<TABLE)/g.test(this.html);
|
54
|
-
}
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Checks whether pasted data is a Handsontable.
|
58
|
-
*
|
59
|
-
* @private
|
60
|
-
* @returns {boolean}
|
61
|
-
*/
|
62
|
-
isSerializedHandsontable() {
|
63
|
-
return this.isSerializedTable() && /<meta (.*?)content="Handsontable"/.test(this.html);
|
64
|
-
}
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Gets type of the copied data.
|
68
|
-
*
|
69
|
-
* @returns {'table' | 'handsontable' | 'unrecognizable'}
|
70
|
-
*/
|
71
|
-
getType() {
|
72
|
-
if (this.isSerializedHandsontable()) {
|
73
|
-
return 'handsontable';
|
74
|
-
}
|
75
|
-
if (this.isSerializedTable()) {
|
76
|
-
return 'table';
|
77
|
-
}
|
78
|
-
return 'unrecognizable';
|
79
|
-
}
|
80
|
-
}
|
81
|
-
exports.PasteClipboardData = PasteClipboardData;
|
@@ -1,77 +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
|
-
import { ClipboardData } from "./clipboardData.mjs";
|
6
|
-
import { getDataWithHeadersByConfig } from "../../../utils/parseTable.mjs";
|
7
|
-
import { parse } from "../../../3rdparty/SheetClip/index.mjs";
|
8
|
-
import { isDefined } from "../../../helpers/mixed.mjs";
|
9
|
-
/**
|
10
|
-
* Creates an object containing information about paste action.
|
11
|
-
*
|
12
|
-
* @private
|
13
|
-
*/
|
14
|
-
export class PasteClipboardData extends ClipboardData {
|
15
|
-
/**
|
16
|
-
* @param {string} data Data of "text/plain" type inside the clipboard.
|
17
|
-
* @param {string} html Sanitized data of "text/html" type inside the clipboard.
|
18
|
-
*/
|
19
|
-
constructor(data, html) {
|
20
|
-
super();
|
21
|
-
/**
|
22
|
-
* Sanitized data of "text/html" type inside the clipboard.
|
23
|
-
*
|
24
|
-
* @private
|
25
|
-
* @type {string}
|
26
|
-
*/
|
27
|
-
_defineProperty(this, "html", void 0);
|
28
|
-
/**
|
29
|
-
* Copied data stored as array of arrays.
|
30
|
-
*
|
31
|
-
* @private
|
32
|
-
* @type {string[][]}
|
33
|
-
*/
|
34
|
-
_defineProperty(this, "data", void 0);
|
35
|
-
this.html = html;
|
36
|
-
if (this.isSerializedTable()) {
|
37
|
-
this.data = getDataWithHeadersByConfig(this.getMetaInfo());
|
38
|
-
} else {
|
39
|
-
this.data = parse(data);
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Checks whether pasted data is an array.
|
45
|
-
*
|
46
|
-
* @private
|
47
|
-
* @returns {boolean}
|
48
|
-
*/
|
49
|
-
isSerializedTable() {
|
50
|
-
return isDefined(this.html) && /(<table)|(<TABLE)/g.test(this.html);
|
51
|
-
}
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Checks whether pasted data is a Handsontable.
|
55
|
-
*
|
56
|
-
* @private
|
57
|
-
* @returns {boolean}
|
58
|
-
*/
|
59
|
-
isSerializedHandsontable() {
|
60
|
-
return this.isSerializedTable() && /<meta (.*?)content="Handsontable"/.test(this.html);
|
61
|
-
}
|
62
|
-
|
63
|
-
/**
|
64
|
-
* Gets type of the copied data.
|
65
|
-
*
|
66
|
-
* @returns {'table' | 'handsontable' | 'unrecognizable'}
|
67
|
-
*/
|
68
|
-
getType() {
|
69
|
-
if (this.isSerializedHandsontable()) {
|
70
|
-
return 'handsontable';
|
71
|
-
}
|
72
|
-
if (this.isSerializedTable()) {
|
73
|
-
return 'table';
|
74
|
-
}
|
75
|
-
return 'unrecognizable';
|
76
|
-
}
|
77
|
-
}
|