@fileverse-dev/fortune-react 1.1.98 → 1.1.99-patch-1
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/DataVerification/DropdownOption.js +3 -0
- package/es/components/SheetOverlay/InputBox.js +1 -1
- package/es/components/SheetOverlay/drag_and_drop/column-helpers.js +20 -18
- package/es/components/SheetOverlay/drag_and_drop/row-helpers.js +20 -18
- package/es/components/SheetOverlay/helper.d.ts +0 -1
- package/es/components/SheetOverlay/helper.js +3 -16
- package/es/components/Toolbar/index.d.ts +1 -1
- package/es/components/Toolbar/index.js +1 -1
- package/lib/components/DataVerification/DropdownOption.js +3 -0
- package/lib/components/SheetOverlay/InputBox.js +1 -1
- package/lib/components/SheetOverlay/drag_and_drop/column-helpers.js +20 -18
- package/lib/components/SheetOverlay/drag_and_drop/row-helpers.js +20 -18
- package/lib/components/SheetOverlay/helper.d.ts +0 -1
- package/lib/components/SheetOverlay/helper.js +3 -17
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/components/Toolbar/index.js +1 -1
- package/package.json +2 -2
|
@@ -241,6 +241,9 @@ var DynamicInputList = function DynamicInputList(_a) {
|
|
|
241
241
|
e.target.focus();
|
|
242
242
|
},
|
|
243
243
|
key: item.id,
|
|
244
|
+
onKeyDown: function onKeyDown(e) {
|
|
245
|
+
e.stopPropagation();
|
|
246
|
+
},
|
|
244
247
|
className: "w-full",
|
|
245
248
|
placeholder: "Option ".concat(index + 1),
|
|
246
249
|
value: item.value,
|
|
@@ -495,7 +495,7 @@ var InputBox = function InputBox() {
|
|
|
495
495
|
minHeight: firstSelection.height
|
|
496
496
|
}, inputBoxStyle) : {}
|
|
497
497
|
}, /*#__PURE__*/React.createElement(ContentEditable, {
|
|
498
|
-
onMouseUp: function onMouseUp(
|
|
498
|
+
onMouseUp: function onMouseUp() {
|
|
499
499
|
var currentCommaCount = countCommasBeforeCursor(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
|
|
500
500
|
setCommaCount(currentCommaCount);
|
|
501
501
|
},
|
|
@@ -272,24 +272,26 @@ export var useColumnDragAndDrop = function useColumnDragAndDrop(containerRef, se
|
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
});
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
275
|
+
if (_sheet.dataVerification) {
|
|
276
|
+
var newDataVerification_1 = {};
|
|
277
|
+
Object.keys(_sheet.dataVerification).forEach(function (item) {
|
|
278
|
+
var _a;
|
|
279
|
+
var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
|
|
280
|
+
var colRow = item.split("_");
|
|
281
|
+
if (colRow.length !== 2) return;
|
|
282
|
+
var presentcol = parseInt(colRow[1], 10);
|
|
283
|
+
var updatedCol = presentcol;
|
|
284
|
+
if (presentcol === sourceIndex_1) {
|
|
285
|
+
updatedCol = targetIndex;
|
|
286
|
+
} else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
|
|
287
|
+
updatedCol -= 1;
|
|
288
|
+
} else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
|
|
289
|
+
updatedCol += 1;
|
|
290
|
+
}
|
|
291
|
+
newDataVerification_1["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
|
|
292
|
+
});
|
|
293
|
+
_sheet.dataVerification = newDataVerification_1;
|
|
294
|
+
}
|
|
293
295
|
(_c = _sheet.calcChain) === null || _c === void 0 ? void 0 : _c.forEach(function (item) {
|
|
294
296
|
if (item.c === sourceIndex_1) {
|
|
295
297
|
item.c = targetIndex;
|
|
@@ -253,24 +253,26 @@ export var useRowDragAndDrop = function useRowDragAndDrop(containerRef, selected
|
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
256
|
+
if (_sheet.dataVerification) {
|
|
257
|
+
var newDataVerification_1 = {};
|
|
258
|
+
Object.keys(_sheet.dataVerification).forEach(function (item) {
|
|
259
|
+
var _a;
|
|
260
|
+
var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
|
|
261
|
+
var colRow = item.split("_");
|
|
262
|
+
if (colRow.length !== 2) return;
|
|
263
|
+
var presentRow = parseInt(colRow[0], 10);
|
|
264
|
+
var updatedRow = presentRow;
|
|
265
|
+
if (presentRow === sourceIndex_1) {
|
|
266
|
+
updatedRow = targetIndex;
|
|
267
|
+
} else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
|
|
268
|
+
updatedRow -= 1;
|
|
269
|
+
} else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
|
|
270
|
+
updatedRow += 1;
|
|
271
|
+
}
|
|
272
|
+
newDataVerification_1["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
|
|
273
|
+
});
|
|
274
|
+
_sheet.dataVerification = newDataVerification_1;
|
|
275
|
+
}
|
|
274
276
|
(_a = _sheet.calcChain) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
|
|
275
277
|
if (item.r === sourceIndex_1) {
|
|
276
278
|
item.r = targetIndex;
|
|
@@ -6,5 +6,4 @@ export declare function incrementColumn(cell: string): string;
|
|
|
6
6
|
export declare function decrementColumn(cell: string): string;
|
|
7
7
|
export declare function incrementRow(cell: string): string;
|
|
8
8
|
export declare function decrementRow(cell: string): string;
|
|
9
|
-
export declare function countCommasOutsideQuotes(str: string): number;
|
|
10
9
|
export declare function countCommasBeforeCursor(editableDiv: HTMLDivElement): number;
|
|
@@ -84,19 +84,6 @@ export function decrementRow(cell) {
|
|
|
84
84
|
var newRowPart = Math.max(1, parsed.rowPart - 1);
|
|
85
85
|
return parsed.colPart + newRowPart;
|
|
86
86
|
}
|
|
87
|
-
export function countCommasOutsideQuotes(str) {
|
|
88
|
-
var inQuotes = false;
|
|
89
|
-
var count = 0;
|
|
90
|
-
for (var i = 0; i < str.length; i++) {
|
|
91
|
-
var char = str[i];
|
|
92
|
-
if (char === '"') {
|
|
93
|
-
inQuotes = !inQuotes;
|
|
94
|
-
} else if (char === ',' && !inQuotes) {
|
|
95
|
-
count++;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return count;
|
|
99
|
-
}
|
|
100
87
|
export function countCommasBeforeCursor(editableDiv) {
|
|
101
88
|
var selection = window.getSelection();
|
|
102
89
|
if (!(selection === null || selection === void 0 ? void 0 : selection.rangeCount)) return 0;
|
|
@@ -107,12 +94,12 @@ export function countCommasBeforeCursor(editableDiv) {
|
|
|
107
94
|
var textBeforeCursor = preCaretRange.toString();
|
|
108
95
|
var inQuotes = false;
|
|
109
96
|
var count = 0;
|
|
110
|
-
for (var i = 0; i < textBeforeCursor.length; i
|
|
97
|
+
for (var i = 0; i < textBeforeCursor.length; i += 1) {
|
|
111
98
|
var char = textBeforeCursor[i];
|
|
112
99
|
if (char === '"') {
|
|
113
100
|
inQuotes = !inQuotes;
|
|
114
|
-
} else if (char ===
|
|
115
|
-
count
|
|
101
|
+
} else if (char === "," && !inQuotes) {
|
|
102
|
+
count += 1;
|
|
116
103
|
}
|
|
117
104
|
}
|
|
118
105
|
return count;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Cell } from "@fileverse-dev/fortune-core";
|
|
3
3
|
import "./index.css";
|
|
4
|
-
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "
|
|
4
|
+
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
|
|
5
5
|
export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
|
|
6
6
|
cell: Cell | null | undefined;
|
|
7
7
|
defaultTextFormat: string;
|
|
@@ -124,7 +124,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
124
124
|
};
|
|
125
125
|
import React, { useContext, useCallback, useRef, useEffect, useState } from "react";
|
|
126
126
|
import { toolbarItemClickHandler, handleTextBackground, handleTextColor, handleTextSize, normalizedCellAttr, getFlowdata, newComment, editComment, deleteComment, showHideComment, showHideAllComments, autoSelectionFormula, handleSum, locale, handleMerge, handleBorder, toolbarItemSelectedFunc, handleFreeze, insertImage, showImgChooser, updateFormat, handleSort, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, createFilter, clearFilter, applyLocation, insertDuneChart } from "@fileverse-dev/fortune-core";
|
|
127
|
-
import { setSelection, getSelection } from "@fileverse-dev/fortune-core/
|
|
127
|
+
import { setSelection, getSelection } from "@fileverse-dev/fortune-core/src/api";
|
|
128
128
|
import _ from "lodash";
|
|
129
129
|
import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
|
|
130
130
|
import DataVerificationPortal from "./dataVerificationPortal";
|
|
@@ -248,6 +248,9 @@ var DynamicInputList = function DynamicInputList(_a) {
|
|
|
248
248
|
e.target.focus();
|
|
249
249
|
},
|
|
250
250
|
key: item.id,
|
|
251
|
+
onKeyDown: function onKeyDown(e) {
|
|
252
|
+
e.stopPropagation();
|
|
253
|
+
},
|
|
251
254
|
className: "w-full",
|
|
252
255
|
placeholder: "Option ".concat(index + 1),
|
|
253
256
|
value: item.value,
|
|
@@ -504,7 +504,7 @@ var InputBox = function InputBox() {
|
|
|
504
504
|
minHeight: firstSelection.height
|
|
505
505
|
}, inputBoxStyle) : {}
|
|
506
506
|
}, /*#__PURE__*/_react.default.createElement(_ContentEditable.default, {
|
|
507
|
-
onMouseUp: function onMouseUp(
|
|
507
|
+
onMouseUp: function onMouseUp() {
|
|
508
508
|
var currentCommaCount = (0, _helper.countCommasBeforeCursor)(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
|
|
509
509
|
setCommaCount(currentCommaCount);
|
|
510
510
|
},
|
|
@@ -280,24 +280,26 @@ var useColumnDragAndDrop = exports.useColumnDragAndDrop = function useColumnDrag
|
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
283
|
+
if (_sheet.dataVerification) {
|
|
284
|
+
var newDataVerification_1 = {};
|
|
285
|
+
Object.keys(_sheet.dataVerification).forEach(function (item) {
|
|
286
|
+
var _a;
|
|
287
|
+
var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
|
|
288
|
+
var colRow = item.split("_");
|
|
289
|
+
if (colRow.length !== 2) return;
|
|
290
|
+
var presentcol = parseInt(colRow[1], 10);
|
|
291
|
+
var updatedCol = presentcol;
|
|
292
|
+
if (presentcol === sourceIndex_1) {
|
|
293
|
+
updatedCol = targetIndex;
|
|
294
|
+
} else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
|
|
295
|
+
updatedCol -= 1;
|
|
296
|
+
} else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
|
|
297
|
+
updatedCol += 1;
|
|
298
|
+
}
|
|
299
|
+
newDataVerification_1["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
|
|
300
|
+
});
|
|
301
|
+
_sheet.dataVerification = newDataVerification_1;
|
|
302
|
+
}
|
|
301
303
|
(_c = _sheet.calcChain) === null || _c === void 0 ? void 0 : _c.forEach(function (item) {
|
|
302
304
|
if (item.c === sourceIndex_1) {
|
|
303
305
|
item.c = targetIndex;
|
|
@@ -260,24 +260,26 @@ var useRowDragAndDrop = exports.useRowDragAndDrop = function useRowDragAndDrop(c
|
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
});
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
263
|
+
if (_sheet.dataVerification) {
|
|
264
|
+
var newDataVerification_1 = {};
|
|
265
|
+
Object.keys(_sheet.dataVerification).forEach(function (item) {
|
|
266
|
+
var _a;
|
|
267
|
+
var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
|
|
268
|
+
var colRow = item.split("_");
|
|
269
|
+
if (colRow.length !== 2) return;
|
|
270
|
+
var presentRow = parseInt(colRow[0], 10);
|
|
271
|
+
var updatedRow = presentRow;
|
|
272
|
+
if (presentRow === sourceIndex_1) {
|
|
273
|
+
updatedRow = targetIndex;
|
|
274
|
+
} else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
|
|
275
|
+
updatedRow -= 1;
|
|
276
|
+
} else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
|
|
277
|
+
updatedRow += 1;
|
|
278
|
+
}
|
|
279
|
+
newDataVerification_1["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
|
|
280
|
+
});
|
|
281
|
+
_sheet.dataVerification = newDataVerification_1;
|
|
282
|
+
}
|
|
281
283
|
(_a = _sheet.calcChain) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
|
|
282
284
|
if (item.r === sourceIndex_1) {
|
|
283
285
|
item.r = targetIndex;
|
|
@@ -6,5 +6,4 @@ export declare function incrementColumn(cell: string): string;
|
|
|
6
6
|
export declare function decrementColumn(cell: string): string;
|
|
7
7
|
export declare function incrementRow(cell: string): string;
|
|
8
8
|
export declare function decrementRow(cell: string): string;
|
|
9
|
-
export declare function countCommasOutsideQuotes(str: string): number;
|
|
10
9
|
export declare function countCommasBeforeCursor(editableDiv: HTMLDivElement): number;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.countCommasBeforeCursor = countCommasBeforeCursor;
|
|
7
|
-
exports.countCommasOutsideQuotes = countCommasOutsideQuotes;
|
|
8
7
|
exports.decrementColumn = decrementColumn;
|
|
9
8
|
exports.decrementRow = decrementRow;
|
|
10
9
|
exports.getCursorPosition = getCursorPosition;
|
|
@@ -99,19 +98,6 @@ function decrementRow(cell) {
|
|
|
99
98
|
var newRowPart = Math.max(1, parsed.rowPart - 1);
|
|
100
99
|
return parsed.colPart + newRowPart;
|
|
101
100
|
}
|
|
102
|
-
function countCommasOutsideQuotes(str) {
|
|
103
|
-
var inQuotes = false;
|
|
104
|
-
var count = 0;
|
|
105
|
-
for (var i = 0; i < str.length; i++) {
|
|
106
|
-
var char = str[i];
|
|
107
|
-
if (char === '"') {
|
|
108
|
-
inQuotes = !inQuotes;
|
|
109
|
-
} else if (char === ',' && !inQuotes) {
|
|
110
|
-
count++;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return count;
|
|
114
|
-
}
|
|
115
101
|
function countCommasBeforeCursor(editableDiv) {
|
|
116
102
|
var selection = window.getSelection();
|
|
117
103
|
if (!(selection === null || selection === void 0 ? void 0 : selection.rangeCount)) return 0;
|
|
@@ -122,12 +108,12 @@ function countCommasBeforeCursor(editableDiv) {
|
|
|
122
108
|
var textBeforeCursor = preCaretRange.toString();
|
|
123
109
|
var inQuotes = false;
|
|
124
110
|
var count = 0;
|
|
125
|
-
for (var i = 0; i < textBeforeCursor.length; i
|
|
111
|
+
for (var i = 0; i < textBeforeCursor.length; i += 1) {
|
|
126
112
|
var char = textBeforeCursor[i];
|
|
127
113
|
if (char === '"') {
|
|
128
114
|
inQuotes = !inQuotes;
|
|
129
|
-
} else if (char ===
|
|
130
|
-
count
|
|
115
|
+
} else if (char === "," && !inQuotes) {
|
|
116
|
+
count += 1;
|
|
131
117
|
}
|
|
132
118
|
}
|
|
133
119
|
return count;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Cell } from "@fileverse-dev/fortune-core";
|
|
3
3
|
import "./index.css";
|
|
4
|
-
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "
|
|
4
|
+
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
|
|
5
5
|
export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
|
|
6
6
|
cell: Cell | null | undefined;
|
|
7
7
|
defaultTextFormat: string;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getLucideIcon = exports.default = exports.CurrencySelector = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
10
|
-
var _api = require("@fileverse-dev/fortune-core/
|
|
10
|
+
var _api = require("@fileverse-dev/fortune-core/src/api");
|
|
11
11
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
12
|
var _ui = require("@fileverse/ui");
|
|
13
13
|
var _dataVerificationPortal = _interopRequireDefault(require("./dataVerificationPortal"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.99-patch-1",
|
|
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.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.99-patch-1",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|