@leankylin-sheet/react 3.1.12 → 3.1.13

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/dist/index.esm.js CHANGED
@@ -7390,8 +7390,11 @@ var ContextMenu = function ContextMenu() {
7390
7390
  generalDialog = _locale.generalDialog,
7391
7391
  info = _locale.info;
7392
7392
  var getMenuElement = useCallback(function (name, i) {
7393
- var _context$luckysheet_s;
7393
+ var _context$luckysheet_s, _context$hooks, _context$hooks$showMe;
7394
7394
  var selection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
7395
+ if (((_context$hooks = context.hooks) === null || _context$hooks === void 0 ? void 0 : (_context$hooks$showMe = _context$hooks.showMenuBefore) === null || _context$hooks$showMe === void 0 ? void 0 : _context$hooks$showMe.call(_context$hooks, name, selection)) === false) {
7396
+ return null;
7397
+ }
7395
7398
  if (name === "|") {
7396
7399
  return /*#__PURE__*/React.createElement(Divider$1, {
7397
7400
  key: "divider-".concat(i)
@@ -7420,12 +7423,10 @@ var ContextMenu = function ContextMenu() {
7420
7423
  return /*#__PURE__*/React.createElement(Menu, {
7421
7424
  key: item.text,
7422
7425
  onClick: function onClick() {
7423
- if (row_index && col_index) {
7424
- setContext(function (draftCtx) {
7425
- item.onClick(draftCtx, refs.globalCache, row_index, col_index);
7426
- draftCtx.contextMenu = {};
7427
- });
7428
- }
7426
+ setContext(function (draftCtx) {
7427
+ item.onClick(draftCtx, refs.globalCache, row_index, col_index);
7428
+ draftCtx.contextMenu = {};
7429
+ });
7429
7430
  }
7430
7431
  }, item.text);
7431
7432
  });
package/dist/index.js CHANGED
@@ -7400,8 +7400,11 @@ var ContextMenu = function ContextMenu() {
7400
7400
  generalDialog = _locale.generalDialog,
7401
7401
  info = _locale.info;
7402
7402
  var getMenuElement = React.useCallback(function (name, i) {
7403
- var _context$luckysheet_s;
7403
+ var _context$luckysheet_s, _context$hooks, _context$hooks$showMe;
7404
7404
  var selection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
7405
+ if (((_context$hooks = context.hooks) === null || _context$hooks === void 0 ? void 0 : (_context$hooks$showMe = _context$hooks.showMenuBefore) === null || _context$hooks$showMe === void 0 ? void 0 : _context$hooks$showMe.call(_context$hooks, name, selection)) === false) {
7406
+ return null;
7407
+ }
7405
7408
  if (name === "|") {
7406
7409
  return /*#__PURE__*/React__default['default'].createElement(Divider$1, {
7407
7410
  key: "divider-".concat(i)
@@ -7430,12 +7433,10 @@ var ContextMenu = function ContextMenu() {
7430
7433
  return /*#__PURE__*/React__default['default'].createElement(Menu, {
7431
7434
  key: item.text,
7432
7435
  onClick: function onClick() {
7433
- if (row_index && col_index) {
7434
- setContext(function (draftCtx) {
7435
- item.onClick(draftCtx, refs.globalCache, row_index, col_index);
7436
- draftCtx.contextMenu = {};
7437
- });
7438
- }
7436
+ setContext(function (draftCtx) {
7437
+ item.onClick(draftCtx, refs.globalCache, row_index, col_index);
7438
+ draftCtx.contextMenu = {};
7439
+ });
7439
7440
  }
7440
7441
  }, item.text);
7441
7442
  });
package/dist/index.umd.js CHANGED
@@ -110490,8 +110490,11 @@
110490
110490
  generalDialog = _locale.generalDialog,
110491
110491
  info = _locale.info;
110492
110492
  var getMenuElement = React.useCallback(function (name, i) {
110493
- var _context$luckysheet_s;
110493
+ var _context$luckysheet_s, _context$hooks, _context$hooks$showMe;
110494
110494
  var selection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
110495
+ if (((_context$hooks = context.hooks) === null || _context$hooks === void 0 ? void 0 : (_context$hooks$showMe = _context$hooks.showMenuBefore) === null || _context$hooks$showMe === void 0 ? void 0 : _context$hooks$showMe.call(_context$hooks, name, selection)) === false) {
110496
+ return null;
110497
+ }
110495
110498
  if (name === "|") {
110496
110499
  return /*#__PURE__*/React__default['default'].createElement(Divider$1, {
110497
110500
  key: "divider-".concat(i)
@@ -110520,12 +110523,10 @@
110520
110523
  return /*#__PURE__*/React__default['default'].createElement(Menu, {
110521
110524
  key: item.text,
110522
110525
  onClick: function onClick() {
110523
- if (row_index && col_index) {
110524
- setContext(function (draftCtx) {
110525
- item.onClick(draftCtx, refs.globalCache, row_index, col_index);
110526
- draftCtx.contextMenu = {};
110527
- });
110528
- }
110526
+ setContext(function (draftCtx) {
110527
+ item.onClick(draftCtx, refs.globalCache, row_index, col_index);
110528
+ draftCtx.contextMenu = {};
110529
+ });
110529
110530
  }
110530
110531
  }, item.text);
110531
110532
  });