@fileverse-dev/fortune-react 1.2.64-patch-3 → 1.2.64-patch-5
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 +17 -12
- package/es/components/Toolbar/conditionalFormatPortal.d.ts +2 -1
- package/es/components/Toolbar/conditionalFormatPortal.js +5 -2
- package/es/components/Toolbar/index.js +2 -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 -10
- package/lib/components/ConditionFormat/ConditionRules.d.ts +1 -0
- package/lib/components/ConditionFormat/ConditionRules.js +17 -12
- package/lib/components/Toolbar/conditionalFormatPortal.d.ts +2 -1
- package/lib/components/Toolbar/conditionalFormatPortal.js +5 -2
- package/lib/components/Toolbar/index.js +2 -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 -10
- 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,25 @@ 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];
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
console.log("c=======why", context);
|
|
42
|
+
var index = getSheetIndex(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
43
|
+
var allCondition = context.luckysheetfile[index].luckysheet_conditionformat_save;
|
|
44
|
+
console.log("====whyallCondition", allCondition);
|
|
45
|
+
}, [context]);
|
|
41
46
|
useEffect(function () {
|
|
42
47
|
var _a, _b, _c, _d;
|
|
43
48
|
var index = getSheetIndex(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
@@ -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;
|
|
@@ -1687,7 +1687,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1687
1687
|
}, /*#__PURE__*/React.createElement(DataVerificationPortal, {
|
|
1688
1688
|
visible: showDataValidation
|
|
1689
1689
|
}), /*#__PURE__*/React.createElement(ConditionalFormatPortal, {
|
|
1690
|
-
visible: showConditionalFormat
|
|
1690
|
+
visible: showConditionalFormat,
|
|
1691
|
+
context: context
|
|
1691
1692
|
}), /*#__PURE__*/React.createElement("input", {
|
|
1692
1693
|
id: "fortune-img-upload",
|
|
1693
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;
|
|
@@ -683,16 +683,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
683
683
|
}
|
|
684
684
|
return /*#__PURE__*/React.createElement(WorkbookContext.Provider, {
|
|
685
685
|
value: providerValue
|
|
686
|
-
},
|
|
687
|
-
id: "placeholder-conditional-format",
|
|
688
|
-
style: {
|
|
689
|
-
width: "500px",
|
|
690
|
-
height: "500px",
|
|
691
|
-
position: "fixed",
|
|
692
|
-
zIndex: "1000",
|
|
693
|
-
backgroundColor: "white"
|
|
694
|
-
}
|
|
695
|
-
}), /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
686
|
+
}, /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
696
687
|
className: "fortune-container",
|
|
697
688
|
ref: workbookContainer,
|
|
698
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,25 @@ 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];
|
|
49
|
+
(0, _react.useEffect)(function () {
|
|
50
|
+
console.log("c=======why", context);
|
|
51
|
+
var index = (0, _fortuneCore.getSheetIndex)(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
52
|
+
var allCondition = context.luckysheetfile[index].luckysheet_conditionformat_save;
|
|
53
|
+
console.log("====whyallCondition", allCondition);
|
|
54
|
+
}, [context]);
|
|
50
55
|
(0, _react.useEffect)(function () {
|
|
51
56
|
var _a, _b, _c, _d;
|
|
52
57
|
var index = (0, _fortuneCore.getSheetIndex)(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
|
|
@@ -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;
|
|
@@ -1696,7 +1696,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
1696
1696
|
}, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
|
|
1697
1697
|
visible: showDataValidation
|
|
1698
1698
|
}), /*#__PURE__*/_react.default.createElement(_conditionalFormatPortal.default, {
|
|
1699
|
-
visible: showConditionalFormat
|
|
1699
|
+
visible: showConditionalFormat,
|
|
1700
|
+
context: context
|
|
1700
1701
|
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
1701
1702
|
id: "fortune-img-upload",
|
|
1702
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;
|
|
@@ -692,16 +692,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
692
692
|
}
|
|
693
693
|
return /*#__PURE__*/_react.default.createElement(_context.default.Provider, {
|
|
694
694
|
value: providerValue
|
|
695
|
-
},
|
|
696
|
-
id: "placeholder-conditional-format",
|
|
697
|
-
style: {
|
|
698
|
-
width: "500px",
|
|
699
|
-
height: "500px",
|
|
700
|
-
position: "fixed",
|
|
701
|
-
zIndex: "1000",
|
|
702
|
-
backgroundColor: "white"
|
|
703
|
-
}
|
|
704
|
-
}), /*#__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", {
|
|
705
696
|
className: "fortune-container",
|
|
706
697
|
ref: workbookContainer,
|
|
707
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-5",
|
|
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-5",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|