@fileverse-dev/fortune-react 1.2.64-patch-1 → 1.2.64-patch-3
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/ConditionFormat/ConditionRules.js +9 -0
- package/es/components/Toolbar/conditionalFormatPortal.d.ts +5 -0
- package/es/components/Toolbar/conditionalFormatPortal.js +10 -0
- package/es/components/Toolbar/index.js +12 -0
- package/es/components/Workbook/index.js +3 -9
- package/lib/components/ConditionFormat/ConditionRules.js +9 -0
- package/lib/components/Toolbar/conditionalFormatPortal.d.ts +5 -0
- package/lib/components/Toolbar/conditionalFormatPortal.js +17 -0
- package/lib/components/Toolbar/index.js +12 -0
- package/lib/components/Workbook/index.js +3 -9
- package/package.json +2 -2
|
@@ -115,6 +115,15 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
115
115
|
});
|
|
116
116
|
hideDialog();
|
|
117
117
|
}, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
|
|
118
|
+
useEffect(function () {
|
|
119
|
+
console.log("add mouseDown listener", window);
|
|
120
|
+
window.addEventListener("mouseDown", function (e) {
|
|
121
|
+
var _a, _b;
|
|
122
|
+
var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
|
|
123
|
+
var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
|
|
124
|
+
console.log("mouseDown", selectionColumn, selectionRow, context);
|
|
125
|
+
});
|
|
126
|
+
}, [type]);
|
|
118
127
|
useEffect(function () {
|
|
119
128
|
setContext(function (ctx) {
|
|
120
129
|
ctx.conditionRules.rulesType = type;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import ConditionRules from "../ConditionFormat/ConditionRules";
|
|
4
|
+
var ConditionalFormatPortal = function ConditionalFormatPortal(_a) {
|
|
5
|
+
var visible = _a.visible;
|
|
6
|
+
var container = document.getElementById("placeholder-conditional-format");
|
|
7
|
+
if (!visible || !container) return null;
|
|
8
|
+
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(ConditionRules, null), container);
|
|
9
|
+
};
|
|
10
|
+
export default ConditionalFormatPortal;
|
|
@@ -127,6 +127,7 @@ import { toolbarItemClickHandler, handleTextBackground, handleTextColor, handleT
|
|
|
127
127
|
import _ from "lodash";
|
|
128
128
|
import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
|
|
129
129
|
import DataVerificationPortal from "./dataVerificationPortal";
|
|
130
|
+
import ConditionalFormatPortal from "./conditionalFormatPortal";
|
|
130
131
|
import WorkbookContext from "../../context";
|
|
131
132
|
import "./index.css";
|
|
132
133
|
import Button from "./Button";
|
|
@@ -595,6 +596,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
595
596
|
var _o = useState(false),
|
|
596
597
|
showDataValidation = _o[0],
|
|
597
598
|
setShowDataValidation = _o[1];
|
|
599
|
+
var _p = useState(false),
|
|
600
|
+
showConditionalFormat = _p[0],
|
|
601
|
+
setShowConditionalFormat = _p[1];
|
|
598
602
|
var dataVerificationClick = function dataVerificationClick(selectedCells) {
|
|
599
603
|
var _a;
|
|
600
604
|
var selection = api.getSelection(context);
|
|
@@ -631,6 +635,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
631
635
|
});
|
|
632
636
|
}
|
|
633
637
|
(_a = document.getElementById("conditional-format-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
638
|
+
setTimeout(function () {
|
|
639
|
+
setShowConditionalFormat(true);
|
|
640
|
+
}, 100);
|
|
634
641
|
};
|
|
635
642
|
var getToolbarItem = useCallback(function (name, i) {
|
|
636
643
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1670,12 +1677,17 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1670
1677
|
}
|
|
1671
1678
|
}));
|
|
1672
1679
|
}, [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, (_d = context.dataVerification) === null || _d === void 0 ? void 0 : _d.dataRegulation]);
|
|
1680
|
+
useEffect(function () {
|
|
1681
|
+
console.log("context", context);
|
|
1682
|
+
}, [context]);
|
|
1673
1683
|
return /*#__PURE__*/React.createElement("div", {
|
|
1674
1684
|
ref: containerRef,
|
|
1675
1685
|
className: "fortune-toolbar",
|
|
1676
1686
|
"aria-label": toolbar.toolbar
|
|
1677
1687
|
}, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
1678
1688
|
visible: showDataValidation
|
|
1689
|
+
}), /*#__PURE__*/React.createElement(ConditionalFormatPortal, {
|
|
1690
|
+
visible: showConditionalFormat
|
|
1679
1691
|
}), /*#__PURE__*/React.createElement("input", {
|
|
1680
1692
|
id: "fortune-img-upload",
|
|
1681
1693
|
className: "test-fortune-img-upload",
|
|
@@ -34,7 +34,6 @@ import { ModalProvider } from "../../context/modal";
|
|
|
34
34
|
import FilterMenu from "../ContextMenu/FilterMenu";
|
|
35
35
|
import SheetList from "../SheetList";
|
|
36
36
|
import DunePreview from "../DunePreview/DunePreview";
|
|
37
|
-
import ConditionRules from "../ConditionFormat/ConditionRules";
|
|
38
37
|
enablePatches();
|
|
39
38
|
var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
|
|
40
39
|
if (ctx.groupValuesRefreshData.length > 0) {
|
|
@@ -357,7 +356,6 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
357
356
|
var _e = useState(false),
|
|
358
357
|
show = _e[0],
|
|
359
358
|
setShow = _e[1];
|
|
360
|
-
var getCond = function getCond() {};
|
|
361
359
|
useEffect(function () {
|
|
362
360
|
if (!_.isEmpty(context.luckysheetfile)) {
|
|
363
361
|
onChange === null || onChange === void 0 ? void 0 : onChange(context.luckysheetfile);
|
|
@@ -685,12 +683,8 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
685
683
|
}
|
|
686
684
|
return /*#__PURE__*/React.createElement(WorkbookContext.Provider, {
|
|
687
685
|
value: providerValue
|
|
688
|
-
}, /*#__PURE__*/React.createElement("
|
|
689
|
-
|
|
690
|
-
setShow(!show);
|
|
691
|
-
}
|
|
692
|
-
}, "Click"), show && /*#__PURE__*/React.createElement("div", {
|
|
693
|
-
id: "placeholder-conditional-formatting",
|
|
686
|
+
}, true && /*#__PURE__*/React.createElement("div", {
|
|
687
|
+
id: "placeholder-conditional-format",
|
|
694
688
|
style: {
|
|
695
689
|
width: "500px",
|
|
696
690
|
height: "500px",
|
|
@@ -698,7 +692,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
698
692
|
zIndex: "1000",
|
|
699
693
|
backgroundColor: "white"
|
|
700
694
|
}
|
|
701
|
-
}
|
|
695
|
+
}), /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
702
696
|
className: "fortune-container",
|
|
703
697
|
ref: workbookContainer,
|
|
704
698
|
onKeyDown: onKeyDown
|
|
@@ -124,6 +124,15 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
124
124
|
});
|
|
125
125
|
hideDialog();
|
|
126
126
|
}, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
|
|
127
|
+
(0, _react.useEffect)(function () {
|
|
128
|
+
console.log("add mouseDown listener", window);
|
|
129
|
+
window.addEventListener("mouseDown", function (e) {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
|
|
132
|
+
var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
|
|
133
|
+
console.log("mouseDown", selectionColumn, selectionRow, context);
|
|
134
|
+
});
|
|
135
|
+
}, [type]);
|
|
127
136
|
(0, _react.useEffect)(function () {
|
|
128
137
|
setContext(function (ctx) {
|
|
129
138
|
ctx.conditionRules.rulesType = type;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactDom = require("react-dom");
|
|
9
|
+
var _ConditionRules = _interopRequireDefault(require("../ConditionFormat/ConditionRules"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var ConditionalFormatPortal = function ConditionalFormatPortal(_a) {
|
|
12
|
+
var visible = _a.visible;
|
|
13
|
+
var container = document.getElementById("placeholder-conditional-format");
|
|
14
|
+
if (!visible || !container) return null;
|
|
15
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_ConditionRules.default, null), container);
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = ConditionalFormatPortal;
|
|
@@ -10,6 +10,7 @@ var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
|
10
10
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
11
|
var _ui = require("@fileverse/ui");
|
|
12
12
|
var _dataVerificationPortal = _interopRequireDefault(require("./dataVerificationPortal"));
|
|
13
|
+
var _conditionalFormatPortal = _interopRequireDefault(require("./conditionalFormatPortal"));
|
|
13
14
|
var _context = _interopRequireDefault(require("../../context"));
|
|
14
15
|
require("./index.css");
|
|
15
16
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
@@ -604,6 +605,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
604
605
|
var _o = (0, _react.useState)(false),
|
|
605
606
|
showDataValidation = _o[0],
|
|
606
607
|
setShowDataValidation = _o[1];
|
|
608
|
+
var _p = (0, _react.useState)(false),
|
|
609
|
+
showConditionalFormat = _p[0],
|
|
610
|
+
setShowConditionalFormat = _p[1];
|
|
607
611
|
var dataVerificationClick = function dataVerificationClick(selectedCells) {
|
|
608
612
|
var _a;
|
|
609
613
|
var selection = _fortuneCore.api.getSelection(context);
|
|
@@ -640,6 +644,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
640
644
|
});
|
|
641
645
|
}
|
|
642
646
|
(_a = document.getElementById("conditional-format-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
647
|
+
setTimeout(function () {
|
|
648
|
+
setShowConditionalFormat(true);
|
|
649
|
+
}, 100);
|
|
643
650
|
};
|
|
644
651
|
var getToolbarItem = (0, _react.useCallback)(function (name, i) {
|
|
645
652
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1679,12 +1686,17 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1679
1686
|
}
|
|
1680
1687
|
}));
|
|
1681
1688
|
}, [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, (_d = context.dataVerification) === null || _d === void 0 ? void 0 : _d.dataRegulation]);
|
|
1689
|
+
(0, _react.useEffect)(function () {
|
|
1690
|
+
console.log("context", context);
|
|
1691
|
+
}, [context]);
|
|
1682
1692
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1683
1693
|
ref: containerRef,
|
|
1684
1694
|
className: "fortune-toolbar",
|
|
1685
1695
|
"aria-label": toolbar.toolbar
|
|
1686
1696
|
}, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
1687
1697
|
visible: showDataValidation
|
|
1698
|
+
}), /*#__PURE__*/_react.default.createElement(_conditionalFormatPortal.default, {
|
|
1699
|
+
visible: showConditionalFormat
|
|
1688
1700
|
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
1689
1701
|
id: "fortune-img-upload",
|
|
1690
1702
|
className: "test-fortune-img-upload",
|
|
@@ -24,7 +24,6 @@ var _modal = require("../../context/modal");
|
|
|
24
24
|
var _FilterMenu = _interopRequireDefault(require("../ContextMenu/FilterMenu"));
|
|
25
25
|
var _SheetList = _interopRequireDefault(require("../SheetList"));
|
|
26
26
|
var _DunePreview = _interopRequireDefault(require("../DunePreview/DunePreview"));
|
|
27
|
-
var _ConditionRules = _interopRequireDefault(require("../ConditionFormat/ConditionRules"));
|
|
28
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
28
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
29
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
@@ -366,7 +365,6 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
366
365
|
var _e = (0, _react.useState)(false),
|
|
367
366
|
show = _e[0],
|
|
368
367
|
setShow = _e[1];
|
|
369
|
-
var getCond = function getCond() {};
|
|
370
368
|
(0, _react.useEffect)(function () {
|
|
371
369
|
if (!_lodash.default.isEmpty(context.luckysheetfile)) {
|
|
372
370
|
onChange === null || onChange === void 0 ? void 0 : onChange(context.luckysheetfile);
|
|
@@ -694,12 +692,8 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
694
692
|
}
|
|
695
693
|
return /*#__PURE__*/_react.default.createElement(_context.default.Provider, {
|
|
696
694
|
value: providerValue
|
|
697
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
698
|
-
|
|
699
|
-
setShow(!show);
|
|
700
|
-
}
|
|
701
|
-
}, "Click"), show && /*#__PURE__*/_react.default.createElement("div", {
|
|
702
|
-
id: "placeholder-conditional-formatting",
|
|
695
|
+
}, true && /*#__PURE__*/_react.default.createElement("div", {
|
|
696
|
+
id: "placeholder-conditional-format",
|
|
703
697
|
style: {
|
|
704
698
|
width: "500px",
|
|
705
699
|
height: "500px",
|
|
@@ -707,7 +701,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
707
701
|
zIndex: "1000",
|
|
708
702
|
backgroundColor: "white"
|
|
709
703
|
}
|
|
710
|
-
}
|
|
704
|
+
}), /*#__PURE__*/_react.default.createElement(_modal.ModalProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
711
705
|
className: "fortune-container",
|
|
712
706
|
ref: workbookContainer,
|
|
713
707
|
onKeyDown: onKeyDown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.64-patch-
|
|
3
|
+
"version": "1.2.64-patch-3",
|
|
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.2.64-patch-
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.64-patch-3",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|