@fileverse-dev/fortune-react 1.0.2-mod-40 → 1.0.2-mod-41-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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
1
+ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropdownValue, onIframeMoveStart, onIframeResizeStart, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, sanitizeDuneUrl, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, insertDuneChart, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
2
2
  import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
3
3
  import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
4
4
  import _ from 'lodash';
@@ -172,7 +172,7 @@ function _regenerator() {
172
172
  i = p[t],
173
173
  d = G.p,
174
174
  l = i[2];
175
- r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
175
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
176
176
  }
177
177
  if (o || r > 1) return a;
178
178
  throw y = !0, n;
@@ -784,12 +784,37 @@ var ContentEditable = function ContentEditable(_ref) {
784
784
  };
785
785
 
786
786
  var FormulaSearch = function FormulaSearch(props) {
787
+ var _context$luckysheet_s;
787
788
  var _useContext = useContext(WorkbookContext),
788
789
  context = _useContext.context;
790
+ var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
791
+ var hintRef = useRef(null);
792
+ var _useState = useState(0),
793
+ _useState2 = _slicedToArray(_useState, 2),
794
+ top = _useState2[0],
795
+ setTop = _useState2[1];
796
+ var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
797
+ var _hintRef$current;
798
+ if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
799
+ var hintHeight = hintRef.current.offsetHeight;
800
+ var inputBottom = firstSelection.top + firstSelection.height_move;
801
+ var availableBelow = window.innerHeight - inputBottom;
802
+ var hintAbove = hintHeight > availableBelow;
803
+ var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
804
+ var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
805
+ setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
806
+ };
807
+ useEffect(function () {
808
+ calcuatePopUpPlacement();
809
+ });
789
810
  if (_.isEmpty(context.functionCandidates)) return null;
790
811
  return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
812
+ ref: hintRef,
791
813
  id: "luckysheet-formula-search-c",
792
- className: "luckysheet-formula-search-c"
814
+ className: "luckysheet-formula-search-c",
815
+ style: {
816
+ top: top
817
+ }
793
818
  }), context.functionCandidates.map(function (v, index) {
794
819
  return /*#__PURE__*/React.createElement("div", {
795
820
  key: v.n,
@@ -801,52 +826,48 @@ var FormulaSearch = function FormulaSearch(props) {
801
826
  justifyContent: "space-between"
802
827
  }
803
828
  }, /*#__PURE__*/React.createElement("div", {
804
- className: "luckysheet-formula-search-func"
829
+ className: "luckysheet-formula-search-func text-body-sm"
805
830
  }, v.n), /*#__PURE__*/React.createElement("div", {
806
831
  style: {
807
832
  display: "flex",
833
+ justifyContent: "end",
834
+ width: "68px",
835
+ height: "20px",
836
+ alignItems: "center",
808
837
  gap: "4px"
809
838
  }
810
839
  }, v.LOGO && (/*#__PURE__*/React.createElement("img", {
811
840
  src: v.LOGO,
812
841
  alt: "Service Logo",
813
- width: 32,
814
- height: 32
842
+ style: {
843
+ width: "20px"
844
+ }
815
845
  })), v.API_KEY && (/*#__PURE__*/React.createElement("div", {
816
846
  style: {
817
847
  borderRadius: "4px",
818
- width: "20px",
819
- height: "20px",
820
- backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#F9A92B")
821
- }
848
+ backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#e8ebec"),
849
+ width: "16px",
850
+ height: "16px"
851
+ },
852
+ className: "flex justify-center"
822
853
  }, /*#__PURE__*/React.createElement(LucideIcon, {
823
854
  name: "Key",
824
855
  style: {
825
- color: "white"
856
+ color: localStorage.getItem(v.API_KEY) ? "white" : "#77818A",
857
+ width: "12px",
858
+ height: "12px"
826
859
  }
827
860
  }))))), /*#__PURE__*/React.createElement("div", {
828
- className: "luckysheet-formula-search-detail"
861
+ className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm"
829
862
  }, v.d));
830
863
  }));
831
864
  };
832
865
 
