@fileverse-dev/fortune-react 1.2.64-patch-3 → 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.
@@ -2,5 +2,6 @@ import React from "react";
2
2
  import "./index.css";
3
3
  declare const ConditionRules: React.FC<{
4
4
  type?: string;
5
+ context?: any;
5
6
  }>;
6
7
  export default ConditionRules;
@@ -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 _f = useContext(WorkbookContext),
27
- context = _f.context,
28
- setContext = _f.setContext;
27
+ var setContext = useContext(WorkbookContext).setContext;
29
28
  var hideDialog = useDialog().hideDialog;
30
- var _g = locale(context),
31
- conditionformat = _g.conditionformat,
32
- button = _g.button,
33
- protection = _g.protection,
34
- generalDialog = _g.generalDialog;
35
- var _h = useState({
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 = _h[0],
40
- setColorRules = _h[1];
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;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- declare const ConditionalFormatPortal: ({ visible }: {
2
+ declare const ConditionalFormatPortal: ({ visible, context }: {
3
3
  visible: boolean;
4
+ context: any;
4
5
  }) => React.ReactPortal | null;
5
6
  export default ConditionalFormatPortal;
@@ -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, null), container);
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
- }, true && /*#__PURE__*/React.createElement("div", {
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
@@ -2,5 +2,6 @@ import React from "react";
2
2
  import "./index.css";
3
3
  declare const ConditionRules: React.FC<{
4
4
  type?: string;
5
+ context?: any;
5
6
  }>;
6
7
  export default ConditionRules;
@@ -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 _f = (0, _react.useContext)(_context.default),
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 _g = (0, _fortuneCore.locale)(context),
40
- conditionformat = _g.conditionformat,
41
- button = _g.button,
42
- protection = _g.protection,
43
- generalDialog = _g.generalDialog;
44
- var _h = (0, _react.useState)({
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 = _h[0],
49
- setColorRules = _h[1];
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;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- declare const ConditionalFormatPortal: ({ visible }: {
2
+ declare const ConditionalFormatPortal: ({ visible, context }: {
3
3
  visible: boolean;
4
+ context: any;
4
5
  }) => React.ReactPortal | null;
5
6
  export default ConditionalFormatPortal;
@@ -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, null), container);
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
- }, true && /*#__PURE__*/_react.default.createElement("div", {
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",
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-3",
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",