@fileverse-dev/fortune-react 1.1.89 → 1.1.91

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.
Files changed (27) hide show
  1. package/es/components/ContextMenu/index.js +2 -2
  2. package/es/components/DataVerification/ColorPicker.d.ts +9 -0
  3. package/es/components/DataVerification/ColorPicker.js +98 -0
  4. package/es/components/DataVerification/DropdownList.js +22 -7
  5. package/es/components/DataVerification/DropdownOption.d.ts +11 -0
  6. package/es/components/DataVerification/DropdownOption.js +264 -0
  7. package/es/components/DataVerification/index.css +4 -0
  8. package/es/components/DataVerification/index.js +62 -14
  9. package/es/components/SheetOverlay/ColumnHeader.js +8 -2
  10. package/es/components/SheetOverlay/drag_and_drop/column-helpers.js +8 -10
  11. package/es/components/SheetOverlay/drag_and_drop/row-helpers.js +7 -9
  12. package/es/components/SheetOverlay/index.js +1 -6
  13. package/es/components/Toolbar/index.js +47 -44
  14. package/lib/components/ContextMenu/index.js +2 -2
  15. package/lib/components/DataVerification/ColorPicker.d.ts +9 -0
  16. package/lib/components/DataVerification/ColorPicker.js +106 -0
  17. package/lib/components/DataVerification/DropdownList.js +22 -7
  18. package/lib/components/DataVerification/DropdownOption.d.ts +11 -0
  19. package/lib/components/DataVerification/DropdownOption.js +271 -0
  20. package/lib/components/DataVerification/index.css +4 -0
  21. package/lib/components/DataVerification/index.js +61 -13
  22. package/lib/components/SheetOverlay/ColumnHeader.js +8 -2
  23. package/lib/components/SheetOverlay/drag_and_drop/column-helpers.js +8 -10
  24. package/lib/components/SheetOverlay/drag_and_drop/row-helpers.js +7 -9
  25. package/lib/components/SheetOverlay/index.js +1 -6
  26. package/lib/components/Toolbar/index.js +47 -44
  27. package/package.json +2 -2
@@ -457,58 +457,58 @@ var CurrencySelector = exports.CurrencySelector = function CurrencySelector(_a)
457
457
  }));
458
458
  };
459
459
  var Toolbar = function Toolbar(_a) {
460
- var _b, _c, _d;
460
+ var _b, _c, _d, _e;
461
461
  var setMoreItems = _a.setMoreItems,
462
462
  moreItemsOpen = _a.moreItemsOpen,
463
463
  onMoreToolbarItemsClose = _a.onMoreToolbarItemsClose,
464
464
  moreToolbarItems = _a.moreToolbarItems;
465
- var _e = (0, _react.useContext)(_context.default),
466
- context = _e.context,
467
- setContext = _e.setContext,
468
- refs = _e.refs,
469
- settings = _e.settings,
470
- handleUndo = _e.handleUndo,
471
- handleRedo = _e.handleRedo;
465
+ var _f = (0, _react.useContext)(_context.default),
466
+ context = _f.context,
467
+ setContext = _f.setContext,
468
+ refs = _f.refs,
469
+ settings = _f.settings,
470
+ handleUndo = _f.handleUndo,
471
+ handleRedo = _f.handleRedo;
472
472
  var contextRef = (0, _react.useRef)(context);
473
473
  var containerRef = (0, _react.useRef)(null);
474
- var _f = (0, _react.useState)(-1),
475
- toolbarWrapIndex = _f[0],
476
- setToolbarWrapIndex = _f[1];
477
- var _g = (0, _react.useState)([]),
478
- itemLocations = _g[0],
479
- setItemLocations = _g[1];
480
- var _h = (0, _react.useState)(false),
481
- showDuneModal = _h[0],
482
- setShowDuneModal = _h[1];
483
- var _j = (0, _react.useState)(window.innerWidth >= 1280),
484
- isDesktop = _j[0],
485
- setIsDesktop = _j[1];
486
- var _k = (0, _useDialog.useDialog)(),
487
- showDialog = _k.showDialog,
488
- hideDialog = _k.hideDialog;
474
+ var _g = (0, _react.useState)(-1),
475
+ toolbarWrapIndex = _g[0],
476
+ setToolbarWrapIndex = _g[1];
477
+ var _h = (0, _react.useState)([]),
478
+ itemLocations = _h[0],
479
+ setItemLocations = _h[1];
480
+ var _j = (0, _react.useState)(false),
481
+ showDuneModal = _j[0],
482
+ setShowDuneModal = _j[1];
483
+ var _k = (0, _react.useState)(window.innerWidth >= 1280),
484
+ isDesktop = _k[0],
485
+ setIsDesktop = _k[1];
486
+ var _l = (0, _useDialog.useDialog)(),
487
+ showDialog = _l.showDialog,
488
+ hideDialog = _l.hideDialog;
489
489
  var firstSelection = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0];