833
- function lightenHexColor(hex) {
834
- var amount = 100;
835
- if (hex.startsWith("#")) {
836
- hex = hex.slice(1);
837
- }
838
- var r = parseInt(hex.slice(0, 2), 16);
839
- var g = parseInt(hex.slice(2, 4), 16);
840
- var b = parseInt(hex.slice(4, 6), 16);
841
- r = Math.min(255, r + amount);
842
- g = Math.min(255, g + amount);
843
- b = Math.min(255, b + amount);
844
- var newHex = "#".concat((1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1).toUpperCase());
845
- return newHex;
846
- }
847
866
  var FormulaHint = function FormulaHint(props) {
867
+ var _context$luckysheet_s;
848
868
  var _useContext = useContext(WorkbookContext),
849
869
  context = _useContext.context;
870
+ var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
850
871
  var _locale = locale(context),
851
872
  formulaMore = _locale.formulaMore;
852
873
  var fn = context.formulaCache.functionlistMap[context.functionHint];
@@ -858,13 +879,89 @@ var FormulaHint = function FormulaHint(props) {
858
879
  _useState4 = _slicedToArray(_useState3, 2),
859
880
  showAPInput = _useState4[0],
860
881
  setShowAPInput = _useState4[1];
882
+ var _useState5 = useState(!!localStorage.getItem(fn === null || fn === void 0 ? void 0 : fn.API_KEY)),
883
+ _useState6 = _slicedToArray(_useState5, 2),
884
+ isKeyAdded = _useState6[0],
885
+ setApiKeyAdded = _useState6[1];
886
+ var _useState7 = useState(true),
887
+ _useState8 = _slicedToArray(_useState7, 2),
888
+ showFunctionBody = _useState8[0],
889
+ setShouldShowFunctionBody = _useState8[1];
890
+ useEffect(function () {
891
+ if (fn) {
892
+ setApiKeyAdded(!!localStorage.getItem(fn === null || fn === void 0 ? void 0 : fn.API_KEY));
893
+ setAPI_KEY(localStorage.getItem(fn === null || fn === void 0 ? void 0 : fn.API_KEY) || "");
894
+ setShowAPInput(!localStorage.getItem(fn === null || fn === void 0 ? void 0 : fn.API_KEY));
895
+ }
896
+ }, [fn]);
897
+ var apiKeyPlaceholder = {
898
+ ETHERSCAN_API_KEY: "Etherscan API key"
899
+ };
900
+ var hintRef = useRef(null);
901
+ var _useState9 = useState(0),
902
+ _useState0 = _slicedToArray(_useState9, 2),
903
+ top = _useState0[0],
904
+ setTop = _useState0[1];
905
+ var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
906
+ var _hintRef$current;
907
+ if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
908
+ var hintHeight = 422;
909
+ var inputBottom = firstSelection.top + firstSelection.height_move;
910
+ var availableBelow = window.innerHeight - inputBottom;
911
+ var hintAbove = hintHeight > availableBelow;
912
+ var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
913
+ var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
914
+ setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
915
+ };
916
+ useEffect(function () {
917
+ calcuatePopUpPlacement();
918
+ });
919
+ useEffect(function () {
920
+ var el = document.getElementById("function-details");
921
+ var handleWheel;
922
+ if (el) {
923
+ var scrollLockTimeout = null;
924
+ var cache = {
925
+ verticalScrollLock: false,
926
+ horizontalScrollLock: false
927
+ };
928
+ handleWheel = function handleWheel(e) {
929
+ e.preventDefault();
930
+ var step = 40;
931
+ var ratio = 1;
932
+ if (e.deltaY !== 0 && !cache.verticalScrollLock) {
933
+ cache.horizontalScrollLock = true;
934
+ el.scrollTop += (e.deltaY > 0 ? 1 : -1) * step * ratio;
935
+ } else if (e.deltaX !== 0 && !cache.horizontalScrollLock) {
936
+ cache.verticalScrollLock = true;
937
+ el.scrollLeft += (e.deltaX > 0 ? 1 : -1) * step * ratio;
938
+ }
939
+ clearTimeout(scrollLockTimeout);
940
+ scrollLockTimeout = setTimeout(function () {
941
+ cache.verticalScrollLock = false;
942
+ cache.horizontalScrollLock = false;
943
+ }, 50);
944
+ };
945
+ el.addEventListener("wheel", handleWheel, {
946
+ passive: false
947
+ });
948
+ }
949
+ return function () {
950
+ if (el && handleWheel) el.removeEventListener("wheel", handleWheel);
951
+ };
952
+ }, []);
861
953
  if (!fn) return null;
862
954
  return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
955
+ ref: hintRef,
863
956
  id: "luckysheet-formula-help-c",
864
957
  className: "luckysheet-formula-help-c",
865
958
  style: {
866
- border: "1px solid ".concat(fn.BRAND_COLOR),
867
- backgroundColor: "".concat(fn.BRAND_COLOR ? lightenHexColor(fn.BRAND_COLOR) : "#F8F9FA")
959
+ top: top,
960
+ borderWidth: "1px",
961
+ borderColor: (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) ? fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR : "#F8F9FA",
962
+ backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
963
+ width: "340px",
964
+ padding: "0px"
868
965
  }
869
966
  }), /*#__PURE__*/React.createElement("div", {
870
967
  className: "luckysheet-formula-help-close",
@@ -879,17 +976,25 @@ var FormulaHint = function FormulaHint(props) {
879
976
  className: "fa fa-angle-up",
880
977
  "aria-hidden": "true"
881
978
  })), /*#__PURE__*/React.createElement("div", {
882
- className: "luckysheet-formula-help-title formula-title",
979
+ onClick: function onClick() {
980
+ setShouldShowFunctionBody(!showFunctionBody);
981
+ },
982
+ className: "flex cursor-pointer items-center justify-between",
883
983
  style: {
884
- backgroundColor: "".concat(fn.BRAND_COLOR ? lightenHexColor(fn.BRAND_COLOR) : "#F8F9FA")
984
+ backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
985
+ padding: "10px",
986
+ borderRadius: "10px"
885
987
  }
886
988
  }, /*#__PURE__*/React.createElement("div", {
887
- className: "luckysheet-formula-help-title-formula"
888
- }, /*#__PURE__*/React.createElement("span", {
989
+ className: " flex-grow color-text-default"
990
+ }, /*#__PURE__*/React.createElement("code", {
991
+ style: {
992
+ fontWeight: 500
993
+ },
889
994
  className: "luckysheet-arguments-help-function-name"
890
- }, fn.n), /*#__PURE__*/React.createElement("span", {
995
+ }, fn.n), /*#__PURE__*/React.createElement("code", {
891
996
  className: "luckysheet-arguments-paren"
892
- }, "("), /*#__PURE__*/React.createElement("span", {
997
+ }, "("), /*#__PURE__*/React.createElement("code", {
893
998
  className: "luckysheet-arguments-parameter-holder"
894
999
  }, fn.p.map(function (param, i) {
895
1000
  var name = param.name;
@@ -899,43 +1004,58 @@ var FormulaHint = function FormulaHint(props) {
899
1004
  if (param.require === "o") {
900
1005
  name = "[".concat(name, "]");
901
1006
  }
902
- return /*#__PURE__*/React.createElement("span", {
1007
+ return /*#__PURE__*/React.createElement("code", {
903
1008
  className: "luckysheet-arguments-help-parameter",
904
1009
  dir: "auto",
905
1010
  key: name
906
1011
  }, name, i !== fn.p.length - 1 && ", ");
907
- })), /*#__PURE__*/React.createElement("span", {
1012
+ })), /*#__PURE__*/React.createElement("code", {
908
1013
  className: "luckysheet-arguments-paren"
909
1014
  }, ")")), /*#__PURE__*/React.createElement("div", {
910
1015
  style: {
911
1016
  display: "flex",
1017
+ justifyContent: "end",
1018
+ width: "68px",
1019
+ height: "20px",
1020
+ alignItems: "center",
912
1021
  gap: "4px"
913
1022
  }
914
1023
  }, fn.LOGO && (/*#__PURE__*/React.createElement("img", {
915
1024
  src: fn.LOGO,
916
1025
  alt: "Service Logo",
917
- width: 32,
918
- height: 32
1026
+ style: {
1027
+ width: "20px"
1028
+ }
919
1029
  })), fn.API_KEY && (/*#__PURE__*/React.createElement("div", {
920
1030
  style: {
921
1031
  borderRadius: "4px",
922
- width: "20px",
923
- height: "20px",
924
- backgroundColor: "".concat(localStorage.getItem(fn.API_KEY) ? "#177E23" : "#F9A92B")
925
- }
1032
+ backgroundColor: "".concat(isKeyAdded ? "#177E23" : "#e8ebec"),
1033
+ width: "16px",
1034
+ height: "16px"
1035
+ },
1036
+ className: "flex justify-center"
926
1037
  }, /*#__PURE__*/React.createElement(LucideIcon, {
927
1038
  name: "Key",
928
1039
  style: {
929
- color: "white"
1040
+ color: isKeyAdded ? "white" : "#77818A",
1041
+ width: "12px",
1042
+ height: "12px"
930
1043
  }
931
- }))))), /*#__PURE__*/React.createElement("div", {
1044
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LucideIcon, {
1045
+ name: showFunctionBody ? "ChevronUp" : "ChevronDown",
1046
+ width: 16,
1047
+ height: 16
1048
+ })))), showFunctionBody && (/*#__PURE__*/React.createElement("div", {
932
1049
  className: "luckysheet-formula-help-content",
1050
+ id: "function-details",
933
1051
  style: {
934
- backgroundColor: "".concat(fn.BRAND_COLOR ? lightenHexColor(fn.BRAND_COLOR) : "#F8F9FA")
1052
+ backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
1053
+ maxHeight: "318px",
1054
+ overflowY: "scroll"
935
1055
  }
936
1056
  }, fn.API_KEY && (/*#__PURE__*/React.createElement("div", {
937
1057
  style: {
938
- borderLeft: "4px solid ".concat(API_KEY ? "#177E23" : "#fb923c"),
1058
+ borderLeft: "4px solid ".concat(isKeyAdded ? "#177E23" : "#fb923c"),
939
1059
  backgroundColor: "white",
940
1060
  padding: "16px",
941
1061
  margin: "4px 4px 0px 4px",
@@ -952,38 +1072,40 @@ var FormulaHint = function FormulaHint(props) {
952
1072
  }
953
1073
  }, /*#__PURE__*/React.createElement("h3", {
954
1074
  style: {
955
- fontSize: "14px",
956
- fontWeight: "600",
957
- color: "#1f2937",
958
1075
  margin: "0 0 8px 0"
959
- }
960
- }, "API key is required"), /*#__PURE__*/React.createElement(LucideIcon, {
961
- name: "ChevronDown",
1076
+ },
1077
+ className: "text-heading-xsm color-text-default"
1078
+ }, isKeyAdded ? "API key provided" : "API key is required"), /*#__PURE__*/React.createElement(LucideIcon, {
1079
+ name: showAPInput ? "ChevronUp" : "ChevronDown",
962
1080
  width: 24,
963
1081
  height: 24
964
1082
  })), showAPInput && (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
965
1083
  style: {
966
- color: "#6b7280",
967
1084
  margin: "0 0 16px 0"
968
- }
969
- }, "This function is require API key. Please paste it below and\n press 'Ok'."), /*#__PURE__*/React.createElement("div", {
970
- style: {
971
- display: "flex",
972
- gap: "12px"
973
- }
1085
+ },
1086
+ className: "text-body-sm color-text-default"
1087
+ }, "This function requires an API key. Please paste it below and\n press 'Ok'."), /*#__PURE__*/React.createElement("div", {
1088
+ className: "w-full"
974
1089
  }, /*#__PURE__*/React.createElement(TextField, {
975
1090
  value: API_KEY,
976
1091
  id: "function-api-key",
977
1092
  type: "text",
978
- placeholder: "API key",
1093
+ placeholder: apiKeyPlaceholder[fn.API_KEY],
979
1094
  onChange: function onChange(e) {
980
1095
  setAPI_KEY(e.target.value);
1096
+ setApiKeyAdded(false);
981
1097
  }
982
- }), /*#__PURE__*/React.createElement(Button$1, {
1098
+ }), /*#__PURE__*/React.createElement("div", {
1099
+ className: "flex justify-end mt-2"
1100
+ }, /*#__PURE__*/React.createElement(Button$1, {
983
1101
  onClick: function onClick() {
984
1102
  localStorage.setItem(fn.API_KEY, API_KEY);
985
- }
986
- }, "Ok")))))), /*#__PURE__*/React.createElement("div", {
1103
+ setApiKeyAdded(true);
1104
+ setShowAPInput(false);
1105
+ },
1106
+ disabled: !API_KEY,
1107
+ className: "min-w-[80px]"
1108
+ }, "Ok"))))))), /*#__PURE__*/React.createElement("div", {
987
1109
  style: {
988
1110
  backgroundColor: "white",
989
1111
  padding: "6px",
@@ -991,13 +1113,20 @@ var FormulaHint = function FormulaHint(props) {
991
1113
  borderRadius: "4px"
992
1114
  }
993
1115
  }, /*#__PURE__*/React.createElement("div", {
994
- className: "luckysheet-formula-help-content-example"
1116
+ className: ""
995
1117
  }, /*#__PURE__*/React.createElement("div", {
996
- className: "luckysheet-arguments-help-section-title example-title"
997
- }, formulaMore.helpExample), /*#__PURE__*/React.createElement("div", {
998
- className: "luckysheet-arguments-help-formula"
1118
+ style: {
1119
+ lineHeight: "16px",
1120
+ fontSize: "12px"
1121
+ },
1122
+ className: "text-body-sm-bold mb-1 color-text-secondary"
1123
+ }, formulaMore.helpExample), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", {
1124
+ style: {
1125
+ overflowWrap: "break-word"
1126
+ },
1127
+ className: "example-value-code"
999
1128
  }, /*#__PURE__*/React.createElement("span", {
1000
- className: "luckysheet-arguments-help-function-name example-value"
1129
+ className: "luckysheet-arguments-help-function-name"
1001
1130
  }, fn.n), /*#__PURE__*/React.createElement("span", {
1002
1131
  className: "luckysheet-arguments-paren"
1003
1132
  }, "("), /*#__PURE__*/React.createElement("span", {
@@ -1010,26 +1139,32 @@ var FormulaHint = function FormulaHint(props) {
1010
1139
  }, param.example, i !== fn.p.length - 1 && ", ");
1011
1140
  })), /*#__PURE__*/React.createElement("span", {
1012
1141
  className: "luckysheet-arguments-paren"
1013
- }, ")"))), /*#__PURE__*/React.createElement("div", {
1142
+ }, ")")))), /*#__PURE__*/React.createElement("div", {
1014
1143
  className: "luckysheet-formula-help-content-detail",
1015
1144
  style: {
1016
- paddingBottom: "6px"
1145
+ paddingBottom: "16px"
1017
1146
  }
1018
1147
  }, /*#__PURE__*/React.createElement("div", {
1019
- className: "luckysheet-arguments-help-section"
1148
+ className: ""
1020
1149
  }, /*#__PURE__*/React.createElement("div", {
1021
- className: "luckysheet-arguments-help-section-title luckysheet-arguments-help-parameter-name example-title"
1150
+ style: {
1151
+ lineHeight: "16px",
1152
+ fontSize: "12px",
1153
+ padding: "0px"
1154
+ },
1155
+ className: "text-body-sm-bold mb-1 mt-2 color-text-secondary"
1022
1156
  }, "About"), /*#__PURE__*/React.createElement("span", {
1023
- className: "luckysheet-arguments-help-parameter-content example-value"
1157
+ className: "luckysheet-arguments-help-parameter-content text-helper-text-sm"
1024
1158
  }, fn.d))), /*#__PURE__*/React.createElement("div", {
1159
+ style: {
1160
+ paddingTop: "16px"
1161
+ },
1025
1162
  className: "luckysheet-formula-help-content-param"
1026
1163
  }, fn.p.map(function (param) {
1027
1164
  return /*#__PURE__*/React.createElement("div", {
1028
- className: "luckysheet-arguments-help-section",
1165
+ className: "",
1029
1166
  key: param.name
1030
- }, /*#__PURE__*/React.createElement("div", {
1031
- className: "luckysheet-arguments-help-section-title example-title"
1032
- }, param.name, param.repeat === "y" && (/*#__PURE__*/React.createElement("span", {
1167
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", null, param.name, param.repeat === "y" && (/*#__PURE__*/React.createElement("span", {
1033
1168
  className: "luckysheet-arguments-help-argument-info example-value",
1034
1169
  style: {
1035
1170
  marginTop: "2px"
@@ -1039,15 +1174,27 @@ var FormulaHint = function FormulaHint(props) {
1039
1174
  style: {
1040
1175
  marginTop: "2px"
1041
1176
  }
1042
- }, "-[", formulaMore.allowOptionText, "]"))), /*#__PURE__*/React.createElement("span", {
1043
- className: "luckysheet-arguments-help-parameter-content example-value",
1177
+ }, "-[", formulaMore.allowOptionText, "]")))), /*#__PURE__*/React.createElement("span", {
1178
+ className: "luckysheet-arguments-help-parameter-content text-helper-text-sm",
1044
1179
  style: {
1045
1180
  marginTop: "2px"
1046
1181
  }
1047
1182
  }, param.detail));
1048
- })))), /*#__PURE__*/React.createElement("div", {
1049
- className: "luckysheet-formula-help-foot"
1050
- }));
1183
+ }))))), /*#__PURE__*/React.createElement("div", {
1184
+ style: {
1185
+ backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
1186
+ padding: "8px",
1187
+ borderBottomLeftRadius: "10px",
1188
+ borderBottomRightRadius: "10px"
1189
+ },
1190
+ className: "w-full"
1191
+ }, /*#__PURE__*/React.createElement("div", {
1192
+ onClick: function onClick() {
1193
+ var _document$getElementB;
1194
+ (_document$getElementB = document.getElementById("function-button")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.click();
1195
+ },
1196
+ className: "color-text-link cursor-pointer text-helper-text-sm"
1197
+ }, "Learn More")));
1051
1198
  };
1052
1199
 
