@fileverse-dev/fortune-react 1.1.94 → 1.1.95
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/dataVerificationPortal.d.ts +5 -0
- package/es/components/Toolbar/dataVerificationPortal.js +10 -0
- package/es/components/Toolbar/index.js +9 -11
- package/lib/components/Toolbar/dataVerificationPortal.d.ts +5 -0
- package/lib/components/Toolbar/dataVerificationPortal.js +17 -0
- package/lib/components/Toolbar/index.js +9 -11
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import DataVerification from "../DataVerification";
|
|
4
|
+
var DataVerificationPortal = function DataVerificationPortal(_a) {
|
|
5
|
+
var visible = _a.visible;
|
|
6
|
+
var container = document.getElementById("placeholder-data-validation");
|
|
7
|
+
if (!visible || !container) return null;
|
|
8
|
+
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(DataVerification, null), container);
|
|
9
|
+
};
|
|
10
|
+
export default DataVerificationPortal;
|
|
@@ -123,7 +123,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
123
123
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
124
124
|
};
|
|
125
125
|
import React, { useContext, useCallback, useRef, useEffect, useState } from "react";
|
|
126
|
-
import
|
|
126
|
+
import DataVerificationPortal from "./dataVerificationPortal";
|
|
127
127
|
import { toolbarItemClickHandler, handleTextBackground, handleTextColor, handleTextSize, normalizedCellAttr, getFlowdata, newComment, editComment, deleteComment, showHideComment, showHideAllComments, autoSelectionFormula, handleSum, locale, handleMerge, handleBorder, toolbarItemSelectedFunc, handleFreeze, insertImage, showImgChooser, updateFormat, handleSort, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, createFilter, clearFilter, applyLocation, insertDuneChart } from "@fileverse-dev/fortune-core";
|
|
128
128
|
import _ from "lodash";
|
|
129
129
|
import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
|
|
@@ -137,7 +137,6 @@ import SVGIcon from "../SVGIcon";
|
|
|
137
137
|
import { useDialog } from "../../hooks/useDialog";
|
|
138
138
|
import { SplitColumn } from "../SplitColumn";
|
|
139
139
|
import { LocationCondition } from "../LocationCondition";
|
|
140
|
-
import DataVerification from "../DataVerification";
|
|
141
140
|
import ConditionalFormat from "../ConditionFormat";
|
|
142
141
|
import CustomButton from "./CustomButton";
|
|
143
142
|
import { CustomColor } from "./CustomColor";
|
|
@@ -585,6 +584,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
585
584
|
}
|
|
586
585
|
}
|
|
587
586
|
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
587
|
+
var _o = useState(false),
|
|
588
|
+
showDataValidation = _o[0],
|
|
589
|
+
setShowDataValidation = _o[1];
|
|
588
590
|
var getToolbarItem = useCallback(function (name, i) {
|
|
589
591
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
590
592
|
var tooltip = toolbar[name];
|
|
@@ -961,7 +963,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
961
963
|
});
|
|
962
964
|
}
|
|
963
965
|
if (name === "dataVerification") {
|
|
964
|
-
return /*#__PURE__*/React.createElement(
|
|
966
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
967
|
+
visible: showDataValidation
|
|
968
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
965
969
|
iconId: name,
|
|
966
970
|
tooltip: tooltip,
|
|
967
971
|
key: name,
|
|
@@ -969,16 +973,10 @@ var Toolbar = function Toolbar(_a) {
|
|
|
969
973
|
var _a;
|
|
970
974
|
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
971
975
|
setTimeout(function () {
|
|
972
|
-
|
|
973
|
-
console.log("Target for DataValidation:", target);
|
|
974
|
-
console.log("DataValidationComponent:", DataVerification);
|
|
975
|
-
if (target) {
|
|
976
|
-
var root = ReactDOM.createRoot(target);
|
|
977
|
-
root.render(/*#__PURE__*/React.createElement(DataVerification, null));
|
|
978
|
-
}
|
|
976
|
+
setShowDataValidation(true);
|
|
979
977
|
}, 100);
|
|
980
978
|
}
|
|
981
|
-
});
|
|
979
|
+
}));
|
|
982
980
|
}
|
|
983
981
|
if (name === "locationCondition") {
|
|
984
982
|
var items_3 = [{
|
|
@@ -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 _DataVerification = _interopRequireDefault(require("../DataVerification"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var DataVerificationPortal = function DataVerificationPortal(_a) {
|
|
12
|
+
var visible = _a.visible;
|
|
13
|
+
var container = document.getElementById("placeholder-data-validation");
|
|
14
|
+
if (!visible || !container) return null;
|
|
15
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_DataVerification.default, null), container);
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = DataVerificationPortal;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getLucideIcon = exports.default = exports.CurrencySelector = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _dataVerificationPortal = _interopRequireDefault(require("./dataVerificationPortal"));
|
|
10
10
|
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
11
11
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
12
|
var _ui = require("@fileverse/ui");
|
|
@@ -20,7 +20,6 @@ var _SVGIcon = _interopRequireDefault(require("../SVGIcon"));
|
|
|
20
20
|
var _useDialog = require("../../hooks/useDialog");
|
|
21
21
|
var _SplitColumn = require("../SplitColumn");
|
|
22
22
|
var _LocationCondition = require("../LocationCondition");
|
|
23
|
-
var _DataVerification = _interopRequireDefault(require("../DataVerification"));
|
|
24
23
|
var _ConditionFormat = _interopRequireDefault(require("../ConditionFormat"));
|
|
25
24
|
var _CustomButton = _interopRequireDefault(require("./CustomButton"));
|
|
26
25
|
var _CustomColor = require("./CustomColor");
|
|
@@ -594,6 +593,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
594
593
|
}
|
|
595
594
|
}
|
|
596
595
|
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
596
|
+
var _o = (0, _react.useState)(false),
|
|
597
|
+
showDataValidation = _o[0],
|
|
598
|
+
setShowDataValidation = _o[1];
|
|
597
599
|
var getToolbarItem = (0, _react.useCallback)(function (name, i) {
|
|
598
600
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
599
601
|
var tooltip = toolbar[name];
|
|
@@ -970,7 +972,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
970
972
|
});
|
|
971
973
|
}
|
|
972
974
|
if (name === "dataVerification") {
|
|
973
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
975
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
976
|
+
visible: showDataValidation
|
|
977
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
974
978
|
iconId: name,
|
|
975
979
|
tooltip: tooltip,
|
|
976
980
|
key: name,
|
|
@@ -978,16 +982,10 @@ var Toolbar = function Toolbar(_a) {
|
|
|
978
982
|
var _a;
|
|
979
983
|
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
980
984
|
setTimeout(function () {
|
|
981
|
-
|
|
982
|
-
console.log("Target for DataValidation:", target);
|
|
983
|
-
console.log("DataValidationComponent:", _DataVerification.default);
|
|
984
|
-
if (target) {
|
|
985
|
-
var root = _client.default.createRoot(target);
|
|
986
|
-
root.render(/*#__PURE__*/_react.default.createElement(_DataVerification.default, null));
|
|
987
|
-
}
|
|
985
|
+
setShowDataValidation(true);
|
|
988
986
|
}, 100);
|
|
989
987
|
}
|
|
990
|
-
});
|
|
988
|
+
}));
|
|
991
989
|
}
|
|
992
990
|
if (name === "locationCondition") {
|
|
993
991
|
var items_3 = [{
|
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.95",
|
|
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.95",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|