handsontable 0.0.0-next-442b0cf-20241209 → 0.0.0-next-ab59106-20241209
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/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +1 -7
- package/core.mjs +1 -7
- package/dataMap/metaManager/metaSchema.js +2 -3
- package/dataMap/metaManager/metaSchema.mjs +2 -3
- package/dist/handsontable.css +12 -2
- package/dist/handsontable.full.css +12 -2
- package/dist/handsontable.full.js +1438 -864
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +9 -7
- package/dist/handsontable.js +1437 -863
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +35 -33
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/plugins/base/base.js +0 -7
- package/plugins/base/base.mjs +0 -7
- package/plugins/undoRedo/actions/_base.js +19 -0
- package/plugins/undoRedo/actions/_base.mjs +15 -0
- package/plugins/undoRedo/actions/cellAlignment.js +85 -0
- package/plugins/undoRedo/actions/cellAlignment.mjs +81 -0
- package/plugins/undoRedo/actions/columnMove.js +84 -0
- package/plugins/undoRedo/actions/columnMove.mjs +80 -0
- package/plugins/undoRedo/actions/columnSort.js +73 -0
- package/plugins/undoRedo/actions/columnSort.mjs +69 -0
- package/plugins/undoRedo/actions/createColumn.js +60 -0
- package/plugins/undoRedo/actions/createColumn.mjs +56 -0
- package/plugins/undoRedo/actions/createRow.js +65 -0
- package/plugins/undoRedo/actions/createRow.mjs +61 -0
- package/plugins/undoRedo/actions/dataChange.js +114 -0
- package/plugins/undoRedo/actions/dataChange.mjs +110 -0
- package/plugins/undoRedo/actions/filters.js +68 -0
- package/plugins/undoRedo/actions/filters.mjs +64 -0
- package/plugins/undoRedo/actions/index.js +27 -0
- package/plugins/undoRedo/actions/index.mjs +23 -0
- package/plugins/undoRedo/actions/mergeCells.js +63 -0
- package/plugins/undoRedo/actions/mergeCells.mjs +59 -0
- package/plugins/undoRedo/actions/removeColumn.js +176 -0
- package/plugins/undoRedo/actions/removeColumn.mjs +172 -0
- package/plugins/undoRedo/actions/removeRow.js +119 -0
- package/plugins/undoRedo/actions/removeRow.mjs +115 -0
- package/plugins/undoRedo/actions/rowMove.js +84 -0
- package/plugins/undoRedo/actions/rowMove.mjs +80 -0
- package/plugins/undoRedo/actions/unmergeCells.js +56 -0
- package/plugins/undoRedo/actions/unmergeCells.mjs +52 -0
- package/plugins/undoRedo/index.js +3 -4
- package/plugins/undoRedo/index.mjs +1 -2
- package/plugins/undoRedo/undoRedo.js +277 -879
- package/plugins/undoRedo/undoRedo.mjs +277 -880
- package/plugins/undoRedo/utils.js +37 -0
- package/plugins/undoRedo/utils.mjs +33 -0
- package/styles/handsontable.css +9 -2
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/utils/ghostTable.js +1 -5
- package/utils/ghostTable.mjs +1 -5
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
6
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
7
|
+
var _base = require("./_base");
|
8
|
+
var _moves = require("../../../helpers/moves");
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
11
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
12
|
+
/**
|
13
|
+
* Action that tracks row move changes.
|
14
|
+
*
|
15
|
+
* @class RowMoveAction
|
16
|
+
* @private
|
17
|
+
*/
|
18
|
+
class RowMoveAction extends _base.BaseAction {
|
19
|
+
constructor(_ref) {
|
20
|
+
let {
|
21
|
+
rows,
|
22
|
+
finalIndex
|
23
|
+
} = _ref;
|
24
|
+
super();
|
25
|
+
/**
|
26
|
+
* @param {number[]} rows An array with moved rows.
|
27
|
+
*/
|
28
|
+
_defineProperty(this, "rows", void 0);
|
29
|
+
/**
|
30
|
+
* @param {number} finalIndex The destination index.
|
31
|
+
*/
|
32
|
+
_defineProperty(this, "finalRowIndex", void 0);
|
33
|
+
this.rows = rows.slice();
|
34
|
+
this.finalRowIndex = finalIndex;
|
35
|
+
}
|
36
|
+
static startRegisteringEvents(hot, undoRedoPlugin) {
|
37
|
+
hot.addHook('beforeRowMove', (rows, finalIndex) => {
|
38
|
+
if (rows === false) {
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
undoRedoPlugin.done(() => new RowMoveAction({
|
42
|
+
rows,
|
43
|
+
finalIndex
|
44
|
+
}));
|
45
|
+
});
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @param {Core} hot The Handsontable instance.
|
50
|
+
* @param {function(): void} undoneCallback The callback to be called after the action is undone.
|
51
|
+
*/
|
52
|
+
undo(hot, undoneCallback) {
|
53
|
+
const manualRowMove = hot.getPlugin('manualRowMove');
|
54
|
+
hot.addHookOnce('afterViewRender', undoneCallback);
|
55
|
+
const rowMoves = (0, _moves.getMoves)(this.rows, this.finalRowIndex, hot.rowIndexMapper.getNumberOfIndexes());
|
56
|
+
rowMoves.reverse().forEach(_ref2 => {
|
57
|
+
let {
|
58
|
+
from,
|
59
|
+
to
|
60
|
+
} = _ref2;
|
61
|
+
if (from < to) {
|
62
|
+
to -= 1;
|
63
|
+
}
|
64
|
+
manualRowMove.moveRow(to, from);
|
65
|
+
});
|
66
|
+
hot.render();
|
67
|
+
hot.deselectCell();
|
68
|
+
hot.selectRows(this.rows[0], this.rows[0] + this.rows.length - 1);
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @param {Core} hot The Handsontable instance.
|
73
|
+
* @param {function(): void} redoneCallback The callback to be called after the action is redone.
|
74
|
+
*/
|
75
|
+
redo(hot, redoneCallback) {
|
76
|
+
const manualRowMove = hot.getPlugin('manualRowMove');
|
77
|
+
hot.addHookOnce('afterViewRender', redoneCallback);
|
78
|
+
manualRowMove.moveRows(this.rows.slice(), this.finalRowIndex);
|
79
|
+
hot.render();
|
80
|
+
hot.deselectCell();
|
81
|
+
hot.selectRows(this.finalRowIndex, this.finalRowIndex + this.rows.length - 1);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.RowMoveAction = RowMoveAction;
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
3
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
+
import { BaseAction } from "./_base.mjs";
|
8
|
+
import { getMoves } from "../../../helpers/moves.mjs";
|
9
|
+
/**
|
10
|
+
* Action that tracks row move changes.
|
11
|
+
*
|
12
|
+
* @class RowMoveAction
|
13
|
+
* @private
|
14
|
+
*/
|
15
|
+
export class RowMoveAction extends BaseAction {
|
16
|
+
constructor(_ref) {
|
17
|
+
let {
|
18
|
+
rows,
|
19
|
+
finalIndex
|
20
|
+
} = _ref;
|
21
|
+
super();
|
22
|
+
/**
|
23
|
+
* @param {number[]} rows An array with moved rows.
|
24
|
+
*/
|
25
|
+
_defineProperty(this, "rows", void 0);
|
26
|
+
/**
|
27
|
+
* @param {number} finalIndex The destination index.
|
28
|
+
*/
|
29
|
+
_defineProperty(this, "finalRowIndex", void 0);
|
30
|
+
this.rows = rows.slice();
|
31
|
+
this.finalRowIndex = finalIndex;
|
32
|
+
}
|
33
|
+
static startRegisteringEvents(hot, undoRedoPlugin) {
|
34
|
+
hot.addHook('beforeRowMove', (rows, finalIndex) => {
|
35
|
+
if (rows === false) {
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
undoRedoPlugin.done(() => new RowMoveAction({
|
39
|
+
rows,
|
40
|
+
finalIndex
|
41
|
+
}));
|
42
|
+
});
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @param {Core} hot The Handsontable instance.
|
47
|
+
* @param {function(): void} undoneCallback The callback to be called after the action is undone.
|
48
|
+
*/
|
49
|
+
undo(hot, undoneCallback) {
|
50
|
+
const manualRowMove = hot.getPlugin('manualRowMove');
|
51
|
+
hot.addHookOnce('afterViewRender', undoneCallback);
|
52
|
+
const rowMoves = getMoves(this.rows, this.finalRowIndex, hot.rowIndexMapper.getNumberOfIndexes());
|
53
|
+
rowMoves.reverse().forEach(_ref2 => {
|
54
|
+
let {
|
55
|
+
from,
|
56
|
+
to
|
57
|
+
} = _ref2;
|
58
|
+
if (from < to) {
|
59
|
+
to -= 1;
|
60
|
+
}
|
61
|
+
manualRowMove.moveRow(to, from);
|
62
|
+
});
|
63
|
+
hot.render();
|
64
|
+
hot.deselectCell();
|
65
|
+
hot.selectRows(this.rows[0], this.rows[0] + this.rows.length - 1);
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* @param {Core} hot The Handsontable instance.
|
70
|
+
* @param {function(): void} redoneCallback The callback to be called after the action is redone.
|
71
|
+
*/
|
72
|
+
redo(hot, redoneCallback) {
|
73
|
+
const manualRowMove = hot.getPlugin('manualRowMove');
|
74
|
+
hot.addHookOnce('afterViewRender', redoneCallback);
|
75
|
+
manualRowMove.moveRows(this.rows.slice(), this.finalRowIndex);
|
76
|
+
hot.render();
|
77
|
+
hot.deselectCell();
|
78
|
+
hot.selectRows(this.finalRowIndex, this.finalRowIndex + this.rows.length - 1);
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
var _base = require("./_base");
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
+
/**
|
10
|
+
* Action that tracks changes in merged cells.
|
11
|
+
*
|
12
|
+
* @class UnmergeCellsAction
|
13
|
+
* @private
|
14
|
+
*/
|
15
|
+
class UnmergeCellsAction extends _base.BaseAction {
|
16
|
+
constructor(_ref) {
|
17
|
+
let {
|
18
|
+
cellRange
|
19
|
+
} = _ref;
|
20
|
+
super();
|
21
|
+
_defineProperty(this, "cellRange", void 0);
|
22
|
+
this.cellRange = cellRange;
|
23
|
+
}
|
24
|
+
static startRegisteringEvents(hot, undoRedoPlugin) {
|
25
|
+
hot.addHook('afterUnmergeCells', (cellRange, auto) => {
|
26
|
+
if (auto) {
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
undoRedoPlugin.done(() => new UnmergeCellsAction({
|
30
|
+
cellRange
|
31
|
+
}));
|
32
|
+
});
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @param {Core} hot The Handsontable instance.
|
37
|
+
* @param {function(): void} undoneCallback The callback to be called after the action is undone.
|
38
|
+
*/
|
39
|
+
undo(hot, undoneCallback) {
|
40
|
+
const mergeCellsPlugin = hot.getPlugin('mergeCells');
|
41
|
+
hot.addHookOnce('afterViewRender', undoneCallback);
|
42
|
+
mergeCellsPlugin.mergeRange(this.cellRange, true);
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @param {Core} hot The Handsontable instance.
|
47
|
+
* @param {function(): void} redoneCallback The callback to be called after the action is redone.
|
48
|
+
*/
|
49
|
+
redo(hot, redoneCallback) {
|
50
|
+
const mergeCellsPlugin = hot.getPlugin('mergeCells');
|
51
|
+
hot.addHookOnce('afterViewRender', redoneCallback);
|
52
|
+
mergeCellsPlugin.unmergeRange(this.cellRange, true);
|
53
|
+
hot.render();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
exports.UnmergeCellsAction = UnmergeCellsAction;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
5
|
+
import { BaseAction } from "./_base.mjs";
|
6
|
+
/**
|
7
|
+
* Action that tracks changes in merged cells.
|
8
|
+
*
|
9
|
+
* @class UnmergeCellsAction
|
10
|
+
* @private
|
11
|
+
*/
|
12
|
+
export class UnmergeCellsAction extends BaseAction {
|
13
|
+
constructor(_ref) {
|
14
|
+
let {
|
15
|
+
cellRange
|
16
|
+
} = _ref;
|
17
|
+
super();
|
18
|
+
_defineProperty(this, "cellRange", void 0);
|
19
|
+
this.cellRange = cellRange;
|
20
|
+
}
|
21
|
+
static startRegisteringEvents(hot, undoRedoPlugin) {
|
22
|
+
hot.addHook('afterUnmergeCells', (cellRange, auto) => {
|
23
|
+
if (auto) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
undoRedoPlugin.done(() => new UnmergeCellsAction({
|
27
|
+
cellRange
|
28
|
+
}));
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param {Core} hot The Handsontable instance.
|
34
|
+
* @param {function(): void} undoneCallback The callback to be called after the action is undone.
|
35
|
+
*/
|
36
|
+
undo(hot, undoneCallback) {
|
37
|
+
const mergeCellsPlugin = hot.getPlugin('mergeCells');
|
38
|
+
hot.addHookOnce('afterViewRender', undoneCallback);
|
39
|
+
mergeCellsPlugin.mergeRange(this.cellRange, true);
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @param {Core} hot The Handsontable instance.
|
44
|
+
* @param {function(): void} redoneCallback The callback to be called after the action is redone.
|
45
|
+
*/
|
46
|
+
redo(hot, redoneCallback) {
|
47
|
+
const mergeCellsPlugin = hot.getPlugin('mergeCells');
|
48
|
+
hot.addHookOnce('afterViewRender', redoneCallback);
|
49
|
+
mergeCellsPlugin.unmergeRange(this.cellRange, true);
|
50
|
+
hot.render();
|
51
|
+
}
|
52
|
+
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
var _undoRedo =
|
5
|
-
exports.UndoRedo = _undoRedo.default;
|
4
|
+
var _undoRedo = require("./undoRedo");
|
6
5
|
exports.PLUGIN_KEY = _undoRedo.PLUGIN_KEY;
|
7
|
-
|
8
|
-
|
6
|
+
exports.PLUGIN_PRIORITY = _undoRedo.PLUGIN_PRIORITY;
|
7
|
+
exports.UndoRedo = _undoRedo.UndoRedo;
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export { PLUGIN_KEY, UndoRedo };
|
1
|
+
export { PLUGIN_KEY, PLUGIN_PRIORITY, UndoRedo } from "./undoRedo.mjs";
|