handsontable 14.0.0-next-4fd76bc-20231114 → 14.0.0-next-bdc44e7-20231115
Sign up to get free protection for your applications and to get access to all the features.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +3 -3
- package/core/focusCatcher/index.mjs +3 -3
- package/dataMap/metaManager/metaSchema.js +7 -7
- package/dataMap/metaManager/metaSchema.mjs +7 -7
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +393 -267
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +147 -147
- package/dist/handsontable.js +393 -267
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +22 -22
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +31 -28
- package/plugins/manualColumnMove/manualColumnMove.mjs +29 -26
- package/plugins/manualColumnResize/manualColumnResize.js +161 -105
- package/plugins/manualColumnResize/manualColumnResize.mjs +160 -104
- package/plugins/manualRowMove/manualRowMove.js +31 -28
- package/plugins/manualRowMove/manualRowMove.mjs +29 -26
- package/plugins/manualRowResize/manualRowResize.js +160 -104
- package/plugins/manualRowResize/manualRowResize.mjs +159 -103
- package/settings.d.ts +1 -1
@@ -8,15 +8,12 @@ var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
|
8
8
|
var _array = require("../../helpers/array");
|
9
9
|
var _element = require("../../helpers/dom/element");
|
10
10
|
var _number = require("../../helpers/number");
|
11
|
-
var
|
12
|
-
var
|
11
|
+
var _backlight2 = _interopRequireDefault(require("./ui/backlight"));
|
12
|
+
var _guideline2 = _interopRequireDefault(require("./ui/guideline"));
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
14
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
15
15
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
16
16
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
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; }
|
18
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
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
17
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
21
18
|
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; } }
|
22
19
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
@@ -58,6 +55,8 @@ const CSS_AFTER_SELECTION = 'after-selection--rows';
|
|
58
55
|
* @class ManualRowMove
|
59
56
|
* @plugin ManualRowMove
|
60
57
|
*/
|
58
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
59
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
61
60
|
var _rowsToMove = /*#__PURE__*/new WeakMap();
|
62
61
|
var _pressed = /*#__PURE__*/new WeakMap();
|
63
62
|
var _target = /*#__PURE__*/new WeakMap();
|
@@ -112,17 +111,21 @@ class ManualRowMove extends _base.BasePlugin {
|
|
112
111
|
/**
|
113
112
|
* Backlight UI object.
|
114
113
|
*
|
115
|
-
* @private
|
116
114
|
* @type {object}
|
117
115
|
*/
|
118
|
-
|
116
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
117
|
+
writable: true,
|
118
|
+
value: new _backlight2.default(this.hot)
|
119
|
+
});
|
119
120
|
/**
|
120
121
|
* Guideline UI object.
|
121
122
|
*
|
122
|
-
* @private
|
123
123
|
* @type {object}
|
124
124
|
*/
|
125
|
-
|
125
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
126
|
+
writable: true,
|
127
|
+
value: new _guideline2.default(this.hot)
|
128
|
+
});
|
126
129
|
/**
|
127
130
|
* @type {number[]}
|
128
131
|
*/
|
@@ -222,8 +225,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
222
225
|
disablePlugin() {
|
223
226
|
(0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);
|
224
227
|
this.unregisterEvents();
|
225
|
-
this.
|
226
|
-
this.
|
228
|
+
_classPrivateFieldGet(this, _backlight).destroy();
|
229
|
+
_classPrivateFieldGet(this, _guideline).destroy();
|
227
230
|
super.disablePlugin();
|
228
231
|
}
|
229
232
|
|
@@ -488,8 +491,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
488
491
|
const pixelsRelToTableStart = _classPrivateFieldGet(this, _target).eventPageY - pixelsAbove + tableScroll;
|
489
492
|
const hiderHeight = wtTable.hider.offsetHeight;
|
490
493
|
const tbodyOffsetTop = wtTable.TBODY.offsetTop;
|
491
|
-
const backlightElemMarginTop = this.
|
492
|
-
const backlightElemHeight = this.
|
494
|
+
const backlightElemMarginTop = _classPrivateFieldGet(this, _backlight).getOffset().top;
|
495
|
+
const backlightElemHeight = _classPrivateFieldGet(this, _backlight).getSize().height;
|
493
496
|
const tdMiddle = TD.offsetHeight / 2;
|
494
497
|
const tdHeight = TD.offsetHeight;
|
495
498
|
let tdStartPixel = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row - 1);
|
@@ -522,8 +525,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
522
525
|
// prevent display guideline below table
|
523
526
|
guidelineTop = hiderHeight - 1;
|
524
527
|
}
|
525
|
-
this.
|
526
|
-
this.
|
528
|
+
_classPrivateFieldGet(this, _backlight).setPosition(backlightTop);
|
529
|
+
_classPrivateFieldGet(this, _guideline).setPosition(guidelineTop);
|
527
530
|
}
|
528
531
|
|
529
532
|
/**
|
@@ -553,15 +556,15 @@ class ManualRowMove extends _base.BasePlugin {
|
|
553
556
|
* @private
|
554
557
|
*/
|
555
558
|
buildPluginUI() {
|
556
|
-
this.
|
557
|
-
this.
|
559
|
+
_classPrivateFieldGet(this, _backlight).build();
|
560
|
+
_classPrivateFieldGet(this, _guideline).build();
|
558
561
|
}
|
559
562
|
/**
|
560
563
|
* Destroys the plugin instance.
|
561
564
|
*/
|
562
565
|
destroy() {
|
563
|
-
this.
|
564
|
-
this.
|
566
|
+
_classPrivateFieldGet(this, _backlight).destroy();
|
567
|
+
_classPrivateFieldGet(this, _guideline).destroy();
|
565
568
|
super.destroy();
|
566
569
|
}
|
567
570
|
}
|
@@ -579,11 +582,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
579
582
|
(0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
580
583
|
return;
|
581
584
|
}
|
582
|
-
const guidelineIsNotReady = this.
|
583
|
-
const backlightIsNotReady = this.
|
585
|
+
const guidelineIsNotReady = _classPrivateFieldGet(this, _guideline).isBuilt() && !_classPrivateFieldGet(this, _guideline).isAppended();
|
586
|
+
const backlightIsNotReady = _classPrivateFieldGet(this, _backlight).isBuilt() && !_classPrivateFieldGet(this, _backlight).isAppended();
|
584
587
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
585
|
-
this.
|
586
|
-
this.
|
588
|
+
_classPrivateFieldGet(this, _guideline).appendTo(wtTable.hider);
|
589
|
+
_classPrivateFieldGet(this, _backlight).appendTo(wtTable.hider);
|
587
590
|
}
|
588
591
|
const {
|
589
592
|
from,
|
@@ -600,9 +603,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
600
603
|
_classPrivateFieldSet(this, _rowsToMove, this.prepareRowsToMoving());
|
601
604
|
const leftPos = wtTable.holder.scrollLeft + wtViewport.getRowHeaderWidth();
|
602
605
|
const topOffset = this.getRowsHeight(start, coords.row - 1) + event.offsetY;
|
603
|
-
this.
|
604
|
-
this.
|
605
|
-
this.
|
606
|
+
_classPrivateFieldGet(this, _backlight).setPosition(null, leftPos);
|
607
|
+
_classPrivateFieldGet(this, _backlight).setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end));
|
608
|
+
_classPrivateFieldGet(this, _backlight).setOffset(-topOffset, null);
|
606
609
|
(0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);
|
607
610
|
this.refreshPositions();
|
608
611
|
} else {
|
@@ -663,8 +666,8 @@ function _onAfterScrollHorizontally2() {
|
|
663
666
|
const headerWidth = this.hot.view._wt.wtViewport.getRowHeaderWidth();
|
664
667
|
const scrollLeft = wtTable.holder.scrollLeft;
|
665
668
|
const posLeft = headerWidth + scrollLeft;
|
666
|
-
this.
|
667
|
-
this.
|
669
|
+
_classPrivateFieldGet(this, _backlight).setPosition(null, posLeft);
|
670
|
+
_classPrivateFieldGet(this, _backlight).setSize(wtTable.hider.offsetWidth - posLeft);
|
668
671
|
}
|
669
672
|
function _onAfterLoadData2() {
|
670
673
|
this.moveBySettingsOrLoad();
|
@@ -3,9 +3,6 @@ import "core-js/modules/es.error.cause.js";
|
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
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; }
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
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
6
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
7
|
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; } }
|
11
8
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
@@ -54,6 +51,8 @@ const CSS_AFTER_SELECTION = 'after-selection--rows';
|
|
54
51
|
* @class ManualRowMove
|
55
52
|
* @plugin ManualRowMove
|
56
53
|
*/
|
54
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
55
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
57
56
|
var _rowsToMove = /*#__PURE__*/new WeakMap();
|
58
57
|
var _pressed = /*#__PURE__*/new WeakMap();
|
59
58
|
var _target = /*#__PURE__*/new WeakMap();
|
@@ -108,17 +107,21 @@ export class ManualRowMove extends BasePlugin {
|
|
108
107
|
/**
|
109
108
|
* Backlight UI object.
|
110
109
|
*
|
111
|
-
* @private
|
112
110
|
* @type {object}
|
113
111
|
*/
|
114
|
-
|
112
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
113
|
+
writable: true,
|
114
|
+
value: new BacklightUI(this.hot)
|
115
|
+
});
|
115
116
|
/**
|
116
117
|
* Guideline UI object.
|
117
118
|
*
|
118
|
-
* @private
|
119
119
|
* @type {object}
|
120
120
|
*/
|
121
|
-
|
121
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
122
|
+
writable: true,
|
123
|
+
value: new GuidelineUI(this.hot)
|
124
|
+
});
|
122
125
|
/**
|
123
126
|
* @type {number[]}
|
124
127
|
*/
|
@@ -218,8 +221,8 @@ export class ManualRowMove extends BasePlugin {
|
|
218
221
|
disablePlugin() {
|
219
222
|
removeClass(this.hot.rootElement, CSS_PLUGIN);
|
220
223
|
this.unregisterEvents();
|
221
|
-
this.
|
222
|
-
this.
|
224
|
+
_classPrivateFieldGet(this, _backlight).destroy();
|
225
|
+
_classPrivateFieldGet(this, _guideline).destroy();
|
223
226
|
super.disablePlugin();
|
224
227
|
}
|
225
228
|
|
@@ -484,8 +487,8 @@ export class ManualRowMove extends BasePlugin {
|
|
484
487
|
const pixelsRelToTableStart = _classPrivateFieldGet(this, _target).eventPageY - pixelsAbove + tableScroll;
|
485
488
|
const hiderHeight = wtTable.hider.offsetHeight;
|
486
489
|
const tbodyOffsetTop = wtTable.TBODY.offsetTop;
|
487
|
-
const backlightElemMarginTop = this.
|
488
|
-
const backlightElemHeight = this.
|
490
|
+
const backlightElemMarginTop = _classPrivateFieldGet(this, _backlight).getOffset().top;
|
491
|
+
const backlightElemHeight = _classPrivateFieldGet(this, _backlight).getSize().height;
|
489
492
|
const tdMiddle = TD.offsetHeight / 2;
|
490
493
|
const tdHeight = TD.offsetHeight;
|
491
494
|
let tdStartPixel = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row - 1);
|
@@ -518,8 +521,8 @@ export class ManualRowMove extends BasePlugin {
|
|
518
521
|
// prevent display guideline below table
|
519
522
|
guidelineTop = hiderHeight - 1;
|
520
523
|
}
|
521
|
-
this.
|
522
|
-
this.
|
524
|
+
_classPrivateFieldGet(this, _backlight).setPosition(backlightTop);
|
525
|
+
_classPrivateFieldGet(this, _guideline).setPosition(guidelineTop);
|
523
526
|
}
|
524
527
|
|
525
528
|
/**
|
@@ -549,15 +552,15 @@ export class ManualRowMove extends BasePlugin {
|
|
549
552
|
* @private
|
550
553
|
*/
|
551
554
|
buildPluginUI() {
|
552
|
-
this.
|
553
|
-
this.
|
555
|
+
_classPrivateFieldGet(this, _backlight).build();
|
556
|
+
_classPrivateFieldGet(this, _guideline).build();
|
554
557
|
}
|
555
558
|
/**
|
556
559
|
* Destroys the plugin instance.
|
557
560
|
*/
|
558
561
|
destroy() {
|
559
|
-
this.
|
560
|
-
this.
|
562
|
+
_classPrivateFieldGet(this, _backlight).destroy();
|
563
|
+
_classPrivateFieldGet(this, _guideline).destroy();
|
561
564
|
super.destroy();
|
562
565
|
}
|
563
566
|
}
|
@@ -574,11 +577,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
574
577
|
removeClass(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
575
578
|
return;
|
576
579
|
}
|
577
|
-
const guidelineIsNotReady = this.
|
578
|
-
const backlightIsNotReady = this.
|
580
|
+
const guidelineIsNotReady = _classPrivateFieldGet(this, _guideline).isBuilt() && !_classPrivateFieldGet(this, _guideline).isAppended();
|
581
|
+
const backlightIsNotReady = _classPrivateFieldGet(this, _backlight).isBuilt() && !_classPrivateFieldGet(this, _backlight).isAppended();
|
579
582
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
580
|
-
this.
|
581
|
-
this.
|
583
|
+
_classPrivateFieldGet(this, _guideline).appendTo(wtTable.hider);
|
584
|
+
_classPrivateFieldGet(this, _backlight).appendTo(wtTable.hider);
|
582
585
|
}
|
583
586
|
const {
|
584
587
|
from,
|
@@ -595,9 +598,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
595
598
|
_classPrivateFieldSet(this, _rowsToMove, this.prepareRowsToMoving());
|
596
599
|
const leftPos = wtTable.holder.scrollLeft + wtViewport.getRowHeaderWidth();
|
597
600
|
const topOffset = this.getRowsHeight(start, coords.row - 1) + event.offsetY;
|
598
|
-
this.
|
599
|
-
this.
|
600
|
-
this.
|
601
|
+
_classPrivateFieldGet(this, _backlight).setPosition(null, leftPos);
|
602
|
+
_classPrivateFieldGet(this, _backlight).setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end));
|
603
|
+
_classPrivateFieldGet(this, _backlight).setOffset(-topOffset, null);
|
601
604
|
addClass(this.hot.rootElement, CSS_ON_MOVING);
|
602
605
|
this.refreshPositions();
|
603
606
|
} else {
|
@@ -658,8 +661,8 @@ function _onAfterScrollHorizontally2() {
|
|
658
661
|
const headerWidth = this.hot.view._wt.wtViewport.getRowHeaderWidth();
|
659
662
|
const scrollLeft = wtTable.holder.scrollLeft;
|
660
663
|
const posLeft = headerWidth + scrollLeft;
|
661
|
-
this.
|
662
|
-
this.
|
664
|
+
_classPrivateFieldGet(this, _backlight).setPosition(null, posLeft);
|
665
|
+
_classPrivateFieldGet(this, _backlight).setSize(wtTable.hider.offsetWidth - posLeft);
|
663
666
|
}
|
664
667
|
function _onAfterLoadData2() {
|
665
668
|
this.moveBySettingsOrLoad();
|