@fileverse-dev/fortune-core 1.2.4 → 1.2.5
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/es/canvas.js
CHANGED
|
@@ -11,7 +11,7 @@ import { cellFadeAnimator } from "./animate";
|
|
|
11
11
|
export var defaultStyle = {
|
|
12
12
|
fillStyle: "#000000",
|
|
13
13
|
textBaseline: "middle",
|
|
14
|
-
strokeStyle: "#
|
|
14
|
+
strokeStyle: "#dfdfdf",
|
|
15
15
|
rowFillStyle: "#5e5e5e",
|
|
16
16
|
textAlign: "center"
|
|
17
17
|
};
|
|
@@ -791,9 +791,9 @@ var Canvas = function () {
|
|
|
791
791
|
var finalPillWidth = ((columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth[c]) || 70) - 5;
|
|
792
792
|
var ps_w = finalPillWidth * this.sheetCtx.zoomRatio;
|
|
793
793
|
var ps_h = 16 * this.sheetCtx.zoomRatio;
|
|
794
|
-
var radius =
|
|
794
|
+
var radius = 8 * this.sheetCtx.zoomRatio;
|
|
795
795
|
var x = endX + offsetLeft - 4 - ps_w;
|
|
796
|
-
var y = startY + offsetTop + 2;
|
|
796
|
+
var y = startY + offsetTop + 2.7;
|
|
797
797
|
renderCtx.beginPath();
|
|
798
798
|
renderCtx.fillStyle = "rgba(232, 235, 236, 1)";
|
|
799
799
|
renderCtx.roundRect(x, y, ps_w, ps_h, radius);
|
|
@@ -801,7 +801,7 @@ var Canvas = function () {
|
|
|
801
801
|
renderCtx.closePath();
|
|
802
802
|
var chevronWidth = 7 * this.sheetCtx.zoomRatio;
|
|
803
803
|
var chevronHeight = 4 * this.sheetCtx.zoomRatio;
|
|
804
|
-
var chevronX = x + ps_w - chevronWidth - 2 * this.sheetCtx.zoomRatio;
|
|
804
|
+
var chevronX = x - 2 + ps_w - chevronWidth - 2 * this.sheetCtx.zoomRatio;
|
|
805
805
|
var chevronY = y + (ps_h - chevronHeight) / 2;
|
|
806
806
|
renderCtx.beginPath();
|
|
807
807
|
renderCtx.fillStyle = "rgba(0, 0, 0, 1)";
|
|
@@ -903,9 +903,9 @@ var Canvas = function () {
|
|
|
903
903
|
var finalPillWidth = ((columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth[c]) || 70) - 5;
|
|
904
904
|
var ps_w = finalPillWidth * this.sheetCtx.zoomRatio;
|
|
905
905
|
var ps_h = 16 * this.sheetCtx.zoomRatio;
|
|
906
|
-
var radius =
|
|
906
|
+
var radius = 8 * this.sheetCtx.zoomRatio;
|
|
907
907
|
var baseX = endX + offsetLeft - 4 - ps_w;
|
|
908
|
-
var baseY = startY + offsetTop + 2;
|
|
908
|
+
var baseY = startY + offsetTop + 2.7;
|
|
909
909
|
var pillSpacing = 2 * this.sheetCtx.zoomRatio;
|
|
910
910
|
var _loop_1 = function _loop_1(i) {
|
|
911
911
|
var x = baseX;
|
|
@@ -918,13 +918,13 @@ var Canvas = function () {
|
|
|
918
918
|
});
|
|
919
919
|
renderCtx.beginPath();
|
|
920
920
|
renderCtx.fillStyle = bgColor || "rgba(232, 235, 236, 1)";
|
|
921
|
-
renderCtx.roundRect(x, y, ps_w
|
|
921
|
+
renderCtx.roundRect(x, y, ps_w, ps_h, radius);
|
|
922
922
|
renderCtx.fill();
|
|
923
923
|
renderCtx.closePath();
|
|
924
924
|
if (i === 0) {
|
|
925
925
|
var chevronWidth = 7 * this_1.sheetCtx.zoomRatio;
|
|
926
926
|
var chevronHeight = 4 * this_1.sheetCtx.zoomRatio;
|
|
927
|
-
var chevronX = x
|
|
927
|
+
var chevronX = x - 2 + ps_w - chevronWidth - 2 * this_1.sheetCtx.zoomRatio;
|
|
928
928
|
var chevronY = y + (ps_h - chevronHeight) / 2;
|
|
929
929
|
renderCtx.beginPath();
|
|
930
930
|
renderCtx.fillStyle = "rgba(0, 0, 0, 1)";
|
|
@@ -516,8 +516,10 @@ export function cellFocus(ctx, r, c, clickMode) {
|
|
|
516
516
|
if (!dataVerification) return;
|
|
517
517
|
var row = ctx.visibledatarow[r];
|
|
518
518
|
var row_pre = r === 0 ? 0 : ctx.visibledatarow[r - 1];
|
|
519
|
+
var row_pre2 = r === 0 ? 0 : ctx.visibledatarow[r - 3];
|
|
519
520
|
var col = ctx.visibledatacolumn[c];
|
|
520
521
|
var col_pre = c === 0 ? 0 : ctx.visibledatacolumn[c - 1];
|
|
522
|
+
var col_pre2 = c === 0 ? 0 : ctx.visibledatacolumn[c];
|
|
521
523
|
var d = getFlowdata(ctx);
|
|
522
524
|
if (!d) return;
|
|
523
525
|
var margeSet = mergeBorder(ctx, d, r, c);
|
|
@@ -579,8 +581,8 @@ export function cellFocus(ctx, r, c, clickMode) {
|
|
|
579
581
|
failureText = invalidText + failureText + getFailureText(ctx, item);
|
|
580
582
|
showHintBox.innerHTML = failureText;
|
|
581
583
|
showHintBox.style.display = "block";
|
|
582
|
-
showHintBox.style.left = "".concat(
|
|
583
|
-
showHintBox.style.top = "".concat(
|
|
584
|
+
showHintBox.style.left = "".concat(col_pre2, "px");
|
|
585
|
+
showHintBox.style.top = "".concat(row_pre2, "px");
|
|
584
586
|
}
|
|
585
587
|
}
|
|
586
588
|
export function setDropdownValue(ctx, value, arr) {
|
package/lib/canvas.js
CHANGED
|
@@ -18,7 +18,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
18
18
|
var defaultStyle = exports.defaultStyle = {
|
|
19
19
|
fillStyle: "#000000",
|
|
20
20
|
textBaseline: "middle",
|
|
21
|
-
strokeStyle: "#
|
|
21
|
+
strokeStyle: "#dfdfdf",
|
|
22
22
|
rowFillStyle: "#5e5e5e",
|
|
23
23
|
textAlign: "center"
|
|
24
24
|
};
|
|
@@ -798,9 +798,9 @@ var Canvas = exports.Canvas = function () {
|
|
|
798
798
|
var finalPillWidth = ((columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth[c]) || 70) - 5;
|
|
799
799
|
var ps_w = finalPillWidth * this.sheetCtx.zoomRatio;
|
|
800
800
|
var ps_h = 16 * this.sheetCtx.zoomRatio;
|
|
801
|
-
var radius =
|
|
801
|
+
var radius = 8 * this.sheetCtx.zoomRatio;
|
|
802
802
|
var x = endX + offsetLeft - 4 - ps_w;
|
|
803
|
-
var y = startY + offsetTop + 2;
|
|
803
|
+
var y = startY + offsetTop + 2.7;
|
|
804
804
|
renderCtx.beginPath();
|
|
805
805
|
renderCtx.fillStyle = "rgba(232, 235, 236, 1)";
|
|
806
806
|
renderCtx.roundRect(x, y, ps_w, ps_h, radius);
|
|
@@ -808,7 +808,7 @@ var Canvas = exports.Canvas = function () {
|
|
|
808
808
|
renderCtx.closePath();
|
|
809
809
|
var chevronWidth = 7 * this.sheetCtx.zoomRatio;
|
|
810
810
|
var chevronHeight = 4 * this.sheetCtx.zoomRatio;
|
|
811
|
-
var chevronX = x + ps_w - chevronWidth - 2 * this.sheetCtx.zoomRatio;
|
|
811
|
+
var chevronX = x - 2 + ps_w - chevronWidth - 2 * this.sheetCtx.zoomRatio;
|
|
812
812
|
var chevronY = y + (ps_h - chevronHeight) / 2;
|
|
813
813
|
renderCtx.beginPath();
|
|
814
814
|
renderCtx.fillStyle = "rgba(0, 0, 0, 1)";
|
|
@@ -910,9 +910,9 @@ var Canvas = exports.Canvas = function () {
|
|
|
910
910
|
var finalPillWidth = ((columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth[c]) || 70) - 5;
|
|
911
911
|
var ps_w = finalPillWidth * this.sheetCtx.zoomRatio;
|
|
912
912
|
var ps_h = 16 * this.sheetCtx.zoomRatio;
|
|
913
|
-
var radius =
|
|
913
|
+
var radius = 8 * this.sheetCtx.zoomRatio;
|
|
914
914
|
var baseX = endX + offsetLeft - 4 - ps_w;
|
|
915
|
-
var baseY = startY + offsetTop + 2;
|
|
915
|
+
var baseY = startY + offsetTop + 2.7;
|
|
916
916
|
var pillSpacing = 2 * this.sheetCtx.zoomRatio;
|
|
917
917
|
var _loop_1 = function _loop_1(i) {
|
|
918
918
|
var x = baseX;
|
|
@@ -925,13 +925,13 @@ var Canvas = exports.Canvas = function () {
|
|
|
925
925
|
});
|
|
926
926
|
renderCtx.beginPath();
|
|
927
927
|
renderCtx.fillStyle = bgColor || "rgba(232, 235, 236, 1)";
|
|
928
|
-
renderCtx.roundRect(x, y, ps_w
|
|
928
|
+
renderCtx.roundRect(x, y, ps_w, ps_h, radius);
|
|
929
929
|
renderCtx.fill();
|
|
930
930
|
renderCtx.closePath();
|
|
931
931
|
if (i === 0) {
|
|
932
932
|
var chevronWidth = 7 * this_1.sheetCtx.zoomRatio;
|
|
933
933
|
var chevronHeight = 4 * this_1.sheetCtx.zoomRatio;
|
|
934
|
-
var chevronX = x
|
|
934
|
+
var chevronX = x - 2 + ps_w - chevronWidth - 2 * this_1.sheetCtx.zoomRatio;
|
|
935
935
|
var chevronY = y + (ps_h - chevronHeight) / 2;
|
|
936
936
|
renderCtx.beginPath();
|
|
937
937
|
renderCtx.fillStyle = "rgba(0, 0, 0, 1)";
|
|
@@ -531,8 +531,10 @@ function cellFocus(ctx, r, c, clickMode) {
|
|
|
531
531
|
if (!dataVerification) return;
|
|
532
532
|
var row = ctx.visibledatarow[r];
|
|
533
533
|
var row_pre = r === 0 ? 0 : ctx.visibledatarow[r - 1];
|
|
534
|
+
var row_pre2 = r === 0 ? 0 : ctx.visibledatarow[r - 3];
|
|
534
535
|
var col = ctx.visibledatacolumn[c];
|
|
535
536
|
var col_pre = c === 0 ? 0 : ctx.visibledatacolumn[c - 1];
|
|
537
|
+
var col_pre2 = c === 0 ? 0 : ctx.visibledatacolumn[c];
|
|
536
538
|
var d = (0, _.getFlowdata)(ctx);
|
|
537
539
|
if (!d) return;
|
|
538
540
|
var margeSet = (0, _.mergeBorder)(ctx, d, r, c);
|
|
@@ -594,8 +596,8 @@ function cellFocus(ctx, r, c, clickMode) {
|
|
|
594
596
|
failureText = invalidText + failureText + getFailureText(ctx, item);
|
|
595
597
|
showHintBox.innerHTML = failureText;
|
|
596
598
|
showHintBox.style.display = "block";
|
|
597
|
-
showHintBox.style.left = "".concat(
|
|
598
|
-
showHintBox.style.top = "".concat(
|
|
599
|
+
showHintBox.style.left = "".concat(col_pre2, "px");
|
|
600
|
+
showHintBox.style.top = "".concat(row_pre2, "px");
|
|
599
601
|
}
|
|
600
602
|
}
|
|
601
603
|
function setDropdownValue(ctx, value, arr) {
|