1053
1200
  function usePrevious(value) {
@@ -1145,6 +1292,38 @@ var InputBox = function InputBox() {
1145
1292
  var getActiveFormula = useCallback(function () {
1146
1293
  return document.querySelector(".luckysheet-formula-search-item-active");
1147
1294
  }, []);
1295
+ var insertSelectedFormula = useCallback(function (formulaName) {
1296
+ var _getrangeseleciton;
1297
+ var textEditor = document.getElementById("luckysheet-rich-text-editor");
1298
+ if (!textEditor) return;
1299
+ var searchTxt = ((_getrangeseleciton = getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
1300
+ var deleteCount = searchTxt.length;
1301
+ textEditor.focus();
1302
+ var selection = window.getSelection();
1303
+ if (!selection || selection.rangeCount === 0) return;
1304
+ var range = selection.getRangeAt(0);
1305
+ if (deleteCount !== 0 && range) {
1306
+ var startOffset = Math.max(range.startOffset - deleteCount, 0);
1307
+ var endOffset = range.startOffset;
1308
+ range.setStart(range.startContainer, startOffset);
1309
+ range.setEnd(range.startContainer, endOffset);
1310
+ range.deleteContents();
1311
+ }
1312
+ var funcNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>"), "text/html").body.firstChild;
1313
+ var parNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>", "text/html").body.firstChild;
1314
+ if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
1315
+ range.setStart(range.startContainer.parentNode, 1);
1316
+ }
1317
+ if (parNode) range.insertNode(parNode);
1318
+ if (funcNode) range.insertNode(funcNode);
1319
+ range.collapse();
1320
+ selection.removeAllRanges();
1321
+ selection.addRange(range);
1322
+ setContext(function (draftCtx) {
1323
+ draftCtx.functionCandidates = [];
1324
+ draftCtx.functionHint = formulaName;
1325
+ });
1326
+ }, [setContext]);
1148
1327
  var clearSearchItemActiveClass = useCallback(function () {
1149
1328
  var activeFormula = getActiveFormula();
1150
1329
  if (activeFormula) {
@@ -1152,47 +1331,24 @@ var InputBox = function InputBox() {
1152
1331
  }
1153
1332
  }, [getActiveFormula]);
1154
1333
  var selectActiveFormula = useCallback(function (e) {
1155
- var activeFormula = getActiveFormula();
1156
- var formulaNameDiv = activeFormula === null || activeFormula === void 0 ? void 0 : activeFormula.querySelector(".luckysheet-formula-search-func");
1157
- if (formulaNameDiv) {
1158
- var formulaName = formulaNameDiv.textContent;
1159
- var textEditor = document.getElementById("luckysheet-rich-text-editor");
1160
- if (textEditor) {
1161
- var _getrangeseleciton;
1162
- var searchTxt = ((_getrangeseleciton = getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
1163
- var deleteCount = searchTxt.length;
1164
- textEditor.focus();
1165
- var selection = window.getSelection();
1166
- if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) === 0) return;
1167
- var range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
1168
- if (deleteCount !== 0 && range) {
1169
- var startOffset = Math.max(range.startOffset - deleteCount, 0);
1170
- var endOffset = range.startOffset;
1171
- range.setStart(range.startContainer, startOffset);
1172
- range.setEnd(range.startContainer, endOffset);
1173
- range.deleteContents();
1174
- }
1175
- var functionStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>");
1176
- var lParStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>";
1177
- var functionNode = new DOMParser().parseFromString(functionStr, "text/html").body.childNodes[0];
1178
- var lParNode = new DOMParser().parseFromString(lParStr, "text/html").body.childNodes[0];
1179
- if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
1180
- range === null || range === void 0 ? void 0 : range.setStart(range.startContainer.parentNode, 1);
1181
- }
1182
- range === null || range === void 0 ? void 0 : range.insertNode(lParNode);
1183
- range === null || range === void 0 ? void 0 : range.insertNode(functionNode);
1184
- range === null || range === void 0 ? void 0 : range.collapse();
1185
- selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
1186
- if (range) selection === null || selection === void 0 ? void 0 : selection.addRange(range);
1187
- setContext(function (draftCtx) {
1188
- draftCtx.functionCandidates = [];
1189
- draftCtx.functionHint = formulaName;
1190
- });
1191
- }
1334
+ var _getActiveFormula, _getActiveFormula$que;
1335
+ var formulaName = (_getActiveFormula = getActiveFormula()) === null || _getActiveFormula === void 0 ? void 0 : (_getActiveFormula$que = _getActiveFormula.querySelector(".luckysheet-formula-search-func")) === null || _getActiveFormula$que === void 0 ? void 0 : _getActiveFormula$que.textContent;
1336
+ if (formulaName) {
1337
+ insertSelectedFormula(formulaName);
1338
+ e.preventDefault();
1339
+ e.stopPropagation();
1340
+ }
1341
+ }, [getActiveFormula, insertSelectedFormula]);
1342
+ var selectActiveFormulaOnClick = useCallback(function (e) {
1343
+ var _getActiveFormula2, _getActiveFormula2$qu;
1344
+ preText.current = inputRef.current.innerText;
1345
+ var formulaName = (_getActiveFormula2 = getActiveFormula()) === null || _getActiveFormula2 === void 0 ? void 0 : (_getActiveFormula2$qu = _getActiveFormula2.querySelector(".luckysheet-formula-search-func")) === null || _getActiveFormula2$qu === void 0 ? void 0 : _getActiveFormula2$qu.textContent;
1346
+ if (formulaName) {
1347
+ insertSelectedFormula(formulaName);
1192
1348
  e.preventDefault();
1193
1349
  e.stopPropagation();
1194
1350
  }
1195
- }, [getActiveFormula, setContext]);
1351
+ }, [getActiveFormula, insertSelectedFormula]);
1196
1352
  var onKeyDown = useCallback(function (e) {
1197
1353
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
1198
1354
  preText.current = inputRef.current.innerText;
@@ -1309,15 +1465,20 @@ var InputBox = function InputBox() {
1309
1465
  onKeyDown: onKeyDown,
1310
1466
  onPaste: onPaste,
1311
1467
  allowEdit: edit ? !isHidenRC : edit
1312
- })), document.activeElement === inputRef.current && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormulaSearch, {
1313
- style: {
1314
- top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
1315
- }
1316
- }), /*#__PURE__*/React.createElement(FormulaHint, {
1317
- style: {
1318
- top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
1468
+ })), (context.functionCandidates.length > 0 || context.functionHint) && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormulaSearch, {
1469
+ onMouseOver: function onMouseOver(e) {
1470
+ if (document.getElementById("luckysheet-formula-search-c")) {
1471
+ var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
1472
+ if (!hoveredItem) return;
1473
+ clearSearchItemActiveClass();
1474
+ hoveredItem.classList.add("luckysheet-formula-search-item-active");
1475
+ }
1476
+ e.preventDefault();
1477
+ },
1478
+ onMouseDown: function onMouseDown(e) {
1479
+ selectActiveFormulaOnClick(e);
1319
1480
  }
1320
- }))));
1481
+ }), /*#__PURE__*/React.createElement(FormulaHint, null))));
1321
1482
  };
1322
1483
 
1323
1484
  var ScrollBar = function ScrollBar(_ref) {
@@ -2447,8 +2608,18 @@ function useDialog() {
2447
2608
  };
2448
2609
  }
2449
2610
 
2611
+ var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
2612
+ var injectDatepickerStyles = function injectDatepickerStyles() {
2613
+ if (typeof document !== "undefined") {
2614
+ var styleSheet = document.createElement("style");
2615
+ styleSheet.textContent = datepickerStyles;
2616
+ document.head.appendChild(styleSheet);
2617
+ }
2618
+ };
2619
+
2620
+ injectDatepickerStyles();
2450
2621
  var DataVerification = function DataVerification() {
2451
- var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11, _context$dataVerifica12, _context$dataVerifica13, _context$dataVerifica14, _context$dataVerifica15, _context$dataVerifica16, _context$dataVerifica17, _context$dataVerifica18, _context$dataVerifica19, _context$dataVerifica20, _context$dataVerifica21, _context$dataVerifica22, _context$dataVerifica23;
2622
+ var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11;
2452
2623
  var _useContext = useContext(WorkbookContext),
2453
2624
  context = _useContext.context,
2454
2625
  setContext = _useContext.setContext;
@@ -2457,15 +2628,11 @@ var DataVerification = function DataVerification() {
2457
2628
  hideDialog = _useDialog.hideDialog;
2458
2629
  var _locale = locale(context),
2459
2630
  dataVerification = _locale.dataVerification,
2460
- toolbar = _locale.toolbar,
2461
2631
  button = _locale.button,
2462
2632
  generalDialog = _locale.generalDialog;
2463
- var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "moreThanThe", "lessThan", "greaterOrEqualTo", "lessThanOrEqualTo"]),
2633
+ var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
2464
2634
  _useState2 = _slicedToArray(_useState, 1),
