@fileverse-dev/fortune-react 1.2.64-patch-2 → 1.2.64-patch-4
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.d.ts +1 -0
- package/es/components/ConditionFormat/ConditionRules.js +20 -12
- package/es/components/Toolbar/conditionalFormatPortal.d.ts +2 -1
- package/es/components/Toolbar/conditionalFormatPortal.js +5 -2
- package/es/components/Toolbar/index.js +5 -1
- package/es/components/Workbook/api.d.ts +1 -0
- package/es/components/Workbook/index.d.ts +1 -0
- package/es/components/Workbook/index.js +1 -16
- package/lib/components/ConditionFormat/ConditionRules.d.ts +1 -0
- package/lib/components/ConditionFormat/ConditionRules.js +20 -12
- package/lib/components/Toolbar/conditionalFormatPortal.d.ts +2 -1
- package/lib/components/Toolbar/conditionalFormatPortal.js +5 -2
- package/lib/components/Toolbar/index.js +5 -1
- package/lib/components/Workbook/api.d.ts +1 -0
- package/lib/components/Workbook/index.d.ts +1 -0
- package/lib/components/Workbook/index.js +1 -16
- package/package.json +2 -2
|
@@ -10,7 +10,8 @@ import { getDisplayedRangeTxt } from "../DataVerification/getDisplayedRangeTxt";
|
|
|
10
10
|
import { injectDatepickerStyles } from "../../utils/datepickerStyles";
|
|
11
11
|
injectDatepickerStyles();
|
|
12
12
|
var ConditionRules = function ConditionRules(_a) {
|
|
13
|
-
var rulesType = _a.type
|
|
13
|
+
var rulesType = _a.type,
|
|
14
|
+
context = _a.context;
|
|
14
15
|
var _b = useState('greaterThan'),
|
|
15
16
|
type = _b[0],
|
|
16
17
|
setType = _b[1];
|
|
@@ -23,21 +24,19 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
23
24
|
var _e = useState(null),
|
|
24
25
|
allConditionFormats = _e[0],
|
|
25
26
|
setAllConditionFormats = _e[1];
|
|
26
|
-
var
|
|
27
|
-
context = _f.context,
|
|
28
|
-
setContext = _f.setContext;
|
|
27
|
+
var setContext = useContext(WorkbookContext).setContext;
|
|
29
28
|
var hideDialog = useDialog().hideDialog;
|
|
30
|
-
var
|
|
31
|
-
conditionformat =
|
|
32
|
-
button =
|
|
33
|
-
protection =
|
|
34
|
-
generalDialog =
|
|
35
|
-
var
|
|
29
|
+
var _f = locale(context),
|
|
30
|
+
conditionformat = _f.conditionformat,
|
|
31
|
+
button = _f.button,
|
|
32
|
+
protection = _f.protection,
|
|
33
|
+
generalDialog = _f.generalDialog;
|
|
34
|
+
var _g = useState({
|
|
36
35
|
textColor: "#FFFFFF",
|
|
37
36
|
cellColor: "#D82E2A"
|
|
38
37
|
}),
|
|
39
|
-
colorRules =
|
|
40
|
-
setColorRules =
|
|
38
|
+
colorRules = _g[0],
|
|
39
|
+
setColorRules = _g[1];
|
|
41
40
|
useEffect(function () {
|
|
42
41
|
var _a, _b, _c, _d;
|
|
43
42
|
var index = getSheetIndex(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
@@ -115,6 +114,15 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
115
114
|
});
|
|
116
115
|
hideDialog();
|
|
117
116
|
}, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
|
|
117
|
+
useEffect(function () {
|
|
118
|
+
console.log("add mouseDown listener", window);
|
|
119
|
+
window.addEventListener("mouseDown", function (e) {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
|
|
122
|
+
var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
|
|
123
|
+
console.log("mouseDown", selectionColumn, selectionRow, context);
|
|
124
|
+
});
|
|
125
|
+
}, [type]);
|
|
118
126
|
useEffect(function () {
|
|
119
127
|
setContext(function (ctx) {
|
|
120
128
|
ctx.conditionRules.rulesType = type;
|
|
@@ -2,9 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
import ConditionRules from "../ConditionFormat/ConditionRules";
|
|
4
4
|
var ConditionalFormatPortal = function ConditionalFormatPortal(_a) {
|
|
5
|
-
var visible = _a.visible
|
|
5
|
+
var visible = _a.visible,
|
|
6
|
+
context = _a.context;
|
|
6
7
|
var container = document.getElementById("placeholder-conditional-format");
|
|
7
8
|
if (!visible || !container) return null;
|
|
8
|
-
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(ConditionRules,
|
|
9
|
+
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
10
|
+
context: context
|
|
11
|
+
}), container);
|
|
9
12
|
};
|
|
10
13
|
export default ConditionalFormatPortal;
|
|
@@ -1677,6 +1677,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
}));
|
|
1679
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]);
|
|
1680
1683
|
return /*#__PURE__*/React.createElement("div", {
|
|
1681
1684
|
ref: containerRef,
|
|
1682
1685
|
className: "fortune-toolbar",
|
|
@@ -1684,7 +1687,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1684
1687
|
}, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
1685
1688
|
visible: showDataValidation
|
|
1686
1689
|
}), /*#__PURE__*/React.createElement(ConditionalFormatPortal, {
|
|
1687
|
-
visible: showConditionalFormat
|
|
1690
|
+
visible: showConditionalFormat,
|
|
1691
|
+
context: context
|
|
1688
1692
|
}), /*#__PURE__*/React.createElement("input", {
|
|
1689
1693
|
id: "fortune-img-upload",
|
|
1690
1694
|
className: "test-fortune-img-upload",
|
|
@@ -1198,5 +1198,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
1198
1198
|
getSplitColComponent: () => import("react").FC<{}>;
|
|
1199
1199
|
getConditionalFormatComponent: () => import("react").FC<{
|
|
1200
1200
|
type?: string | undefined;
|
|
1201
|
+
context?: any;
|
|
1201
1202
|
}>;
|
|
1202
1203
|
};
|
|
@@ -1205,6 +1205,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
1205
1205
|
getSplitColComponent: () => React.FC<{}>;
|
|
1206
1206
|
getConditionalFormatComponent: () => React.FC<{
|
|
1207
1207
|
type?: string | undefined;
|
|
1208
|
+
context?: any;
|
|
1208
1209
|
}>;
|
|
1209
1210
|
}>>;
|
|
1210
1211
|
export default Workbook;
|
|
@@ -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,20 +683,7 @@ 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
|
-
onClick: function onClick() {
|
|
690
|
-
setShow(!show);
|
|
691
|
-
}
|
|
692
|
-
}, "Click"), show && /*#__PURE__*/React.createElement("div", {
|
|
693
|
-
id: "placeholder-conditional-formatting",
|
|
694
|
-
style: {
|
|
695
|
-
width: "500px",
|
|
696
|
-
height: "500px",
|
|
697
|
-
position: "fixed",
|
|
698
|
-
zIndex: "1000",
|
|
699
|
-
backgroundColor: "white"
|
|
700
|
-
}
|
|
701
|
-
}, /*#__PURE__*/React.createElement(ConditionRules, null)), /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
686
|
+
}, /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
702
687
|
className: "fortune-container",
|
|
703
688
|
ref: workbookContainer,
|
|
704
689
|
onKeyDown: onKeyDown
|
|
@@ -19,7 +19,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
19
19
|
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); }
|
|
20
20
|
(0, _datepickerStyles.injectDatepickerStyles)();
|
|
21
21
|
var ConditionRules = function ConditionRules(_a) {
|
|
22
|
-
var rulesType = _a.type
|
|
22
|
+
var rulesType = _a.type,
|
|
23
|
+
context = _a.context;
|
|
23
24
|
var _b = (0, _react.useState)('greaterThan'),
|
|
24
25
|
type = _b[0],
|
|
25
26
|
setType = _b[1];
|
|
@@ -32,21 +33,19 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
32
33
|
var _e = (0, _react.useState)(null),
|
|
33
34
|
allConditionFormats = _e[0],
|
|
34
35
|
setAllConditionFormats = _e[1];
|
|
35
|
-
var
|
|
36
|
-
context = _f.context,
|
|
37
|
-
setContext = _f.setContext;
|
|
36
|
+
var setContext = (0, _react.useContext)(_context.default).setContext;
|
|
38
37
|
var hideDialog = (0, _useDialog.useDialog)().hideDialog;
|
|
39
|
-
var
|
|
40
|
-
conditionformat =
|
|
41
|
-
button =
|
|
42
|
-
protection =
|
|
43
|
-
generalDialog =
|
|
44
|
-
var
|
|
38
|
+
var _f = (0, _fortuneCore.locale)(context),
|
|
39
|
+
conditionformat = _f.conditionformat,
|
|
40
|
+
button = _f.button,
|
|
41
|
+
protection = _f.protection,
|
|
42
|
+
generalDialog = _f.generalDialog;
|
|
43
|
+
var _g = (0, _react.useState)({
|
|
45
44
|
textColor: "#FFFFFF",
|
|
46
45
|
cellColor: "#D82E2A"
|
|
47
46
|
}),
|
|
48
|
-
colorRules =
|
|
49
|
-
setColorRules =
|
|
47
|
+
colorRules = _g[0],
|
|
48
|
+
setColorRules = _g[1];
|
|
50
49
|
(0, _react.useEffect)(function () {
|
|
51
50
|
var _a, _b, _c, _d;
|
|
52
51
|
var index = (0, _fortuneCore.getSheetIndex)(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
@@ -124,6 +123,15 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
124
123
|
});
|
|
125
124
|
hideDialog();
|
|
126
125
|
}, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
|
|
126
|
+
(0, _react.useEffect)(function () {
|
|
127
|
+
console.log("add mouseDown listener", window);
|
|
128
|
+
window.addEventListener("mouseDown", function (e) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
|
|
131
|
+
var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
|
|
132
|
+
console.log("mouseDown", selectionColumn, selectionRow, context);
|
|
133
|
+
});
|
|
134
|
+
}, [type]);
|
|
127
135
|
(0, _react.useEffect)(function () {
|
|
128
136
|
setContext(function (ctx) {
|
|
129
137
|
ctx.conditionRules.rulesType = type;
|
|
@@ -9,9 +9,12 @@ var _reactDom = require("react-dom");
|
|
|
9
9
|
var _ConditionRules = _interopRequireDefault(require("../ConditionFormat/ConditionRules"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
var ConditionalFormatPortal = function ConditionalFormatPortal(_a) {
|
|
12
|
-
var visible = _a.visible
|
|
12
|
+
var visible = _a.visible,
|
|
13
|
+
context = _a.context;
|
|
13
14
|
var container = document.getElementById("placeholder-conditional-format");
|
|
14
15
|
if (!visible || !container) return null;
|
|
15
|
-
return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_ConditionRules.default,
|
|
16
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_ConditionRules.default, {
|
|
17
|
+
context: context
|
|
18
|
+
}), container);
|
|
16
19
|
};
|
|
17
20
|
var _default = exports.default = ConditionalFormatPortal;
|
|
@@ -1686,6 +1686,9 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
}));
|
|
1688
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]);
|
|
1689
1692
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1690
1693
|
ref: containerRef,
|
|
1691
1694
|
className: "fortune-toolbar",
|
|
@@ -1693,7 +1696,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1693
1696
|
}, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
1694
1697
|
visible: showDataValidation
|
|
1695
1698
|
}), /*#__PURE__*/_react.default.createElement(_conditionalFormatPortal.default, {
|
|
1696
|
-
visible: showConditionalFormat
|
|
1699
|
+
visible: showConditionalFormat,
|
|
1700
|
+
context: context
|
|
1697
1701
|
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
1698
1702
|
id: "fortune-img-upload",
|
|
1699
1703
|
className: "test-fortune-img-upload",
|
|
@@ -1198,5 +1198,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
1198
1198
|
getSplitColComponent: () => import("react").FC<{}>;
|
|
1199
1199
|
getConditionalFormatComponent: () => import("react").FC<{
|
|
1200
1200
|
type?: string | undefined;
|
|
1201
|
+
context?: any;
|
|
1201
1202
|
}>;
|
|
1202
1203
|
};
|
|
@@ -1205,6 +1205,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
1205
1205
|
getSplitColComponent: () => React.FC<{}>;
|
|
1206
1206
|
getConditionalFormatComponent: () => React.FC<{
|
|
1207
1207
|
type?: string | undefined;
|
|
1208
|
+
context?: any;
|
|
1208
1209
|
}>;
|
|
1209
1210
|
}>>;
|
|
1210
1211
|
export default Workbook;
|
|
@@ -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,20 +692,7 @@ 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
|
-
onClick: function onClick() {
|
|
699
|
-
setShow(!show);
|
|
700
|
-
}
|
|
701
|
-
}, "Click"), show && /*#__PURE__*/_react.default.createElement("div", {
|
|
702
|
-
id: "placeholder-conditional-formatting",
|
|
703
|
-
style: {
|
|
704
|
-
width: "500px",
|
|
705
|
-
height: "500px",
|
|
706
|
-
position: "fixed",
|
|
707
|
-
zIndex: "1000",
|
|
708
|
-
backgroundColor: "white"
|
|
709
|
-
}
|
|
710
|
-
}, /*#__PURE__*/_react.default.createElement(_ConditionRules.default, null)), /*#__PURE__*/_react.default.createElement(_modal.ModalProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
695
|
+
}, /*#__PURE__*/_react.default.createElement(_modal.ModalProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
711
696
|
className: "fortune-container",
|
|
712
697
|
ref: workbookContainer,
|
|
713
698
|
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-4",
|
|
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-4",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|