@fileverse-dev/fortune-react 1.1.98 → 1.1.99-patch-3

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 (43) hide show
  1. package/es/components/ContextMenu/index.js +2 -2
  2. package/es/components/DataVerification/ColorPicker.js +31 -7
  3. package/es/components/DataVerification/DropdownList.js +20 -1
  4. package/es/components/DataVerification/DropdownOption.js +8 -2
  5. package/es/components/DataVerification/RangeDialog.js +0 -2
  6. package/es/components/DataVerification/index.css +20 -0
  7. package/es/components/DataVerification/index.js +29 -5
  8. package/es/components/SheetOverlay/ColumnHeader.js +88 -5
  9. package/es/components/SheetOverlay/FormulaHint/index.js +13 -2
  10. package/es/components/SheetOverlay/InputBox.js +1 -1
  11. package/es/components/SheetOverlay/RowHeader.js +82 -5
  12. package/es/components/SheetOverlay/drag_and_drop/column-helpers.js +20 -18
  13. package/es/components/SheetOverlay/drag_and_drop/row-helpers.js +20 -18
  14. package/es/components/SheetOverlay/helper.d.ts +0 -1
  15. package/es/components/SheetOverlay/helper.js +3 -16
  16. package/es/components/SheetOverlay/index.css +24 -1
  17. package/es/components/Toolbar/index.d.ts +1 -1
  18. package/es/components/Toolbar/index.js +23 -19
  19. package/es/components/Workbook/api.d.ts +1 -1
  20. package/es/components/Workbook/index.d.ts +10 -10
  21. package/es/components/Workbook/index.js +5 -0
  22. package/lib/components/ContextMenu/index.js +2 -2
  23. package/lib/components/DataVerification/ColorPicker.js +30 -6
  24. package/lib/components/DataVerification/DropdownList.js +20 -1
  25. package/lib/components/DataVerification/DropdownOption.js +8 -2
  26. package/lib/components/DataVerification/RangeDialog.js +0 -2
  27. package/lib/components/DataVerification/index.css +20 -0
  28. package/lib/components/DataVerification/index.js +29 -5
  29. package/lib/components/SheetOverlay/ColumnHeader.js +87 -4
  30. package/lib/components/SheetOverlay/FormulaHint/index.js +13 -2
  31. package/lib/components/SheetOverlay/InputBox.js +1 -1
  32. package/lib/components/SheetOverlay/RowHeader.js +81 -4
  33. package/lib/components/SheetOverlay/drag_and_drop/column-helpers.js +20 -18
  34. package/lib/components/SheetOverlay/drag_and_drop/row-helpers.js +20 -18
  35. package/lib/components/SheetOverlay/helper.d.ts +0 -1
  36. package/lib/components/SheetOverlay/helper.js +3 -17
  37. package/lib/components/SheetOverlay/index.css +24 -1
  38. package/lib/components/Toolbar/index.d.ts +1 -1
  39. package/lib/components/Toolbar/index.js +23 -19
  40. package/lib/components/Workbook/api.d.ts +1 -1
  41. package/lib/components/Workbook/index.d.ts +10 -10
  42. package/lib/components/Workbook/index.js +5 -0
  43. package/package.json +2 -2
@@ -253,24 +253,26 @@ export var useRowDragAndDrop = function useRowDragAndDrop(containerRef, selected
253
253
  }
254
254
  });
255
255
  });
256
- var newDataVerification = {};
257
- Object.keys(_sheet.dataVerification).forEach(function (item) {
258
- var _a;
259
- var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
260
- var colRow = item.split("_");
261
- if (colRow.length !== 2) return;
262
- var presentRow = parseInt(colRow[0], 10);
263
- var updatedRow = presentRow;
264
- if (presentRow === sourceIndex_1) {
265
- updatedRow = targetIndex;
266
- } else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
267
- updatedRow -= 1;
268
- } else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
269
- updatedRow += 1;
270
- }
271
- newDataVerification["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
272
- });
273
- _sheet.dataVerification = newDataVerification;
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 === ',' && !inQuotes) {
115
- count++;
101
+ } else if (char === "," && !inQuotes) {
102
+ count += 1;
116
103
  }
