@fileverse-dev/dsheet 1.3.18-patch.6 → 2.0.0-insert

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.
@@ -110,6 +110,15 @@ export type Context = {
110
110
  sheetScrollRecord: Record<string, any>;
111
111
  luckysheet_select_status: boolean;
112
112
  luckysheet_select_save: Sheet['luckysheet_select_save'];
113
+ /**
114
+ * Sheet row/column (0-based) for the extra primary-cell outline. Kept in context so
115
+ * features can move it via `setPrimaryCellActive`; it is auto-synced from the
116
+ * top-left of the last multi-cell selection whenever `normalizeSelection` runs.
117
+ */
118
+ primaryCellActive: {
119
+ r: number;
120
+ c: number;
121
+ } | null;
113
122
  luckysheet_selection_range: Sheet['luckysheet_selection_range'];
114
123
  formulaRangeHighlight: ({
115
124
  rangeIndex: number;
@@ -7,7 +7,7 @@ export { defaultSettings } from './settings';
7
7
  export type { Settings, Hooks } 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, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, update, is_date, valueShowEs, FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, normalizeSelection, 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, 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, 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, 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, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, update, is_date, valueShowEs, FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, 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, 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, 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, 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';
@@ -379,6 +379,14 @@ declare const _default: {
379
379
  cannotDeleteColumnReadOnly: string;
380
380
  cannotInsertOnRowReadOnly: string;
381
381
  cannotInsertOnColumnReadOnly: string;
382
+ insertRowAboveOne: string;
383
+ insertRowsAboveN: string;
384
+ insertRowBelowOne: string;
385
+ insertRowsBelowN: string;
386
+ insertColumnLeftOne: string;
387
+ insertColumnsLeftN: string;
388
+ insertColumnRightOne: string;
389
+ insertColumnsRightN: string;
382
390
  rowOverLimit: string;
383
391
  columnOverLimit: string;
384
392
  conditionFormat: string;
@@ -548,6 +548,14 @@ declare const _default: {
548
548
  cannotDeleteColumnReadOnly: string;
549
549
  cannotInsertOnRowReadOnly: string;
550
550
  cannotInsertOnColumnReadOnly: string;
551
+ insertRowAboveOne: string;
552
+ insertRowsAboveN: string;
553
+ insertRowBelowOne: string;
554
+ insertRowsBelowN: string;
555
+ insertColumnLeftOne: string;
556
+ insertColumnsLeftN: string;
557
+ insertColumnRightOne: string;
558
+ insertColumnsRightN: string;
551
559
  rowOverLimit: string;
552
560
  columnOverLimit: string;
553
561
  };
@@ -418,6 +418,14 @@ declare const _default: {
418
418
  cannotDeleteColumnReadOnly: string;
419
419
  cannotInsertOnRowReadOnly: string;
420
420
  cannotInsertOnColumnReadOnly: string;
421
+ insertRowAboveOne: string;
422
+ insertRowsAboveN: string;
423
+ insertRowBelowOne: string;
424
+ insertRowsBelowN: string;
425
+ insertColumnLeftOne: string;
426
+ insertColumnsLeftN: string;
427
+ insertColumnRightOne: string;
428
+ insertColumnsRightN: string;
421
429
  rowOverLimit: string;
422
430
  columnOverLimit: string;
423
431
  };
@@ -435,6 +435,14 @@ declare const _default: {
435
435
  cannotDeleteColumnReadOnly: string;
436
436
  cannotInsertOnRowReadOnly: string;
437
437
  cannotInsertOnColumnReadOnly: string;
438
+ insertRowAboveOne: string;
439
+ insertRowsAboveN: string;
440
+ insertRowBelowOne: string;
441
+ insertRowsBelowN: string;
442
+ insertColumnLeftOne: string;
443
+ insertColumnsLeftN: string;
444
+ insertColumnRightOne: string;
445
+ insertColumnsRightN: string;
438
446
  rowOverLimit: string;
439
447
  columnOverLimit: string;
440
448
  conditionFormat: string;
@@ -581,6 +581,14 @@ declare const _default: {
581
581
  cannotDeleteColumnReadOnly: string;
582
582
  cannotInsertOnRowReadOnly: string;
583
583
  cannotInsertOnColumnReadOnly: string;
584
+ insertRowAboveOne: string;
585
+ insertRowsAboveN: string;
586
+ insertRowBelowOne: string;
587
+ insertRowsBelowN: string;
588
+ insertColumnLeftOne: string;
589
+ insertColumnsLeftN: string;
590
+ insertColumnRightOne: string;
591
+ insertColumnsRightN: string;
584
592
  rowOverLimit: string;
585
593
  columnOverLimit: string;
586
594
  };
@@ -81,6 +81,8 @@ export declare function markRangeSelectionDirty(ctx: Context): void;
81
81
  */
82
82
  export declare function getFormulaRangeIndexForKeyboardSync($editor: HTMLDivElement): number | null;
83
83
  export declare function handleFormulaInput(ctx: Context, $copyTo: HTMLDivElement | null | undefined, $editor: HTMLDivElement, kcode: number, preText?: string, refreshRangeSelect?: boolean): void;
84
+ /** True while picking a range for a formula (sheet selection drives references). */
85
+ export declare function isLegacyFormulaRangeMode(ctx: Context): boolean;
84
86
  export declare function israngeseleciton(ctx: Context, istooltip?: boolean): boolean;
85
87
  export declare function isFormulaReferenceInputMode(ctx: Context): boolean;
86
88
  export declare function maybeRecoverDirtyRangeSelection(ctx: Context): boolean;
@@ -3,12 +3,12 @@ export { normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getReal
3
3
  export { default as clipboard } from './clipboard';
4
4
  export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
5
  export { update, is_date, valueShowEs } from './format';
6
- export { FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, createFormulaRangeSelect, maybeRecoverDirtyRangeSelection, delFunctionGroup, functionHTMLGenerate, onFormulaRangeDragEnd, rangeDrag, rangeSetValue, remapFormulaReferencesByMap, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, markRangeSelectionDirty, getFormulaRangeIndexForKeyboardSync, isFormulaReferenceInputMode, functionStrChange, setFormulaEditorOwner, getAllFunctionGroup, suppressFormulaRangeSelectionForInitialEdit, } from './formula';
6
+ export { FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, createFormulaRangeSelect, maybeRecoverDirtyRangeSelection, delFunctionGroup, functionHTMLGenerate, onFormulaRangeDragEnd, rangeDrag, rangeSetValue, remapFormulaReferencesByMap, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, getFormulaRangeIndexForKeyboardSync, isFormulaReferenceInputMode, functionStrChange, setFormulaEditorOwner, getAllFunctionGroup, suppressFormulaRangeSelectionForInitialEdit, } from './formula';
7
7
  export { initFreeze } from './freeze';
8
8
  export { isInlineStringCell, getInlineStringNoStyle } from './inline-string';
9
9
  export { rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, } from './location';
10
10
  export { insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, hideCRCount, } from './rowcol';
11
- export { scrollToHighlightCell, seletedHighlistByindex, selectTitlesMap, selectTitlesRange, normalizeSelection, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, rangeValueToHtml, } from './selection';
11
+ export { scrollToHighlightCell, seletedHighlistByindex, selectTitlesMap, selectTitlesRange, normalizeSelection, syncPrimaryCellActiveFromSelection, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, rangeValueToHtml, } from './selection';
12
12
  export { addSheet, deleteSheet, editSheetName, changeSheet, updateSheet, } from './sheet';
13
13
  export { updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, handleSort, handleFreeze, handleTextSize, handleSum, handleLink, toolbarItemClickHandler, toolbarItemSelectedFunc, updateFormatCell, cancelPaintModel, } from './toolbar';
14
14
  export { handleScreenShot } from './screenshot';
@@ -15,6 +15,10 @@ export declare function insertRowCol(ctx: Context, op: {
15
15
  count: number;
16
16
  direction: "lefttop" | "rightbottom";
17
17
  id: string;
18
+ /** Pre-insert row index for each inserted row (length must equal count). */
19
+ templateSourceRows?: number[];
20
+ /** Pre-insert column index for each inserted column (length must equal count). */
21
+ templateSourceColumns?: number[];
18
22
  }, changeSelection?: boolean): void;
19
23
  export declare function deleteRowCol(ctx: Context, op: {
20
24
  type: "row" | "column";
@@ -12,6 +12,26 @@ export declare function seletedHighlistByindex(ctx: Context, r1: number, r2: num
12
12
  top: number;
13
13
  height: number;
14
14
  } | null;
15
+ /**
16
+ * Updates `ctx.primaryCellActive` from a selection list (multi-cell → active focus cell;
17
+ * else null). Pass `selection` explicitly when normalizing a **new** array that is not
18
+ * yet assigned to `ctx.luckysheet_select_save`.
19
+ */
20
+ export declare function syncPrimaryCellActiveFromSelection(ctx: Context, selection?: SheetType["luckysheet_select_save"] | null): void;
21
+ /**
22
+ * Multi-cell range only: move `row_focus` / `column_focus` (and primary) in
23
+ * column-major order — forward: down then next column right, wrapping top-left;
24
+ * backward (Shift+Enter): up then previous column left, wrapping bottom-right.
25
+ * Does not enter edit mode. Returns false if not a multi-cell selection.
26
+ */
27
+ export declare function advancePrimaryCellInLastMultiSelection(ctx: Context, forward?: boolean): boolean;
28
+ /**
29
+ * Pin the primary-cell highlight to a sheet cell. Prefer calling inside the same
30
+ * `setContext` (draft) as your selection update, after `normalizeSelection`, so a
31
+ * later normalize in the same commit does not overwrite it. The next user-driven
32
+ * selection that runs `normalizeSelection` will re-sync from the new range.
33
+ */
34
+ export declare function setPrimaryCellActive(ctx: Context, r: number, c: number): void;
15
35
  export declare function normalizeSelection(ctx: Context, selection: SheetType["luckysheet_select_save"]): import('..').Selection[] | undefined;
16
36
  export declare function selectTitlesMap(rangeMap: Record<string, number>, range1: number, range2: number): Record<string, number>;
17
37
  export declare function selectTitlesRange(map: Record<string, number>): number[][];
@@ -15,6 +15,8 @@ export type PatchOptions = {
15
15
  count: number;
16
16
  direction: 'lefttop' | 'rightbottom';
17
17
  id: string;
18
+ templateSourceRows?: number[];
19
+ templateSourceColumns?: number[];
18
20
  };
19
21
  deleteRowColOp?: {
20
22
  type: 'row' | 'column';
@@ -1,14 +1,15 @@
1
1
  /**
2
- * Convert value into number.
2
+ * Convert value into number for arithmetic (+ - * / ^, unary +/-, numeric literals).
3
+ * Strings that are not strictly numeric (no parseFloat prefix tricks) become NaN.
3
4
  *
4
- * @param {String|Number} number
5
- * @returns {*}
5
+ * @param {*} number
6
+ * @returns {number|NaN}
6
7
  */
7
- export function toNumber(number: string | number): any;
8
+ export function toNumber(number: any): number | number;
8
9
  /**
9
- * Invert provided number.
10
+ * Invert provided number (unary minus).
10
11
  *
11
- * @param {Number} number
12
- * @returns {Number} Returns inverted number.
12
+ * @param {*} number
13
+ * @returns {number}
13
14
  */
14
- export function invertNumber(number: number): number;
15
+ export function invertNumber(number: any): number;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare const ResetRowHeight: React.FC;