@fileverse-dev/dsheet 2.0.17 → 2.0.18

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.
@@ -154,6 +154,19 @@ export type Context = {
154
154
  formulaRangeSelect: ({
155
155
  rangeIndex: number;
156
156
  } & Rect) | undefined;
157
+ /**
158
+ * Apply-to ranges (0-based inclusive row/column) for transient sheet overlay when
159
+ * hovering a conditional-formatting rule in the list. Null when inactive.
160
+ */
161
+ conditionalFormatRuleHoverRanges: {
162
+ row: number[];
163
+ column: number[];
164
+ }[] | null;
165
+ /**
166
+ * True while the CF create/edit form is open — drives live sheet preview of the draft
167
+ * rule in `getComputeMap` (must be false on list or after close).
168
+ */
169
+ conditionFormatDraftActive: boolean;
157
170
  functionCandidates: any[];
158
171
  defaultCandidates: any[];
159
172
  functionHint: string | null | undefined;
@@ -7,7 +7,7 @@ export { defaultSettings } from './settings';
7
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, 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, getFilterHiddenRowsUnionFromFilterMap, getFilterHiddenRowsUnion, ensureManualHiddenInitialized, rebuildRowHiddenUnion, 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, sortSheetBySelectedColumn, searchAll, searchNext, replace, replaceAll, replaceAllScoped, 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, clearFilterForColumn, toggleViewerFilter, 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';
10
+ export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, 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, getFilterHiddenRowsUnionFromFilterMap, getFilterHiddenRowsUnion, ensureManualHiddenInitialized, rebuildRowHiddenUnion, 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, sortSheetBySelectedColumn, searchAll, searchNext, replace, replaceAll, replaceAllScoped, 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, clearFilterForColumn, toggleViewerFilter, createFilter, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, CF_DATE_DEFAULT_FORMAT, parseCfDateConditionForUi, formatCfDatePresetSnapshot, parseDdMmYyyyToSerial, 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';
@@ -604,6 +604,7 @@ declare const _default: {
604
604
  setAs: string;
605
605
  setAsByArea: string;
606
606
  applyRange: string;
607
+ invalidRangeText: string;
607
608
  selectRange: string;
608
609
  selectRange_percent: string;
609
610
  selectRange_average: string;
@@ -613,6 +614,7 @@ declare const _default: {
613
614
  selectCell: string;
614
615
  pleaseSelectCell: string;
615
616
  pleaseSelectADate: string;
617
+ pleaseEnterDateDdMmYyyy: string;
616
618
  pleaseEnterInteger: string;
617
619
  onlySingleCell: string;
618
620
  conditionValueCanOnly: string;
@@ -672,12 +674,29 @@ declare const _default: {
672
674
  lessThan: string;
673
675
  lessThanOrEqual: string;
674
676
  between: string;
677
+ notBetween: string;
675
678
  equal: string;
679
+ notEqual: string;
676
680
  in: string;
677
681
  between2: string;
678
682
  contain: string;
679
683
  textContains: string;
684
+ textDoesNotContain: string;
685
+ textStartsWith: string;
686
+ textEndsWith: string;
687
+ textExactly: string;
680
688
  empty: string;
689
+ notEmpty: string;
690
+ dateIs: string;
691
+ dateBefore: string;
692
+ dateAfter: string;
693
+ cfDatePreset_today: string;
694
+ cfDatePreset_tomorrow: string;
695
+ cfDatePreset_yesterday: string;
696
+ cfDatePreset_pastWeek: string;
697
+ cfDatePreset_pastMonth: string;
698
+ cfDatePreset_pastYear: string;
699
+ cfDatePreset_exact: string;
681
700
  duplicateValue: string;
682
701
  uniqueValue: string;
683
702
  top: string;
@@ -693,6 +712,9 @@ declare const _default: {
693
712
  belowAverage: string;
694
713
  all: string;
695
714
  yesterday: string;
715
+ formatCellsIfRulesGroup_presenceText: string;
716
+ formatCellsIfRulesGroup_dates: string;
717
+ formatCellsIfRulesGroup_numbers: string;
696
718
  today: string;
697
719
  tomorrow: string;
698
720
  lastWeek: string;
@@ -771,6 +793,7 @@ declare const _default: {
771
793
  cellRange: string;
772
794
  selectCellRange: string;
773
795
  selectCellRange2: string;
796
+ invalidRangeText: string;
774
797
  verificationCondition: string;
775
798
  allowMultiSelect: string;
776
799
  dropdown: string;
@@ -1,6 +1,17 @@
1
1
  import { Context } from '../context';
2
2
  import { CellMatrix, Sheet } from '../types';
3
3
 
4
+ /** Default text format recorded alongside preset / value for CF date rules. */
5
+ export declare const CF_DATE_DEFAULT_FORMAT = "DD/MM/YYYY";
6
+ /** Parse strict DD/MM/YYYY to Excel serial (local calendar day). */
7
+ export declare function parseDdMmYyyyToSerial(s: string): number | null;
8
+ /** Human-readable snapshot for the given preset (evaluation still uses preset id at compute time). */
9
+ export declare function formatCfDatePresetSnapshot(preset: string): string;
10
+ export declare function parseCfDateConditionForUi(cv: any[] | undefined): {
11
+ preset: string;
12
+ snapshotOrExact: string;
13
+ format: string;
14
+ };
4
15
  export declare function getHistoryRules(fileH: Sheet[]): {
5
16
  sheetIndex: number;
6
17
  luckysheet_conditionformat_save: any[] | undefined;
@@ -28,6 +28,12 @@ export declare function getFlattenedRange(ctx: Context, range?: Range): {
28
28
  }[];
29
29
  export declare function getRangetxt(ctx: Context, sheetId: string, range: SingleRange, currentId?: string): string;
30
30
  export declare function getRangeByTxt(ctx: Context, txt: string): any[];
31
+ /**
32
+ * True if the string is empty/whitespace (allowed while editing) or parses to at least
33
+ * one range with {@link getRangeByTxt} (same rules as sheet range entry elsewhere), plus
34
+ * stricter form checks for the conditional-format and range-dialog inputs.
35
+ */
36
+ export declare function isValidRangeText(ctx: Context, txt: string): boolean;
31
37
  export declare function isAllSelectedCellsInStatus(ctx: Context, attr: keyof Cell, status: any): boolean;
32
38
  export declare function getFontStyleByCell(cell: Cell | null | undefined, checksAF?: any[], checksCF?: any, isCheck?: boolean): any;
33
39
  export declare function getStyleByCell(ctx: Context, d: CellMatrix, r: number, c: number): any;
@@ -29,6 +29,7 @@ export declare class FormulaCache {
29
29
  formulaKeyboardRefSync?: boolean;
30
30
  formulaEditorOwner?: "cell" | "fx" | null;
31
31
  functionRangeIndex?: number[];
32
+ functionRangeGlobalOffset?: number | null;
32
33
  functionlistMap: any;
33
34
  execFunctionExist?: any[];
34
35
  execFunctionGlobalData: any;
@@ -104,6 +105,7 @@ export declare function markRangeSelectionDirty(ctx: Context): void;
104
105
  */
105
106
  export declare function getFormulaRangeIndexForKeyboardSync($editor: HTMLDivElement): number | null;
106
107
  export declare function handleFormulaInput(ctx: Context, $copyTo: HTMLDivElement | null | undefined, $editor: HTMLDivElement, kcode: number, preText?: string, refreshRangeSelect?: boolean): void;
108
+ export declare function toggleFormulaAbsoluteReferenceAtCaret(ctx: Context, $copyTo: HTMLDivElement | null | undefined, $editor: HTMLDivElement | null | undefined): boolean;
107
109
  /** True while picking a range for a formula (sheet selection drives references). */
108
110
  export declare function isLegacyFormulaRangeMode(ctx: Context): boolean;
109
111
  export declare function israngeseleciton(ctx: Context, istooltip?: boolean): boolean;
@@ -1,5 +1,5 @@
1
1
  export { getBorderInfoComputeRange, getBorderInfoCompute } from './border';
2
- export { normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, getInlineStringHTML, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, cancelFunctionrangeSelected, } from './cell';
2
+ export { normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, cancelFunctionrangeSelected, } from './cell';
3
3
  export { default as clipboard } from './clipboard';
4
4
  export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
5
  export { getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, } from './date-base-locale';
@@ -30,7 +30,7 @@ export { CFSplitRange } from './ConditionFormat';
30
30
  export { updateMoreCell, getRegStr, getDataArr } from './splitColumn';
31
31
  export { applyLocation, getOptionValue, getSelectRange, } from './locationCondition';
32
32
  export { getDropdownList, setDropdownValue, confirmMessage, cellFocus, validateCellData, } from './dataVerification';
33
- export { setConditionRules } from './ConditionFormat';
33
+ export { setConditionRules, CF_DATE_DEFAULT_FORMAT, parseCfDateConditionForUi, formatCfDatePresetSnapshot, parseDdMmYyyyToSerial, } from './ConditionFormat';
34
34
  export { handleOverlayTouchStart, handleOverlayTouchEnd } from './mobile';
35
35
  export { MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, handleKeydownForZoom } from './zoom';
36
36
  export { jfrefreshgrid } from './refresh';
@@ -43,6 +43,8 @@ export type Cell = {
43
43
  cs?: number;
44
44
  };
45
45
  f?: string;
46
+ /** Editor-only HTML snapshot for reopening multiline formulas as typed. */
47
+ _formulaEditHtml?: string;
46
48
  /** `dp`: fixed decimal places for display when `fa` is General (Auto); does not change `fa`/`t`. */
47
49
  ct?: {
48
50
  fa?: string;
@@ -171,6 +173,10 @@ export type ConditionRulesProps = {
171
173
  value1: string;
172
174
  value2: string;
173
175
  };
176
+ /** Preset for dateIs / dateBefore / dateAfter (allowed values depend on rule type). */
177
+ datePreset: string;
178
+ /** Declared format for stored date text (e.g. DD/MM/YYYY). */
179
+ dateFormat: string;
174
180
  dateValue: string;
175
181
  repeatValue: string;
176
182
  projectValue: string;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { Cell } from '../../../core';
3
3
 
4
- export declare const getLucideIcon: (title: string) => "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "" | "Percent" | "Ethereum" | "ChevronDown" | "Bold" | "Italic" | "Strikethrough" | "PaintBucket" | "PaintRoller" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "MergeHorizontal" | "DollarSign" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "ArrowDownUp" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
4
+ export declare const getLucideIcon: (title: string) => "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "" | "Percent" | "Ethereum" | "ChevronDown" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DollarSign" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "ArrowDownUp" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
5
5
  export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
6
6
  cell: Cell | null | undefined;
7
7
  defaultTextFormat: string;