2465
- numberCondition = _useState2[0];
2466
- var _useState3 = useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
2467
- _useState4 = _slicedToArray(_useState3, 1),
2468
- dateCondition = _useState4[0];
2635
+ dateCondition = _useState2[0];
2469
2636
  var dataSelectRange = useCallback(function (type, value) {
2470
2637
  hideDialog();
2471
2638
  setContext(function (ctx) {
@@ -2600,48 +2767,36 @@ var DataVerification = function DataVerification() {
2600
2767
  return /*#__PURE__*/React.createElement("div", {
2601
2768
  id: "fortune-data-verification"
2602
2769
  }, /*#__PURE__*/React.createElement("div", {
2603
- className: "title"
2604
- }, toolbar.dataVerification), /*#__PURE__*/React.createElement("div", {
2605
- className: "box"
2770
+ className: "flex flex-col gap-4"
2606
2771
  }, /*#__PURE__*/React.createElement("div", {
2607
- className: "box-item",
2608
- style: {
2609
- borderTop: "1px solid #E1E4E8"
2610
- }
2772
+ className: "flex flex-col"
2611
2773
  }, /*#__PURE__*/React.createElement("div", {
2612
- className: "box-item-title"
2613
- }, dataVerification.cellRange), /*#__PURE__*/React.createElement("div", {
2614
- className: "data-verification-range"
2615
- }, /*#__PURE__*/React.createElement("input", {
2616
- className: "formulaInputFocus",
2617
- spellCheck: "false",
2774
+ className: "text-heading-xsm mb-2"
2775
+ }, dataVerification.cellRange), /*#__PURE__*/React.createElement(TextField, {
2776
+ rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
2777
+ name: "Grid2x2",
2778
+ size: "sm"
2779
+ }),
2780
+ "aria-hidden": "true",
2781
+ readOnly: true,
2618
2782
  value: (_context$dataVerifica = context.dataVerification.dataRegulation) === null || _context$dataVerifica === void 0 ? void 0 : _context$dataVerifica.rangeTxt,
2619
2783
  onChange: function onChange(e) {
2620
2784
  var value = e.target.value;
2621
2785
  setContext(function (ctx) {
2622
2786
  ctx.dataVerification.dataRegulation.rangeTxt = value;
2623
2787
  });
2624
- }
2625
- }), /*#__PURE__*/React.createElement("i", {
2626
- className: "icon",
2627
- "aria-hidden": "true",
2788
+ },
2628
2789
  onClick: function onClick() {
2629
2790
  hideDialog();
2630
2791
  dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
2631
- },
2632
- tabIndex: 0
2633
- }, /*#__PURE__*/React.createElement(SVGIcon, {
2634
- name: "tab",
2635
- width: 18
2636
- })))), /*#__PURE__*/React.createElement("div", {
2637
- className: "box-item"
2792
+ }
2793
+ })), /*#__PURE__*/React.createElement("div", {
2794
+ className: "flex flex-col"
2638
2795
  }, /*#__PURE__*/React.createElement("div", {
2639
- className: "box-item-title"
2640
- }, dataVerification.verificationCondition), /*#__PURE__*/React.createElement("select", {
2641
- className: "data-verification-type-select",
2796
+ className: "text-heading-xsm mb-2"
2797
+ }, dataVerification.verificationCondition), /*#__PURE__*/React.createElement(Select$1, {
2642
2798
  value: context.dataVerification.dataRegulation.type,
2643
- onChange: function onChange(e) {
2644
- var value = e.target.value;
2799
+ onValueChange: function onValueChange(value) {
2645
2800
  setContext(function (ctx) {
2646
2801
  ctx.dataVerification.dataRegulation.type = value;
2647
2802
  if (value === "dropdown" || value === "checkbox") {
@@ -2657,18 +2812,14 @@ var DataVerification = function DataVerification() {
2657
2812
  ctx.dataVerification.dataRegulation.value2 = "";
2658
2813
  });
2659
2814
  }
2660
- }, ["dropdown", "checkbox", "number", "number_integer", "number_decimal", "text_content", "text_length", "date", "validity"].map(function (v) {
2661
- return /*#__PURE__*/React.createElement("option", {
2815
+ }, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null)), /*#__PURE__*/React.createElement(SelectContent, null, ["dropdown", "checkbox", "date"].map(function (v) {
2816
+ return /*#__PURE__*/React.createElement(SelectItem$1, {
2662
2817
  value: v,
2663
2818
  key: v
2664
2819
  }, dataVerification[v]);
2665
- })), ((_context$dataVerifica2 = context.dataVerification) === null || _context$dataVerifica2 === void 0 ? void 0 : (_context$dataVerifica3 = _context$dataVerifica2.dataRegulation) === null || _context$dataVerifica3 === void 0 ? void 0 : _context$dataVerifica3.type) === "dropdown" && (/*#__PURE__*/React.createElement("div", {
2666
- className: "show-box-item"
2667
- }, /*#__PURE__*/React.createElement("div", {
2668
- className: "data-verification-range"
2669
- }, /*#__PURE__*/React.createElement("input", {
2670
- className: "formulaInputFocus",
2671
- spellCheck: "false",
2820
+ }))), ((_context$dataVerifica2 = context.dataVerification) === null || _context$dataVerifica2 === void 0 ? void 0 : (_context$dataVerifica3 = _context$dataVerifica2.dataRegulation) === null || _context$dataVerifica3 === void 0 ? void 0 : _context$dataVerifica3.type) === "dropdown" && (/*#__PURE__*/React.createElement("div", {
2821
+ className: "mt-4"
2822
+ }, /*#__PURE__*/React.createElement(TextField, {
2672
2823
  value: context.dataVerification.dataRegulation.value1,
2673
2824
  placeholder: dataVerification.placeholder1,
2674
2825
  onChange: function onChange(e) {
@@ -2677,39 +2828,28 @@ var DataVerification = function DataVerification() {
2677
2828
  ctx.dataVerification.dataRegulation.value1 = value;
2678
2829
  });
2679
2830
  }
2680
- }), /*#__PURE__*/React.createElement("i", {
2681
- className: "icon",
2682
- "aria-hidden": "true",
2683
- onClick: function onClick() {
2684
- return dataSelectRange("dropDown", context.dataVerification.dataRegulation.value1);
2685
- },
2686
- tabIndex: 0
2687
- }, /*#__PURE__*/React.createElement(SVGIcon, {
2688
- name: "tab",
2689
- width: 18
2690
- }))), /*#__PURE__*/React.createElement("div", {
2691
- className: "check"
2692
- }, /*#__PURE__*/React.createElement("input", {
2693
- type: "checkbox",
2831
+ }), /*#__PURE__*/React.createElement("div", {
2832
+ className: "mt-4 flex items-center"
2833
+ }, /*#__PURE__*/React.createElement(Checkbox, {
2834
+ className: "border-2",
2694
2835
  checked: context.dataVerification.dataRegulation.type2 === "true",
2695
- id: "mul",
2696
- onChange: function onChange(e) {
2836
+ onCheckedChange: function onCheckedChange(e) {
2697
2837
  var checked = e.target.checked;
2698
2838
  setContext(function (ctx) {
2699
2839
  ctx.dataVerification.dataRegulation.type2 = "".concat(checked);
2700
2840
  });
2701
2841
  }
2702
- }), /*#__PURE__*/React.createElement("label", {
2703
- htmlFor: "mul"
2842
+ }), /*#__PURE__*/React.createElement("span", {
2843
+ className: "ml-2"
2704
2844
  }, dataVerification.allowMultiSelect)))), ((_context$dataVerifica4 = context.dataVerification) === null || _context$dataVerifica4 === void 0 ? void 0 : (_context$dataVerifica5 = _context$dataVerifica4.dataRegulation) === null || _context$dataVerifica5 === void 0 ? void 0 : _context$dataVerifica5.type) === "checkbox" && (/*#__PURE__*/React.createElement("div", {
2705
- className: "show-box-item"
2845
+ className: "mt-4 space-y-2"
2706
2846
  }, /*#__PURE__*/React.createElement("div", {
2707
- className: "check-box"
2708
- }, /*#__PURE__*/React.createElement("span", null, dataVerification.selected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
2709
- type: "text",
2710
- className: "data-verification-value1",
2711
- placeholder: dataVerification.placeholder2,
2847
+ className: "flex items-center gap-2"
2848
+ }, /*#__PURE__*/React.createElement("span", {
2849
+ className: "data-verification-checkbox-label"
2850
+ }, dataVerification.selected), /*#__PURE__*/React.createElement(TextField, {
2712
2851
  value: (_context$dataVerifica6 = context.dataVerification) === null || _context$dataVerifica6 === void 0 ? void 0 : (_context$dataVerifica7 = _context$dataVerifica6.dataRegulation) === null || _context$dataVerifica7 === void 0 ? void 0 : _context$dataVerifica7.value1,
2852
+ placeholder: dataVerification.placeholder2,
2713
2853
  onChange: function onChange(e) {
2714
2854
  var value = e.target.value;
2715
2855
  setContext(function (ctx) {
@@ -2717,129 +2857,41 @@ var DataVerification = function DataVerification() {
2717
2857
  });
2718
2858
  }
2719
2859
  })), /*#__PURE__*/React.createElement("div", {
2720
- className: "check-box"
2721
- }, /*#__PURE__*/React.createElement("span", null, dataVerification.notSelected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
2722
- type: "text",
2723
- className: "data-verification-value2",
2724
- placeholder: dataVerification.placeholder2,
2860
+ className: "flex items-center gap-2"
2861
+ }, /*#__PURE__*/React.createElement("span", {
2862
+ className: "data-verification-checkbox-label"
2863
+ }, dataVerification.notSelected), /*#__PURE__*/React.createElement(TextField, {
2725
2864
  value: (_context$dataVerifica8 = context.dataVerification) === null || _context$dataVerifica8 === void 0 ? void 0 : (_context$dataVerifica9 = _context$dataVerifica8.dataRegulation) === null || _context$dataVerifica9 === void 0 ? void 0 : _context$dataVerifica9.value2,
2865
+ placeholder: dataVerification.placeholder2,
2726
2866
  onChange: function onChange(e) {
2727
2867
  var value = e.target.value;
2728
2868
  setContext(function (ctx) {
2729
2869
  ctx.dataVerification.dataRegulation.value2 = value;
2730
2870
  });
2731
2871
  }
2732
- })))), (((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "number" || ((_context$dataVerifica10 = context.dataVerification) === null || _context$dataVerifica10 === void 0 ? void 0 : (_context$dataVerifica11 = _context$dataVerifica10.dataRegulation) === null || _context$dataVerifica11 === void 0 ? void 0 : _context$dataVerifica11.type) === "number_integer" || ((_context$dataVerifica12 = context.dataVerification) === null || _context$dataVerifica12 === void 0 ? void 0 : (_context$dataVerifica13 = _context$dataVerifica12.dataRegulation) === null || _context$dataVerifica13 === void 0 ? void 0 : _context$dataVerifica13.type) === "number_decimal" || ((_context$dataVerifica14 = context.dataVerification) === null || _context$dataVerifica14 === void 0 ? void 0 : (_context$dataVerifica15 = _context$dataVerifica14.dataRegulation) === null || _context$dataVerifica15 === void 0 ? void 0 : _context$dataVerifica15.type) === "text_length") && (/*#__PURE__*/React.createElement("div", {
2733
- className: "show-box-item"
2734
- }, /*#__PURE__*/React.createElement("select", {
2735
- className: "data-verification-type-select",
2736
- value: context.dataVerification.dataRegulation.type2,
2737
- onChange: function onChange(e) {
2738
- var value = e.target.value;
2739
- setContext(function (ctx) {
2740
- ctx.dataVerification.dataRegulation.type2 = value;
2741
- ctx.dataVerification.dataRegulation.value1 = "";
2742
- ctx.dataVerification.dataRegulation.value2 = "";
2743
- });
2744
- }
2745
- }, numberCondition.map(function (v) {
2746
- return /*#__PURE__*/React.createElement("option", {
2747
- value: v,
2748
- key: v
2749
- }, dataVerification[v]);
2750
- })), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2751
- className: "input-box"
2752
- }, /*#__PURE__*/React.createElement("input", {
2753
- type: "number",
2754
- placeholder: "1",
2755
- value: context.dataVerification.dataRegulation.value1,
2756
- onChange: function onChange(e) {
2757
- var value = e.target.value;
2758
- setContext(function (ctx) {
2759
- ctx.dataVerification.dataRegulation.value1 = value;
2760
- });
2761
- }
2762
- }), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
2763
- type: "number",
2764
- placeholder: "100",
2765
- value: context.dataVerification.dataRegulation.value2,
2766
- onChange: function onChange(e) {
2767
- var value = e.target.value;
2768
- setContext(function (ctx) {
2769
- ctx.dataVerification.dataRegulation.value2 = value;
2770
- });
2771
- }
2772
- }))) : (/*#__PURE__*/React.createElement("div", {
2773
- className: "input-box"
2774
- }, /*#__PURE__*/React.createElement("input", {
2775
- type: "number",
2776
- style: {
2777
- width: "100%"
2778
- },
2779
- placeholder: dataVerification.placeholder3,
2780
- value: context.dataVerification.dataRegulation.value1,
2781
- onChange: function onChange(e) {
2782
- var value = e.target.value;
2783
- setContext(function (ctx) {
2784
- ctx.dataVerification.dataRegulation.value1 = value;
2785
- });
2786
- }
2787
- }))))), ((_context$dataVerifica16 = context.dataVerification) === null || _context$dataVerifica16 === void 0 ? void 0 : (_context$dataVerifica17 = _context$dataVerifica16.dataRegulation) === null || _context$dataVerifica17 === void 0 ? void 0 : _context$dataVerifica17.type) === "text_content" && (/*#__PURE__*/React.createElement("div", {
2788
- className: "show-box-item"
2789
- }, /*#__PURE__*/React.createElement("select", {
2790
- className: "data-verification-type-select",
2791
- value: context.dataVerification.dataRegulation.type2,
2792
- onChange: function onChange(e) {
2793
- var value = e.target.value;
2794
- setContext(function (ctx) {
2795
- ctx.dataVerification.dataRegulation.type2 = value;
2796
- ctx.dataVerification.dataRegulation.value1 = "";
2797
- ctx.dataVerification.dataRegulation.value2 = "";
2798
- });
2799
- }
2800
- }, ["include", "exclude", "equal"].map(function (v) {
2801
- return /*#__PURE__*/React.createElement("option", {
2802
- value: v,
2803
- key: v
2804
- }, dataVerification[v]);
2805
- })), /*#__PURE__*/React.createElement("div", {
2806
- className: "input-box"
2807
- }, /*#__PURE__*/React.createElement("input", {
2808
- type: "text",
2809
- style: {
2810
- width: "100%"
2811
- },
2812
- placeholder: dataVerification.placeholder4,
2813
- value: context.dataVerification.dataRegulation.value1,
2814
- onChange: function onChange(e) {
2815
- var value = e.target.value;
2816
- setContext(function (ctx) {
2817
- ctx.dataVerification.dataRegulation.value1 = value;
2818
- });
2819
- }
2820
- })))), ((_context$dataVerifica18 = context.dataVerification) === null || _context$dataVerifica18 === void 0 ? void 0 : (_context$dataVerifica19 = _context$dataVerifica18.dataRegulation) === null || _context$dataVerifica19 === void 0 ? void 0 : _context$dataVerifica19.type) === "date" && (/*#__PURE__*/React.createElement("div", {
2821
- className: "show-box-item"
2822
- }, /*#__PURE__*/React.createElement("select", {
2823
- className: "data-verification-type-select",
2872
+ })))), ((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "date" && (/*#__PURE__*/React.createElement("div", {
2873
+ className: "mt-4"
2874
+ }, /*#__PURE__*/React.createElement(Select$1, {
2824
2875
  value: context.dataVerification.dataRegulation.type2,
2825
- onChange: function onChange(e) {
2826
- var value = e.target.value;
2876
+ onValueChange: function onValueChange(value) {
2827
2877
  setContext(function (ctx) {
2828
2878
  ctx.dataVerification.dataRegulation.type2 = value;
2829
2879
  ctx.dataVerification.dataRegulation.value1 = "";
2830
2880
  ctx.dataVerification.dataRegulation.value2 = "";
2831
2881
  });
2832
2882
  }
2833
- }, dateCondition.map(function (v) {
2834
- return /*#__PURE__*/React.createElement("option", {
2883
+ }, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null)), /*#__PURE__*/React.createElement(SelectContent, null, dateCondition.map(function (v) {
2884
+ return /*#__PURE__*/React.createElement(SelectItem$1, {
2835
2885
  value: v,
2836
2886
  key: v
2837
2887
  }, dataVerification[v]);
2838
- })), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2839
- className: "input-box"
2888
+ }))), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2889
+ className: "mt-4 flex gap-2 items-center"
2890
+ }, /*#__PURE__*/React.createElement("div", {
2891
+ className: "datepicker-toggle"
2840
2892
  }, /*#__PURE__*/React.createElement("input", {
2841
2893
  type: "date",
2842
- placeholder: "1",
2894
+ className: "datepicker-input",
2843
2895
  value: context.dataVerification.dataRegulation.value1,
2844
2896
  onChange: function onChange(e) {
2845
2897
  var value = e.target.value;
@@ -2847,9 +2899,13 @@ var DataVerification = function DataVerification() {
2847
2899
  ctx.dataVerification.dataRegulation.value1 = value;
2848
2900
  });
2849
2901
  }
2850
- }), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
2902
+ }), /*#__PURE__*/React.createElement("span", {
2903
+ className: "datepicker-toggle-button"
2904
+ })), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("div", {
2905
+ className: "datepicker-toggle"
2906
+ }, /*#__PURE__*/React.createElement("input", {
2851
2907
  type: "date",
2852
- placeholder: "100",
2908
+ className: "datepicker-input",
2853
2909
  value: context.dataVerification.dataRegulation.value2,
2854
2910
  onChange: function onChange(e) {
2855
2911
  var value = e.target.value;
@@ -2857,13 +2913,15 @@ var DataVerification = function DataVerification() {
2857
2913
  ctx.dataVerification.dataRegulation.value2 = value;
2858
2914
  });
2859
2915
  }
2860
- }))) : (/*#__PURE__*/React.createElement("div", {
2861
- className: "input-box"
2916
+ }), /*#__PURE__*/React.createElement("span", {
2917
+ className: "datepicker-toggle-button"
2918
+ })))) : (/*#__PURE__*/React.createElement("div", {
2919
+ className: "mt-4"
2920
+ }, /*#__PURE__*/React.createElement("div", {
2921
+ className: "datepicker-toggle"
2862
2922
  }, /*#__PURE__*/React.createElement("input", {
2863
2923
  type: "date",
2864
- style: {
2865
- width: "100%"
2866
- },
2924
+ className: "datepicker-input",
2867
2925
  placeholder: dataVerification.placeholder3,
2868
2926
  value: context.dataVerification.dataRegulation.value1,
2869
2927
  onChange: function onChange(e) {
@@ -2872,57 +2930,35 @@ var DataVerification = function DataVerification() {
2872
2930
  ctx.dataVerification.dataRegulation.value1 = value;
2873
2931
  });
2874
2932
  }
2875
- }))))), ((_context$dataVerifica20 = context.dataVerification) === null || _context$dataVerifica20 === void 0 ? void 0 : (_context$dataVerifica21 = _context$dataVerifica20.dataRegulation) === null || _context$dataVerifica21 === void 0 ? void 0 : _context$dataVerifica21.type) === "validity" && (/*#__PURE__*/React.createElement("div", {
2876
- className: "show-box-item"
2877
- }, /*#__PURE__*/React.createElement("select", {
2878
- className: "data-verification-type-select",
2879
- value: context.dataVerification.dataRegulation.type2,
2880
- onChange: function onChange(e) {
2881
- var value = e.target.value;
2882
- setContext(function (ctx) {
2883
- ctx.dataVerification.dataRegulation.type2 = value;
2884
- ctx.dataVerification.dataRegulation.value1 = "";
2885
- ctx.dataVerification.dataRegulation.value2 = "";
2886
- });
2887
- }
2888
- }, ["identificationNumber", "phoneNumber"].map(function (v) {
2889
- return /*#__PURE__*/React.createElement("option", {
2890
- value: v,
2891
- key: v
2892
- }, dataVerification[v]);
2893
- }))))), /*#__PURE__*/React.createElement("div", {
2894
- className: "box-item"
2933
+ }), /*#__PURE__*/React.createElement("span", {
2934
+ className: "datepicker-toggle-button"
2935
+ }))))))), /*#__PURE__*/React.createElement(Divider$2, {
2936
+ className: "w-full border-t-[1px]"
2937
+ }), /*#__PURE__*/React.createElement("div", {
2938
+ className: "flex flex-col gap-2"
2895
2939
  }, ["prohibitInput", "hintShow"].map(function (v) {
2896
2940
  return /*#__PURE__*/React.createElement("div", {
2897
- className: "check",
2898
- key: "div".concat(v)
2899
- }, /*#__PURE__*/React.createElement("input", {
2900
- type: "checkbox",
2901
- id: v,
2902
- key: "input".concat(v),
2941
+ key: v,
2942
+ className: "flex items-center"
2943
+ }, /*#__PURE__*/React.createElement(Checkbox, {
2944
+ className: "border-2",
2903
2945
  checked: context.dataVerification.dataRegulation[v],
2904
- onChange: function onChange() {
2946
+ onCheckedChange: function onCheckedChange(e) {
2947
+ var checked = e.target.checked;
2905
2948
  setContext(function (ctx) {
2906
2949
  var _ctx$dataVerification5;
2907
2950
  var dataRegulation = (_ctx$dataVerification5 = ctx.dataVerification) === null || _ctx$dataVerification5 === void 0 ? void 0 : _ctx$dataVerification5.dataRegulation;
2908
2951
  if (v === "prohibitInput") {
2909
- dataRegulation.prohibitInput = !dataRegulation.prohibitInput;
2952
+ dataRegulation.prohibitInput = checked;
2910
2953
  } else if (v === "hintShow") {
2911
- dataRegulation.hintShow = !dataRegulation.hintShow;
2954
+ dataRegulation.hintShow = checked;
2912
2955
  }
2913
2956
  });
2914
- }
2915
- }), /*#__PURE__*/React.createElement("label", {
2916
- htmlFor: v,
2917
- key: "label".concat(v)
2918
- }, dataVerification[v]));
2919
- }), ((_context$dataVerifica22 = context.dataVerification) === null || _context$dataVerifica22 === void 0 ? void 0 : (_context$dataVerifica23 = _context$dataVerifica22.dataRegulation) === null || _context$dataVerifica23 === void 0 ? void 0 : _context$dataVerifica23.hintShow) && (/*#__PURE__*/React.createElement("div", {
2920
- className: "input-box"
2921
- }, /*#__PURE__*/React.createElement("input", {
2922
- type: "text",
2923
- style: {
2924
- width: "100%"
2925
- },
2957
+ }
2958
+ }), /*#__PURE__*/React.createElement("span", {
2959
+ className: "ml-2"
2960
+ }, dataVerification[v]));
2961
+ }), ((_context$dataVerifica10 = context.dataVerification) === null || _context$dataVerifica10 === void 0 ? void 0 : (_context$dataVerifica11 = _context$dataVerifica10.dataRegulation) === null || _context$dataVerifica11 === void 0 ? void 0 : _context$dataVerifica11.hintShow) && (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextField, {
2926
2962
  placeholder: dataVerification.placeholder5,
2927
2963
  value: context.dataVerification.dataRegulation.hintValue,
2928
2964
  onChange: function onChange(e) {
@@ -2931,25 +2967,37 @@ var DataVerification = function DataVerification() {
2931
2967
  ctx.dataVerification.dataRegulation.hintValue = value;
2932
2968
  });
2933
2969
  }
2934
- }))))), /*#__PURE__*/React.createElement("div", {
2935
- className: "button-basic button-primary",
2970
+ }))))), /*#__PURE__*/React.createElement(Divider$2, {
2971
+ className: "w-full border-t-[1px] my-4"
2972
+ }), /*#__PURE__*/React.createElement("div", {
2973
+ className: "flex gap-2 justify-between items-center"
2974
+ }, /*#__PURE__*/React.createElement(Button$1, {
2975
+ variant: "secondary",
2976
+ style: {
2977
+ minWidth: "80px"
2978
+ },
2936
2979
  onClick: function onClick() {
2937
- btn("confirm");
2980
+ btn("close");
2981
+ }
2982
+ }, button.cancel), /*#__PURE__*/React.createElement("div", {
2983
+ className: "flex gap-2"
2984
+ }, /*#__PURE__*/React.createElement(Button$1, {
2985
+ variant: "secondary",
2986
+ style: {
2987
+ minWidth: "80px"
2938
2988
  },
2939
- tabIndex: 0
2940
- }, button.confirm), /*#__PURE__*/React.createElement("div", {
2941
- className: "button-basic button-close",
2942
2989
  onClick: function onClick() {
2943
2990
  btn("delete");
2991
+ }
2992
+ }, dataVerification.deleteVerification), /*#__PURE__*/React.createElement(Button$1, {
2993
+ variant: "default",
2994
+ style: {
2995
+ minWidth: "80px"
2944
2996
  },
2945
- tabIndex: 0
2946
- }, dataVerification.deleteVerification), /*#__PURE__*/React.createElement("div", {
2947
- className: "button-basic button-close",
2948
2997
  onClick: function onClick() {
2949
- btn("close");
2950
- },
2951
- tabIndex: 0
2952
- }, button.cancel));
2998
+ btn("confirm");
2999
+ }
3000
+ }, button.confirm))));
2953
3001
  };
