@fileverse-dev/fortune-react 1.1.64 → 1.1.65
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/components/Sheet/use-smooth-scroll.js +68 -9
- package/es/components/SheetOverlay/index.css +1 -0
- package/es/components/SheetOverlay/index.js +1 -8
- package/es/components/Toolbar/index.css +10 -0
- package/es/components/Toolbar/index.js +28 -10
- package/lib/components/Sheet/use-smooth-scroll.js +68 -9
- package/lib/components/SheetOverlay/index.css +1 -0
- package/lib/components/SheetOverlay/index.js +0 -7
- package/lib/components/Toolbar/index.css +10 -0
- package/lib/components/Toolbar/index.js +28 -10
- package/package.json +2 -2
|
@@ -29,6 +29,11 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
29
29
|
queuedXPixels = 0;
|
|
30
30
|
queuedYPixels = 0;
|
|
31
31
|
}
|
|
32
|
+
function scheduleScrollUpdate(x, y) {
|
|
33
|
+
queuedXPixels += x;
|
|
34
|
+
queuedYPixels += y;
|
|
35
|
+
if (!animationFrameId) animationFrameId = requestAnimationFrame(applyQueuedScroll);
|
|
36
|
+
}
|
|
32
37
|
function handleWheelEvent(event) {
|
|
33
38
|
var _a, _b;
|
|
34
39
|
event.preventDefault();
|
|
@@ -45,16 +50,61 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
45
50
|
return;
|
|
46
51
|
}
|
|
47
52
|
var scaleFactor = getPixelScale();
|
|
48
|
-
|
|
49
|
-
queuedYPixels += event.deltaY * scaleFactor;
|
|
50
|
-
if (!animationFrameId) animationFrameId = requestAnimationFrame(applyQueuedScroll);
|
|
53
|
+
scheduleScrollUpdate(event.deltaX * scaleFactor, event.deltaY * scaleFactor);
|
|
51
54
|
}
|
|
52
55
|
scrollContainer.addEventListener("wheel", handleWheelEvent, {
|
|
53
56
|
passive: false
|
|
54
57
|
});
|
|
58
|
+
return {
|
|
59
|
+
scheduleScrollUpdate: scheduleScrollUpdate,
|
|
60
|
+
detach: function detach() {
|
|
61
|
+
scrollContainer.removeEventListener("wheel", handleWheelEvent);
|
|
62
|
+
if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function attachTouchPanToQueue(containerEl, scheduleScrollUpdate, getPixelScale) {
|
|
67
|
+
var dragging = false;
|
|
68
|
+
var lastX = 0;
|
|
69
|
+
var lastY = 0;
|
|
70
|
+
function onPointerDown(e) {
|
|
71
|
+
if (e.pointerType !== "touch" && e.pointerType !== "pen") return;
|
|
72
|
+
dragging = true;
|
|
73
|
+
lastX = e.clientX;
|
|
74
|
+
lastY = e.clientY;
|
|
75
|
+
containerEl.setPointerCapture(e.pointerId);
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
function onPointerMove(e) {
|
|
79
|
+
if (!dragging) return;
|
|
80
|
+
var dx = e.clientX - lastX;
|
|
81
|
+
var dy = e.clientY - lastY;
|
|
82
|
+
lastX = e.clientX;
|
|
83
|
+
lastY = e.clientY;
|
|
84
|
+
var scale = getPixelScale();
|
|
85
|
+
scheduleScrollUpdate(-dx * scale, -dy * scale);
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
}
|
|
88
|
+
function onPointerUp(e) {
|
|
89
|
+
if (!dragging) return;
|
|
90
|
+
dragging = false;
|
|
91
|
+
try {
|
|
92
|
+
containerEl.releasePointerCapture(e.pointerId);
|
|
93
|
+
} catch (_a) {}
|
|
94
|
+
}
|
|
95
|
+
containerEl.addEventListener("pointerdown", onPointerDown, {
|
|
96
|
+
passive: false
|
|
97
|
+
});
|
|
98
|
+
containerEl.addEventListener("pointermove", onPointerMove, {
|
|
99
|
+
passive: false
|
|
100
|
+
});
|
|
101
|
+
containerEl.addEventListener("pointerup", onPointerUp);
|
|
102
|
+
containerEl.addEventListener("pointercancel", onPointerUp);
|
|
55
103
|
return function () {
|
|
56
|
-
|
|
57
|
-
|
|
104
|
+
containerEl.removeEventListener("pointerdown", onPointerDown);
|
|
105
|
+
containerEl.removeEventListener("pointermove", onPointerMove);
|
|
106
|
+
containerEl.removeEventListener("pointerup", onPointerUp);
|
|
107
|
+
containerEl.removeEventListener("pointercancel", onPointerUp);
|
|
58
108
|
};
|
|
59
109
|
}
|
|
60
110
|
var makeScrollbarsMoveByPixels = function makeScrollbarsMoveByPixels(horizontalScrollbarEl, verticalScrollbarEl) {
|
|
@@ -73,18 +123,27 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
73
123
|
}
|
|
74
124
|
};
|
|
75
125
|
};
|
|
76
|
-
function routeWheelScrollToScrollbars(
|
|
126
|
+
function routeWheelScrollToScrollbars(scrollContainerEl, horizontalScrollbarEl, verticalScrollbarEl) {
|
|
77
127
|
var moveScrollbarsByPixels = makeScrollbarsMoveByPixels(horizontalScrollbarEl, verticalScrollbarEl);
|
|
78
|
-
|
|
79
|
-
|
|
128
|
+
var _a = attachSmoothWheelScroll(scrollContainerEl, moveScrollbarsByPixels, function () {
|
|
129
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
130
|
+
}),
|
|
131
|
+
scheduleScrollUpdate = _a.scheduleScrollUpdate,
|
|
132
|
+
detach = _a.detach;
|
|
133
|
+
var detachTouch = attachTouchPanToQueue(scrollContainerEl, scheduleScrollUpdate, function () {
|
|
134
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
80
135
|
});
|
|
136
|
+
return function () {
|
|
137
|
+
detach();
|
|
138
|
+
detachTouch();
|
|
139
|
+
};
|
|
81
140
|
}
|
|
82
141
|
useEffect(function () {
|
|
83
142
|
var scrollContainerEl = scrollContainerRef.current;
|
|
84
143
|
var horizontalScrollbarEl = refs.scrollbarX.current;
|
|
85
144
|
var verticalScrollbarEl = refs.scrollbarY.current;
|
|
86
145
|
if (!scrollContainerEl || !horizontalScrollbarEl || !verticalScrollbarEl) return function () {};
|
|
87
|
-
var unmountScrollHandler = routeWheelScrollToScrollbars(
|
|
146
|
+
var unmountScrollHandler = routeWheelScrollToScrollbars(scrollContainerEl, horizontalScrollbarEl, verticalScrollbarEl);
|
|
88
147
|
return unmountScrollHandler;
|
|
89
148
|
}, [context.zoomRatio]);
|
|
90
149
|
};
|
|
@@ -10,7 +10,7 @@ var __assign = this && this.__assign || function () {
|
|
|
10
10
|
};
|
|
11
11
|
import React, { useContext, useCallback, useRef, useEffect, useLayoutEffect, useMemo } from "react";
|
|
12
12
|
import "./index.css";
|
|
13
|
-
import { locale, drawArrow, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleContextMenu, handleOverlayMouseMove, handleOverlayMouseUp, selectAll, handleOverlayTouchEnd,
|
|
13
|
+
import { locale, drawArrow, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleContextMenu, handleOverlayMouseMove, handleOverlayMouseUp, selectAll, handleOverlayTouchEnd, handleOverlayTouchStart, createDropCellRange, getCellRowColumn, getCellHyperlink, showLinkCard, onCellsMoveStart, insertRowCol, getSheetIndex, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, handleKeydownForZoom } from "@fileverse-dev/fortune-core";
|
|
14
14
|
import _ from "lodash";
|
|
15
15
|
import WorkbookContext from "../../context";
|
|
16
16
|
import ColumnHeader from "./ColumnHeader";
|
|
@@ -131,12 +131,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
131
131
|
});
|
|
132
132
|
e.stopPropagation();
|
|
133
133
|
}, [refs.globalCache, setContext]);
|
|
134
|
-
var onTouchMove = useCallback(function (e) {
|
|
135
|
-
var nativeEvent = e.nativeEvent;
|
|
136
|
-
setContext(function (draftCtx) {
|
|
137
|
-
handleOverlayTouchMove(draftCtx, nativeEvent, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
138
|
-
});
|
|
139
|
-
}, [refs.globalCache, refs.scrollbarX, refs.scrollbarY, setContext]);
|
|
140
134
|
var onTouchEnd = useCallback(function () {
|
|
141
135
|
handleOverlayTouchEnd(refs.globalCache);
|
|
142
136
|
}, [refs.globalCache]);
|
|
@@ -216,7 +210,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
216
210
|
className: "fortune-sheet-overlay",
|
|
217
211
|
ref: containerRef,
|
|
218
212
|
onTouchStart: onTouchStart,
|
|
219
|
-
onTouchMove: onTouchMove,
|
|
220
213
|
onTouchEnd: onTouchEnd,
|
|
221
214
|
tabIndex: -1,
|
|
222
215
|
style: {
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.scrollbar-hidden {
|
|
15
|
+
overflow: auto; /* enables scrolling */
|
|
16
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
17
|
+
scrollbar-width: none; /* Firefox */
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.scrollbar-hidden::-webkit-scrollbar {
|
|
21
|
+
display: none; /* Chrome, Safari, Opera */
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
.fortune-toolbar-divider {
|
|
15
25
|
width: 1px;
|
|
16
26
|
height: 20px;
|
|
@@ -638,7 +638,7 @@ var Toolbar = function Toolbar(_a) {
|
|
|
638
638
|
}));
|
|
639
639
|
}
|
|
640
640
|
if (name === "format") {
|
|
641
|
-
var
|
|
641
|
+
var currentFmt_1 = defaultFormat[0].text;
|
|
642
642
|
if (cell) {
|
|
643
643
|
var curr_2 = normalizedCellAttr(cell, "ct");
|
|
644
644
|
var format = _.find(defaultFormat, function (v) {
|
|
@@ -646,16 +646,16 @@ var Toolbar = function Toolbar(_a) {
|
|
|
646
646
|
});
|
|
647
647
|
if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
|
|
648
648
|
if (format != null) {
|
|
649
|
-
|
|
649
|
+
currentFmt_1 = format.text;
|
|
650
650
|
} else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
|
|
651
|
-
|
|
651
|
+
currentFmt_1 = "Number";
|
|
652
652
|
} else {
|
|
653
|
-
|
|
653
|
+
currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
return /*#__PURE__*/React.createElement(Combo, {
|
|
658
|
-
text:
|
|
658
|
+
text: currentFmt_1,
|
|
659
659
|
key: name,
|
|
660
660
|
tooltip: tooltip,
|
|
661
661
|
showArrow: false
|
|
@@ -681,9 +681,17 @@ var Toolbar = function Toolbar(_a) {
|
|
|
681
681
|
}
|
|
682
682
|
}, /*#__PURE__*/React.createElement("div", {
|
|
683
683
|
className: "fortune-toolbar-menu-line"
|
|
684
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
685
|
-
className: "
|
|
686
|
-
},
|
|
684
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
685
|
+
className: "flex gap-2 items-center"
|
|
686
|
+
}, currentFmt_1 === text ? (/*#__PURE__*/React.createElement(LucideIcon, {
|
|
687
|
+
name: "Check",
|
|
688
|
+
className: "w-4 h-4"
|
|
689
|
+
})) : (/*#__PURE__*/React.createElement("span", {
|
|
690
|
+
className: "w-4 h-4"
|
|
691
|
+
})), /*#__PURE__*/React.createElement("div", null, text)), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
692
|
+
name: "ChevronRight",
|
|
693
|
+
className: "w-4 h-4 color-icon-secondary"
|
|
694
|
+
})));
|
|
687
695
|
}
|
|
688
696
|
return /*#__PURE__*/React.createElement(Option, {
|
|
689
697
|
key: value,
|
|
@@ -696,8 +704,18 @@ var Toolbar = function Toolbar(_a) {
|
|
|
696
704
|
});
|
|
697
705
|
}
|
|
698
706
|
}, /*#__PURE__*/React.createElement("div", {
|
|
699
|
-
|
|
700
|
-
|
|
707
|
+
style: {
|
|
708
|
+
overflowX: "scroll"
|
|
709
|
+
},
|
|
710
|
+
className: "fortune-toolbar-menu-line scrollbar-hidden w-full"
|
|
711
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
712
|
+
className: "flex gap-2 items-center"
|
|
713
|
+
}, currentFmt_1 === text ? (/*#__PURE__*/React.createElement(LucideIcon, {
|
|
714
|
+
name: "Check",
|
|
715
|
+
className: "w-4 h-4"
|
|
716
|
+
})) : (/*#__PURE__*/React.createElement("span", {
|
|
717
|
+
className: "w-4 h-4"
|
|
718
|
+
})), /*#__PURE__*/React.createElement("div", null, text)), /*#__PURE__*/React.createElement("div", {
|
|
701
719
|
className: "fortune-toolbar-subtext"
|
|
702
720
|
}, example)));
|
|
703
721
|
}));
|
|
@@ -36,6 +36,11 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
36
36
|
queuedXPixels = 0;
|
|
37
37
|
queuedYPixels = 0;
|
|
38
38
|
}
|
|
39
|
+
function scheduleScrollUpdate(x, y) {
|
|
40
|
+
queuedXPixels += x;
|
|
41
|
+
queuedYPixels += y;
|
|
42
|
+
if (!animationFrameId) animationFrameId = requestAnimationFrame(applyQueuedScroll);
|
|
43
|
+
}
|
|
39
44
|
function handleWheelEvent(event) {
|
|
40
45
|
var _a, _b;
|
|
41
46
|
event.preventDefault();
|
|
@@ -52,16 +57,61 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
52
57
|
return;
|
|
53
58
|
}
|
|
54
59
|
var scaleFactor = getPixelScale();
|
|
55
|
-
|
|
56
|
-
queuedYPixels += event.deltaY * scaleFactor;
|
|
57
|
-
if (!animationFrameId) animationFrameId = requestAnimationFrame(applyQueuedScroll);
|
|
60
|
+
scheduleScrollUpdate(event.deltaX * scaleFactor, event.deltaY * scaleFactor);
|
|
58
61
|
}
|
|
59
62
|
scrollContainer.addEventListener("wheel", handleWheelEvent, {
|
|
60
63
|
passive: false
|
|
61
64
|
});
|
|
65
|
+
return {
|
|
66
|
+
scheduleScrollUpdate: scheduleScrollUpdate,
|
|
67
|
+
detach: function detach() {
|
|
68
|
+
scrollContainer.removeEventListener("wheel", handleWheelEvent);
|
|
69
|
+
if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function attachTouchPanToQueue(containerEl, scheduleScrollUpdate, getPixelScale) {
|
|
74
|
+
var dragging = false;
|
|
75
|
+
var lastX = 0;
|
|
76
|
+
var lastY = 0;
|
|
77
|
+
function onPointerDown(e) {
|
|
78
|
+
if (e.pointerType !== "touch" && e.pointerType !== "pen") return;
|
|
79
|
+
dragging = true;
|
|
80
|
+
lastX = e.clientX;
|
|
81
|
+
lastY = e.clientY;
|
|
82
|
+
containerEl.setPointerCapture(e.pointerId);
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
}
|
|
85
|
+
function onPointerMove(e) {
|
|
86
|
+
if (!dragging) return;
|
|
87
|
+
var dx = e.clientX - lastX;
|
|
88
|
+
var dy = e.clientY - lastY;
|
|
89
|
+
lastX = e.clientX;
|
|
90
|
+
lastY = e.clientY;
|
|
91
|
+
var scale = getPixelScale();
|
|
92
|
+
scheduleScrollUpdate(-dx * scale, -dy * scale);
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
}
|
|
95
|
+
function onPointerUp(e) {
|
|
96
|
+
if (!dragging) return;
|
|
97
|
+
dragging = false;
|
|
98
|
+
try {
|
|
99
|
+
containerEl.releasePointerCapture(e.pointerId);
|
|
100
|
+
} catch (_a) {}
|
|
101
|
+
}
|
|
102
|
+
containerEl.addEventListener("pointerdown", onPointerDown, {
|
|
103
|
+
passive: false
|
|
104
|
+
});
|
|
105
|
+
containerEl.addEventListener("pointermove", onPointerMove, {
|
|
106
|
+
passive: false
|
|
107
|
+
});
|
|
108
|
+
containerEl.addEventListener("pointerup", onPointerUp);
|
|
109
|
+
containerEl.addEventListener("pointercancel", onPointerUp);
|
|
62
110
|
return function () {
|
|
63
|
-
|
|
64
|
-
|
|
111
|
+
containerEl.removeEventListener("pointerdown", onPointerDown);
|
|
112
|
+
containerEl.removeEventListener("pointermove", onPointerMove);
|
|
113
|
+
containerEl.removeEventListener("pointerup", onPointerUp);
|
|
114
|
+
containerEl.removeEventListener("pointercancel", onPointerUp);
|
|
65
115
|
};
|
|
66
116
|
}
|
|
67
117
|
var makeScrollbarsMoveByPixels = function makeScrollbarsMoveByPixels(horizontalScrollbarEl, verticalScrollbarEl) {
|
|
@@ -80,18 +130,27 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
80
130
|
}
|
|
81
131
|
};
|
|
82
132
|
};
|
|
83
|
-
function routeWheelScrollToScrollbars(
|
|
133
|
+
function routeWheelScrollToScrollbars(scrollContainerEl, horizontalScrollbarEl, verticalScrollbarEl) {
|
|
84
134
|
var moveScrollbarsByPixels = makeScrollbarsMoveByPixels(horizontalScrollbarEl, verticalScrollbarEl);
|
|
85
|
-
|
|
86
|
-
|
|
135
|
+
var _a = attachSmoothWheelScroll(scrollContainerEl, moveScrollbarsByPixels, function () {
|
|
136
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
137
|
+
}),
|
|
138
|
+
scheduleScrollUpdate = _a.scheduleScrollUpdate,
|
|
139
|
+
detach = _a.detach;
|
|
140
|
+
var detachTouch = attachTouchPanToQueue(scrollContainerEl, scheduleScrollUpdate, function () {
|
|
141
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
87
142
|
});
|
|
143
|
+
return function () {
|
|
144
|
+
detach();
|
|
145
|
+
detachTouch();
|
|
146
|
+
};
|
|
88
147
|
}
|
|
89
148
|
(0, _react.useEffect)(function () {
|
|
90
149
|
var scrollContainerEl = scrollContainerRef.current;
|
|
91
150
|
var horizontalScrollbarEl = refs.scrollbarX.current;
|
|
92
151
|
var verticalScrollbarEl = refs.scrollbarY.current;
|
|
93
152
|
if (!scrollContainerEl || !horizontalScrollbarEl || !verticalScrollbarEl) return function () {};
|
|
94
|
-
var unmountScrollHandler = routeWheelScrollToScrollbars(
|
|
153
|
+
var unmountScrollHandler = routeWheelScrollToScrollbars(scrollContainerEl, horizontalScrollbarEl, verticalScrollbarEl);
|
|
95
154
|
return unmountScrollHandler;
|
|
96
155
|
}, [context.zoomRatio]);
|
|
97
156
|
};
|
|
@@ -140,12 +140,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
140
140
|
});
|
|
141
141
|
e.stopPropagation();
|
|
142
142
|
}, [refs.globalCache, setContext]);
|
|
143
|
-
var onTouchMove = (0, _react.useCallback)(function (e) {
|
|
144
|
-
var nativeEvent = e.nativeEvent;
|
|
145
|
-
setContext(function (draftCtx) {
|
|
146
|
-
(0, _fortuneCore.handleOverlayTouchMove)(draftCtx, nativeEvent, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
147
|
-
});
|
|
148
|
-
}, [refs.globalCache, refs.scrollbarX, refs.scrollbarY, setContext]);
|
|
149
143
|
var onTouchEnd = (0, _react.useCallback)(function () {
|
|
150
144
|
(0, _fortuneCore.handleOverlayTouchEnd)(refs.globalCache);
|
|
151
145
|
}, [refs.globalCache]);
|
|
@@ -225,7 +219,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
225
219
|
className: "fortune-sheet-overlay",
|
|
226
220
|
ref: containerRef,
|
|
227
221
|
onTouchStart: onTouchStart,
|
|
228
|
-
onTouchMove: onTouchMove,
|
|
229
222
|
onTouchEnd: onTouchEnd,
|
|
230
223
|
tabIndex: -1,
|
|
231
224
|
style: {
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.scrollbar-hidden {
|
|
15
|
+
overflow: auto; /* enables scrolling */
|
|
16
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
17
|
+
scrollbar-width: none; /* Firefox */
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.scrollbar-hidden::-webkit-scrollbar {
|
|
21
|
+
display: none; /* Chrome, Safari, Opera */
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
.fortune-toolbar-divider {
|
|
15
25
|
width: 1px;
|
|
16
26
|
height: 20px;
|
|
@@ -647,7 +647,7 @@ var Toolbar = function Toolbar(_a) {
|
|
|
647
647
|
}));
|
|
648
648
|
}
|
|
649
649
|
if (name === "format") {
|
|
650
|
-
var
|
|
650
|
+
var currentFmt_1 = defaultFormat[0].text;
|
|
651
651
|
if (cell) {
|
|
652
652
|
var curr_2 = (0, _fortuneCore.normalizedCellAttr)(cell, "ct");
|
|
653
653
|
var format = _lodash.default.find(defaultFormat, function (v) {
|
|
@@ -655,16 +655,16 @@ var Toolbar = function Toolbar(_a) {
|
|
|
655
655
|
});
|
|
656
656
|
if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
|
|
657
657
|
if (format != null) {
|
|
658
|
-
|
|
658
|
+
currentFmt_1 = format.text;
|
|
659
659
|
} else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
|
|
660
|
-
|
|
660
|
+
currentFmt_1 = "Number";
|
|
661
661
|
} else {
|
|
662
|
-
|
|
662
|
+
currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
667
|
-
text:
|
|
667
|
+
text: currentFmt_1,
|
|
668
668
|
key: name,
|
|
669
669
|
tooltip: tooltip,
|
|
670
670
|
showArrow: false
|
|
@@ -690,9 +690,17 @@ var Toolbar = function Toolbar(_a) {
|
|
|
690
690
|
}
|
|
691
691
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
692
692
|
className: "fortune-toolbar-menu-line"
|
|
693
|
-
}, /*#__PURE__*/_react.default.createElement("div",
|
|
694
|
-
className: "
|
|
695
|
-
},
|
|
693
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
694
|
+
className: "flex gap-2 items-center"
|
|
695
|
+
}, currentFmt_1 === text ? (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
696
|
+
name: "Check",
|
|
697
|
+
className: "w-4 h-4"
|
|
698
|
+
})) : (/*#__PURE__*/_react.default.createElement("span", {
|
|
699
|
+
className: "w-4 h-4"
|
|
700
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, text)), /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
701
|
+
name: "ChevronRight",
|
|
702
|
+
className: "w-4 h-4 color-icon-secondary"
|
|
703
|
+
})));
|
|
696
704
|
}
|
|
697
705
|
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
698
706
|
key: value,
|
|
@@ -705,8 +713,18 @@ var Toolbar = function Toolbar(_a) {
|
|
|
705
713
|
});
|
|
706
714
|
}
|
|
707
715
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
708
|
-
|
|
709
|
-
|
|
716
|
+
style: {
|
|
717
|
+
overflowX: "scroll"
|
|
718
|
+
},
|
|
719
|
+
className: "fortune-toolbar-menu-line scrollbar-hidden w-full"
|
|
720
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
721
|
+
className: "flex gap-2 items-center"
|
|
722
|
+
}, currentFmt_1 === text ? (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
723
|
+
name: "Check",
|
|
724
|
+
className: "w-4 h-4"
|
|
725
|
+
})) : (/*#__PURE__*/_react.default.createElement("span", {
|
|
726
|
+
className: "w-4 h-4"
|
|
727
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
710
728
|
className: "fortune-toolbar-subtext"
|
|
711
729
|
}, example)));
|
|
712
730
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.65",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.1.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.65",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|