@fileverse-dev/fortune-react 1.2.19 → 1.2.21

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.
@@ -292,7 +292,7 @@ var ContextMenu = function ContextMenu() {
292
292
  className: "context-item"
293
293
  }, /*#__PURE__*/React.createElement(LucideIcon, {
294
294
  name: "ShieldCheck"
295
- }), /*#__PURE__*/React.createElement("p", null, "Data Verification")));
295
+ }), /*#__PURE__*/React.createElement("p", null, "Data Validation")));
296
296
  }
297
297
  if (name === "searchReplace") {
298
298
  return /*#__PURE__*/React.createElement(Menu, {
@@ -1,4 +1,4 @@
1
- import { getCellValue, getDropdownList, getFlowdata, getSheetIndex, mergeBorder, setDropdownValue } from "@fileverse-dev/fortune-core";
1
+ import { getCellValue, getDropdownList, getFlowdata, getSheetIndex, mergeBorder, setDropdownValue, api } from "@fileverse-dev/fortune-core";
2
2
  import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
3
3
  import { Button, IconButton } from "@fileverse/ui";
4
4
  import WorkbookContext from "../../context";
@@ -160,7 +160,8 @@ var DropDownList = function DropDownList() {
160
160
  },
161
161
  onClick: function onClick() {
162
162
  var _a;
163
- (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window);
163
+ var selectedCells = api.getSelection(context);
164
+ (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window, selectedCells);
164
165
  setContext(function (ctx) {
165
166
  ctx.dataVerificationDropDownList = false;
166
167
  });
@@ -27,7 +27,7 @@ var Dialog = function Dialog(_a) {
27
27
  var button = locale(context).button;
28
28
  return /*#__PURE__*/React.createElement("div", {
29
29
  className: "fortune-dialog",
30
- style: __assign(__assign({}, containerStyle), ["Data verification", "Split text to columns", "Resize column"].includes(title) ? {
30
+ style: __assign(__assign({}, containerStyle), ["Data validation", "Split text to columns", "Resize column"].includes(title) ? {
31
31
  maxWidth: "unset"
32
32
  } : {})
33
33
  }, /*#__PURE__*/React.createElement("div", {
@@ -186,7 +186,7 @@ var ColumnHeader = function ColumnHeader() {
186
186
  var cod = true;
187
187
  var tempStartPoint = startPoint;
188
188
  while (cod) {
189
- tempStartPoint -= 1;
189
+ tempStartPoint = Number(tempStartPoint) - 1;
190
190
  if (colhiddenData === null || colhiddenData === void 0 ? void 0 : colhiddenData.hasOwnProperty(tempStartPoint)) {
191
191
  startCol = tempStartPoint;
192
192
  } else {
@@ -196,7 +196,7 @@ var ColumnHeader = function ColumnHeader() {
196
196
  cod = true;
197
197
  tempStartPoint = startPoint;
198
198
  while (cod) {
199
- tempStartPoint += 1;
199
+ tempStartPoint = Number(tempStartPoint) + 1;
200
200
  if (colhiddenData === null || colhiddenData === void 0 ? void 0 : colhiddenData.hasOwnProperty(tempStartPoint)) {
201
201
  endCol = tempStartPoint;
202
202
  } else {
@@ -184,7 +184,7 @@ var RowHeader = function RowHeader() {
184
184
  var cod = true;
185
185
  var tempStartPoint = startPoint;
186
186
  while (cod) {
187
- tempStartPoint -= 1;
187
+ tempStartPoint = Number(tempStartPoint) - 1;
188
188
  if (rowhiddenData === null || rowhiddenData === void 0 ? void 0 : rowhiddenData.hasOwnProperty(tempStartPoint)) {
189
189
  startRow = tempStartPoint;
190
190
  } else {
@@ -194,7 +194,7 @@ var RowHeader = function RowHeader() {
194
194
  cod = true;
195
195
  tempStartPoint = startPoint;
196
196
  while (cod) {
197
- tempStartPoint += 1;
197
+ tempStartPoint = Number(tempStartPoint) + 1;
198
198
  if (rowhiddenData === null || rowhiddenData === void 0 ? void 0 : rowhiddenData.hasOwnProperty(tempStartPoint)) {
199
199
  endRow = tempStartPoint;
200
200
  } else {
@@ -596,10 +596,10 @@ var Toolbar = function Toolbar(_a) {
596
596
  var _o = useState(false),
597
597
  showDataValidation = _o[0],
598
598
  setShowDataValidation = _o[1];
599
- var dataVerificationClick = function dataVerificationClick() {
599
+ var dataVerificationClick = function dataVerificationClick(selectedCells) {
600
600
  var _a;
601
601
  var selection = api.getSelection(context);
602
- if (!selection) {
602
+ if (!selection && !selectedCells) {
603
603
  setContext(function (ctx) {
604
604
  api.setSelection(ctx, [{
605
605
  row: [0, 0],
@@ -301,7 +301,7 @@ var ContextMenu = function ContextMenu() {
301
301
  className: "context-item"
302
302
  }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
303
303
  name: "ShieldCheck"
304
- }), /*#__PURE__*/_react.default.createElement("p", null, "Data Verification")));
304
+ }), /*#__PURE__*/_react.default.createElement("p", null, "Data Validation")));
305
305
  }
306
306
  if (name === "searchReplace") {
307
307
  return /*#__PURE__*/_react.default.createElement(_Menu.default, {
@@ -169,7 +169,8 @@ var DropDownList = function DropDownList() {
169
169
  },
170
170
  onClick: function onClick() {
171
171
  var _a;
172
- (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window);
172
+ var selectedCells = _fortuneCore.api.getSelection(context);
173
+ (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window, selectedCells);
173
174
  setContext(function (ctx) {
174
175
  ctx.dataVerificationDropDownList = false;
175
176
  });
@@ -36,7 +36,7 @@ var Dialog = function Dialog(_a) {
36
36
  var button = (0, _fortuneCore.locale)(context).button;
37
37
  return /*#__PURE__*/_react.default.createElement("div", {
38
38
  className: "fortune-dialog",
39
- style: __assign(__assign({}, containerStyle), ["Data verification", "Split text to columns", "Resize column"].includes(title) ? {
39
+ style: __assign(__assign({}, containerStyle), ["Data validation", "Split text to columns", "Resize column"].includes(title) ? {
40
40
  maxWidth: "unset"
41
41
  } : {})
42
42
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -195,7 +195,7 @@ var ColumnHeader = function ColumnHeader() {
195
195
  var cod = true;
196
196
  var tempStartPoint = startPoint;
197
197
  while (cod) {
198
- tempStartPoint -= 1;
198
+ tempStartPoint = Number(tempStartPoint) - 1;
199
199
  if (colhiddenData === null || colhiddenData === void 0 ? void 0 : colhiddenData.hasOwnProperty(tempStartPoint)) {
200
200
  startCol = tempStartPoint;
201
201
  } else {
@@ -205,7 +205,7 @@ var ColumnHeader = function ColumnHeader() {
205
205
  cod = true;
206
206
  tempStartPoint = startPoint;
207
207
  while (cod) {
208
- tempStartPoint += 1;
208
+ tempStartPoint = Number(tempStartPoint) + 1;
209
209
  if (colhiddenData === null || colhiddenData === void 0 ? void 0 : colhiddenData.hasOwnProperty(tempStartPoint)) {
210
210
  endCol = tempStartPoint;
211
211
  } else {
@@ -193,7 +193,7 @@ var RowHeader = function RowHeader() {
193
193
  var cod = true;
194
194
  var tempStartPoint = startPoint;
195
195
  while (cod) {
196
- tempStartPoint -= 1;
196
+ tempStartPoint = Number(tempStartPoint) - 1;
197
197
  if (rowhiddenData === null || rowhiddenData === void 0 ? void 0 : rowhiddenData.hasOwnProperty(tempStartPoint)) {
198
198
  startRow = tempStartPoint;
199
199
  } else {
@@ -203,7 +203,7 @@ var RowHeader = function RowHeader() {
203
203
  cod = true;
204
204
  tempStartPoint = startPoint;
205
205
  while (cod) {
206
- tempStartPoint += 1;
206
+ tempStartPoint = Number(tempStartPoint) + 1;
207
207
  if (rowhiddenData === null || rowhiddenData === void 0 ? void 0 : rowhiddenData.hasOwnProperty(tempStartPoint)) {
208
208
  endRow = tempStartPoint;
209
209
  } else {
@@ -605,10 +605,10 @@ var Toolbar = function Toolbar(_a) {
605
605
  var _o = (0, _react.useState)(false),
606
606
  showDataValidation = _o[0],
607
607
  setShowDataValidation = _o[1];
608
- var dataVerificationClick = function dataVerificationClick() {
608
+ var dataVerificationClick = function dataVerificationClick(selectedCells) {
609
609
  var _a;
610
610
  var selection = _fortuneCore.api.getSelection(context);
611
- if (!selection) {
611
+ if (!selection && !selectedCells) {
612
612
  setContext(function (ctx) {
613
613
  _fortuneCore.api.setSelection(ctx, [{
614
614
  row: [0, 0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
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.19",
19
+ "@fileverse-dev/fortune-core": "1.2.21",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",