2954
3002
 
2955
3003
  function getDisplayedRangeTxt(context) {
@@ -2961,12 +3009,7 @@ function getDisplayedRangeTxt(context) {
2961
3009
  return (_context$rangeDialog$ = (_context$rangeDialog = context.rangeDialog) === null || _context$rangeDialog === void 0 ? void 0 : _context$rangeDialog.rangeTxt) !== null && _context$rangeDialog$ !== void 0 ? _context$rangeDialog$ : "";
2962
3010
  }
2963
3011
 
2964
- var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
2965
- if (typeof document !== "undefined") {
2966
- var styleSheet = document.createElement("style");
2967
- styleSheet.textContent = datepickerStyles;
2968
- document.head.appendChild(styleSheet);
2969
- }
3012
+ injectDatepickerStyles();
2970
3013
  var ConditionRules = function ConditionRules(_ref) {
2971
3014
  var type = _ref.type;
2972
3015
  var _useContext = useContext(WorkbookContext),
@@ -3287,7 +3330,8 @@ var RangeDialog = function RangeDialog() {
3287
3330
  showDialog = _useDialog.showDialog;
3288
3331
  var _locale = locale(context),
3289
3332
  dataVerification = _locale.dataVerification,
3290
- button = _locale.button;
3333
+ button = _locale.button,
3334
+ toolbar = _locale.toolbar;
3291
3335
  var _useState = useState(getDisplayedRangeTxt(context)),
3292
3336
  _useState2 = _slicedToArray(_useState, 2),
3293
3337
  rangeTxt2 = _useState2[0],
@@ -3312,7 +3356,7 @@ var RangeDialog = function RangeDialog() {
3312
3356
  }), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
3313
3357
  return;
3314
3358
  }
3315
- showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
3359
+ showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
3316
3360
  }, [setContext, showDialog, context]);
