@windoc/core 0.3.15 → 0.3.16
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/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +31 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var version = "0.3.
|
|
2
|
+
var version = "0.3.16";
|
|
3
3
|
|
|
4
4
|
// src/dataset/enum/Common.ts
|
|
5
5
|
var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
|
|
@@ -106,24 +106,6 @@ function debounce(func, delay) {
|
|
|
106
106
|
}, delay);
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function throttle(func, delay) {
|
|
110
|
-
let lastExecTime = 0;
|
|
111
|
-
let timer;
|
|
112
|
-
return function(...args) {
|
|
113
|
-
const currentTime = Date.now();
|
|
114
|
-
if (currentTime - lastExecTime >= delay) {
|
|
115
|
-
window.clearTimeout(timer);
|
|
116
|
-
func.apply(this, args);
|
|
117
|
-
lastExecTime = currentTime;
|
|
118
|
-
} else {
|
|
119
|
-
window.clearTimeout(timer);
|
|
120
|
-
timer = window.setTimeout(() => {
|
|
121
|
-
func.apply(this, args);
|
|
122
|
-
lastExecTime = currentTime;
|
|
123
|
-
}, delay);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
109
|
function deepCloneOmitKeys(obj, omitKeys) {
|
|
128
110
|
if (!obj || typeof obj !== "object") {
|
|
129
111
|
return obj;
|
|
@@ -6496,7 +6478,9 @@ var Cursor = class {
|
|
|
6496
6478
|
const prePageY = pageNo * (this.draw.getHeight() + this.draw.getPageGap()) + this.container.getBoundingClientRect().top;
|
|
6497
6479
|
const isUp = direction === "top" /* UP */;
|
|
6498
6480
|
const x = leftBottom[0];
|
|
6499
|
-
const
|
|
6481
|
+
const cursorTop = leftTop[1] + cursorPosition.ascent - cursorPosition.metrics.boundingBoxAscent;
|
|
6482
|
+
const cursorBottom = cursorTop + cursorPosition.metrics.boundingBoxAscent + cursorPosition.metrics.boundingBoxDescent;
|
|
6483
|
+
const y = isUp ? cursorTop + prePageY : cursorBottom + prePageY;
|
|
6500
6484
|
const scrollContainer = findScrollContainer(this.container);
|
|
6501
6485
|
const rect = {
|
|
6502
6486
|
left: 0,
|
|
@@ -17766,28 +17750,27 @@ var ZoneTip = class {
|
|
|
17766
17750
|
this._watchMouseMoveZoneChange(watchZones);
|
|
17767
17751
|
}
|
|
17768
17752
|
_watchMouseMoveZoneChange(watchZones) {
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
);
|
|
17753
|
+
const showTip = debounce((evt) => {
|
|
17754
|
+
if (this.isDisableMouseMove || !this.draw.getIsPagingMode()) return;
|
|
17755
|
+
if (!(evt.target instanceof HTMLCanvasElement)) return;
|
|
17756
|
+
const mousemoveZone = this.zone.getZoneByY(evt.offsetY);
|
|
17757
|
+
if (!watchZones.includes(mousemoveZone)) return;
|
|
17758
|
+
this.currentMoveZone = mousemoveZone;
|
|
17759
|
+
this._updateZoneTip(
|
|
17760
|
+
this.zone.getZone() === "main" /* MAIN */ && (mousemoveZone === "header" /* HEADER */ || mousemoveZone === "footer" /* FOOTER */),
|
|
17761
|
+
evt.x,
|
|
17762
|
+
evt.y
|
|
17763
|
+
);
|
|
17764
|
+
}, 300);
|
|
17765
|
+
this.pageContainer.addEventListener("mousemove", (evt) => {
|
|
17766
|
+
if (this.isDisableMouseMove || !this.draw.getIsPagingMode()) return;
|
|
17767
|
+
if (!evt.offsetY) return;
|
|
17768
|
+
const mousemoveZone = this.zone.getZoneByY(evt.offsetY);
|
|
17769
|
+
if (!watchZones.includes(mousemoveZone)) {
|
|
17770
|
+
this._updateZoneTip(false);
|
|
17771
|
+
}
|
|
17772
|
+
showTip(evt);
|
|
17773
|
+
});
|
|
17791
17774
|
this.pageContainer.addEventListener("mouseenter", () => {
|
|
17792
17775
|
this.isDisableMouseMove = false;
|
|
17793
17776
|
});
|
|
@@ -17810,7 +17793,12 @@ var ZoneTip = class {
|
|
|
17810
17793
|
_updateZoneTip(visible, left2, top) {
|
|
17811
17794
|
if (visible) {
|
|
17812
17795
|
this.tipContainer.classList.add("show");
|
|
17813
|
-
this.tipContainer.
|
|
17796
|
+
const tipWidth = this.tipContainer.offsetWidth;
|
|
17797
|
+
const clampedLeft = Math.min(
|
|
17798
|
+
left2 ?? 0,
|
|
17799
|
+
window.innerWidth - tipWidth - 10
|
|
17800
|
+
);
|
|
17801
|
+
this.tipContainer.style.left = `${clampedLeft}px`;
|
|
17814
17802
|
this.tipContainer.style.top = `${top}px`;
|
|
17815
17803
|
const options = this.draw.getOptions();
|
|
17816
17804
|
const isHeader = this.currentMoveZone === "header" /* HEADER */;
|