@fileverse-dev/fortune-react 1.2.50 → 1.2.51
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.
|
@@ -121,7 +121,6 @@ import Tippy from "@tippyjs/react";
|
|
|
121
121
|
import { LucideIcon } from "@fileverse/ui";
|
|
122
122
|
import { SplitColumn } from "../SplitColumn";
|
|
123
123
|
import { ResetColumnWidth } from "../ResetColumnWidth";
|
|
124
|
-
import DataVerification from "../DataVerification";
|
|
125
124
|
import WorkbookContext from "../../context";
|
|
126
125
|
import { useAlert } from "../../hooks/useAlert";
|
|
127
126
|
import { useDialog } from "../../hooks/useDialog";
|
|
@@ -147,7 +146,6 @@ var ContextMenu = function ContextMenu() {
|
|
|
147
146
|
drag = _b.drag,
|
|
148
147
|
generalDialog = _b.generalDialog,
|
|
149
148
|
info = _b.info,
|
|
150
|
-
toolbar = _b.toolbar,
|
|
151
149
|
splitText = _b.splitText;
|
|
152
150
|
var _c = useState(""),
|
|
153
151
|
activeMenu = _c[0],
|
|
@@ -286,7 +284,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
286
284
|
setContext(function (draftCtx) {
|
|
287
285
|
draftCtx.contextMenu = {};
|
|
288
286
|
});
|
|
289
|
-
|
|
287
|
+
window.dataVerificationClick(context.luckysheet_select_save);
|
|
290
288
|
}
|
|
291
289
|
}, /*#__PURE__*/React.createElement("div", {
|
|
292
290
|
className: "context-item"
|
|
@@ -995,15 +995,13 @@ var Toolbar = function Toolbar(_a) {
|
|
|
995
995
|
});
|
|
996
996
|
}
|
|
997
997
|
if (name === "dataVerification") {
|
|
998
|
-
return /*#__PURE__*/React.createElement(
|
|
999
|
-
visible: showDataValidation
|
|
1000
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
998
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1001
999
|
id: "dataVerification",
|
|
1002
1000
|
iconId: name,
|
|
1003
1001
|
tooltip: tooltip,
|
|
1004
1002
|
key: name,
|
|
1005
1003
|
onClick: dataVerificationClick
|
|
1006
|
-
})
|
|
1004
|
+
});
|
|
1007
1005
|
}
|
|
1008
1006
|
if (name === "locationCondition") {
|
|
1009
1007
|
var items_3 = [{
|
|
@@ -1136,34 +1134,7 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1136
1134
|
if (context.allowEdit === false) return;
|
|
1137
1135
|
showImgChooser();
|
|
1138
1136
|
}
|
|
1139
|
-
}
|
|
1140
|
-
id: "fortune-img-upload",
|
|
1141
|
-
type: "file",
|
|
1142
|
-
accept: "image/*",
|
|
1143
|
-
style: {
|
|
1144
|
-
display: "none"
|
|
1145
|
-
},
|
|
1146
|
-
onChange: function onChange(e) {
|
|
1147
|
-
var _a;
|
|
1148
|
-
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1149
|
-
if (!file) return;
|
|
1150
|
-
var render = new FileReader();
|
|
1151
|
-
render.readAsDataURL(file);
|
|
1152
|
-
render.onload = function (event) {
|
|
1153
|
-
var _a;
|
|
1154
|
-
if (event.target == null) return;
|
|
1155
|
-
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
1156
|
-
var image = new Image();
|
|
1157
|
-
image.onload = function () {
|
|
1158
|
-
setContext(function (draftCtx) {
|
|
1159
|
-
insertImage(draftCtx, image);
|
|
1160
|
-
});
|
|
1161
|
-
};
|
|
1162
|
-
image.src = src;
|
|
1163
|
-
};
|
|
1164
|
-
e.currentTarget.value = "";
|
|
1165
|
-
}
|
|
1166
|
-
}));
|
|
1137
|
+
});
|
|
1167
1138
|
}
|
|
1168
1139
|
if (name === "comment") {
|
|
1169
1140
|
var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
|
|
@@ -1692,7 +1663,37 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1692
1663
|
ref: containerRef,
|
|
1693
1664
|
className: "fortune-toolbar",
|
|
1694
1665
|
"aria-label": toolbar.toolbar
|
|
1695
|
-
}, /*#__PURE__*/React.createElement(
|
|
1666
|
+
}, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
1667
|
+
visible: showDataValidation
|
|
1668
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
1669
|
+
id: "fortune-img-upload",
|
|
1670
|
+
className: "test-fortune-img-upload",
|
|
1671
|
+
type: "file",
|
|
1672
|
+
accept: "image/*",
|
|
1673
|
+
style: {
|
|
1674
|
+
display: "none"
|
|
1675
|
+
},
|
|
1676
|
+
onChange: function onChange(e) {
|
|
1677
|
+
var _a;
|
|
1678
|
+
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1679
|
+
if (!file) return;
|
|
1680
|
+
var render = new FileReader();
|
|
1681
|
+
render.readAsDataURL(file);
|
|
1682
|
+
render.onload = function (event) {
|
|
1683
|
+
var _a;
|
|
1684
|
+
if (event.target == null) return;
|
|
1685
|
+
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
1686
|
+
var image = new Image();
|
|
1687
|
+
image.onload = function () {
|
|
1688
|
+
setContext(function (draftCtx) {
|
|
1689
|
+
insertImage(draftCtx, image);
|
|
1690
|
+
});
|
|
1691
|
+
};
|
|
1692
|
+
image.src = src;
|
|
1693
|
+
};
|
|
1694
|
+
e.currentTarget.value = "";
|
|
1695
|
+
}
|
|
1696
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1696
1697
|
className: "fortune-toolbar-left"
|
|
1697
1698
|
}, settings.customToolbarItems.filter(function (n) {
|
|
1698
1699
|
return n.key === "import-export";
|
|
@@ -13,7 +13,6 @@ var _react2 = _interopRequireDefault(require("@tippyjs/react"));
|
|
|
13
13
|
var _ui = require("@fileverse/ui");
|
|
14
14
|
var _SplitColumn = require("../SplitColumn");
|
|
15
15
|
var _ResetColumnWidth = require("../ResetColumnWidth");
|
|
16
|
-
var _DataVerification = _interopRequireDefault(require("../DataVerification"));
|
|
17
16
|
var _context = _interopRequireDefault(require("../../context"));
|
|
18
17
|
var _useAlert = require("../../hooks/useAlert");
|
|
19
18
|
var _useDialog = require("../../hooks/useDialog");
|
|
@@ -156,7 +155,6 @@ var ContextMenu = function ContextMenu() {
|
|
|
156
155
|
drag = _b.drag,
|
|
157
156
|
generalDialog = _b.generalDialog,
|
|
158
157
|
info = _b.info,
|
|
159
|
-
toolbar = _b.toolbar,
|
|
160
158
|
splitText = _b.splitText;
|
|
161
159
|
var _c = (0, _react.useState)(""),
|
|
162
160
|
activeMenu = _c[0],
|
|
@@ -295,7 +293,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
295
293
|
setContext(function (draftCtx) {
|
|
296
294
|
draftCtx.contextMenu = {};
|
|
297
295
|
});
|
|
298
|
-
|
|
296
|
+
window.dataVerificationClick(context.luckysheet_select_save);
|
|
299
297
|
}
|
|
300
298
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
301
299
|
className: "context-item"
|
|
@@ -1004,15 +1004,13 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
1006
|
if (name === "dataVerification") {
|
|
1007
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
1008
|
-
visible: showDataValidation
|
|
1009
|
-
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1007
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1010
1008
|
id: "dataVerification",
|
|
1011
1009
|
iconId: name,
|
|
1012
1010
|
tooltip: tooltip,
|
|
1013
1011
|
key: name,
|
|
1014
1012
|
onClick: dataVerificationClick
|
|
1015
|
-
})
|
|
1013
|
+
});
|
|
1016
1014
|
}
|
|
1017
1015
|
if (name === "locationCondition") {
|
|
1018
1016
|
var items_3 = [{
|
|
@@ -1145,34 +1143,7 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1145
1143
|
if (context.allowEdit === false) return;
|
|
1146
1144
|
(0, _fortuneCore.showImgChooser)();
|
|
1147
1145
|
}
|
|
1148
|
-
}
|
|
1149
|
-
id: "fortune-img-upload",
|
|
1150
|
-
type: "file",
|
|
1151
|
-
accept: "image/*",
|
|
1152
|
-
style: {
|
|
1153
|
-
display: "none"
|
|
1154
|
-
},
|
|
1155
|
-
onChange: function onChange(e) {
|
|
1156
|
-
var _a;
|
|
1157
|
-
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1158
|
-
if (!file) return;
|
|
1159
|
-
var render = new FileReader();
|
|
1160
|
-
render.readAsDataURL(file);
|
|
1161
|
-
render.onload = function (event) {
|
|
1162
|
-
var _a;
|
|
1163
|
-
if (event.target == null) return;
|
|
1164
|
-
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
1165
|
-
var image = new Image();
|
|
1166
|
-
image.onload = function () {
|
|
1167
|
-
setContext(function (draftCtx) {
|
|
1168
|
-
(0, _fortuneCore.insertImage)(draftCtx, image);
|
|
1169
|
-
});
|
|
1170
|
-
};
|
|
1171
|
-
image.src = src;
|
|
1172
|
-
};
|
|
1173
|
-
e.currentTarget.value = "";
|
|
1174
|
-
}
|
|
1175
|
-
}));
|
|
1146
|
+
});
|
|
1176
1147
|
}
|
|
1177
1148
|
if (name === "comment") {
|
|
1178
1149
|
var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
|
|
@@ -1701,7 +1672,37 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1701
1672
|
ref: containerRef,
|
|
1702
1673
|
className: "fortune-toolbar",
|
|
1703
1674
|
"aria-label": toolbar.toolbar
|
|
1704
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
1675
|
+
}, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
1676
|
+
visible: showDataValidation
|
|
1677
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
1678
|
+
id: "fortune-img-upload",
|
|
1679
|
+
className: "test-fortune-img-upload",
|
|
1680
|
+
type: "file",
|
|
1681
|
+
accept: "image/*",
|
|
1682
|
+
style: {
|
|
1683
|
+
display: "none"
|
|
1684
|
+
},
|
|
1685
|
+
onChange: function onChange(e) {
|
|
1686
|
+
var _a;
|
|
1687
|
+
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1688
|
+
if (!file) return;
|
|
1689
|
+
var render = new FileReader();
|
|
1690
|
+
render.readAsDataURL(file);
|
|
1691
|
+
render.onload = function (event) {
|
|
1692
|
+
var _a;
|
|
1693
|
+
if (event.target == null) return;
|
|
1694
|
+
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
1695
|
+
var image = new Image();
|
|
1696
|
+
image.onload = function () {
|
|
1697
|
+
setContext(function (draftCtx) {
|
|
1698
|
+
(0, _fortuneCore.insertImage)(draftCtx, image);
|
|
1699
|
+
});
|
|
1700
|
+
};
|
|
1701
|
+
image.src = src;
|
|
1702
|
+
};
|
|
1703
|
+
e.currentTarget.value = "";
|
|
1704
|
+
}
|
|
1705
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
1705
1706
|
className: "fortune-toolbar-left"
|
|
1706
1707
|
}, settings.customToolbarItems.filter(function (n) {
|
|
1707
1708
|
return n.key === "import-export";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.51",
|
|
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.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.51",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|