@fileverse-dev/fortune-react 1.2.64-patch-1 → 1.2.64-patch-2
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/Toolbar/conditionalFormatPortal.d.ts +5 -0
- package/es/components/Toolbar/conditionalFormatPortal.js +10 -0
- package/es/components/Toolbar/index.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 +9 -0
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -1676,6 +1683,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1676
1683
|
"aria-label": toolbar.toolbar
|
|
1677
1684
|
}, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
1678
1685
|
visible: showDataValidation
|
|
1686
|
+
}), /*#__PURE__*/React.createElement(ConditionalFormatPortal, {
|
|
1687
|
+
visible: showConditionalFormat
|
|
1679
1688
|
}), /*#__PURE__*/React.createElement("input", {
|
|
1680
1689
|
id: "fortune-img-upload",
|
|
1681
1690
|
className: "test-fortune-img-upload",
|
|
@@ -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;
|
|
@@ -1685,6 +1692,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1685
1692
|
"aria-label": toolbar.toolbar
|
|
1686
1693
|
}, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
1687
1694
|
visible: showDataValidation
|
|
1695
|
+
}), /*#__PURE__*/_react.default.createElement(_conditionalFormatPortal.default, {
|
|
1696
|
+
visible: showConditionalFormat
|
|
1688
1697
|
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
1689
1698
|
id: "fortune-img-upload",
|
|
1690
1699
|
className: "test-fortune-img-upload",
|
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-2",
|
|
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-2",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|