3317
3361
  useEffect(function () {
3318
3362
  setRangeTxt2(getDisplayedRangeTxt(context));
@@ -3501,7 +3545,7 @@ var DropDownList = function DropDownList() {
3501
3545
  arr.splice(index, 1);
3502
3546
  }
3503
3547
  setSelected(arr);
3504
- setDropcownValue(ctx, v, arr);
3548
+ setDropdownValue(ctx, v, arr);
3505
3549
  });
3506
3550
  },
3507
3551
  tabIndex: 0
@@ -3516,6 +3560,118 @@ var DropDownList = function DropDownList() {
3516
3560
  }));
3517
3561
  };
3518
3562
 
3563
+ var IframeBoxs = function IframeBoxs() {
3564
+ var _context$insertedIfra;
3565
+ var _useContext = useContext(WorkbookContext),
3566
+ context = _useContext.context,
3567
+ setContext = _useContext.setContext,
3568
+ refs = _useContext.refs;
3569
+ var containerRef = useRef(null);
3570
+ useEffect(function () {
3571
+ var handleClickOutside = function handleClickOutside(e) {
3572
+ if (!containerRef.current) return;
3573
+ var iframeBoxes = containerRef.current.querySelectorAll(".luckysheet-modal-dialog-iframe");
3574
+ var clickedInsideSomeIframe = Array.from(iframeBoxes).some(function (el) {
3575
+ return el.contains(e.target);
3576
+ });
3577
+ if (!clickedInsideSomeIframe && context.activeIframe !== undefined) {
3578
+ setContext(function (ctx) {
3579
+ ctx.activeIframe = undefined;
3580
+ });
3581
+ }
3582
+ };
3583
+ document.addEventListener("mousedown", handleClickOutside);
3584
+ return function () {
3585
+ document.removeEventListener("mousedown", handleClickOutside);
3586
+ };
3587
+ }, [context.activeIframe, setContext]);
3588
+ return /*#__PURE__*/React.createElement("div", {
3589
+ id: "fortune-iframe-boxes",
3590
+ ref: containerRef
3591
+ }, (_context$insertedIfra = context.insertedIframes) === null || _context$insertedIfra === void 0 ? void 0 : _context$insertedIfra.map(function (frame) {
3592
+ var isActive = frame.id === context.activeIframe;
3593
+ var style = {
3594
+ width: frame.width * context.zoomRatio,
3595
+ height: frame.height * context.zoomRatio,
3596
+ left: frame.left * context.zoomRatio,
3597
+ top: frame.top * context.zoomRatio,
3598
+ position: "absolute",
3599
+ padding: 0,
3600
+ zIndex: isActive ? 300 : 200
3601
+ };
3602
+ return /*#__PURE__*/React.createElement("div", {
3603
+ key: frame.id,
3604
+ id: isActive ? "fortune-modal-dialog-activeIframe" : frame.id,
3605
+ className: "luckysheet-modal-dialog luckysheet-modal-dialog-iframe",
3606
+ style: style,
3607
+ onClick: function onClick(e) {
3608
+ if (!isActive) {
3609
+ setContext(function (ctx) {
3610
+ ctx.activeIframe = frame.id;
3611
+ });
3612
+ }
3613
+ e.stopPropagation();
3614
+ },
3615
+ onMouseDown: function onMouseDown(e) {
3616
+ if (isActive) {
3617
+ onIframeMoveStart(context, refs.globalCache, e.nativeEvent);
3618
+ }
3619
+ e.stopPropagation();
3620
+ }
3621
+ }, /*#__PURE__*/React.createElement("div", {
3622
+ className: "luckysheet-modal-dialog-content",
3623
+ style: {
3624
+ width: "100%",
3625
+ height: "100%",
3626
+ overflow: "hidden"
3627
+ }
3628
+ }, /*#__PURE__*/React.createElement("iframe", {
3629
+ title: "iframe-".concat(frame.id),
3630
+ src: frame.src,
3631
+ style: {
3632
+ width: "100%",
3633
+ height: "100%",
3634
+ border: "none",
3635
+ pointerEvents: "none"
3636
+ }
3637
+ })), /*#__PURE__*/React.createElement("div", {
3638
+ className: "luckysheet-modal-dialog-border"
3639
+ }), isActive && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3640
+ className: "luckysheet-modal-dialog-resize"
3641
+ }, ["lt", "mt", "lm", "rm", "rt", "lb", "mb", "rb"].map(function (dir) {
3642
+ return /*#__PURE__*/React.createElement("div", {
3643
+ key: dir,
3644
+ className: "luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-".concat(dir),
3645
+ "data-type": dir,
3646
+ style: {
3647
+ zIndex: 300,
3648
+ position: "absolute"
3649
+ },
3650
+ onMouseDown: function onMouseDown(e) {
3651
+ onIframeResizeStart(context, refs.globalCache, e.nativeEvent, dir);
3652
+ e.stopPropagation();
3653
+ }
3654
+ });
3655
+ })), /*#__PURE__*/React.createElement("div", {
3656
+ className: "luckysheet-modal-dialog-controll"
3657
+ }, /*#__PURE__*/React.createElement("span", {
3658
+ className: "luckysheet-modal-controll-btn luckysheet-modal-controll-del",
3659
+ role: "button",
3660
+ tabIndex: 0,
3661
+ title: "Delete",
3662
+ onClick: function onClick() {
3663
+ setContext(function (ctx) {
3664
+ var _ctx$insertedIframes;
3665
+ ctx.insertedIframes = ctx === null || ctx === void 0 ? void 0 : (_ctx$insertedIframes = ctx.insertedIframes) === null || _ctx$insertedIframes === void 0 ? void 0 : _ctx$insertedIframes.filter(function (f) {
3666
+ return f.id !== frame.id;
3667
+ });
3668
+ ctx.activeIframe = undefined;
3669
+ });
3670
+ }
3671
+ }, "DELETE")))));
3672
+ }));
3673
+ };
3674
+
3519
3675
  var SheetOverlay = function SheetOverlay() {
3520
3676
  var _refs$cellArea$curren, _refs$cellArea$curren2, _context$luckysheet_s, _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4, _context$luckysheet_s5, _context$luckysheet_s6, _context$presences$le, _context$presences, _context$linkCard, _context$rangeDialog;
3521
3677
  var _useContext = useContext(WorkbookContext),
@@ -3958,7 +4114,7 @@ var SheetOverlay = function SheetOverlay() {
3958
4114
  id: "luckysheet-multipleRange-show"
3959
4115
  }), /*#__PURE__*/React.createElement("div", {
3960
4116
  id: "luckysheet-dynamicArray-hightShow"
3961
- }), /*#__PURE__*/React.createElement(ImgBoxs, null), /*#__PURE__*/React.createElement("div", {
4117
+ }), /*#__PURE__*/React.createElement(ImgBoxs, null), /*#__PURE__*/React.createElement(IframeBoxs, null), /*#__PURE__*/React.createElement("div", {
3962
4118
  id: "luckysheet-dataVerification-dropdown-btn",
3963
4119
  onClick: function onClick() {
3964
4120
  setContext(function (ctx) {
@@ -3971,8 +4127,9 @@ var SheetOverlay = function SheetOverlay() {
3971
4127
  display: "none"
3972
4128
  }
3973
4129
  }, /*#__PURE__*/React.createElement(SVGIcon, {
3974
- name: "combo-arrow",
3975
- width: 16
4130
+ name: "caret-down-fill",
4131
+ width: 16,
4132
+ height: 16
3976
4133
  })), context.dataVerificationDropDownList && /*#__PURE__*/React.createElement(DropDownList, null), /*#__PURE__*/React.createElement("div", {
3977
4134
  id: "luckysheet-dataVerification-showHintBox",
3978
4135
  className: "luckysheet-mousedown-cancel",
@@ -4206,6 +4363,9 @@ var Sheet = function Sheet(_ref) {
4206
4363
  }
4207
4364
  }, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
4208
4365
  var onWheel = useCallback(function (e) {
4366
+ var el = document.getElementById("function-details");
4367
+ var isMouseOver = el === null || el === void 0 ? void 0 : el.matches(":hover");
4368
+ if (el && isMouseOver) return;
4209
4369
  setContext(function (draftCtx) {
4210
4370
  handleGlobalWheel(draftCtx, e, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
4211
4371
  });
@@ -4291,6 +4451,9 @@ var Combo = function Combo(_ref) {
4291
4451
  setPopupPosition = _useState4[1];
4292
4452
  var popupRef = useRef(null);
4293
4453
  var buttonRef = useRef(null);
4454
+ var isLucideIcon = useMemo(function () {
4455
+ return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
4456
+ }, [iconId]);
4294
4457
  useOutsideClick(popupRef, function () {
4295
4458
  setOpen(false);
4296
4459
  });
@@ -4318,7 +4481,7 @@ var Combo = function Combo(_ref) {
4318
4481
  }, /*#__PURE__*/React.createElement("div", {
4319
4482
  ref: buttonRef,
4320
4483
  className: "fortune-toolbar-combo"
4321
- }, /*#__PURE__*/React.createElement("div", {
4484
+ }, !isLucideIcon ? (/*#__PURE__*/React.createElement("div", {
4322
4485
  className: "fortune-toolbar-combo-button",
4323
4486
  onClick: function onClick(e) {
4324
4487
  if (_onClick) {
@@ -4337,7 +4500,13 @@ var Combo = function Combo(_ref) {
4337
4500
  name: iconId
4338
4501
  })) : (/*#__PURE__*/React.createElement("span", {
4339
4502
  className: "fortune-toolbar-combo-text"
4340
- }, text !== undefined ? text : ""))), showArrow && (/*#__PURE__*/React.createElement("div", {
4503
+ }, text !== undefined ? text : "")))) : (/*#__PURE__*/React.createElement(IconButton, {
4504
+ icon: getIcon(iconId),
4505
+ variant: "ghost",
4506
+ onClick: function onClick() {
4507
+ return setOpen(!open);
4508
+ }
4509
+ })), showArrow && (/*#__PURE__*/React.createElement("div", {
4341
4510
  className: "fortune-toolbar-combo-arrow",
4342
4511
  onClick: function onClick() {
4343
4512
  return setOpen(!open);
@@ -5242,6 +5411,121 @@ var FormatSearch = function FormatSearch(_ref) {
5242
5411
  }, button.cancel)));
5243
5412
  };
5244
5413
 
5414
+ var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
5415
+ var isOpen = _ref.isOpen,
5416
+ onClose = _ref.onClose,
5417
+ onSubmit = _ref.onSubmit,
5418
+ icon = _ref.icon,
5419
+ _ref$submitText = _ref.submitText,
5420
+ submitText = _ref$submitText === void 0 ? "Submit" : _ref$submitText,
5421
+ _ref$placeholder = _ref.placeholder,
5422
+ placeholder = _ref$placeholder === void 0 ? "Enter a value..." : _ref$placeholder;
5423
+ var _useState = useState(""),
5424
+ _useState2 = _slicedToArray(_useState, 2),
5425
+ url = _useState2[0],
5426
+ setUrl = _useState2[1];
5427
+ var _useState3 = useState(false),
5428
+ _useState4 = _slicedToArray(_useState3, 2),
5429
+ showError = _useState4[0],
5430
+ setShowError = _useState4[1];
5431
+ var inputRef = useRef(null);
5432
+ useEffect(function () {
5433
+ if (isOpen && inputRef.current) {
5434
+ var timer = setTimeout(function () {
5435
+ var _inputRef$current;
5436
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
5437
+ }, 100);
5438
+ return function () {
5439
+ return clearTimeout(timer);
5440
+ };
5441
+ }
5442
+ return undefined;
5443
+ }, [isOpen]);
5444
+ if (!isOpen) return null;
5445
+ var handleSubmit = function handleSubmit() {
5446
+ var trimmed = url.trim();
5447
+ if (trimmed && sanitizeDuneUrl(trimmed)) {
5448
+ onSubmit(trimmed);
5449
+ setUrl("");
5450
+ setShowError(false);
5451
+ onClose();
5452
+ } else {
5453
+ setShowError(true);
5454
+ }
5455
+ };
5456
+ var handleKeyDown = function handleKeyDown(e) {
5457
+ e.stopPropagation();
5458
+ if (e.key === "Enter") {
5459
+ handleSubmit();
5460
+ }
5461
+ };
5462
+ return /*#__PURE__*/React.createElement("div", {
5463
+ className: "custom-overlay",
5464
+ onClick: onClose
5465
+ }, /*#__PURE__*/React.createElement("div", {
5466
+ className: "input-modal",
5467
+ style: {
5468
+ transformOrigin: "top center"
5469
+ },
5470
+ onClick: function onClick(e) {
5471
+ return e.stopPropagation();
5472
+ },
5473
+ onKeyDown: handleKeyDown
5474
+ }, /*#__PURE__*/React.createElement("div", {
5475
+ className: "modal-header"
5476
+ }, /*#__PURE__*/React.createElement(SVGIcon, {
5477
+ name: icon
5478
+ }), /*#__PURE__*/React.createElement("input", {
5479
+ ref: inputRef,
5480
+ className: "modal-input",
5481
+ type: "text",
5482
+ placeholder: placeholder,
5483
+ value: url,
5484
+ onChange: function onChange(e) {
5485
+ setUrl(e.target.value);
5486
+ setShowError(false);
5487
+ },
5488
+ onKeyDown: handleKeyDown
5489
+ })), showError && (/*#__PURE__*/React.createElement("div", {
5490
+ className: "modal-error-message"
5491
+ }, /*#__PURE__*/React.createElement(SVGIcon, {
5492
+ style: {
5493
+ width: "14px",
5494
+ height: "14px"
5495
+ },
5496
+ name: "circle-alert"
5497
+ }), /*#__PURE__*/React.createElement("span", null, "Please make sure the URL is a valid Dune chart link"))), url.length > 0 && !showError && (/*#__PURE__*/React.createElement("div", {
5498
+ className: "modal-footer"
5499
+ }, /*#__PURE__*/React.createElement(Button$1, {
5500
+ onClick: handleSubmit,
5501
+ className: "modal-button"
5502
+ }, submitText)))));
5503
+ };
5504
+
5505
+ var getIcon = function getIcon(title) {
5506
+ switch (title) {
5507
+ case "align-left":
5508
+ return "AlignLeft";
5509
+ case "align-center":
5510
+ return "AlignCenter";
5511
+ case "align-right":
5512
+ return "AlignRight";
5513
+ case "align-top":
5514
+ return "ArrowUpFromLine";
5515
+ case "align-middle":
5516
+ return "AlignVerticalMiddle";
5517
+ case "align-bottom":
5518
+ return "ArrowDownFromLine";
5519
+ case "text-overflow":
5520
+ return "TextOverflow";
5521
+ case "text-wrap":
5522
+ return "WrapText";
5523
+ case "text-clip":
5524
+ return "TextClip";
5525
+ default:
5526
+ return "";
5527
+ }
5528
+ };
5245
5529
  var Toolbar = function Toolbar(_ref) {
5246
5530
  var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
5247
5531
  var setMoreItems = _ref.setMoreItems,
@@ -5263,6 +5547,10 @@ var Toolbar = function Toolbar(_ref) {
5263
5547
  _useState4 = _slicedToArray(_useState3, 2),
5264
5548
  itemLocations = _useState4[0],
5265
5549
  setItemLocations = _useState4[1];
5550
+ var _useState5 = useState(false),
5551
+ _useState6 = _slicedToArray(_useState5, 2),
5552
+ showDuneModal = _useState6[0],
5553
+ setShowDuneModal = _useState6[1];
5266
5554
  var _useDialog = useDialog(),
5267
5555
  showDialog = _useDialog.showDialog,
5268
5556
  hideDialog = _useDialog.hideDialog;
@@ -5293,14 +5581,12 @@ var Toolbar = function Toolbar(_ref) {
5293
5581
  var sheetWidth = context.luckysheetTableContentHW[0];
5294
5582
  var currency = settings.currency;
5295
5583
  var defaultFormat = defaultFmt(currency);
5296
- var _useState5 = useState("#000000"),
5297
- _useState6 = _slicedToArray(_useState5, 2),
5298
- customColor = _useState6[0],
5299
- setcustomColor = _useState6[1];
5300
- var _useState7 = useState("1"),
5301
- _useState8 = _slicedToArray(_useState7, 2),
5302
- customStyle = _useState8[0],
5303
- setcustomStyle = _useState8[1];
5584
+ var _useState7 = useState("#000000"),
5585
+ _useState8 = _slicedToArray(_useState7, 1),
5586
+ customColor = _useState8[0];
5587
+ var _useState9 = useState("1"),
5588
+ _useState0 = _slicedToArray(_useState9, 1),
5589
+ customStyle = _useState0[0];
5304
5590
  var showSubMenu = useCallback(function (e, className) {
5305
5591
  var target = e.target;
5306
5592
  var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
@@ -5580,27 +5866,38 @@ var Toolbar = function Toolbar(_ref) {
5580
5866
  tooltip: toolbar.horizontalAlign,
5581
5867
  showArrow: false
5582
5868
  }, function (setOpen) {
5583
- return /*#__PURE__*/React.createElement(Select, null, items.map(function (_ref3) {
5584
- var text = _ref3.text,
5585
- title = _ref3.title;
5586
- return /*#__PURE__*/React.createElement(Option, {
5869
+ return /*#__PURE__*/React.createElement(Select, {
5870
+ style: {
5871
+ minWidth: "fit-content",
5872
+ display: "flex",
5873
+ flexDirection: "row",
5874
+ alignItems: "center",
5875
+ justifyContent: "center",
5876
+ gap: 4
5877
+ }
5878
+ }, items.map(function (_ref3) {
5879
+ var _$find2;
5880
+ var title = _ref3.title;
5881
+ return /*#__PURE__*/React.createElement(IconButton, {
5587
5882
  key: title,
5883
+ isActive: ((_$find2 = _.find(items, function (item) {
5884
+ return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
5885
+ })) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
5886
+ icon: getIcon(title),
5887
+ variant: "ghost",
5588
5888
  onClick: function onClick() {
5589
5889
  setContext(function (ctx) {
5590
5890
  handleHorizontalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
5591
5891
  });
5592
5892
  setOpen(false);
5593
- }
5594
- }, /*#__PURE__*/React.createElement("div", {
5595
- className: "fortune-toolbar-menu-line"
5596
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
5597
- name: title
5598
- })));
5893
+ },
5894
+ tabIndex: 0
5895
+ });
5599
5896
  }));
5600
5897
  });
5601
5898
  }
5602
5899
  if (name === "vertical-align") {
5603
- var _$find2;
5900
+ var _$find3;
5604
5901
  var _items = [{
5605
5902
  title: "align-top",
5606
5903
  text: align.top,
@@ -5615,29 +5912,40 @@ var Toolbar = function Toolbar(_ref) {
5615
5912
  value: 2
5616
5913
  }];
5617
5914
  return /*#__PURE__*/React.createElement(Combo, {
5618
- iconId: ((_$find2 = _.find(_items, function (item) {
5915
+ iconId: ((_$find3 = _.find(_items, function (item) {
5619
5916
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
5620
- })) === null || _$find2 === void 0 ? void 0 : _$find2.title) || "align-top",
5917
+ })) === null || _$find3 === void 0 ? void 0 : _$find3.title) || "align-top",
5621
5918
  key: name,
5622
5919
  tooltip: toolbar.verticalAlign,
5623
5920
  showArrow: false
5624
5921
  }, function (setOpen) {
5625
- return /*#__PURE__*/React.createElement(Select, null, _items.map(function (_ref4) {
5626
- var text = _ref4.text,
5627
- title = _ref4.title;
5628
- return /*#__PURE__*/React.createElement(Option, {
5922
+ return /*#__PURE__*/React.createElement(Select, {
5923
+ style: {
5924
+ minWidth: "fit-content",
5925
+ display: "flex",
5926
+ flexDirection: "row",
5927
+ alignItems: "center",
5928
+ justifyContent: "center",
5929
+ gap: 4
5930
+ }
5931
+ }, _items.map(function (_ref4) {
5932
+ var _$find4;
5933
+ var title = _ref4.title;
5934
+ return /*#__PURE__*/React.createElement(IconButton, {
5629
5935
  key: title,
5936
+ isActive: ((_$find4 = _.find(_items, function (item) {
5937
+ return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
5938
+ })) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
5939
+ icon: getIcon(title),
5940
+ variant: "ghost",
5630
5941
  onClick: function onClick() {
5631
5942
  setContext(function (ctx) {
5632
5943
  handleVerticalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
5633
5944
  });
5634
5945
  setOpen(false);
5635
- }
5636
- }, /*#__PURE__*/React.createElement("div", {
5637
- className: "fortune-toolbar-menu-line"
5638
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
5639
- name: title
5640
- })));
5946
+ },
5947
+ tabIndex: 0
5948
+ });
5641
5949
  }));
5642
5950
  });
5643
5951
  }
@@ -5712,7 +6020,7 @@ var Toolbar = function Toolbar(_ref) {
5712
6020
  key: name,
5713
6021
  onClick: function onClick() {
5714
6022
  if (context.allowEdit === false) return;
5715
- showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
6023
+ showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
5716
6024
  }
5717
6025
  });
5718
6026
  }
@@ -6186,12 +6494,23 @@ var Toolbar = function Toolbar(_ref) {
6186
6494
  tooltip: toolbar.textWrap,
6187
6495
  showArrow: false
6188
6496
  }, function (setOpen) {
6189
- return /*#__PURE__*/React.createElement(Select, null, _items6.map(function (_ref1) {
6190
- var text = _ref1.text,
6191
- iconId = _ref1.iconId,
6497
+ return /*#__PURE__*/React.createElement(Select, {
6498
+ style: {
6499
+ minWidth: "fit-content",
6500
+ display: "flex",
6501
+ flexDirection: "row",
6502
+ alignItems: "center",
6503
+ justifyContent: "center",
6504
+ gap: 4
6505
+ }
6506
+ }, _items6.map(function (_ref1) {
6507
+ var iconId = _ref1.iconId,
6192
6508
  value = _ref1.value;
6193
- return /*#__PURE__*/React.createElement(Option, {
6509
+ return /*#__PURE__*/React.createElement(IconButton, {
6194
6510
  key: value,
6511
+ isActive: _curr.value === value,
6512
+ icon: getIcon(iconId),
6513
+ variant: "ghost",
6195
6514
  onClick: function onClick() {
6196
6515
  setContext(function (ctx) {
6197
6516
  var d = getFlowdata(ctx);
@@ -6199,12 +6518,9 @@ var Toolbar = function Toolbar(_ref) {
6199
6518
  updateFormat(ctx, refs.cellInput.current, d, "tb", value);
6200
6519
  });
6201
6520
  setOpen(false);
6202
- }
6203
- }, /*#__PURE__*/React.createElement("div", {
6204
- className: "fortune-toolbar-menu-line"
6205
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
6206
- name: iconId
6207
- })));
6521
+ },
6522
+ tabIndex: 0
6523
+ });
6208
6524
  }));
6209
6525
  });
6210
6526
  }
@@ -6355,7 +6671,7 @@ var Toolbar = function Toolbar(_ref) {
6355
6671
  });
6356
6672
  }
6357
6673
  });
6358
- }, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula, showDialog, hideDialog, 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]);
6674
+ }, [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]);
6359
6675
  return /*#__PURE__*/React.createElement("div", {
6360
6676
  ref: containerRef,
6361
6677
  className: "fortune-toolbar",
@@ -6410,7 +6726,29 @@ var Toolbar = function Toolbar(_ref) {
6410
6726
  icon: n.icon,
6411
6727
  iconName: n.iconName
6412
6728
  }, n.children);
6413
- }));
6729
+ }), /*#__PURE__*/React.createElement(Button, {
6730
+ iconId: "dune-logo",
6731
+ tooltip: "Insert Dune Chart",
6732
+ key: "dune-charts",
6733
+ onClick: function onClick() {
6734
+ if (context.allowEdit === false) return;
6735
+ setShowDuneModal(true);
6736
+ }
6737
+ }), showDuneModal && (/*#__PURE__*/React.createElement(DuneChartsInputModal, {
6738
+ isOpen: showDuneModal,
6739
+ onSubmit: function onSubmit(url) {
6740
+ setContext(function (draftCtx) {
6741
+ insertDuneChart(draftCtx, url);
6742
+ });
6743
+ setShowDuneModal(false);
6744
+ },
6745
+ onClose: function onClose() {
6746
+ return setShowDuneModal(false);
6747
+ },
6748
+ icon: "dune-logo",
6749
+ placeholder: "Add Dune chart link to embed",
6750
+ submitText: "Embed Dune chart"
6751
+ })));
6414
6752
  };