117
104
  }
118
105
  return count;
@@ -1010,4 +1010,27 @@
1010
1010
  background: #555;
1011
1011
  /* darker on hover */
1012
1012
  /* scrollbar */
1013
- }
1013
+ }
1014
+
1015
+ .hide-btn {
1016
+ padding-top: 1px;
1017
+ position: absolute;
1018
+ right: 5;
1019
+ top: 5px;
1020
+ z-index: 200;
1021
+ width: 9px;
1022
+ }
1023
+
1024
+ .hide-btn:hover {
1025
+ border: 1px solid #0188fb;
1026
+ }
1027
+
1028
+ .rotate-row-icon {
1029
+ transform: rotate(-90deg);
1030
+ }
1031
+
1032
+ .hide-btn-row {
1033
+ position: absolute;
1034
+ left: 4px;
1035
+ z-index: 200;
1036
+ }
@@ -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" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis";
4
+ export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "" | "Percent" | "ChevronDown" | "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/lib/api";
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";
@@ -588,6 +588,27 @@ var Toolbar = function Toolbar(_a) {
588
588
  var _o = useState(false),
589
589
  showDataValidation = _o[0],
590
590
  setShowDataValidation = _o[1];
591
+ var dataVerificationClick = function dataVerificationClick() {
592
+ var _a;
593
+ var selection = getSelection(context);
594
+ if (!selection) {
595
+ setContext(function (ctx) {
596
+ setSelection(ctx, [{
597
+ row: [0, 0],
598
+ column: [0, 0]
599
+ }], {
600
+ id: context.currentSheetId
601
+ });
602
+ });
603
+ }
604
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
605
+ setTimeout(function () {
606
+ setShowDataValidation(true);
607
+ }, 100);
608
+ };
609
+ useEffect(function () {
610
+ window.dataVerificationClick = dataVerificationClick;
611
+ }, []);
591
612
  var getToolbarItem = useCallback(function (name, i) {
592
613
  var _a, _b, _c, _d, _e, _f, _g;
593
614
  var tooltip = toolbar[name];
@@ -970,24 +991,7 @@ var Toolbar = function Toolbar(_a) {
970
991
  iconId: name,
971
992
  tooltip: tooltip,
972
993
  key: name,
973
- onClick: function onClick() {
974
- var _a;
975
- var selection = getSelection(context);
976
- if (!selection) {
977
- setContext(function (ctx) {
978
- setSelection(ctx, [{
979
- row: [0, 0],
980
- column: [0, 0]
981
- }], {
982
- id: context.currentSheetId
983
- });
984
- });
985
- }
986
- (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
987
- setTimeout(function () {
988
- setShowDataValidation(true);
989
- }, 100);
990
- }
994
+ onClick: dataVerificationClick
991
995
  }));
992
996
  }
993
997
  if (name === "locationCondition") {
@@ -109,7 +109,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
109
109
  dynamicArray_compute?: any;
110
110
  dynamicArray?: any[] | undefined;
111
111
  frozen?: {
112
- type: "column" | "rangeColumn" | "rangeBoth" | "both" | "row" | "rangeRow";
112
+ type: "row" | "column" | "both" | "rangeRow" | "rangeColumn" | "rangeBoth";
113
113
  range?: {
114
114
  row_focus: number;
115
115
  column_focus: number;
@@ -12,30 +12,30 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
12
12
  applyOp: (ops: Op[]) => void;
13
13
  getCryptoPrice: typeof getCryptoPrice;
14
14
  getCellValue: (row: number, column: number, options?: api.CommonOptions & {
15
- type?: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
15
+ type?: "m" | "mc" | "rt" | "v" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | "error" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
16
16
  }) => any;
17
17
  onboardingActiveCell: (functionName: string) => void;
18
18
  initializeComment: (row: number, column: number) => void;
19
19
  updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
20
20
  removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
21
21
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
22
- type?: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
22
+ type?: "m" | "mc" | "rt" | "v" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | "error" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
23
23
  }) => void;
24
24
  setCellError: (row: number, column: number, errorMessage: {
25
25
  title: string;
26
26
  message: string;
27
27
  }) => void;
28
28
  clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
29
- setCellFormat: (row: number, column: number, attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
29
+ setCellFormat: (row: number, column: number, attr: "m" | "mc" | "rt" | "v" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | "error" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
30
30
  autoFillCell: (copyRange: import("@fileverse-dev/fortune-core").SingleRange, applyRange: import("@fileverse-dev/fortune-core").SingleRange, direction: "left" | "right" | "down" | "up") => void;
31
- freeze: (type: "column" | "both" | "row", range: {
31
+ freeze: (type: "row" | "column" | "both", range: {
32
32
  row: number;
33
33
  column: number;
34
34
  }, options?: api.CommonOptions) => void;
35
- insertRowOrColumn: (type: "column" | "row", index: number, count: number, direction?: "lefttop" | "rightbottom", options?: api.CommonOptions) => void;
36
- deleteRowOrColumn: (type: "column" | "row", start: number, end: number, options?: api.CommonOptions) => void;
37
- hideRowOrColumn: (rowOrColInfo: string[], type: "column" | "row") => void;
38
- showRowOrColumn: (rowOrColInfo: string[], type: "column" | "row") => void;
35
+ insertRowOrColumn: (type: "row" | "column", index: number, count: number, direction?: "lefttop" | "rightbottom", options?: api.CommonOptions) => void;
36
+ deleteRowOrColumn: (type: "row" | "column", start: number, end: number, options?: api.CommonOptions) => void;
37
+ hideRowOrColumn: (rowOrColInfo: string[], type: "row" | "column") => void;
38
+ showRowOrColumn: (rowOrColInfo: string[], type: "row" | "column") => void;
39
39
  setRowHeight: (rowInfo: Record<string, number>, options?: api.CommonOptions, custom?: boolean) => void;
40
40
  setColumnWidth: (columnInfo: Record<string, number>, options?: api.CommonOptions, custom?: boolean) => void;
41
41
  getRowHeight: (rows: number[], options?: api.CommonOptions) => Record<number, number>;
@@ -57,7 +57,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
57
57
  getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
58
58
  setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
59
59
  setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
60
- setCellFormatByRange: (attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
60
+ setCellFormatByRange: (attr: "m" | "mc" | "rt" | "v" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | "error" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
61
61
  mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
62
62
  cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
63
63
  getAllSheets: () => SheetType[];
@@ -116,7 +116,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
116
116
  dynamicArray_compute?: any;
117
117
  dynamicArray?: any[] | undefined;
118
118
  frozen?: {
119
- type: "column" | "rangeColumn" | "rangeBoth" | "both" | "row" | "rangeRow";
119
+ type: "row" | "column" | "both" | "rangeRow" | "rangeColumn" | "rangeBoth";
120
120
  range?: {
121
121
  row_focus: number;
122
122
  column_focus: number;
@@ -647,6 +647,11 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
647
647
  }
648
648
  });
649
649
  }
650
+ setContextWithProduce(function (ctx) {
651
+ if (ctx.luckysheet_selection_range) {
652
+ ctx.luckysheet_selection_range = [];
653
+ }
654
+ });
650
655
  }, [context, setContextWithProduce]);
651
656
  var onMoreToolbarItemsClose = useCallback(function () {
652
657
  setMoreToolbarItems(null);
@@ -642,7 +642,7 @@ var ContextMenu = function ContextMenu() {
642
642
  }), /*#__PURE__*/_react.default.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
643
643
  }
644
644
  if (name === "hide-row") {
645
- return (selection === null || selection === void 0 ? void 0 : selection.row_select) === true && ["hideSelected", "showHide"].map(function (item) {
645
+ return (selection === null || selection === void 0 ? void 0 : selection.row_select) && ["hideSelected", "showHide"].map(function (item) {
646
646
  return /*#__PURE__*/_react.default.createElement(_Menu.default, {
647
647
  key: item,
648
648
  onClick: function onClick() {
@@ -1086,7 +1086,7 @@ var ContextMenu = function ContextMenu() {
1086
1086
  left: contextMenu.x,
1087
1087
  top: contextMenu.y
1088
1088
  }
1089
- }, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
1089
+ }, context.contextMenu.headerMenu === true || context.contextMenu.headerMenu === "row" ? settings.headerContextMenu.map(function (menu, i) {
1090
1090
  return getMenuElement(menu, i);
1091
1091
  }) : settings.cellContextMenu.map(function (menu, i) {
1092
1092
  return getMenuElement(menu, i);
@@ -65,7 +65,9 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
65
65
  }, /*#__PURE__*/_react.default.createElement("div", {
66
66
  className: "flex items-center justify-between color-picker rounded transition-all cursor-pointer border border-gray-300",
67
67
  style: {
68
- padding: "7px"
68
+ padding: "7px",
69
+ border: "var(--border-width-md, 1px) solid hsl(var(--color-border-default, #E8EBEC))",
70
+ borderRadius: "var(--border-radius-sm, 4px)"
69
71
  }
70
72
  }, /*#__PURE__*/_react.default.createElement("div", {
71
73
  className: "flex items-center gap-3 color-text-secondary"
@@ -80,7 +82,7 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
80
82
  })))), /*#__PURE__*/_react.default.createElement(_ui.PopoverContent, {
81
83
  align: "start",
82
84
  alignOffset: 0,
83
- className: "w-[200px] export-content-popover",
85
+ className: "color-picker-container",
84
86
  elevation: 2,
85
87
  side: "bottom",
86
88
  sideOffset: 4
@@ -89,18 +91,40 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
89
91
  }, /*#__PURE__*/_react.default.createElement("div", {
90
92
  className: "flex gap-2 flex-wrap w-full"
91
93
  }, TEXT_COLORS.map(function (color) {
92
- return /*#__PURE__*/_react.default.createElement("button", {
94
+ return /*#__PURE__*/_react.default.createElement("div", {
95
+ key: color.value,
96
+ className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
97
+ style: {
98
+ border: "".concat(color.value) === trigerColor ? "2px solid rgb(".concat(color.value, ")") : "none",
99
+ padding: "2px"
100
+ }
101
+ }, /*#__PURE__*/_react.default.createElement("button", {
93
102
  type: "button",
94
103
  key: color.value,
95
104
  onClick: function onClick() {
96
105
  onPick(color.value);
97
106
  setIsOpen(false);
98
107
  },
99
- className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
108
+ className: "w-full h-full rounded-full transition-all hover:scale-110 hover:shadow-md",
100
109
  style: {
101
110
  backgroundColor: "rgb(".concat(color.value, ")")
102
111
  },
103
112
  title: color.name
104
- });
105
- })))));
113
+ }));
114
+ }), /*#__PURE__*/_react.default.createElement("div", {
115
+ className: "w-full flex justify-center",
116
+ onClick: function onClick() {
117
+ onPick("228, 232, 237");
118
+ setIsOpen(false);
119
+ }
120
+ }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
121
+ icon: "DropletOff",
122
+ size: "md",
123
+ variant: "ghost",
124
+ className: "color-picker-icon"
125
+ }), /*#__PURE__*/_react.default.createElement(_ui.Button, {
126
+ size: "md",
127
+ variant: "ghost",
128
+ className: "color-picker-reset"
129
+ }, "Reset"))))));
106
130
  };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _fortuneCore = require("@fileverse-dev/fortune-core");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _ui = require("@fileverse/ui");
