@fileverse-dev/fortune-react 1.0.2-mod-62 → 1.0.2-mod-64
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 +1 -1
- package/dist/index.css +33 -19
- package/dist/index.esm.css +33 -19
- package/dist/index.esm.js +90 -96
- package/dist/index.js +90 -96
- package/dist/index.umd.css +33 -19
- package/dist/index.umd.js +2866 -4489
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.css";
|
|
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" | "
|
|
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" | "DollarSign" | "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;
|
package/dist/index.css
CHANGED
|
@@ -2332,7 +2332,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2332
2332
|
|
|
2333
2333
|
.fortune-toolbar-button:active,
|
|
2334
2334
|
.fortune-toolbar-combo:active {
|
|
2335
|
-
background-color: rgba(0, 0, 0, 0.12);
|
|
2335
|
+
/* background-color: rgba(0, 0, 0, 0.12); */
|
|
2336
2336
|
cursor: pointer;
|
|
2337
2337
|
}
|
|
2338
2338
|
|
|
@@ -2458,13 +2458,16 @@ input[type="number"].condition-rules-project-input {
|
|
|
2458
2458
|
flex-direction: row;
|
|
2459
2459
|
align-items: center;
|
|
2460
2460
|
align-self: flex-end;
|
|
2461
|
-
top:
|
|
2461
|
+
top: 32px;
|
|
2462
2462
|
right: 0px;
|
|
2463
2463
|
max-width: 348px;
|
|
2464
2464
|
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
2465
2465
|
background: white;
|
|
2466
2466
|
flex-wrap: wrap;
|
|
2467
2467
|
z-index: 1002;
|
|
2468
|
+
padding: 8px;
|
|
2469
|
+
border-radius: 8px;
|
|
2470
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
2468
2471
|
}
|
|
2469
2472
|
|
|
2470
2473
|
.fortune-toolbar-subtext {
|
|
@@ -2505,9 +2508,9 @@ input[type="number"].condition-rules-project-input {
|
|
|
2505
2508
|
|
|
2506
2509
|
#fortune-custom-color {
|
|
2507
2510
|
min-width: 164px;
|
|
2508
|
-
background:
|
|
2509
|
-
border-radius:
|
|
2510
|
-
border: 1px solid
|
|
2511
|
+
background: hsl(var(--color-bg-default));
|
|
2512
|
+
border-radius: 8px;
|
|
2513
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
2511
2514
|
font-size: 12px;
|
|
2512
2515
|
padding: 8px;
|
|
2513
2516
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
@@ -2532,7 +2535,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2532
2535
|
background: white;
|
|
2533
2536
|
padding: 4px 8px;
|
|
2534
2537
|
height: 30px;
|
|
2535
|
-
border-radius: 4px
|
|
2538
|
+
border-radius: 4px;
|
|
2536
2539
|
display: flex;
|
|
2537
2540
|
align-items: center;
|
|
2538
2541
|
gap: 10px;
|
|
@@ -2542,7 +2545,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2542
2545
|
}
|
|
2543
2546
|
|
|
2544
2547
|
#fortune-custom-color .color-reset:hover {
|
|
2545
|
-
background:
|
|
2548
|
+
background: hsl(var(--color-bg-default-hover));
|
|
2549
|
+
transition: all 0.2s ease-in-out;
|
|
2546
2550
|
}
|
|
2547
2551
|
|
|
2548
2552
|
#fortune-custom-color .custom-color {
|
|
@@ -3711,35 +3715,45 @@ label {
|
|
|
3711
3715
|
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
|
|
3712
3716
|
#fortune-change-color {
|
|
3713
3717
|
min-width: 164px;
|
|
3714
|
-
|
|
3715
|
-
background: rgb(240, 240, 240);
|
|
3718
|
+
background: hsl(var(--color-bg-default));
|
|
3716
3719
|
position: absolute;
|
|
3717
|
-
|
|
3718
|
-
left:
|
|
3720
|
+
top: -100px;
|
|
3721
|
+
left: 232px;
|
|
3719
3722
|
border-radius: 6px;
|
|
3720
|
-
|
|
3721
|
-
|
|
3723
|
+
padding: 8px;
|
|
3724
|
+
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
3725
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
3726
|
+
display: flex;
|
|
3727
|
+
flex-direction: column;
|
|
3728
|
+
gap: 8px;
|
|
3722
3729
|
}
|
|
3723
3730
|
|
|
3724
3731
|
#fortune-change-color .color-reset {
|
|
3725
3732
|
position: relative;
|
|
3726
|
-
color:
|
|
3733
|
+
color: hsl(var(--color-text-default));
|
|
3727
3734
|
cursor: pointer;
|
|
3728
3735
|
list-style: none;
|
|
3729
|
-
padding:
|
|
3736
|
+
padding: 4px 8px;
|
|
3730
3737
|
white-space: nowrap;
|
|
3731
|
-
padding-left: 8px;
|
|
3732
3738
|
vertical-align: middle;
|
|
3733
3739
|
padding-right: 24px;
|
|
3734
3740
|
-webkit-user-select: none;
|
|
3735
3741
|
-moz-user-select: none;
|
|
3736
3742
|
user-select: none;
|
|
3737
|
-
border-radius:
|
|
3738
|
-
background:
|
|
3743
|
+
border-radius: 4px;
|
|
3744
|
+
background: hsl(var(--color-bg-default));
|
|
3745
|
+
height: 30px;
|
|
3746
|
+
display: flex;
|
|
3747
|
+
align-items: center;
|
|
3748
|
+
gap: 10px;
|
|
3749
|
+
font-size: 14px;
|
|
3750
|
+
font-weight: 500;
|
|
3751
|
+
line-height: 20px;
|
|
3739
3752
|
}
|
|
3740
3753
|
|
|
3741
3754
|
#fortune-change-color .color-reset:hover {
|
|
3742
|
-
background:
|
|
3755
|
+
background: hsl(var(--color-bg-default-hover));
|
|
3756
|
+
transition: all 0.2s ease-in-out;
|
|
3743
3757
|
}
|
|
3744
3758
|
|
|
3745
3759
|
#fortune-change-color .custom-color {
|
package/dist/index.esm.css
CHANGED
|
@@ -2332,7 +2332,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2332
2332
|
|
|
2333
2333
|
.fortune-toolbar-button:active,
|
|
2334
2334
|
.fortune-toolbar-combo:active {
|
|
2335
|
-
background-color: rgba(0, 0, 0, 0.12);
|
|
2335
|
+
/* background-color: rgba(0, 0, 0, 0.12); */
|
|
2336
2336
|
cursor: pointer;
|
|
2337
2337
|
}
|
|
2338
2338
|
|
|
@@ -2458,13 +2458,16 @@ input[type="number"].condition-rules-project-input {
|
|
|
2458
2458
|
flex-direction: row;
|
|
2459
2459
|
align-items: center;
|
|
2460
2460
|
align-self: flex-end;
|
|
2461
|
-
top:
|
|
2461
|
+
top: 32px;
|
|
2462
2462
|
right: 0px;
|
|
2463
2463
|
max-width: 348px;
|
|
2464
2464
|
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
2465
2465
|
background: white;
|
|
2466
2466
|
flex-wrap: wrap;
|
|
2467
2467
|
z-index: 1002;
|
|
2468
|
+
padding: 8px;
|
|
2469
|
+
border-radius: 8px;
|
|
2470
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
2468
2471
|
}
|
|
2469
2472
|
|
|
2470
2473
|
.fortune-toolbar-subtext {
|
|
@@ -2505,9 +2508,9 @@ input[type="number"].condition-rules-project-input {
|
|
|
2505
2508
|
|
|
2506
2509
|
#fortune-custom-color {
|
|
2507
2510
|
min-width: 164px;
|
|
2508
|
-
background:
|
|
2509
|
-
border-radius:
|
|
2510
|
-
border: 1px solid
|
|
2511
|
+
background: hsl(var(--color-bg-default));
|
|
2512
|
+
border-radius: 8px;
|
|
2513
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
2511
2514
|
font-size: 12px;
|
|
2512
2515
|
padding: 8px;
|
|
2513
2516
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
@@ -2532,7 +2535,7 @@ input[type="number"].condition-rules-project-input {
|
|
|
2532
2535
|
background: white;
|
|
2533
2536
|
padding: 4px 8px;
|
|
2534
2537
|
height: 30px;
|
|
2535
|
-
border-radius: 4px
|
|
2538
|
+
border-radius: 4px;
|
|
2536
2539
|
display: flex;
|
|
2537
2540
|
align-items: center;
|
|
2538
2541
|
gap: 10px;
|
|
@@ -2542,7 +2545,8 @@ input[type="number"].condition-rules-project-input {
|
|
|
2542
2545
|
}
|
|
2543
2546
|
|
|
2544
2547
|
#fortune-custom-color .color-reset:hover {
|
|
2545
|
-
background:
|
|
2548
|
+
background: hsl(var(--color-bg-default-hover));
|
|
2549
|
+
transition: all 0.2s ease-in-out;
|
|
2546
2550
|
}
|
|
2547
2551
|
|
|
2548
2552
|
#fortune-custom-color .custom-color {
|
|
@@ -3711,35 +3715,45 @@ label {
|
|
|
3711
3715
|
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
|
|
3712
3716
|
#fortune-change-color {
|
|
3713
3717
|
min-width: 164px;
|
|
3714
|
-
|
|
3715
|
-
background: rgb(240, 240, 240);
|
|
3718
|
+
background: hsl(var(--color-bg-default));
|
|
3716
3719
|
position: absolute;
|
|
3717
|
-
|
|
3718
|
-
left:
|
|
3720
|
+
top: -100px;
|
|
3721
|
+
left: 232px;
|
|
3719
3722
|
border-radius: 6px;
|
|
3720
|
-
|
|
3721
|
-
|
|
3723
|
+
padding: 8px;
|
|
3724
|
+
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
3725
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
3726
|
+
display: flex;
|
|
3727
|
+
flex-direction: column;
|
|
3728
|
+
gap: 8px;
|
|
3722
3729
|
}
|
|
3723
3730
|
|
|
3724
3731
|
#fortune-change-color .color-reset {
|
|
3725
3732
|
position: relative;
|
|
3726
|
-
color:
|
|
3733
|
+
color: hsl(var(--color-text-default));
|
|
3727
3734
|
cursor: pointer;
|
|
3728
3735
|
list-style: none;
|
|
3729
|
-
padding:
|
|
3736
|
+
padding: 4px 8px;
|
|
3730
3737
|
white-space: nowrap;
|
|
3731
|
-
padding-left: 8px;
|
|
3732
3738
|
vertical-align: middle;
|
|
3733
3739
|
padding-right: 24px;
|
|
3734
3740
|
-webkit-user-select: none;
|
|
3735
3741
|
-moz-user-select: none;
|
|
3736
3742
|
user-select: none;
|
|
3737
|
-
border-radius:
|
|
3738
|
-
background:
|
|
3743
|
+
border-radius: 4px;
|
|
3744
|
+
background: hsl(var(--color-bg-default));
|
|
3745
|
+
height: 30px;
|
|
3746
|
+
display: flex;
|
|
3747
|
+
align-items: center;
|
|
3748
|
+
gap: 10px;
|
|
3749
|
+
font-size: 14px;
|
|
3750
|
+
font-weight: 500;
|
|
3751
|
+
line-height: 20px;
|
|
3739
3752
|
}
|
|
3740
3753
|
|
|
3741
3754
|
#fortune-change-color .color-reset:hover {
|
|
3742
|
-
background:
|
|
3755
|
+
background: hsl(var(--color-bg-default-hover));
|
|
3756
|
+
transition: all 0.2s ease-in-out;
|
|
3743
3757
|
}
|
|
3744
3758
|
|
|
3745
3759
|
#fortune-change-color .custom-color {
|
package/dist/index.esm.js
CHANGED
|
@@ -5326,6 +5326,7 @@ var CustomColor = function CustomColor(_ref) {
|
|
|
5326
5326
|
};
|
|
5327
5327
|
|
|
5328
5328
|
var FormatSearch = function FormatSearch(_ref) {
|
|
5329
|
+
var _toolbarFormat$select, _toolbarFormat$select2;
|
|
5329
5330
|
var type = _ref.type,
|
|
5330
5331
|
_onCancel = _ref.onCancel;
|
|
5331
5332
|
var _useContext = useContext(WorkbookContext),
|
|
@@ -5357,7 +5358,6 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5357
5358
|
var toolbarFormat = useMemo(function () {
|
|
5358
5359
|
return toolbarFormatAll[type];
|
|
5359
5360
|
}, [toolbarFormatAll, type]);
|
|
5360
|
-
var tips = _.get(format, type);
|
|
5361
5361
|
var onConfirm = useCallback(function () {
|
|
5362
5362
|
if (decimalPlace < 0 || decimalPlace > 9) {
|
|
5363
5363
|
_onCancel();
|
|
@@ -5393,60 +5393,62 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5393
5393
|
_onCancel();
|
|
5394
5394
|
}, [_onCancel, cellInput, setContext]);
|
|
5395
5395
|
return /*#__PURE__*/React.createElement("div", {
|
|
5396
|
-
|
|
5397
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5398
|
-
className: "listbox",
|
|
5399
|
-
style: {
|
|
5400
|
-
height: 200
|
|
5401
|
-
}
|
|
5396
|
+
className: "format-search"
|
|
5402
5397
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5398
|
+
className: "flex flex-col gap-4"
|
|
5399
|
+
}, type === "currency" && (/*#__PURE__*/React.createElement("div", {
|
|
5400
|
+
className: "flex items-center gap-2"
|
|
5401
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5402
|
+
className: "text-body-sm",
|
|
5403
5403
|
style: {
|
|
5404
|
-
|
|
5404
|
+
width: "180px"
|
|
5405
5405
|
}
|
|
5406
|
-
},
|
|
5407
|
-
className: "
|
|
5408
|
-
|
|
5409
|
-
display: "block"
|
|
5410
|
-
} : {
|
|
5411
|
-
display: "none"
|
|
5412
|
-
}
|
|
5413
|
-
}, format.decimalPlaces, "\uFF1A", /*#__PURE__*/React.createElement("input", {
|
|
5414
|
-
className: "decimal-places-input",
|
|
5415
|
-
id: "decimal-places-input",
|
|
5406
|
+
}, format.decimalPlaces, "\uFF1A"), /*#__PURE__*/React.createElement(TextField, {
|
|
5407
|
+
className: "w-full",
|
|
5408
|
+
type: "number",
|
|
5416
5409
|
min: 0,
|
|
5417
5410
|
max: 9,
|
|
5418
5411
|
defaultValue: 2,
|
|
5419
|
-
type: "number",
|
|
5420
5412
|
onChange: function onChange(e) {
|
|
5421
5413
|
setDecimalPlace(parseInt(e.target.value, 10));
|
|
5422
5414
|
}
|
|
5423
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
5424
|
-
className: "format-list"
|
|
5425
|
-
}, toolbarFormat.map(function (v, index) {
|
|
5426
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
5427
|
-
className: "listBox".concat(index === selectedFormatIndex ? " on" : ""),
|
|
5428
|
-
key: v.name,
|
|
5429
|
-
onClick: function onClick() {
|
|
5430
|
-
setSelectedFormatIndex(index);
|
|
5431
|
-
},
|
|
5432
|
-
tabIndex: 0
|
|
5433
|
-
}, /*#__PURE__*/React.createElement("div", null, v.name), /*#__PURE__*/React.createElement("div", null, v.value));
|
|
5434
5415
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
5435
|
-
className: "
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5416
|
+
className: "flex flex-col gap-2"
|
|
5417
|
+
}, /*#__PURE__*/React.createElement(Select$1, {
|
|
5418
|
+
value: String(selectedFormatIndex),
|
|
5419
|
+
onValueChange: function onValueChange(value) {
|
|
5420
|
+
setSelectedFormatIndex(Number(value));
|
|
5440
5421
|
}
|
|
5441
|
-
}, /*#__PURE__*/React.createElement(
|
|
5442
|
-
className: "
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5422
|
+
}, /*#__PURE__*/React.createElement(SelectTrigger, {
|
|
5423
|
+
className: "w-full"
|
|
5424
|
+
}, /*#__PURE__*/React.createElement(SelectValue, null, (_toolbarFormat$select = toolbarFormat[selectedFormatIndex]) === null || _toolbarFormat$select === void 0 ? void 0 : _toolbarFormat$select.name, " ", (_toolbarFormat$select2 = toolbarFormat[selectedFormatIndex]) === null || _toolbarFormat$select2 === void 0 ? void 0 : _toolbarFormat$select2.value)), /*#__PURE__*/React.createElement(SelectContent, null, toolbarFormat.map(function (v, index) {
|
|
5425
|
+
return /*#__PURE__*/React.createElement(SelectItem$1, {
|
|
5426
|
+
key: v.name,
|
|
5427
|
+
value: String(index)
|
|
5428
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5429
|
+
className: "flex justify-between w-full"
|
|
5430
|
+
}, /*#__PURE__*/React.createElement("span", null, v.name), /*#__PURE__*/React.createElement("span", {
|
|
5431
|
+
className: "text-body-sm text-icon-secondary"
|
|
5432
|
+
}, v.value)));
|
|
5433
|
+
}))))), /*#__PURE__*/React.createElement(Divider$2, {
|
|
5434
|
+
className: "w-full border-t-[1px] my-4"
|
|
5435
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
5436
|
+
className: "flex gap-2 justify-end"
|
|
5437
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
5438
|
+
variant: "secondary",
|
|
5439
|
+
style: {
|
|
5440
|
+
minWidth: "80px"
|
|
5441
|
+
},
|
|
5447
5442
|
onClick: onCancel,
|
|
5448
5443
|
tabIndex: 0
|
|
5449
|
-
}, button.cancel)
|
|
5444
|
+
}, button.cancel), /*#__PURE__*/React.createElement(Button$1, {
|
|
5445
|
+
variant: "default",
|
|
5446
|
+
style: {
|
|
5447
|
+
minWidth: "80px"
|
|
5448
|
+
},
|
|
5449
|
+
onClick: onConfirm,
|
|
5450
|
+
tabIndex: 0
|
|
5451
|
+
}, button.confirm)));
|
|
5450
5452
|
};
|
|
5451
5453
|
|
|
5452
5454
|
var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
|
|
@@ -5594,9 +5596,9 @@ var getLucideIcon = function getLucideIcon(title) {
|
|
|
5594
5596
|
case "merge-all":
|
|
5595
5597
|
return "MergeHorizontal";
|
|
5596
5598
|
case "format":
|
|
5597
|
-
return "
|
|
5599
|
+
return "DollarSign";
|
|
5598
5600
|
case "currency-format":
|
|
5599
|
-
return "
|
|
5601
|
+
return "DollarSign";
|
|
5600
5602
|
case "percentage-format":
|
|
5601
5603
|
return "Percent";
|
|
5602
5604
|
case "number-decrease":
|
|
@@ -5654,6 +5656,10 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5654
5656
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
5655
5657
|
showDuneModal = _useState6[0],
|
|
5656
5658
|
setShowDuneModal = _useState6[1];
|
|
5659
|
+
var _useState7 = useState(window.innerWidth >= 1280),
|
|
5660
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
5661
|
+
isDesktop = _useState8[0],
|
|
5662
|
+
setIsDesktop = _useState8[1];
|
|
5657
5663
|
var _useDialog = useDialog(),
|
|
5658
5664
|
showDialog = _useDialog.showDialog,
|
|
5659
5665
|
hideDialog = _useDialog.hideDialog;
|
|
@@ -5684,12 +5690,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5684
5690
|
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
5685
5691
|
var currency = settings.currency;
|
|
5686
5692
|
var defaultFormat = defaultFmt(currency);
|
|
5687
|
-
var
|
|
5688
|
-
_useState8 = _slicedToArray(_useState7, 1),
|
|
5689
|
-
customColor = _useState8[0];
|
|
5690
|
-
var _useState9 = useState("1"),
|
|
5693
|
+
var _useState9 = useState("#000000"),
|
|
5691
5694
|
_useState0 = _slicedToArray(_useState9, 1),
|
|
5692
|
-
|
|
5695
|
+
customColor = _useState0[0];
|
|
5696
|
+
var _useState1 = useState("1"),
|
|
5697
|
+
_useState10 = _slicedToArray(_useState1, 1),
|
|
5698
|
+
customStyle = _useState10[0];
|
|
5693
5699
|
var showSubMenu = useCallback(function (e, className) {
|
|
5694
5700
|
var target = e.target;
|
|
5695
5701
|
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
@@ -5717,6 +5723,15 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5717
5723
|
if (_.isNil(subMenu)) return;
|
|
5718
5724
|
subMenu.style.display = "none";
|
|
5719
5725
|
}, []);
|
|
5726
|
+
useEffect(function () {
|
|
5727
|
+
var handleResize = function handleResize() {
|
|
5728
|
+
setIsDesktop(window.innerWidth >= 1280);
|
|
5729
|
+
};
|
|
5730
|
+
window.addEventListener("resize", handleResize);
|
|
5731
|
+
return function () {
|
|
5732
|
+
return window.removeEventListener("resize", handleResize);
|
|
5733
|
+
};
|
|
5734
|
+
}, []);
|
|
5720
5735
|
useEffect(function () {
|
|
5721
5736
|
setToolbarWrapIndex(-1);
|
|
5722
5737
|
}, [settings.toolbarItems, settings.customToolbarItems]);
|
|
@@ -5737,6 +5752,11 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5737
5752
|
}
|
|
5738
5753
|
}, [toolbarWrapIndex, sheetWidth]);
|
|
5739
5754
|
useEffect(function () {
|
|
5755
|
+
if (isDesktop) {
|
|
5756
|
+
setToolbarWrapIndex(-1);
|
|
5757
|
+
setMoreItems(null);
|
|
5758
|
+
return;
|
|
5759
|
+
}
|
|
5740
5760
|
if (itemLocations.length === 0) return;
|
|
5741
5761
|
var container = containerRef.current;
|
|
5742
5762
|
if (!container) return;
|
|
@@ -5753,7 +5773,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5753
5773
|
break;
|
|
5754
5774
|
}
|
|
5755
5775
|
}
|
|
5756
|
-
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth]);
|
|
5776
|
+
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
5757
5777
|
var getToolbarItem = useCallback(function (name, i) {
|
|
5758
5778
|
var _toolbarItemSelectedF;
|
|
5759
5779
|
var tooltip = toolbar[name];
|
|
@@ -5865,7 +5885,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5865
5885
|
showDialog(/*#__PURE__*/React.createElement(FormatSearch, {
|
|
5866
5886
|
onCancel: hideDialog,
|
|
5867
5887
|
type: "currency"
|
|
5868
|
-
}));
|
|
5888
|
+
}), undefined, "Currency Format");
|
|
5869
5889
|
setOpen(false);
|
|
5870
5890
|
}
|
|
5871
5891
|
}].map(function (v) {
|
|
@@ -6836,9 +6856,9 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6836
6856
|
}, n.children);
|
|
6837
6857
|
}), ((_settings$customToolb = settings.customToolbarItems) === null || _settings$customToolb === void 0 ? void 0 : _settings$customToolb.length) > 0 ? (/*#__PURE__*/React.createElement(Divider, {
|
|
6838
6858
|
key: "customDivider"
|
|
6839
|
-
})) : null, (toolbarWrapIndex === -1 ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
|
|
6859
|
+
})) : null, (toolbarWrapIndex === -1 || isDesktop ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
|
|
6840
6860
|
return getToolbarItem(name, i);
|
|
6841
|
-
}), toolbarWrapIndex !== -1 && toolbarWrapIndex < settings.toolbarItems.length - 1 ? (/*#__PURE__*/React.createElement(Button, {
|
|
6861
|
+
}), !isDesktop && toolbarWrapIndex !== -1 && toolbarWrapIndex < settings.toolbarItems.length - 1 ? (/*#__PURE__*/React.createElement(Button, {
|
|
6842
6862
|
iconId: "Ellipsis",
|
|
6843
6863
|
tooltip: toolbar.toolMore,
|
|
6844
6864
|
onClick: function onClick() {
|
|
@@ -10701,21 +10721,10 @@ var ChangeColor = function ChangeColor(_ref) {
|
|
|
10701
10721
|
var _useContext = useContext(WorkbookContext),
|
|
10702
10722
|
context = _useContext.context,
|
|
10703
10723
|
setContext = _useContext.setContext;
|
|
10704
|
-
var
|
|
10705
|
-
toolbar = _locale.toolbar,
|
|
10706
|
-
sheetconfig = _locale.sheetconfig,
|
|
10707
|
-
button = _locale.button;
|
|
10708
|
-
var _useState = useState("#000000"),
|
|
10724
|
+
var _useState = useState(context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].color),
|
|
10709
10725
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
var _useState3 = useState(context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].color),
|
|
10713
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
10714
|
-
selectColor = _useState4[0],
|
|
10715
|
-
setSelectColor = _useState4[1];
|
|
10716
|
-
var certainBtn = useCallback(function () {
|
|
10717
|
-
setSelectColor(inputColor);
|
|
10718
|
-
}, [inputColor]);
|
|
10726
|
+
selectColor = _useState2[0],
|
|
10727
|
+
setSelectColor = _useState2[1];
|
|
10719
10728
|
useEffect(function () {
|
|
10720
10729
|
setContext(function (ctx) {
|
|
10721
10730
|
if (ctx.allowEdit === false) return;
|
|
@@ -10731,30 +10740,15 @@ var ChangeColor = function ChangeColor(_ref) {
|
|
|
10731
10740
|
return setSelectColor(undefined);
|
|
10732
10741
|
},
|
|
10733
10742
|
tabIndex: 0
|
|
10734
|
-
},
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
onChange: function onChange(e) {
|
|
10740
|
-
return setInputColor(e.target.value);
|
|
10741
|
-
},
|
|
10742
|
-
onFocus: function onFocus() {
|
|
10743
|
-
triggerParentUpdate(true);
|
|
10744
|
-
},
|
|
10745
|
-
onBlur: function onBlur() {
|
|
10746
|
-
triggerParentUpdate(false);
|
|
10747
|
-
}
|
|
10748
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
10749
|
-
className: "button-basic button-primary",
|
|
10750
|
-
onClick: function onClick() {
|
|
10751
|
-
certainBtn();
|
|
10752
|
-
},
|
|
10753
|
-
tabIndex: 0
|
|
10754
|
-
}, button.confirm)), /*#__PURE__*/React.createElement(ColorPicker, {
|
|
10743
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
10744
|
+
name: "reset-color",
|
|
10745
|
+
width: 16,
|
|
10746
|
+
height: 16
|
|
10747
|
+
}), "Reset"), /*#__PURE__*/React.createElement(ColorPicker, {
|
|
10755
10748
|
onPick: function onPick(color) {
|
|
10756
|
-
|
|
10749
|
+
triggerParentUpdate(true);
|
|
10757
10750
|
setSelectColor(color);
|
|
10751
|
+
triggerParentUpdate(false);
|
|
10758
10752
|
}
|
|
10759
10753
|
}));
|
|
10760
10754
|
};
|
|
@@ -10947,14 +10941,14 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
|
|
|
10947
10941
|
setIsShowChangeColor(false);
|
|
10948
10942
|
}
|
|
10949
10943
|
}
|
|
10950
|
-
},
|
|
10951
|
-
className: "
|
|
10952
|
-
}, /*#__PURE__*/React.createElement(
|
|
10953
|
-
name: "
|
|
10954
|
-
|
|
10955
|
-
})
|
|
10944
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10945
|
+
className: "flex items-center justify-between w-full"
|
|
10946
|
+
}, sheetconfig.changeColor, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
10947
|
+
name: "ChevronRight",
|
|
10948
|
+
size: "sm"
|
|
10949
|
+
}), isShowChangeColor && context.allowEdit && (/*#__PURE__*/React.createElement(ChangeColor, {
|
|
10956
10950
|
triggerParentUpdate: updateShowInputColor
|
|
10957
|
-
})));
|
|
10951
|
+
}))));
|
|
10958
10952
|
}
|
|
10959
10953
|
if (name === "focus") {
|
|
10960
10954
|
return /*#__PURE__*/React.createElement(Menu, {
|