6415
6753
 
6416
6754
  var LocationBox = function LocationBox() {
@@ -9541,6 +9879,74 @@ var SVGDefines = function SVGDefines(_ref) {
9541
9879
  "clip-rule": "evenodd",
9542
9880
  d: "M12.75 2.25C13.1642 2.25 13.5 2.58579 13.5 3V15C13.5 15.4142 13.1642 15.75 12.75 15.75C12.3358 15.75 12 15.4142 12 15V3C12 2.58579 12.3358 2.25 12.75 2.25Z",
9543
9881
  fill: "#363B3F"
9882
+ })), /*#__PURE__*/React.createElement("symbol", {
9883
+ id: "dune-logo",
9884
+ viewBox: "0 0 18 16",
9885
+ fill: "none"
9886
+ }, /*#__PURE__*/React.createElement("svg", {
9887
+ width: "18",
9888
+ height: "16",
9889
+ viewBox: "0 0 18 16",
9890
+ fill: "none",
9891
+ xmlns: "http://www.w3.org/2000/svg"
9892
+ }, /*#__PURE__*/React.createElement("g", {
9893
+ "clip-path": "url(#clip0_80_246690)"
9894
+ }, /*#__PURE__*/React.createElement("path", {
9895
+ d: "M7.99485 15.9875C12.4102 15.9875 15.9896 12.4085 15.9896 7.99373C15.9896 3.57891 12.4102 0 7.99485 0C3.57941 0 0 3.57891 0 7.99373C0 12.4085 3.57941 15.9875 7.99485 15.9875Z",
9896
+ fill: "#F4603E"
9897
+ }), /*#__PURE__*/React.createElement("path", {
9898
+ d: "M1.39258 12.5028C1.39258 12.5028 6.67562 10.7723 15.9868 7.73633C15.9868 7.73633 16.4968 12.7082 11.3424 15.3015C11.3424 15.3015 8.80068 16.5197 6.01215 15.7383C6.01215 15.7383 3.23545 15.2142 1.39258 12.5028Z",
9899
+ fill: "#1E1870"
9900
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
9901
+ id: "clip0_80_246690"
9902
+ }, /*#__PURE__*/React.createElement("rect", {
9903
+ width: "16",
9904
+ height: "16",
9905
+ fill: "white"
9906
+ }))))), /*#__PURE__*/React.createElement("symbol", {
9907
+ id: "circle-alert",
9908
+ viewBox: "0 0 14 14",
9909
+ fill: "none"
9910
+ }, /*#__PURE__*/React.createElement("svg", {
9911
+ width: "14",
9912
+ height: "14",
9913
+ viewBox: "0 0 14 14",
9914
+ fill: "none",
9915
+ xmlns: "http://www.w3.org/2000/svg"
9916
+ }, /*#__PURE__*/React.createElement("g", {
9917
+ "clip-path": "url(#clip0_138_127604)"
9918
+ }, /*#__PURE__*/React.createElement("path", {
9919
+ d: "M6.99967 4.0835C7.32184 4.0835 7.58301 4.34466 7.58301 4.66683V7.00016C7.58301 7.32233 7.32184 7.5835 6.99967 7.5835C6.67751 7.5835 6.41634 7.32233 6.41634 7.00016V4.66683C6.41634 4.34466 6.67751 4.0835 6.99967 4.0835Z",
9920
+ fill: "#FB3449"
9921
+ }), /*#__PURE__*/React.createElement("path", {
9922
+ d: "M6.99967 8.75016C6.67751 8.75016 6.41634 9.01133 6.41634 9.3335C6.41634 9.65566 6.67751 9.91683 6.99967 9.91683H7.00551C7.32767 9.91683 7.58884 9.65566 7.58884 9.3335C7.58884 9.01133 7.32767 8.75016 7.00551 8.75016H6.99967Z",
9923
+ fill: "#FB3449"
9924
+ }), /*#__PURE__*/React.createElement("path", {
9925
+ "fill-rule": "evenodd",
9926
+ "clip-rule": "evenodd",
9927
+ d: "M0.583008 7.00016C0.583008 3.45634 3.45585 0.583496 6.99967 0.583496C10.5435 0.583496 13.4163 3.45634 13.4163 7.00016C13.4163 10.544 10.5435 13.4168 6.99967 13.4168C3.45585 13.4168 0.583008 10.544 0.583008 7.00016ZM6.99967 1.75016C4.10018 1.75016 1.74967 4.10067 1.74967 7.00016C1.74967 9.89966 4.10018 12.2502 6.99967 12.2502C9.89917 12.2502 12.2497 9.89966 12.2497 7.00016C12.2497 4.10067 9.89917 1.75016 6.99967 1.75016Z",
9928
+ fill: "#FB3449"
9929
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
9930
+ id: "clip0_138_127604"
9931
+ }, /*#__PURE__*/React.createElement("rect", {
9932
+ width: "14",
9933
+ height: "14",
9934
+ fill: "white"
9935
+ }))))), /*#__PURE__*/React.createElement("symbol", {
9936
+ id: "caret-down-fill",
9937
+ width: "14",
9938
+ height: "14",
9939
+ viewBox: "0 0 14 14",
9940
+ fill: "none"
9941
+ }, /*#__PURE__*/React.createElement("rect", {
9942
+ width: "14",
9943
+ height: "14",
9944
+ rx: "4",
9945
+ fill: "black",
9946
+ "fill-opacity": "0.1"
9947
+ }), /*#__PURE__*/React.createElement("path", {
9948
+ d: "M6.64775 8.97978L3.77152 6.10355C3.45654 5.78857 3.67962 5.25 4.12507 5.25H9.87753C10.323 5.25 10.5461 5.78857 10.2311 6.10355L7.35486 8.97978C7.15959 9.17504 6.84301 9.17504 6.64775 8.97978Z",
9949
+ fill: "#363B3F"
9544
9950
  }))));