10
11
  var _context = _interopRequireDefault(require("../../context"));
11
12
  var _useOutsideClick = require("../../hooks/useOutsideClick");
12
13
  var _SVGIcon = _interopRequireDefault(require("../SVGIcon"));
@@ -154,6 +155,24 @@ var DropDownList = function DropDownList() {
154
155
  display: isMul && selected.indexOf(v) >= 0 ? "inline" : "none"
155
156
  }
156
157
  }), v);
157
- }));
158
+ }), /*#__PURE__*/_react.default.createElement("div", {
159
+ className: "w-full flex align-center",
160
+ style: {
161
+ height: "28px"
162
+ }
163
+ }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
164
+ icon: "Pencil",
165
+ size: "sm",
166
+ variant: "ghost",
167
+ className: "color-picker-icon pt-2"
168
+ }), /*#__PURE__*/_react.default.createElement(_ui.Button, {
169
+ size: "md",
170
+ variant: "ghost",
171
+ className: "color-picker-reset",
172
+ onClick: function onClick() {
173
+ var _a;
174
+ (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window);
175
+ }
176
+ }, "Edit")));
158
177
  };
159
178
  var _default = exports.default = DropDownList;
@@ -181,7 +181,7 @@ var DynamicInputList = function DynamicInputList(_a) {
181
181
  }, optionItems.map(function (item, index) {
182
182
  return /*#__PURE__*/_react.default.createElement("li", {
183
183
  key: item.id,
184
- className: (0, _ui.cn)("relative flex optionItems-center gap-3 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
184
+ className: (0, _ui.cn)("relative flex optionItems-center gap-2 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
185
185
  onDragOver: function onDragOver(e) {
186
186
  return onDragOverRow(index, e);
187
187
  },
@@ -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,
@@ -273,7 +276,10 @@ var DynamicInputList = function DynamicInputList(_a) {
273
276
  }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
274
277
  variant: "secondary",
275
278
  onClick: handleAdd,
276
- className: ""
279
+ size: "sm",
280
+ style: {
281
+ fontWeight: 500
282
+ }
277
283
  }, "Add another item")));
278
284
  };
279
285
  var _default = exports.default = DynamicInputList;
@@ -8,7 +8,6 @@ exports.default = void 0;
8
8
  var _fortuneCore = require("@fileverse-dev/fortune-core");
9
9
  var _ui = require("@fileverse/ui");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _ = _interopRequireDefault(require("."));
12
11
  var _context = _interopRequireDefault(require("../../context"));
13
12
  var _useDialog = require("../../hooks/useDialog");
14
13
  var _ConditionRules = _interopRequireDefault(require("../ConditionFormat/ConditionRules"));
@@ -48,7 +47,6 @@ var RangeDialog = function RangeDialog() {
48
47
  }), undefined, (0, _fortuneCore.locale)(context).conditionformat["conditionformat_".concat(rulesType)]);
