@fileverse-dev/fortune-react 1.0.2-mod-56 → 1.0.2-mod-57
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/components/Toolbar/index.d.ts +3 -1
- package/dist/index.css +11 -4
- package/dist/index.esm.css +11 -4
- package/dist/index.esm.js +116 -64
- package/dist/index.js +115 -63
- package/dist/index.umd.css +11 -4
- package/dist/index.umd.js +4597 -2641
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +3 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.css";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const getLucideIcon: (title: string) => "Undo" | "Redo" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "JapaneseYen" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis" | "";
|
|
4
4
|
declare const Toolbar: React.FC<{
|
|
5
5
|
setMoreItems: React.Dispatch<React.SetStateAction<React.ReactNode>>;
|
|
6
6
|
moreItemsOpen: boolean;
|
|
7
|
+
onMoreToolbarItemsClose?: () => void;
|
|
8
|
+
moreToolbarItems?: React.ReactNode;
|
|
7
9
|
}>;
|
|
8
10
|
export default Toolbar;
|
package/dist/index.css
CHANGED
|
@@ -2250,11 +2250,12 @@ input[type="number"].condition-rules-project-input {
|
|
|
2250
2250
|
flex-direction: row;
|
|
2251
2251
|
/* background: #fafafc; */
|
|
2252
2252
|
position: relative;
|
|
2253
|
-
padding:
|
|
2253
|
+
padding: 4px 8px;
|
|
2254
2254
|
border-bottom: 1px solid #d4d4d4;
|
|
2255
2255
|
white-space: nowrap;
|
|
2256
2256
|
align-items: center;
|
|
2257
2257
|
gap: 4px;
|
|
2258
|
+
justify-content: space-between;
|
|
2258
2259
|
}
|
|
2259
2260
|
|
|
2260
2261
|
.fortune-toolbar-divider {
|
|
@@ -2313,8 +2314,11 @@ input[type="number"].condition-rules-project-input {
|
|
|
2313
2314
|
align-items: center;
|
|
2314
2315
|
}
|
|
2315
2316
|
|
|
2316
|
-
.fortune-toolbar-button
|
|
2317
|
-
|
|
2317
|
+
.fortune-toolbar-combo-button.show-arrow {
|
|
2318
|
+
border-radius: 4px 0px 0px 4px;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
.fortune-toolbar-button:hover {
|
|
2318
2322
|
background-color: #f2f4f5;
|
|
2319
2323
|
cursor: pointer;
|
|
2320
2324
|
}
|
|
@@ -2322,6 +2326,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2322
2326
|
.fortune-toolbar-combo-arrow:hover {
|
|
2323
2327
|
background-color: #f2f4f5;
|
|
2324
2328
|
cursor: pointer;
|
|
2329
|
+
height: 30px;
|
|
2330
|
+
border-radius: 0px 4px 4px 0px;
|
|
2325
2331
|
}
|
|
2326
2332
|
|
|
2327
2333
|
.fortune-toolbar-button:active,
|
|
@@ -2452,8 +2458,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2452
2458
|
flex-direction: row;
|
|
2453
2459
|
align-items: center;
|
|
2454
2460
|
align-self: flex-end;
|
|
2455
|
-
margin-right: 40px;
|
|
2456
2461
|
top: 40px;
|
|
2462
|
+
right: 0px;
|
|
2457
2463
|
max-width: 348px;
|
|
2458
2464
|
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
2459
2465
|
background: white;
|
|
@@ -2641,6 +2647,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2641
2647
|
flex-direction: row;
|
|
2642
2648
|
align-items: center;
|
|
2643
2649
|
gap: 4px;
|
|
2650
|
+
position: relative;
|
|
2644
2651
|
}
|
|
2645
2652
|
|
|
2646
2653
|
.fortune-toolbar-right {
|
package/dist/index.esm.css
CHANGED
|
@@ -2250,11 +2250,12 @@ input[type="number"].condition-rules-project-input {
|
|
|
2250
2250
|
flex-direction: row;
|
|
2251
2251
|
/* background: #fafafc; */
|
|
2252
2252
|
position: relative;
|
|
2253
|
-
padding:
|
|
2253
|
+
padding: 4px 8px;
|
|
2254
2254
|
border-bottom: 1px solid #d4d4d4;
|
|
2255
2255
|
white-space: nowrap;
|
|
2256
2256
|
align-items: center;
|
|
2257
2257
|
gap: 4px;
|
|
2258
|
+
justify-content: space-between;
|
|
2258
2259
|
}
|
|
2259
2260
|
|
|
2260
2261
|
.fortune-toolbar-divider {
|
|
@@ -2313,8 +2314,11 @@ input[type="number"].condition-rules-project-input {
|
|
|
2313
2314
|
align-items: center;
|
|
2314
2315
|
}
|
|
2315
2316
|
|
|
2316
|
-
.fortune-toolbar-button
|
|
2317
|
-
|
|
2317
|
+
.fortune-toolbar-combo-button.show-arrow {
|
|
2318
|
+
border-radius: 4px 0px 0px 4px;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
.fortune-toolbar-button:hover {
|
|
2318
2322
|
background-color: #f2f4f5;
|
|
2319
2323
|
cursor: pointer;
|
|
2320
2324
|
}
|
|
@@ -2322,6 +2326,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2322
2326
|
.fortune-toolbar-combo-arrow:hover {
|
|
2323
2327
|
background-color: #f2f4f5;
|
|
2324
2328
|
cursor: pointer;
|
|
2329
|
+
height: 30px;
|
|
2330
|
+
border-radius: 0px 4px 4px 0px;
|
|
2325
2331
|
}
|
|
2326
2332
|
|
|
2327
2333
|
.fortune-toolbar-button:active,
|
|
@@ -2452,8 +2458,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2452
2458
|
flex-direction: row;
|
|
2453
2459
|
align-items: center;
|
|
2454
2460
|
align-self: flex-end;
|
|
2455
|
-
margin-right: 40px;
|
|
2456
2461
|
top: 40px;
|
|
2462
|
+
right: 0px;
|
|
2457
2463
|
max-width: 348px;
|
|
2458
2464
|
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
2459
2465
|
background: white;
|
|
@@ -2641,6 +2647,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2641
2647
|
flex-direction: row;
|
|
2642
2648
|
align-items: center;
|
|
2643
2649
|
gap: 4px;
|
|
2650
|
+
position: relative;
|
|
2644
2651
|
}
|
|
2645
2652
|
|
|
2646
2653
|
.fortune-toolbar-right {
|
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fix
|
|
|
2
2
|
import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
|
|
3
3
|
import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
-
import { LucideIcon, TextField, Button as Button$1, cn, IconButton, Checkbox, Divider as Divider$2, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Select as Select$1, SelectTrigger, SelectValue, SelectContent, SelectItem as SelectItem$1, RadioGroup, RadioGroupItem, Label } from '@fileverse/ui';
|
|
5
|
+
import { LucideIcon, TextField, Button as Button$1, cn, IconButton, Checkbox, Divider as Divider$2, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Select as Select$1, SelectTrigger, SelectValue, SelectContent, SelectItem as SelectItem$1, Tooltip, RadioGroup, RadioGroupItem, Label } from '@fileverse/ui';
|
|
6
6
|
import regeneratorRuntime from 'regenerator-runtime';
|
|
7
7
|
import Tippy from '@tippyjs/react';
|
|
8
8
|
|
|
@@ -4443,26 +4443,25 @@ var Button = function Button(_ref) {
|
|
|
4443
4443
|
selected = _ref.selected,
|
|
4444
4444
|
children = _ref.children,
|
|
4445
4445
|
style = _ref.style;
|
|
4446
|
-
return /*#__PURE__*/React.createElement(
|
|
4446
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
4447
|
+
text: tooltip,
|
|
4448
|
+
placement: "bottom"
|
|
4449
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4447
4450
|
className: "fortune-toolbar-button fortune-toolbar-item",
|
|
4448
4451
|
onClick: onClick,
|
|
4449
4452
|
tabIndex: 0,
|
|
4450
|
-
"data-tips": tooltip,
|
|
4451
4453
|
role: "button",
|
|
4452
|
-
"aria-label": tooltip,
|
|
4453
4454
|
style: selected ? {
|
|
4454
4455
|
backgroundColor: "#E7E5EB"
|
|
4455
4456
|
} : style
|
|
4456
|
-
}, /*#__PURE__*/React.createElement(
|
|
4457
|
-
name: iconId,
|
|
4457
|
+
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
4458
|
+
name: getLucideIcon(iconId),
|
|
4458
4459
|
width: 16,
|
|
4459
4460
|
height: 16,
|
|
4460
4461
|
style: disabled ? {
|
|
4461
4462
|
opacity: 0.3
|
|
4462
4463
|
} : {}
|
|
4463
|
-
}),
|
|
4464
|
-
className: "fortune-tooltip"
|
|
4465
|
-
}, tooltip), children);
|
|
4464
|
+
}), children));
|
|
4466
4465
|
};
|
|
4467
4466
|
|
|
4468
4467
|
var Divider = function Divider() {
|
|
@@ -4500,7 +4499,7 @@ var Combo = function Combo(_ref) {
|
|
|
4500
4499
|
var popupRef = useRef(null);
|
|
4501
4500
|
var buttonRef = useRef(null);
|
|
4502
4501
|
var isLucideIcon = useMemo(function () {
|
|
4503
|
-
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
|
|
4502
|
+
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip", "font-color", "background", "border-all", "merge-all", "format", "conditionFormat", "filter", "comment", "image", "formula-sum", "dune", "template"].includes(iconId);
|
|
4504
4503
|
}, [iconId]);
|
|
4505
4504
|
useOutsideClick(popupRef, function () {
|
|
4506
4505
|
setOpen(false);
|
|
@@ -4529,7 +4528,10 @@ var Combo = function Combo(_ref) {
|
|
|
4529
4528
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4530
4529
|
ref: buttonRef,
|
|
4531
4530
|
className: "fortune-toolbar-combo"
|
|
4532
|
-
}, !isLucideIcon ? (/*#__PURE__*/React.createElement(
|
|
4531
|
+
}, !isLucideIcon ? (/*#__PURE__*/React.createElement(Tooltip, {
|
|
4532
|
+
text: tooltip,
|
|
4533
|
+
placement: "bottom"
|
|
4534
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4533
4535
|
className: "fortune-toolbar-combo-button",
|
|
4534
4536
|
onClick: function onClick(e) {
|
|
4535
4537
|
if (_onClick) {
|
|
@@ -4540,9 +4542,7 @@ var Combo = function Combo(_ref) {
|
|
|
4540
4542
|
}
|
|
4541
4543
|
},
|
|
4542
4544
|
tabIndex: 0,
|
|
4543
|
-
"data-tips": tooltip,
|
|
4544
4545
|
role: "button",
|
|
4545
|
-
"aria-label": "".concat(tooltip, ": ").concat(text !== undefined ? text : ""),
|
|
4546
4546
|
style: style
|
|
4547
4547
|
}, iconId ? (/*#__PURE__*/React.createElement(SVGIcon, {
|
|
4548
4548
|
name: iconId,
|
|
@@ -4550,29 +4550,29 @@ var Combo = function Combo(_ref) {
|
|
|
4550
4550
|
height: 16
|
|
4551
4551
|
})) : (/*#__PURE__*/React.createElement("span", {
|
|
4552
4552
|
className: "fortune-toolbar-combo-text"
|
|
4553
|
-
}, text !== undefined ? text : "")))) : (/*#__PURE__*/React.createElement(
|
|
4554
|
-
|
|
4553
|
+
}, text !== undefined ? text : ""))))) : (/*#__PURE__*/React.createElement(Tooltip, {
|
|
4554
|
+
text: tooltip,
|
|
4555
|
+
placement: "bottom"
|
|
4556
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
4557
|
+
icon: getLucideIcon(iconId),
|
|
4555
4558
|
variant: "ghost",
|
|
4556
4559
|
onClick: function onClick() {
|
|
4557
4560
|
return setOpen(!open);
|
|
4558
|
-
}
|
|
4559
|
-
|
|
4561
|
+
},
|
|
4562
|
+
className: showArrow ? "fortune-toolbar-combo-button show-arrow" : ""
|
|
4563
|
+
}))), showArrow && (/*#__PURE__*/React.createElement("div", {
|
|
4560
4564
|
className: "fortune-toolbar-combo-arrow",
|
|
4561
4565
|
onClick: function onClick() {
|
|
4562
4566
|
return setOpen(!open);
|
|
4563
4567
|
},
|
|
4564
4568
|
tabIndex: 0,
|
|
4565
|
-
"data-tips": tooltip,
|
|
4566
4569
|
role: "button",
|
|
4567
|
-
"aria-label": tooltip,
|
|
4568
4570
|
style: style
|
|
4569
4571
|
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
4570
4572
|
name: "ChevronDown",
|
|
4571
4573
|
width: 14,
|
|
4572
4574
|
height: 14
|
|
4573
|
-
}))),
|
|
4574
|
-
className: "fortune-tooltip"
|
|
4575
|
-
}, tooltip)), open && (/*#__PURE__*/React.createElement("div", {
|
|
4575
|
+
})))), open && (/*#__PURE__*/React.createElement("div", {
|
|
4576
4576
|
ref: popupRef,
|
|
4577
4577
|
className: "fortune-toolbar-combo-popup",
|
|
4578
4578
|
style: popupPosition
|
|
@@ -5256,11 +5256,13 @@ var CustomButton = function CustomButton(_ref) {
|
|
|
5256
5256
|
children = _ref.children,
|
|
5257
5257
|
iconName = _ref.iconName,
|
|
5258
5258
|
icon = _ref.icon;
|
|
5259
|
-
return /*#__PURE__*/React.createElement(
|
|
5259
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
5260
|
+
text: tooltip,
|
|
5261
|
+
placement: "bottom"
|
|
5262
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5260
5263
|
className: "fortune-toolbar-button fortune-toolbar-item",
|
|
5261
5264
|
onClick: onClick,
|
|
5262
5265
|
tabIndex: 0,
|
|
5263
|
-
"data-tips": tooltip,
|
|
5264
5266
|
role: "button",
|
|
5265
5267
|
style: selected ? {
|
|
5266
5268
|
backgroundColor: "#E7E5EB"
|
|
@@ -5270,9 +5272,7 @@ var CustomButton = function CustomButton(_ref) {
|
|
|
5270
5272
|
height: 16,
|
|
5271
5273
|
iconName: iconName,
|
|
5272
5274
|
content: icon
|
|
5273
|
-
}),
|
|
5274
|
-
className: "fortune-tooltip"
|
|
5275
|
-
}, tooltip), children);
|
|
5275
|
+
}), children));
|
|
5276
5276
|
};
|
|
5277
5277
|
|
|
5278
5278
|
var palette = [["#000000", "#444444", "#666666", "#999999", "#B7B7B7", "#cccccc", "#D9D9D9", "#EFEFEF", "#f3f3f3", "#ffffff"], ["#970007", "#FE0012", "#FE9728", "#FFFD40", "#27FD3C", "#21FFFF", "#4A89E4", "#0027F9", "#9726FA", "#FD23FA"], ["#E6B8B0", "#f4cccc", "#FCE5CF", "#FFF1CF", "#DAEAD4", "#D0E0E3", "#C9DBF7", "#CFE3F2", "#D9D3E8", "#EAD1DC"], ["#DC7D6D", "#E9999A", "#F9CAA0", "#FFE49F", "#B7D6AB", "#A3C4C9", "#A4C3F2", "#A0C6E6", "#B4A8D4", "#D5A7BC"], ["#CB402B", "#DF6668", "#F6B171", "#FFD871", "#95C382", "#77A6AF", "#6DA0E8", "#70AADA", "#8E7EC0", "#C17C9F"], ["#A51A0A", "#CB000C", "#E59043", "#F1C046", "#6CA756", "#46828D", "#3C7BD4", "#3E87C3", "#6651A4", "#A54E78"], ["#841F11", "#980007", "#B35E19", "#BF8F22", "#3A7527", "#15505B", "#0E5AC8", "#0B5592", "#0B5592", "#731C46"], ["#5B0E03", "#660003", "#783E0E", "#7F5F13", "#284E19", "#0D343D", "#1C4785", "#073961", "#1F154B", "#4C112F"]];
|
|
@@ -5538,8 +5538,33 @@ var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
|
|
|
5538
5538
|
}, submitText)))));
|
|
5539
5539
|
};
|
|
5540
5540
|
|
|
5541
|
-
var
|
|
5541
|
+
var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
5542
|
+
var onClose = _ref.onClose,
|
|
5543
|
+
children = _ref.children;
|
|
5544
|
+
var containerRef = useRef(null);
|
|
5545
|
+
useOutsideClick(containerRef, function () {
|
|
5546
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
5547
|
+
}, [containerRef, onClose]);
|
|
5548
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5549
|
+
ref: containerRef,
|
|
5550
|
+
className: "fortune-toolbar-more-container"
|
|
5551
|
+
}, children);
|
|
5552
|
+
};
|
|
5553
|
+
|
|
5554
|
+
var getLucideIcon = function getLucideIcon(title) {
|
|
5542
5555
|
switch (title) {
|
|
5556
|
+
case "undo":
|
|
5557
|
+
return "Undo";
|
|
5558
|
+
case "redo":
|
|
5559
|
+
return "Redo";
|
|
5560
|
+
case "bold":
|
|
5561
|
+
return "Bold";
|
|
5562
|
+
case "italic":
|
|
5563
|
+
return "Italic";
|
|
5564
|
+
case "strike-through":
|
|
5565
|
+
return "Strikethrough";
|
|
5566
|
+
case "underline":
|
|
5567
|
+
return "Underline";
|
|
5543
5568
|
case "align-left":
|
|
5544
5569
|
return "AlignLeft";
|
|
5545
5570
|
case "align-center":
|
|
@@ -5558,6 +5583,44 @@ var getIcon = function getIcon(title) {
|
|
|
5558
5583
|
return "WrapText";
|
|
5559
5584
|
case "text-clip":
|
|
5560
5585
|
return "TextClip";
|
|
5586
|
+
case "font-color":
|
|
5587
|
+
return "Baseline";
|
|
5588
|
+
case "background":
|
|
5589
|
+
return "PaintBucket";
|
|
5590
|
+
case "border-all":
|
|
5591
|
+
return "Border";
|
|
5592
|
+
case "merge-all":
|
|
5593
|
+
return "MergeHorizontal";
|
|
5594
|
+
case "format":
|
|
5595
|
+
return "JapaneseYen";
|
|
5596
|
+
case "currency-format":
|
|
5597
|
+
return "JapaneseYen";
|
|
5598
|
+
case "percentage-format":
|
|
5599
|
+
return "Percent";
|
|
5600
|
+
case "number-decrease":
|
|
5601
|
+
return "DecimalsArrowLeft";
|
|
5602
|
+
case "number-increase":
|
|
5603
|
+
return "DecimalsArrowRight";
|
|
5604
|
+
case "conditionFormat":
|
|
5605
|
+
return "PaintbrushVertical";
|
|
5606
|
+
case "filter":
|
|
5607
|
+
return "Filter";
|
|
5608
|
+
case "link":
|
|
5609
|
+
return "Link";
|
|
5610
|
+
case "comment":
|
|
5611
|
+
return "MessageSquarePlus";
|
|
5612
|
+
case "image":
|
|
5613
|
+
return "Image";
|
|
5614
|
+
case "formula-sum":
|
|
5615
|
+
return "Sigma";
|
|
5616
|
+
case "dataVerification":
|
|
5617
|
+
return "ShieldCheck";
|
|
5618
|
+
case "search":
|
|
5619
|
+
return "Search";
|
|
5620
|
+
case "dune":
|
|
5621
|
+
return "DuneChart";
|
|
5622
|
+
case "Ellipsis":
|
|
5623
|
+
return "Ellipsis";
|
|
5561
5624
|
default:
|
|
5562
5625
|
return "";
|
|
5563
5626
|
}
|
|
@@ -5565,7 +5628,9 @@ var getIcon = function getIcon(title) {
|
|
|
5565
5628
|
var Toolbar = function Toolbar(_ref) {
|
|
5566
5629
|
var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
|
|
5567
5630
|
var setMoreItems = _ref.setMoreItems,
|
|
5568
|
-
moreItemsOpen = _ref.moreItemsOpen
|
|
5631
|
+
moreItemsOpen = _ref.moreItemsOpen,
|
|
5632
|
+
onMoreToolbarItemsClose = _ref.onMoreToolbarItemsClose,
|
|
5633
|
+
moreToolbarItems = _ref.moreToolbarItems;
|
|
5569
5634
|
var _useContext = useContext(WorkbookContext),
|
|
5570
5635
|
context = _useContext.context,
|
|
5571
5636
|
setContext = _useContext.setContext,
|
|
@@ -5938,7 +6003,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5938
6003
|
isActive: ((_$find2 = _.find(items, function (item) {
|
|
5939
6004
|
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
5940
6005
|
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
|
|
5941
|
-
icon:
|
|
6006
|
+
icon: getLucideIcon(title),
|
|
5942
6007
|
variant: "ghost",
|
|
5943
6008
|
onClick: function onClick() {
|
|
5944
6009
|
setContext(function (ctx) {
|
|
@@ -5991,7 +6056,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5991
6056
|
isActive: ((_$find4 = _.find(_items, function (item) {
|
|
5992
6057
|
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5993
6058
|
})) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
|
|
5994
|
-
icon:
|
|
6059
|
+
icon: getLucideIcon(title),
|
|
5995
6060
|
variant: "ghost",
|
|
5996
6061
|
onClick: function onClick() {
|
|
5997
6062
|
setContext(function (ctx) {
|
|
@@ -6583,7 +6648,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6583
6648
|
return /*#__PURE__*/React.createElement(IconButton, {
|
|
6584
6649
|
key: value,
|
|
6585
6650
|
isActive: _curr.value === value,
|
|
6586
|
-
icon:
|
|
6651
|
+
icon: getLucideIcon(iconId),
|
|
6587
6652
|
variant: "ghost",
|
|
6588
6653
|
onClick: function onClick() {
|
|
6589
6654
|
setContext(function (ctx) {
|
|
@@ -6735,7 +6800,10 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6735
6800
|
}));
|
|
6736
6801
|
});
|
|
6737
6802
|
}
|
|
6738
|
-
return /*#__PURE__*/React.createElement(
|
|
6803
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
6804
|
+
text: tooltip,
|
|
6805
|
+
placement: "bottom"
|
|
6806
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
6739
6807
|
iconId: name,
|
|
6740
6808
|
tooltip: tooltip,
|
|
6741
6809
|
key: name,
|
|
@@ -6746,7 +6814,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6746
6814
|
(_toolbarItemClickHand = toolbarItemClickHandler(name)) === null || _toolbarItemClickHand === void 0 ? void 0 : _toolbarItemClickHand(draftCtx, refs.cellInput.current, refs.globalCache);
|
|
6747
6815
|
});
|
|
6748
6816
|
}
|
|
6749
|
-
});
|
|
6817
|
+
}));
|
|
6750
6818
|
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula, showDuneModal, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle, toolbarFormat.moreCurrency]);
|
|
6751
6819
|
return /*#__PURE__*/React.createElement("div", {
|
|
6752
6820
|
ref: containerRef,
|
|
@@ -6769,7 +6837,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6769
6837
|
})) : null, (toolbarWrapIndex === -1 ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
|
|
6770
6838
|
return getToolbarItem(name, i);
|
|
6771
6839
|
}), toolbarWrapIndex !== -1 && toolbarWrapIndex < settings.toolbarItems.length - 1 ? (/*#__PURE__*/React.createElement(Button, {
|
|
6772
|
-
iconId: "
|
|
6840
|
+
iconId: "Ellipsis",
|
|
6773
6841
|
tooltip: toolbar.toolMore,
|
|
6774
6842
|
onClick: function onClick() {
|
|
6775
6843
|
if (moreItemsOpen) {
|
|
@@ -6780,7 +6848,9 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6780
6848
|
}));
|
|
6781
6849
|
}
|
|
6782
6850
|
}
|
|
6783
|
-
})) : null
|
|
6851
|
+
})) : null, moreToolbarItems && (/*#__PURE__*/React.createElement(MoreItemsContaier, {
|
|
6852
|
+
onClose: onMoreToolbarItemsClose
|
|
6853
|
+
}, moreToolbarItems))), /*#__PURE__*/React.createElement("div", {
|
|
6784
6854
|
className: "fortune-toolbar-right"
|
|
6785
6855
|
}, settings.customToolbarItems.filter(function (n) {
|
|
6786
6856
|
return n.key === "templates";
|
|
@@ -6803,7 +6873,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6803
6873
|
iconName: n.iconName
|
|
6804
6874
|
}, n.children);
|
|
6805
6875
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
6806
|
-
iconId: "dune
|
|
6876
|
+
iconId: "dune",
|
|
6807
6877
|
tooltip: "Insert Dune Chart",
|
|
6808
6878
|
key: "dune-charts",
|
|
6809
6879
|
onClick: function onClick() {
|
|
@@ -7519,11 +7589,11 @@ var ResetColumnWidth = function ResetColumnWidth() {
|
|
|
7519
7589
|
if (data) {
|
|
7520
7590
|
for (var i = 0; i < data.length; i += 1) {
|
|
7521
7591
|
var cellD = data[i][col];
|
|
7522
|
-
if (typeof cellD ===
|
|
7592
|
+
if (typeof cellD === "string") {
|
|
7523
7593
|
if (cellD.length * 7 > maxWidth) {
|
|
7524
7594
|
maxWidth = cellD.length * 7;
|
|
7525
7595
|
}
|
|
7526
|
-
} else if (_typeof(cellD) ===
|
|
7596
|
+
} else if (_typeof(cellD) === "object" && cellD !== null) {
|
|
7527
7597
|
console.log(cellD, "cellD");
|
|
7528
7598
|
var cellText = cellD.v || cellD.m;
|
|
7529
7599
|
if (cellText.length * 7 > maxWidth) {
|
|
@@ -8333,21 +8403,16 @@ var ContextMenu = function ContextMenu() {
|
|
|
8333
8403
|
}), "px")))) : null;
|
|
8334
8404
|
}
|
|
8335
8405
|
if (name === "set-column-width") {
|
|
8336
|
-
var _context$luckysheet_s0
|
|
8337
|
-
|
|
8338
|
-
var shownColWidth = ((_context$luckysheet_s0 = context.luckysheet_select_save) === null || _context$luckysheet_s0 === void 0 ? void 0 : _context$luckysheet_s0.some(function (section) {
|
|
8339
|
-
return section.width_move !== (colWidth + 1) * (section.column[1] - section.column[0] + 1) - 1;
|
|
8340
|
-
})) ? "" : colWidth;
|
|
8341
|
-
return ((_context$luckysheet_s1 = context.luckysheet_select_save) === null || _context$luckysheet_s1 === void 0 ? void 0 : _context$luckysheet_s1.some(function (section) {
|
|
8406
|
+
var _context$luckysheet_s0;
|
|
8407
|
+
return ((_context$luckysheet_s0 = context.luckysheet_select_save) === null || _context$luckysheet_s0 === void 0 ? void 0 : _context$luckysheet_s0.some(function (section) {
|
|
8342
8408
|
return section.column_select;
|
|
8343
8409
|
})) ? (/*#__PURE__*/React.createElement(Menu, {
|
|
8344
8410
|
key: "set-column-width",
|
|
8345
|
-
onClick: function onClick(
|
|
8411
|
+
onClick: function onClick() {
|
|
8346
8412
|
showDialog(/*#__PURE__*/React.createElement(ResetColumnWidth, null), undefined, "Resize column");
|
|
8347
8413
|
setContext(function (draftCtx) {
|
|
8348
8414
|
draftCtx.contextMenu = {};
|
|
8349
8415
|
});
|
|
8350
|
-
return;
|
|
8351
8416
|
}
|
|
8352
8417
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8353
8418
|
className: "context-item"
|
|
@@ -10894,19 +10959,6 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
|
|
|
10894
10959
|
}));
|
|
10895
10960
|
};
|
|
10896
10961
|
|
|
10897
|
-
var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
10898
|
-
var onClose = _ref.onClose,
|
|
10899
|
-
children = _ref.children;
|
|
10900
|
-
var containerRef = useRef(null);
|
|
10901
|
-
useOutsideClick(containerRef, function () {
|
|
10902
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
10903
|
-
}, [containerRef, onClose]);
|
|
10904
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
10905
|
-
ref: containerRef,
|
|
10906
|
-
className: "fortune-toolbar-more-container"
|
|
10907
|
-
}, children);
|
|
10908
|
-
};
|
|
10909
|
-
|
|
10910
10962
|
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY, globalCache) {
|
|
10911
10963
|
return {
|
|
10912
10964
|
applyOp: function applyOp(ops) {
|
|
@@ -12521,12 +12573,12 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
12521
12573
|
className: "fortune-workarea"
|
|
12522
12574
|
}, mergedSettings.showToolbar && (/*#__PURE__*/React.createElement(Toolbar, {
|
|
12523
12575
|
moreItemsOpen: moreToolbarItems !== null,
|
|
12524
|
-
setMoreItems: setMoreToolbarItems
|
|
12576
|
+
setMoreItems: setMoreToolbarItems,
|
|
12577
|
+
onMoreToolbarItemsClose: onMoreToolbarItemsClose,
|
|
12578
|
+
moreToolbarItems: moreToolbarItems
|
|
12525
12579
|
})), mergedSettings.showFormulaBar && /*#__PURE__*/React.createElement(FxEditor, null)), /*#__PURE__*/React.createElement(Sheet, {
|
|
12526
12580
|
sheet: sheet
|
|
12527
|
-
}), mergedSettings.showSheetTabs && /*#__PURE__*/React.createElement(SheetTab, null), /*#__PURE__*/React.createElement(ContextMenu, null), /*#__PURE__*/React.createElement(FilterMenu, null), /*#__PURE__*/React.createElement(SheetTabContextMenu, null), context.showSheetList && /*#__PURE__*/React.createElement(SheetList, null),
|
|
12528
|
-
onClose: onMoreToolbarItemsClose
|
|
12529
|
-
}, moreToolbarItems)), !_.isEmpty(context.contextMenu) && (/*#__PURE__*/React.createElement("div", {
|
|
12581
|
+
}), mergedSettings.showSheetTabs && /*#__PURE__*/React.createElement(SheetTab, null), /*#__PURE__*/React.createElement(ContextMenu, null), /*#__PURE__*/React.createElement(FilterMenu, null), /*#__PURE__*/React.createElement(SheetTabContextMenu, null), context.showSheetList && /*#__PURE__*/React.createElement(SheetList, null), !_.isEmpty(context.contextMenu) && (/*#__PURE__*/React.createElement("div", {
|
|
12530
12582
|
onMouseDown: function onMouseDown() {
|
|
12531
12583
|
setContextWithProduce(function (draftCtx) {
|
|
12532
12584
|
draftCtx.contextMenu = {};
|