9545
9951
  };
9546
9952
 
@@ -10180,6 +10586,9 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
10180
10586
  },
10181
10587
  getLocaleContext: function getLocaleContext() {
10182
10588
  return locale(context);
10589
+ },
10590
+ getWorkbookContext: function getWorkbookContext() {
10591
+ return context;
10183
10592
  }
10184
10593
  };
10185
10594
  }
@@ -10903,6 +11312,48 @@ var SheetList = function SheetList() {
10903
11312
  }));
10904
11313
  };
10905
11314
 
11315
+ var DunePreview = function DunePreview(_ref) {
11316
+ var url = _ref.url,
11317
+ position = _ref.position,
11318
+ onKeepAsLink = _ref.onKeepAsLink,
11319
+ onEmbed = _ref.onEmbed;
11320
+ var embedUrl = sanitizeDuneUrl(url);
11321
+ if (!embedUrl) return null;
11322
+ return /*#__PURE__*/React.createElement("div", {
11323
+ className: "fortune-dune-preview",
11324
+ style: {
11325
+ left: position.left,
11326
+ top: position.top
11327
+ },
11328
+ onClick: function onClick(e) {
11329
+ return e.stopPropagation();
11330
+ }
11331
+ }, /*#__PURE__*/React.createElement("div", {
11332
+ className: "fortune-dune-preview-header"
11333
+ }, /*#__PURE__*/React.createElement("span", {
11334
+ className: "fortune-dune-preview-title"
11335
+ }, "Detected Dune chart link")), /*#__PURE__*/React.createElement("div", {
11336
+ className: "fortune-dune-preview-content"
11337
+ }, /*#__PURE__*/React.createElement("iframe", {
11338
+ src: embedUrl,
11339
+ title: "Dune Chart Preview",
11340
+ style: {
11341
+ width: "100%",
11342
+ height: "100%",
11343
+ border: "none"
11344
+ }
11345
+ })), /*#__PURE__*/React.createElement("p", null, "Do you want to insert Dune chart?"), /*#__PURE__*/React.createElement("div", {
11346
+ className: "fortune-dune-preview-footer"
11347
+ }, /*#__PURE__*/React.createElement(Button$1, {
11348
+ variant: "ghost",
11349
+ onClick: onKeepAsLink,
11350
+ className: "!w-fit px-0"
11351
+ }, "Keep as Link"), /*#__PURE__*/React.createElement(Button$1, {
11352
+ onClick: onEmbed,
11353
+ className: "!w-fit px-0"
11354
+ }, "Embed")));
11355
+ };
11356
+
10906
11357
  var _excluded = ["onChange", "onOp", "data"];
10907
11358
  enablePatches();
10908
11359
  var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
@@ -11435,7 +11886,25 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11435
11886
  style: {
11436
11887
  width: "60px"
11437
11888
  }
11438
- }, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React.createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React.createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React.createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React.createElement("div", null, formula.min, ": ", calInfo.min)))))));
11889
+ }, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React.createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React.createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React.createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React.createElement("div", null, formula.min, ": ", calInfo.min)))), context.showDunePreview && (/*#__PURE__*/React.createElement(DunePreview, {
11890
+ url: context.showDunePreview.url,
11891
+ position: context.showDunePreview.position,
11892
+ onKeepAsLink: function onKeepAsLink() {
11893
+ setContextWithProduce(function (draftCtx) {
11894
+ draftCtx.showDunePreview = undefined;
11895
+ }, {
11896
+ noHistory: true
11897
+ });
11898
+ },
11899
+ onEmbed: function onEmbed() {
11900
+ setContextWithProduce(function (draftCtx) {
11901
+ insertDuneChart(draftCtx, context.showDunePreview.url);
11902
+ draftCtx.showDunePreview = undefined;
11903
+ }, {
11904
+ noHistory: true
11905
+ });
11906
+ }
11907
+ })))));
11439
11908
  });
11440
11909
 
11441
11910
  export { Workbook };