49
48
  return;
50
49
  }
51
- showDialog(/*#__PURE__*/_react.default.createElement(_.default, null), undefined, toolbar.dataVerification);
52
50
  }, [setContext, showDialog, context]);
53
51
  (0, _react.useEffect)(function () {
54
52
  setRangeTxt2((0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context));
@@ -203,4 +203,24 @@
203
203
 
204
204
  .color-picker:hover {
205
205
  background: hsl(var(--color-bg-default-hover, #F2F4F5));
206
+ }
207
+
208
+ .color-picker-container {
209
+ border: 1px solid hsl(var(--color-border-default, #E8EBEC)) !important;
210
+ box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.15);
211
+ width: 230px !important;
212
+ }
213
+
214
+ .color-picker-reset {
215
+ min-width: 0px;
216
+ padding-left: 0px;
217
+ margin-left: 0px;
218
+ }
219
+
220
+ .color-picker-reset:hover {
221
+ background-color: white;
222
+ }
223
+
224
+ .color-picker-icon:hover {
225
+ background-color: white;
206
226
  }
@@ -93,6 +93,14 @@ var DataVerification = function DataVerification() {
93
93
  }));
94
94
  }
95
95
  }, []);
96
+ var dataSelectRange = (0, _react.useCallback)(function (type, value) {
97
+ hideDialog();
98
+ setContext(function (ctx) {
99
+ ctx.rangeDialog.show = true;
100
+ ctx.rangeDialog.type = type;
101
+ ctx.rangeDialog.rangeTxt = value;
102
+ });
103
+ }, [hideDialog, setContext]);
96
104
  var btn = (0, _react.useCallback)(function (type) {
97
105
  if (type === "confirm") {
98
106
  setContext(function (ctx) {
@@ -219,7 +227,7 @@ var DataVerification = function DataVerification() {
219
227
  return /*#__PURE__*/_react.default.createElement("div", {
220
228
  id: "fortune-data-verification"
221
229
  }, /*#__PURE__*/_react.default.createElement("div", {
222
- className: "flex flex-col gap-4",
230
+ className: "flex flex-col gap-4 h-[calc(100vh-270px)] overflow-y-auto no-scrollbar",
223
231
  style: {
224
232
  width: "345px",
225
233
  padding: "16px"
@@ -235,7 +243,17 @@ var DataVerification = function DataVerification() {
235
243
  }),
236
244
  "aria-hidden": "true",
237
245
  readOnly: true,
238
- value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt
246
+ value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt,
247
+ onChange: function onChange(e) {
248
+ var value = e.target.value;
249
+ setContext(function (ctx) {
250
+ ctx.dataVerification.dataRegulation.rangeTxt = value;
251
+ });
252
+ },
253
+ onClick: function onClick() {
254
+ hideDialog();
255
+ dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
256
+ }
239
257
  })), /*#__PURE__*/_react.default.createElement("div", {
240
258
  className: "flex flex-col"
241
259
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -280,7 +298,7 @@ var DataVerification = function DataVerification() {
280
298
  });
281
299
  }
282
300
  }), /*#__PURE__*/_react.default.createElement("span", {
283
- className: "ml-2"
301
+ className: "ml-2 text-body-sm"
284
302
  }, dataVerification.allowMultiSelect)))), ((_e = (_d = context.dataVerification) === null || _d === void 0 ? void 0 : _d.dataRegulation) === null || _e === void 0 ? void 0 : _e.type) === "checkbox" && (/*#__PURE__*/_react.default.createElement("div", {
285
303
  className: "mt-4 space-y-2"
286
304
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -396,7 +414,7 @@ var DataVerification = function DataVerification() {
396
414
  });
397
415
  }
398
416
  }), /*#__PURE__*/_react.default.createElement("span", {
399
- className: "ml-2"
417
+ className: "ml-2 text-body-sm"
400
418
  }, dataVerification[v]));
401
419
  }), ((_o = (_m = context.dataVerification) === null || _m === void 0 ? void 0 : _m.dataRegulation) === null || _o === void 0 ? void 0 : _o.hintShow) && (/*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
402
420
  placeholder: dataVerification.placeholder5,
@@ -408,7 +426,11 @@ var DataVerification = function DataVerification() {
408
426
  });
409
427
  }
410
428
  }))))), /*#__PURE__*/_react.default.createElement(_ui.Divider, {
411
- className: "w-full border-t-[1px] my-4"
429
+ className: "border-t-[1px]",
430
+ style: {
431
+ width: "315px",
432
+ margin: "0 16px 16px 16px"
433
+ }
412
434
  }), /*#__PURE__*/_react.default.createElement("div", {
413
435
  className: "flex gap-2 justify-between items-center",
414
436
  style: {
@@ -432,7 +454,9 @@ var DataVerification = function DataVerification() {
432
454
  minWidth: "80px"
433
455
  },
434
456
  onClick: function onClick() {
457
+ var _a;
435
458
  btn("confirm");
459
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
436
460
  }
437
461
  }, button.confirm))));
438
462
  };