@fileverse-dev/dsheet 2.0.7 → 2.0.8-date
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/editor/utils/formula-ui-sync.d.ts +5 -0
- package/dist/index.es.js +16432 -15413
- package/dist/sheet-engine/core/context.d.ts +2 -1
- package/dist/sheet-engine/core/index.d.ts +2 -2
- package/dist/sheet-engine/core/modules/date-base-locale.d.ts +8 -0
- package/dist/sheet-engine/core/modules/format.d.ts +60 -1
- package/dist/sheet-engine/core/modules/formula.d.ts +2 -0
- package/dist/sheet-engine/core/modules/index.d.ts +6 -5
- package/dist/sheet-engine/core/modules/merge.d.ts +2 -0
- package/dist/sheet-engine/core/modules/selection.d.ts +7 -2
- package/dist/sheet-engine/core/modules/toolbar.d.ts +3 -2
- package/dist/sheet-engine/core/settings.d.ts +2 -0
- package/dist/sheet-engine/core/types.d.ts +4 -0
- package/dist/sheet-engine/react/components/SheetOverlay/CellDatePicker.d.ts +12 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SheetConfig, Sheet, Selection, Cell, CommentBox, Rect, Image, Presence, LinkCardProps, FilterOptions, RangeDialogProps, DataRegulationProps, ConditionRulesProps, GlobalCache, CellError } from './types';
|
|
2
2
|
import { FormulaCache } from './modules';
|
|
3
|
-
import { Hooks } from './settings';
|
|
3
|
+
import { DateBaseLocale, Hooks } from './settings';
|
|
4
4
|
|
|
5
5
|
interface MutableRefObject<T> {
|
|
6
6
|
current: T;
|
|
@@ -207,6 +207,7 @@ export type Context = {
|
|
|
207
207
|
luckysheet_cell_selected_extend: boolean;
|
|
208
208
|
luckysheet_cell_selected_extend_index: any[];
|
|
209
209
|
lang: string | null;
|
|
210
|
+
dateBaseLocale: DateBaseLocale;
|
|
210
211
|
chart_selection: any;
|
|
211
212
|
zoomRatio: number;
|
|
212
213
|
showGridLines: boolean;
|
|
@@ -4,10 +4,10 @@ export { Canvas, defaultStyle } from './canvas';
|
|
|
4
4
|
export { defaultContext, getFlowdata, ensureSheetIndex, initSheetIndex, updateContextWithSheetData, updateContextWithCanvas, } from './context';
|
|
5
5
|
export type { Context } from './context';
|
|
6
6
|
export { defaultSettings } from './settings';
|
|
7
|
-
export type { Settings, Hooks } from './settings';
|
|
7
|
+
export type { Settings, Hooks, DateBaseLocale } from './settings';
|
|
8
8
|
export { handleCopy, handleGlobalKeyDown, handlePaste, handlePasteByClick, fixPositionOnFrozenCells, handleCellAreaMouseDown, handleCellAreaDoubleClick, handleContextMenu, mouseRender, handleOverlayMouseMove, handleOverlayMouseUp, handleRowHeaderMouseDown, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColSizeHandleDoubleClick, handleRowSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleRowFreezeHandleMouseDown, } from './events';
|
|
9
9
|
export * from './locale';
|
|
10
|
-
export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, update, is_date, valueShowEs, FormulaCache, groupValuesRefresh, execFunctionGroup, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, addSheet, deleteSheet, editSheetName, changeSheet, updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, handleSort, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, toolbarItemClickHandler, toolbarItemSelectedFunc, handleScreenShot, insertImage, showImgChooser, drawArrow, setEditingComment, removeEditingComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, removeActiveImage, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, createDropCellRange, sortSelection, searchAll, searchNext, replace, replaceAll, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, getCellHyperlinks, getHyperlinkDisplayTextInCell, getInlineLinkPlainRange, getUniformLinkCoveringPlainRange, getUniformLinkAtPlainOffset, removeHyperlinkForLink, updateHyperlinkForLink, syncLinkCardAfterHyperlinkChange, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, getCellRowColumn, getCellHyperlink, saveHyperlink, removeHyperlink, showLinkCard, goToLink, isLinkValid, createFilterOptions, clearFilter, createFilter, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, handleOverlayTouchStart, handleOverlayTouchEnd, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, handleKeydownForZoom, jfrefreshgrid, sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, setCellError, clearCellError, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, iscelldata, getcellrange, cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult, execfunction, insertUpdateFunctionGroup, remapFormulaReferencesByMap, checkCF, getComputeMap, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
|
|
10
|
+
export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, FormulaCache, groupValuesRefresh, execFunctionGroup, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, selectionIsExactlyOneMergeBlock, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, addSheet, deleteSheet, editSheetName, changeSheet, updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, mergeSelectionHasValues, handleSort, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, isHyperlinkCreationBlocked, toolbarItemClickHandler, toolbarItemSelectedFunc, handleScreenShot, insertImage, showImgChooser, drawArrow, setEditingComment, removeEditingComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, removeActiveImage, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, createDropCellRange, sortSelection, searchAll, searchNext, replace, replaceAll, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, getCellHyperlinks, getHyperlinkDisplayTextInCell, getInlineLinkPlainRange, getUniformLinkCoveringPlainRange, getUniformLinkAtPlainOffset, removeHyperlinkForLink, updateHyperlinkForLink, syncLinkCardAfterHyperlinkChange, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, getCellRowColumn, getCellHyperlink, saveHyperlink, removeHyperlink, showLinkCard, goToLink, isLinkValid, createFilterOptions, clearFilter, createFilter, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, handleOverlayTouchStart, handleOverlayTouchEnd, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, handleKeydownForZoom, jfrefreshgrid, sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, setCellError, clearCellError, detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, iscelldata, getcellrange, cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult, execfunction, insertUpdateFunctionGroup, remapFormulaReferencesByMap, checkCF, getComputeMap, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
|
|
11
11
|
export type { FilterDate, FilterValue, FilterColor } from './modules';
|
|
12
12
|
export { getFreezeState, toggleFreeze, indexToColumnChar, escapeScriptTag, escapeHTMLTag, getSheetIndex, replaceHtml, isAllowEdit, isAllowEditReadOnly, filterPatch, patchToOp, opToPatch, inverseRowColOptions, } from './utils';
|
|
13
13
|
export type { PatchOptions, ChangedSheet } from './utils';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type DateBaseLocale = 'uk' | 'us';
|
|
2
|
+
export declare function normalizeDateBaseLocale(locale: unknown): DateBaseLocale;
|
|
3
|
+
export declare function setDateBaseLocale(locale: unknown): void;
|
|
4
|
+
export declare function getDateBaseLocale(): DateBaseLocale;
|
|
5
|
+
export declare function isUsDateBaseLocale(): boolean;
|
|
6
|
+
export declare function getCanonicalDateEditFormat(hasTime: boolean): string;
|
|
7
|
+
export declare function shouldPreserveDateFormatForEdit(format: string): boolean;
|
|
8
|
+
export declare function getDateEditFormatForCell(cellDateFormat: string, hasTime: boolean): string;
|
|
@@ -1,7 +1,66 @@
|
|
|
1
|
-
import { CellMatrix } from '../types';
|
|
1
|
+
import { Cell, CellMatrix } from '../types';
|
|
2
2
|
|
|
3
|
+
/** Below this absolute value, never use automatic scientific (Sheets-like). */
|
|
4
|
+
export declare const GS_PLAIN_MAX_ABS = 999999999999997;
|
|
5
|
+
/** Smallest 16-digit positive integer — use plain / text, not E-notation. */
|
|
6
|
+
export declare const GS_SIXTEEN_DIGIT_MIN_ABS = 1000000000000000;
|
|
7
|
+
/** Scientific only in (GS_PLAIN_MAX_ABS, 1e15) — 999…997 itself stays plain. */
|
|
8
|
+
export declare function gsAllowsScientificMagnitude(av: number): boolean;
|
|
9
|
+
/** Integer string (optional `-`, optional `,`) with ≥16 digits — store literally under General/Auto. */
|
|
10
|
+
export declare function isSixteenPlusDigitIntegerString(value: unknown): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Display string for a JS number when `toString()` may use `e` notation.
|
|
13
|
+
* Applies Sheets-like rules: no E below GS_PLAIN_MAX_ABS or at/above 16-digit scale.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatMForNumericCellAvoidingGsRules(v: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Numeric safety gate for formula-computed numbers:
|
|
18
|
+
* - integer beyond MAX_SAFE_INTEGER => scientific
|
|
19
|
+
* - significant digits > 15 => scientific
|
|
20
|
+
*/
|
|
21
|
+
export declare function shouldUseScientificForComputedNumber(v: number): boolean;
|
|
22
|
+
export declare function formatScientificForComputedNumber(v: number): string;
|
|
23
|
+
export declare function formatCompactScientific(v: number, fractionDigits?: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* Sheets-like Auto decimal display:
|
|
26
|
+
* keep about 10 visible digits total (integer digits + decimal digits), with rounding.
|
|
27
|
+
* Examples:
|
|
28
|
+
* - 999999999.478 -> 999999999.5
|
|
29
|
+
* - 123456.123456 -> 123456.1235
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatGeneralAutoDecimalWithTenDigitRule(v: number): string | null;
|
|
3
32
|
export declare function datenum_local(v: Date, date1904?: number): number;
|
|
4
33
|
export declare function genarate(value: string | number | boolean): any[] | null;
|
|
34
|
+
/** Crypto tickers for typed prefix (e.g. BTC123) — keep aligned with toolbar CRYPTO_OPTIONS. */
|
|
35
|
+
export declare const TYPED_CRYPTO_CURRENCY_PREFIXES: readonly ["BTC", "ETH", "SOL"];
|
|
36
|
+
/**
|
|
37
|
+
* True when `fa` matches formats produced by typed currency/crypto prefix (or the same shape).
|
|
38
|
+
* Used so the format dropdown shows "Currency" instead of mislabeling `#,##0` masks as "Number".
|
|
39
|
+
*/
|
|
40
|
+
export declare function isTypedCurrencyDisplayFormat(fa: string | undefined, currencyDetail: unknown): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* True for currency / accounting / crypto number formats where we should keep `fa` when the user
|
|
43
|
+
* types plain text, so a later numeric entry still formats like Google Sheets.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isCurrencyLikeNumberFormat(fa: string | undefined, currencyDetail: unknown): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If the user types a known currency/crypto prefix immediately followed by a parseable number
|
|
48
|
+
* (e.g. `$1,234.5`, `€100`, `BTC1.5`), return numeric cell value + matching currency format.
|
|
49
|
+
* Uses locale `currencyDetail` (fiat symbols); object-shaped locales yield no fiat prefixes.
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseCurrencyPrefixedInput(raw: string, currencyDetail: unknown): [string, {
|
|
52
|
+
fa: string;
|
|
53
|
+
t: string;
|
|
54
|
+
}, number] | null;
|
|
55
|
+
export declare function genarateOrCurrencyPrefixed(vupdateStr: string, vupdate: any, currencyDetail: unknown): ReturnType<typeof genarate>;
|
|
5
56
|
export declare function update(fmt: string, v: any): string;
|
|
57
|
+
/** Max decimal places for toolbar +/- on General (Auto) without switching to a numeric `fa`. */
|
|
58
|
+
export declare const MAX_GENERAL_AUTO_DP = 15;
|
|
59
|
+
/**
|
|
60
|
+
* Recompute `m` for numeric cells with `fa === "General"`.
|
|
61
|
+
* When `ct.dp` is set (1..MAX), uses fixed decimals like Sheets Auto + decimal buttons.
|
|
62
|
+
* Otherwise uses the usual `genarate` General display.
|
|
63
|
+
*/
|
|
64
|
+
export declare function refreshGeneralNumericDisplay(cell: Cell): void;
|
|
6
65
|
export declare function is_date(fmt: string, v?: any): boolean;
|
|
7
66
|
export declare function valueShowEs(r: number, c: number, d: CellMatrix): any;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Cell, Rect, Selection } from '../types';
|
|
2
2
|
import { Context } from '../context';
|
|
3
3
|
|
|
4
|
+
/** True when the formula is only numeric ops on TODAY()/NOW() (incl. unary +/−); used to display serials as dates. */
|
|
5
|
+
export declare function isTodayNowPureArithmeticDateResult(formula: string, value: number): boolean;
|
|
4
6
|
export declare class FormulaCache {
|
|
5
7
|
parser: any;
|
|
6
8
|
func_selectedrange?: Selection;
|
|
@@ -2,20 +2,21 @@ export { getBorderInfoComputeRange, getBorderInfoCompute } from './border';
|
|
|
2
2
|
export { normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, getInlineStringHTML, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, cancelFunctionrangeSelected, } from './cell';
|
|
3
3
|
export { default as clipboard } from './clipboard';
|
|
4
4
|
export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
|
|
5
|
-
export {
|
|
5
|
+
export { getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, } from './date-base-locale';
|
|
6
|
+
export { update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, } from './format';
|
|
6
7
|
export { FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, createFormulaRangeSelect, maybeRecoverDirtyRangeSelection, delFunctionGroup, functionHTMLGenerate, onFormulaRangeDragEnd, rangeDrag, rangeSetValue, remapFormulaReferencesByMap, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, getFormulaRangeIndexForKeyboardSync, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, functionStrChange, setFormulaEditorOwner, getAllFunctionGroup, suppressFormulaRangeSelectionForInitialEdit, } from './formula';
|
|
7
8
|
export { initFreeze } from './freeze';
|
|
8
9
|
export { isInlineStringCell, getInlineStringNoStyle, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, } from './inline-string';
|
|
9
10
|
export { rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, } from './location';
|
|
10
11
|
export { insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, hideCRCount, } from './rowcol';
|
|
11
|
-
export { scrollToHighlightCell, seletedHighlistByindex, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, rangeValueToHtml, } from './selection';
|
|
12
|
+
export { scrollToHighlightCell, seletedHighlistByindex, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, selectionIsExactlyOneMergeBlock, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, rangeValueToHtml, } from './selection';
|
|
12
13
|
export { addSheet, deleteSheet, editSheetName, changeSheet, updateSheet, } from './sheet';
|
|
13
|
-
export { updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, handleSort, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, toolbarItemClickHandler, toolbarItemSelectedFunc, updateFormatCell, cancelPaintModel, } from './toolbar';
|
|
14
|
+
export { updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, handleSort, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, isHyperlinkCreationBlocked, toolbarItemClickHandler, toolbarItemSelectedFunc, updateFormatCell, cancelPaintModel, } from './toolbar';
|
|
14
15
|
export { handleScreenShot } from './screenshot';
|
|
15
16
|
export { drawArrow, setEditingComment, removeEditingComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxResize, onCommentBoxResizeEnd, removeOverShowComment, } from './comment';
|
|
16
17
|
export { showImgChooser, insertImage, removeActiveImage, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, onImageMove, onImageMoveEnd, onImageResize, onImageResizeEnd, } from './image';
|
|
17
18
|
export { createDropCellRange, dropCellCache, getTypeItemHide, updateDropCell, } from './dropCell';
|
|
18
|
-
export { mergeCells } from './merge';
|
|
19
|
+
export { mergeCells, mergeSelectionHasValues } from './merge';
|
|
19
20
|
export { sortSelection, spillSortResult } from './sort';
|
|
20
21
|
export { searchAll, searchNext, replace, replaceAll, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, } from './searchReplace';
|
|
21
22
|
export type { CheckModes, HyperlinkMap, FindSearchScope, SearchHiddenConfig, SearchNextResult, ReplaceAllResult, } from './searchReplace';
|
|
@@ -35,7 +36,7 @@ export { jfrefreshgrid } from './refresh';
|
|
|
35
36
|
export { sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, } from './iframe';
|
|
36
37
|
export { setCellError, clearCellError, overShowError, } from './error-state-helpers';
|
|
37
38
|
export { checkCellIsLocked } from './protection';
|
|
38
|
-
export { isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, } from './validation';
|
|
39
|
+
export { detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, } from './validation';
|
|
39
40
|
export { iscelldata, getcellrange, execfunction, execFunctionGroup, insertUpdateFunctionGroup, functionCopy, } from './formula';
|
|
40
41
|
export { checkCF, getComputeMap } from './ConditionFormat';
|
|
41
42
|
export { getdatabyselection, getQKBorder } from './cell';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Context } from '../context';
|
|
2
2
|
import { Range } from '../types';
|
|
3
3
|
|
|
4
|
+
/** True if any cell in the current selection has content that merge would consider. */
|
|
5
|
+
export declare function mergeSelectionHasValues(ctx: Context): boolean;
|
|
4
6
|
export declare function mergeCells(ctx: Context, sheetId: string, ranges: Range, type: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sheet as SheetType, Freezen, Range } from '../types';
|
|
1
|
+
import { Sheet as SheetType, Freezen, Range, Selection } from '../types';
|
|
2
2
|
import { Context } from '../context';
|
|
3
3
|
|
|
4
4
|
export declare const selectionCache: {
|
|
@@ -12,6 +12,11 @@ export declare function seletedHighlistByindex(ctx: Context, r1: number, r2: num
|
|
|
12
12
|
top: number;
|
|
13
13
|
height: number;
|
|
14
14
|
} | null;
|
|
15
|
+
/**
|
|
16
|
+
* True when the selection rectangle is exactly one merged block (multi grid cells, one
|
|
17
|
+
* logical cell). Literal 1×1 is false here — callers use row/column span for that.
|
|
18
|
+
*/
|
|
19
|
+
export declare function selectionIsExactlyOneMergeBlock(ctx: Context, selection: Selection): boolean;
|
|
15
20
|
/**
|
|
16
21
|
* Updates `ctx.primaryCellActive` from a selection list (multi-cell → active focus cell;
|
|
17
22
|
* else null). Pass `selection` explicitly when normalizing a **new** array that is not
|
|
@@ -38,7 +43,7 @@ export declare function setPrimaryCellActive(ctx: Context, r: number, c: number)
|
|
|
38
43
|
* that range so Enter-primary navigation + typing do not collapse the yellow box.
|
|
39
44
|
*/
|
|
40
45
|
export declare function snapSheetSelectionFocusToCellPreserveMultiRange(ctx: Context, r: number, c: number): void;
|
|
41
|
-
export declare function normalizeSelection(ctx: Context, selection: SheetType["luckysheet_select_save"]):
|
|
46
|
+
export declare function normalizeSelection(ctx: Context, selection: SheetType["luckysheet_select_save"]): Selection[] | undefined;
|
|
42
47
|
export declare function selectTitlesMap(rangeMap: Record<string, number>, range1: number, range2: number): Record<string, number>;
|
|
43
48
|
export declare function selectTitlesRange(map: Record<string, number>): number[][];
|
|
44
49
|
export declare function pasteHandlerOfPaintModel(ctx: Context, copyRange: Context["luckysheet_copy_save"]): void;
|
|
@@ -28,9 +28,10 @@ export declare function handleFreeze(ctx: Context, type: string): void;
|
|
|
28
28
|
export declare function handleTextSize(ctx: Context, cellInput: HTMLDivElement, size: number, canvas?: CanvasRenderingContext2D): void;
|
|
29
29
|
export declare function handleSum(ctx: Context, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null | undefined, cache?: GlobalCache): void;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Hyperlink insert is not supported for formula cells or when the user is entering a formula
|
|
32
|
+
* (cell / formula bar content starts with `=`).
|
|
33
33
|
*/
|
|
34
|
+
export declare function isHyperlinkCreationBlocked(ctx: Context, cellInput: HTMLDivElement | null | undefined): boolean;
|
|
34
35
|
export declare function captureLinkEditorOpenSnapshot(ctx: Context, cellInput: HTMLDivElement | null | undefined, cache: GlobalCache | undefined): void;
|
|
35
36
|
export declare function handleLink(ctx: Context, cellInput: HTMLDivElement | null | undefined, cache?: GlobalCache): void;
|
|
36
37
|
export declare function toolbarItemClickHandler(name: string): ToolbarItemClickHandler;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Sheet, Selection, CellMatrix, Cell } from './types';
|
|
3
3
|
|
|
4
|
+
export type DateBaseLocale = 'uk' | 'us';
|
|
4
5
|
type SheetChangePath = {
|
|
5
6
|
sheetId: string;
|
|
6
7
|
path: string[];
|
|
@@ -130,6 +131,7 @@ export type Settings = {
|
|
|
130
131
|
onSheetCountChange?: (count: number) => void;
|
|
131
132
|
isAuthorized?: boolean;
|
|
132
133
|
isFlvReadOnly?: boolean;
|
|
134
|
+
dateBaseLocale?: DateBaseLocale;
|
|
133
135
|
};
|
|
134
136
|
export declare const defaultSettings: Required<Settings>;
|
|
135
137
|
export {};
|
|
@@ -43,11 +43,13 @@ export type Cell = {
|
|
|
43
43
|
cs?: number;
|
|
44
44
|
};
|
|
45
45
|
f?: string;
|
|
46
|
+
/** `dp`: fixed decimal places for display when `fa` is General (Auto); does not change `fa`/`t`. */
|
|
46
47
|
ct?: {
|
|
47
48
|
fa?: string;
|
|
48
49
|
t?: string;
|
|
49
50
|
tb?: string;
|
|
50
51
|
s?: any;
|
|
52
|
+
dp?: number;
|
|
51
53
|
};
|
|
52
54
|
qp?: number;
|
|
53
55
|
spl?: any;
|
|
@@ -426,6 +428,8 @@ export type GlobalCache = {
|
|
|
426
428
|
} | null;
|
|
427
429
|
selectedPlain: string;
|
|
428
430
|
};
|
|
431
|
+
/** Injected by React: show modal when link insert is blocked (formula / = in editor). */
|
|
432
|
+
onHyperlinkInsertBlocked?: () => void;
|
|
429
433
|
dragCellStartPos?: {
|
|
430
434
|
x: number;
|
|
431
435
|
y: number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type CellDatePickerVariant = 'cell' | 'fx';
|
|
4
|
+
/**
|
|
5
|
+
* Fileverse UI date picker shown below the in-cell editor when editing a date cell
|
|
6
|
+
* (same general area as formula hint). Inserts canonical base date format (with time
|
|
7
|
+
* preserved when the current base value includes time).
|
|
8
|
+
*/
|
|
9
|
+
declare const CellDatePicker: React.FC<{
|
|
10
|
+
variant?: CellDatePickerVariant;
|
|
11
|
+
}>;
|
|
12
|
+
export default CellDatePicker;
|