490
490
  var flowdata = (0, _fortuneCore.getFlowdata)(context);
491
491
  contextRef.current = context;
492
492
  var row = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
493
493
  var col = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
494
494
  var cell = flowdata && row != null && col != null ? (_c = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row]) === null || _c === void 0 ? void 0 : _c[col] : undefined;
495
- var _l = (0, _fortuneCore.locale)(context),
496
- toolbar = _l.toolbar,
497
- merge = _l.merge,
498
- border = _l.border,
499
- freezen = _l.freezen,
500
- defaultFmt = _l.defaultFmt,
501
- formula = _l.formula,
502
- sort = _l.sort,
503
- align = _l.align,
504
- textWrap = _l.textWrap,
505
- rotation = _l.rotation,
506
- screenshot = _l.screenshot,
507
- filter = _l.filter,
508
- splitText = _l.splitText,
509
- findAndReplace = _l.findAndReplace,
510
- comment = _l.comment,
511
- fontarray = _l.fontarray;
495
+ var _m = (0, _fortuneCore.locale)(context),
496
+ toolbar = _m.toolbar,
497
+ merge = _m.merge,
498
+ border = _m.border,
499
+ freezen = _m.freezen,
500
+ defaultFmt = _m.defaultFmt,
501
+ formula = _m.formula,
502
+ sort = _m.sort,
503
+ align = _m.align,
504
+ textWrap = _m.textWrap,
505
+ rotation = _m.rotation,
506
+ screenshot = _m.screenshot,
507
+ filter = _m.filter,
508
+ splitText = _m.splitText,
509
+ findAndReplace = _m.findAndReplace,
510
+ comment = _m.comment,
511
+ fontarray = _m.fontarray;
512
512
  var toolbarFormat = (0, _fortuneCore.locale)(context).format;
513
513
  var sheetWidth = context.luckysheetTableContentHW[0];
514
514
  var currency = settings.currency;
@@ -543,6 +543,9 @@ var Toolbar = function Toolbar(_a) {
543
543
  subMenu.style.display = "none";
544
544
  }, []);
545
545
  (0, _react.useEffect)(function () {
546
+ window.getDataValidationComponent = function () {
547
+ return /*#__PURE__*/_react.default.createElement(_DataVerification.default, null);
548
+ };
546
549
  var handleResize = function handleResize() {
547
550
  setIsDesktop(window.innerWidth >= 1280);
548
551
  };
@@ -974,8 +977,8 @@ var Toolbar = function Toolbar(_a) {
974
977
  tooltip: tooltip,
975
978
  key: name,
976
979
  onClick: function onClick() {
977
- if (context.allowEdit === false) return;
978
- showDialog(/*#__PURE__*/_react.default.createElement(_DataVerification.default, null), undefined, toolbar.dataVerification);
980
+ var _a;
981
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
979
982
  }
980
983
  });
981
984
  }
@@ -1652,7 +1655,7 @@ var Toolbar = function Toolbar(_a) {
1652
1655
  });
1653
1656
  }
1654
1657
  }));
1655
- }, [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]);
1658
+ }, [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]);
1656
1659
  return /*#__PURE__*/_react.default.createElement("div", {
1657
1660
  ref: containerRef,
1658
1661
  className: "fortune-toolbar",
@@ -1669,7 +1672,7 @@ var Toolbar = function Toolbar(_a) {
1669
1672
  icon: n.icon,
1670
1673
  iconName: n.iconName
1671
1674
  }, n.children);
1672
- }), ((_d = settings.customToolbarItems) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (/*#__PURE__*/_react.default.createElement(_Divider.default, {
1675
+ }), ((_e = settings.customToolbarItems) === null || _e === void 0 ? void 0 : _e.length) > 0 ? (/*#__PURE__*/_react.default.createElement(_Divider.default, {
1673
1676
  key: "customDivider"
1674
1677
  })) : null, (toolbarWrapIndex === -1 || isDesktop ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
1675
1678
  return getToolbarItem(name, i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.89",
3
+ "version": "1.1.91",
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.1.89",
19
+ "@fileverse-dev/fortune-core": "1.1.91",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",