@leankylin-sheet/core 6.0.0 → 6.0.2
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/api/common.d.ts +1 -0
- package/dist/index.esm.js +14 -5
- package/dist/index.js +14 -4
- package/dist/modules/hyperlink.d.ts +8 -1
- package/dist/settings.d.ts +60 -0
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/api/common.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare function getSheetWithLatestCelldata(ctx: Context, options?: Commo
|
|
|
44
44
|
hyperlink?: Record<string, {
|
|
45
45
|
linkType: string;
|
|
46
46
|
linkAddress: string;
|
|
47
|
+
payload?: Record<string, any> | undefined;
|
|
47
48
|
}> | undefined;
|
|
48
49
|
dynamicArray_compute?: any;
|
|
49
50
|
dynamicArray?: any[] | undefined;
|
package/dist/index.esm.js
CHANGED
|
@@ -36602,6 +36602,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36602
36602
|
continue;
|
|
36603
36603
|
}
|
|
36604
36604
|
var calc_funcStr = formulaCell.calc_funcStr;
|
|
36605
|
+
console.time('formulaRunList' + _i14);
|
|
36605
36606
|
var v = execfunction(ctx, calc_funcStr, formulaCell.r, formulaCell.c, formulaCell.id, false, notInsertFunc);
|
|
36606
36607
|
ctx.groupValuesRefreshData.push({
|
|
36607
36608
|
r: formulaCell.r,
|
|
@@ -36615,6 +36616,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36615
36616
|
v: v[1],
|
|
36616
36617
|
f: v[2]
|
|
36617
36618
|
};
|
|
36619
|
+
console.timeEnd('formulaRunList' + _i14);
|
|
36618
36620
|
}
|
|
36619
36621
|
console.timeEnd('formulaRunList');
|
|
36620
36622
|
ctx.formulaCache.execFunctionExist = undefined;
|
|
@@ -48041,16 +48043,21 @@ function getCellHyperlink(ctx, r, c) {
|
|
|
48041
48043
|
}
|
|
48042
48044
|
return undefined;
|
|
48043
48045
|
}
|
|
48044
|
-
function
|
|
48046
|
+
function getCellHyperlinkWithPayload(ctx, r, c) {
|
|
48047
|
+
return getCellHyperlink(ctx, r, c);
|
|
48048
|
+
}
|
|
48049
|
+
function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress, payload) {
|
|
48045
48050
|
var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
48046
48051
|
var flowdata = getFlowdata(ctx);
|
|
48047
48052
|
if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
|
|
48048
48053
|
var cell = flowdata[r][c];
|
|
48049
48054
|
if (cell == null) cell = {};
|
|
48050
|
-
_.set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], {
|
|
48055
|
+
_.set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], _objectSpread2({
|
|
48051
48056
|
linkType: linkType,
|
|
48052
48057
|
linkAddress: linkAddress
|
|
48053
|
-
}
|
|
48058
|
+
}, payload != null ? {
|
|
48059
|
+
payload: payload
|
|
48060
|
+
} : {}));
|
|
48054
48061
|
cell.fc = "rgb(0, 0, 255)";
|
|
48055
48062
|
cell.un = 1;
|
|
48056
48063
|
cell.v = linkText || linkAddress;
|
|
@@ -48103,7 +48110,7 @@ function showLinkCard(ctx, r, c) {
|
|
|
48103
48110
|
c: c,
|
|
48104
48111
|
rc: "".concat(r, "_").concat(c),
|
|
48105
48112
|
originText: (cell === null || cell === void 0 ? void 0 : cell.v) == null ? "" : "".concat(cell.v),
|
|
48106
|
-
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "
|
|
48113
|
+
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "",
|
|
48107
48114
|
originAddress: (link === null || link === void 0 ? void 0 : link.linkAddress) || "",
|
|
48108
48115
|
position: {
|
|
48109
48116
|
cellLeft: col_pre,
|
|
@@ -57401,6 +57408,8 @@ var defaultSettings = {
|
|
|
57401
57408
|
renderTopToolbar: undefined,
|
|
57402
57409
|
renderBottomToolbar: undefined,
|
|
57403
57410
|
headerBgColor: "#fff",
|
|
57411
|
+
detailLinkType: "",
|
|
57412
|
+
customLinkTypes: [],
|
|
57404
57413
|
toolbarRightRender: undefined,
|
|
57405
57414
|
onClickContentEditable: undefined,
|
|
57406
57415
|
renderCustomColor: undefined,
|
|
@@ -61344,4 +61353,4 @@ function handlePasteByClick(ctx, triggerType) {
|
|
|
61344
61353
|
} else if (data.indexOf("leankylin-copy-action-image") > -1) ; else ;
|
|
61345
61354
|
}
|
|
61346
61355
|
|
|
61347
|
-
export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, index as api, applyLocation, attrToCssName, autoSelectionFormula, calcSelectionInfo, cancelActiveImgItem, cancelFunctionrangeSelected, cancelNormalSelected, cancelPaintModel, cellFocus, cfSplitRange, changeSheet, chatatABC, checkCF, checkCellIsLocked, checkProtectionAllSelected, checkProtectionFormatCells, checkProtectionSelectLockedOrUnLockedCells, checkboxChange, clearFilter, clearMeasureTextCache, colHasMerged, colLocation, colLocationByIndex, colors, columnCharToIndex, commentBoxProps, compute, computeRowlenArr, confirmMessage, convertCssToStyleList, convertSpanToShareString, copy, copy2, createDropCellRange, createFilter, createFilterOptions, createFormulaRangeSelect, createRangeHightlight, dataRangeSelection, datenum_local, defaultContext, defaultFont, defaultSettings, defaultStyle, delFunctionGroup, deleteCellInSave, deleteComment, deleteRowCol, deleteSelectedCellText, deleteSheet, diff, drawArrow, drawLineInfo, dropCellCache, editComment, editSheetName, ensureSheetIndex, error, escapeHTMLTag, escapeRegExpStr, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getClipboardContent, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHLColor, getHintText, getHistoryRules, getInlineStringHTML, getInlineStringNoStyle, getMeasureText, getNowDateTime, getNullData, getOptionValue, getOrigincell, getQKBorder, getRange, getRangeArr, getRangeByTxt, getRangetxt, getRealCellValue, getRegExpStr, getRegStr, getRowMerge, getSearchIndexArr, getSelectRange, getSheetByIndex, getSheetIdByName, getSheetIndex, getStyleByCell, getTypeItemHide, getcellFormula, getcellrange, getdatabyselection, getrangeseleciton, goToLink, groupValuesRefresh, handleArrowKey, handleBold, handleBorder, handleCellAreaDoubleClick, handleCellAreaDragOver, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellDrop, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleDropCellDoubleClick, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePasteByLeanklin, handlePercentageFormat, handleRowFreezeHandleMouseDown, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleScreenShot, handleSort, handleStrikeThrough, handleSum, handleTextBackground, handleTextColor, handleTextSize, handleUnderline, handleVerticalAlign, handleWithCtrlOrMetaKey, hasChinaword, hasPartMC, hideCRCount, hideDropCellSelection, hideSelected, imageProps, indexToColumnChar, initFreeze, initSheetIndex, inlineStyleAffectAttribute, inlineStyleAffectCssName, insertImage, insertRowCol, insertUpdateFunctionGroup, inverseRowColOptions, isAllSelectedCellsInStatus, isAllowEdit, isInlineStringCT, isInlineStringCell, isLinkValid, isRealNull, isRealNum, isShowHidenCR, isSupportBoundingBox, is_date, iscelldata, isdatatype, isdatatypemulti, isdatetime, israngeseleciton, jfrefreshgrid, labelFilterOptionState, locale, luckysheetUpdateCell, mergeBorder, mergeCells, mergeMoveMain, mousePosition, moveHighlightCell, moveHighlightRange, moveToEnd, newComment, normalizeSelection, normalizedAttr, normalizedCellAttr, onCellsMove, onCellsMoveEnd, onCellsMoveStart, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxMoveStart, onCommentBoxResize, onCommentBoxResizeEnd, onCommentBoxResizeStart, onDropCellSelect, onDropCellSelectEnd, onFormulaRangeDragEnd, onImageMove, onImageMoveEnd, onImageMoveStart, onImageResize, onImageResizeEnd, onImageResizeStart, onRangeSelectionModalMove, onRangeSelectionModalMoveEnd, onRangeSelectionModalMoveStart, onSearchDialogMove, onSearchDialogMoveEnd, onSearchDialogMoveStart, opToPatch, orderbydata, orderbydatafiler, overShowComment, pasteHandlerOfPaintModel, patchToOp, rangeDrag, rangeDragColumn, rangeDragRow, rangeHightlightselected, rangeSetValue, rangeValueToHtml, removeActiveImage, removeEditingComment, removeHyperlink, replace, replaceAll, replaceHtml, rgbToHex, rowHasMerged, rowLocation, rowLocationByIndex, saveFilter, saveHyperlink, saveImage, scrollToFrozenRowCol, scrollToHighlightCell, searchAll, searchNext, selectAll, selectIsOverlap, selectTextContent, selectTextContentCross, selectTitlesMap, selectTitlesRange, selectionCache, selectionCopyShow, seletedHighlistByindex, setCaretPosition, setCellValue, setConditionRules, setDropcownValue, setEditingComment, setNextSheet, showComments, showDropCellSelection, showHideAllComments, showHideComment, showImgChooser, showLinkCard, showSelected, sortDataRange, sortSelection, storeSheetParamALL, toolbarItemClickHandler, toolbarItemSelectedFunc, update, updateCell, updateContextWithCanvas, updateContextWithSheetData, updateDropCell, updateFormat, updateFormatCell, updateInlineStringFormat, updateInlineStringFormatOutside, updateItem, updateMoreCell, updateSheet, validateCellData, validateIdCard, valueIsError, valueShowEs };
|
|
61356
|
+
export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, index as api, applyLocation, attrToCssName, autoSelectionFormula, calcSelectionInfo, cancelActiveImgItem, cancelFunctionrangeSelected, cancelNormalSelected, cancelPaintModel, cellFocus, cfSplitRange, changeSheet, chatatABC, checkCF, checkCellIsLocked, checkProtectionAllSelected, checkProtectionFormatCells, checkProtectionSelectLockedOrUnLockedCells, checkboxChange, clearFilter, clearMeasureTextCache, colHasMerged, colLocation, colLocationByIndex, colors, columnCharToIndex, commentBoxProps, compute, computeRowlenArr, confirmMessage, convertCssToStyleList, convertSpanToShareString, copy, copy2, createDropCellRange, createFilter, createFilterOptions, createFormulaRangeSelect, createRangeHightlight, dataRangeSelection, datenum_local, defaultContext, defaultFont, defaultSettings, defaultStyle, delFunctionGroup, deleteCellInSave, deleteComment, deleteRowCol, deleteSelectedCellText, deleteSheet, diff, drawArrow, drawLineInfo, dropCellCache, editComment, editSheetName, ensureSheetIndex, error, escapeHTMLTag, escapeRegExpStr, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellHyperlinkWithPayload, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getClipboardContent, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHLColor, getHintText, getHistoryRules, getInlineStringHTML, getInlineStringNoStyle, getMeasureText, getNowDateTime, getNullData, getOptionValue, getOrigincell, getQKBorder, getRange, getRangeArr, getRangeByTxt, getRangetxt, getRealCellValue, getRegExpStr, getRegStr, getRowMerge, getSearchIndexArr, getSelectRange, getSheetByIndex, getSheetIdByName, getSheetIndex, getStyleByCell, getTypeItemHide, getcellFormula, getcellrange, getdatabyselection, getrangeseleciton, goToLink, groupValuesRefresh, handleArrowKey, handleBold, handleBorder, handleCellAreaDoubleClick, handleCellAreaDragOver, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellDrop, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleDropCellDoubleClick, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePasteByLeanklin, handlePercentageFormat, handleRowFreezeHandleMouseDown, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleScreenShot, handleSort, handleStrikeThrough, handleSum, handleTextBackground, handleTextColor, handleTextSize, handleUnderline, handleVerticalAlign, handleWithCtrlOrMetaKey, hasChinaword, hasPartMC, hideCRCount, hideDropCellSelection, hideSelected, imageProps, indexToColumnChar, initFreeze, initSheetIndex, inlineStyleAffectAttribute, inlineStyleAffectCssName, insertImage, insertRowCol, insertUpdateFunctionGroup, inverseRowColOptions, isAllSelectedCellsInStatus, isAllowEdit, isInlineStringCT, isInlineStringCell, isLinkValid, isRealNull, isRealNum, isShowHidenCR, isSupportBoundingBox, is_date, iscelldata, isdatatype, isdatatypemulti, isdatetime, israngeseleciton, jfrefreshgrid, labelFilterOptionState, locale, luckysheetUpdateCell, mergeBorder, mergeCells, mergeMoveMain, mousePosition, moveHighlightCell, moveHighlightRange, moveToEnd, newComment, normalizeSelection, normalizedAttr, normalizedCellAttr, onCellsMove, onCellsMoveEnd, onCellsMoveStart, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxMoveStart, onCommentBoxResize, onCommentBoxResizeEnd, onCommentBoxResizeStart, onDropCellSelect, onDropCellSelectEnd, onFormulaRangeDragEnd, onImageMove, onImageMoveEnd, onImageMoveStart, onImageResize, onImageResizeEnd, onImageResizeStart, onRangeSelectionModalMove, onRangeSelectionModalMoveEnd, onRangeSelectionModalMoveStart, onSearchDialogMove, onSearchDialogMoveEnd, onSearchDialogMoveStart, opToPatch, orderbydata, orderbydatafiler, overShowComment, pasteHandlerOfPaintModel, patchToOp, rangeDrag, rangeDragColumn, rangeDragRow, rangeHightlightselected, rangeSetValue, rangeValueToHtml, removeActiveImage, removeEditingComment, removeHyperlink, replace, replaceAll, replaceHtml, rgbToHex, rowHasMerged, rowLocation, rowLocationByIndex, saveFilter, saveHyperlink, saveImage, scrollToFrozenRowCol, scrollToHighlightCell, searchAll, searchNext, selectAll, selectIsOverlap, selectTextContent, selectTextContentCross, selectTitlesMap, selectTitlesRange, selectionCache, selectionCopyShow, seletedHighlistByindex, setCaretPosition, setCellValue, setConditionRules, setDropcownValue, setEditingComment, setNextSheet, showComments, showDropCellSelection, showHideAllComments, showHideComment, showImgChooser, showLinkCard, showSelected, sortDataRange, sortSelection, storeSheetParamALL, toolbarItemClickHandler, toolbarItemSelectedFunc, update, updateCell, updateContextWithCanvas, updateContextWithSheetData, updateDropCell, updateFormat, updateFormatCell, updateInlineStringFormat, updateInlineStringFormatOutside, updateItem, updateMoreCell, updateSheet, validateCellData, validateIdCard, valueIsError, valueShowEs };
|
package/dist/index.js
CHANGED
|
@@ -36612,6 +36612,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36612
36612
|
continue;
|
|
36613
36613
|
}
|
|
36614
36614
|
var calc_funcStr = formulaCell.calc_funcStr;
|
|
36615
|
+
console.time('formulaRunList' + _i14);
|
|
36615
36616
|
var v = execfunction(ctx, calc_funcStr, formulaCell.r, formulaCell.c, formulaCell.id, false, notInsertFunc);
|
|
36616
36617
|
ctx.groupValuesRefreshData.push({
|
|
36617
36618
|
r: formulaCell.r,
|
|
@@ -36625,6 +36626,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36625
36626
|
v: v[1],
|
|
36626
36627
|
f: v[2]
|
|
36627
36628
|
};
|
|
36629
|
+
console.timeEnd('formulaRunList' + _i14);
|
|
36628
36630
|
}
|
|
36629
36631
|
console.timeEnd('formulaRunList');
|
|
36630
36632
|
ctx.formulaCache.execFunctionExist = undefined;
|
|
@@ -48051,16 +48053,21 @@ function getCellHyperlink(ctx, r, c) {
|
|
|
48051
48053
|
}
|
|
48052
48054
|
return undefined;
|
|
48053
48055
|
}
|
|
48054
|
-
function
|
|
48056
|
+
function getCellHyperlinkWithPayload(ctx, r, c) {
|
|
48057
|
+
return getCellHyperlink(ctx, r, c);
|
|
48058
|
+
}
|
|
48059
|
+
function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress, payload) {
|
|
48055
48060
|
var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
48056
48061
|
var flowdata = getFlowdata(ctx);
|
|
48057
48062
|
if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
|
|
48058
48063
|
var cell = flowdata[r][c];
|
|
48059
48064
|
if (cell == null) cell = {};
|
|
48060
|
-
___default['default'].set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], {
|
|
48065
|
+
___default['default'].set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], _objectSpread2({
|
|
48061
48066
|
linkType: linkType,
|
|
48062
48067
|
linkAddress: linkAddress
|
|
48063
|
-
}
|
|
48068
|
+
}, payload != null ? {
|
|
48069
|
+
payload: payload
|
|
48070
|
+
} : {}));
|
|
48064
48071
|
cell.fc = "rgb(0, 0, 255)";
|
|
48065
48072
|
cell.un = 1;
|
|
48066
48073
|
cell.v = linkText || linkAddress;
|
|
@@ -48113,7 +48120,7 @@ function showLinkCard(ctx, r, c) {
|
|
|
48113
48120
|
c: c,
|
|
48114
48121
|
rc: "".concat(r, "_").concat(c),
|
|
48115
48122
|
originText: (cell === null || cell === void 0 ? void 0 : cell.v) == null ? "" : "".concat(cell.v),
|
|
48116
|
-
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "
|
|
48123
|
+
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "",
|
|
48117
48124
|
originAddress: (link === null || link === void 0 ? void 0 : link.linkAddress) || "",
|
|
48118
48125
|
position: {
|
|
48119
48126
|
cellLeft: col_pre,
|
|
@@ -57411,6 +57418,8 @@ var defaultSettings = {
|
|
|
57411
57418
|
renderTopToolbar: undefined,
|
|
57412
57419
|
renderBottomToolbar: undefined,
|
|
57413
57420
|
headerBgColor: "#fff",
|
|
57421
|
+
detailLinkType: "",
|
|
57422
|
+
customLinkTypes: [],
|
|
57414
57423
|
toolbarRightRender: undefined,
|
|
57415
57424
|
onClickContentEditable: undefined,
|
|
57416
57425
|
renderCustomColor: undefined,
|
|
@@ -61441,6 +61450,7 @@ exports.getArrowCanvasSize = getArrowCanvasSize;
|
|
|
61441
61450
|
exports.getBorderInfoCompute = getBorderInfoCompute;
|
|
61442
61451
|
exports.getBorderInfoComputeRange = getBorderInfoComputeRange;
|
|
61443
61452
|
exports.getCellHyperlink = getCellHyperlink;
|
|
61453
|
+
exports.getCellHyperlinkWithPayload = getCellHyperlinkWithPayload;
|
|
61444
61454
|
exports.getCellRowColumn = getCellRowColumn;
|
|
61445
61455
|
exports.getCellTextInfo = getCellTextInfo;
|
|
61446
61456
|
exports.getCellTopRightPostion = getCellTopRightPostion;
|
|
@@ -7,8 +7,15 @@ export declare function getCellRowColumn(ctx: Context, e: MouseEvent, container:
|
|
|
7
7
|
export declare function getCellHyperlink(ctx: Context, r: number, c: number): {
|
|
8
8
|
linkType: string;
|
|
9
9
|
linkAddress: string;
|
|
10
|
+
payload?: Record<string, any> | undefined;
|
|
10
11
|
} | undefined;
|
|
11
|
-
export
|
|
12
|
+
export type HyperlinkWithPayload = {
|
|
13
|
+
linkType: string;
|
|
14
|
+
linkAddress: string;
|
|
15
|
+
payload?: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
export declare function getCellHyperlinkWithPayload(ctx: Context, r: number, c: number): HyperlinkWithPayload | undefined;
|
|
18
|
+
export declare function saveHyperlink(ctx: Context, r: number, c: number, linkText: string, linkType: string, linkAddress: string, payload?: Record<string, any>): void;
|
|
12
19
|
export declare function removeHyperlink(ctx: Context, r: number, c: number): void;
|
|
13
20
|
export declare function showLinkCard(ctx: Context, r: number, c: number, isEditing?: boolean, isMouseDown?: boolean): void;
|
|
14
21
|
export declare function goToLink(ctx: Context, r: number, c: number, linkType: string, linkAddress: string, scrollbarX: HTMLDivElement, scrollbarY: HTMLDivElement): void;
|
package/dist/settings.d.ts
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Sheet, Selection, CellMatrix, Cell } from "./types";
|
|
3
|
+
export type LinkTypeSavedValue = {
|
|
4
|
+
linkType: string;
|
|
5
|
+
linkAddress: string;
|
|
6
|
+
payload?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
export type LinkTypeRenderProps = {
|
|
9
|
+
value: string;
|
|
10
|
+
position: {
|
|
11
|
+
r: number;
|
|
12
|
+
c: number;
|
|
13
|
+
};
|
|
14
|
+
onChange: (next: string) => void;
|
|
15
|
+
payload: Record<string, any>;
|
|
16
|
+
setPayload: (next: Record<string, any> | ((prev: Record<string, any>) => Record<string, any>)) => void;
|
|
17
|
+
ctx: any;
|
|
18
|
+
};
|
|
19
|
+
export type LinkTypeSaveProps = {
|
|
20
|
+
linkText: string;
|
|
21
|
+
linkAddress: string;
|
|
22
|
+
position: {
|
|
23
|
+
r: number;
|
|
24
|
+
c: number;
|
|
25
|
+
};
|
|
26
|
+
origin: {
|
|
27
|
+
linkType: string;
|
|
28
|
+
linkAddress: string;
|
|
29
|
+
payload?: any;
|
|
30
|
+
} | undefined;
|
|
31
|
+
};
|
|
32
|
+
export type LinkTypeClickProps = {
|
|
33
|
+
linkType: string;
|
|
34
|
+
linkAddress: string;
|
|
35
|
+
payload?: Record<string, any>;
|
|
36
|
+
position: {
|
|
37
|
+
r: number;
|
|
38
|
+
c: number;
|
|
39
|
+
sheetId: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type LinkTypeHoverProps = LinkTypeClickProps & {
|
|
43
|
+
event: MouseEvent | TouchEvent;
|
|
44
|
+
};
|
|
45
|
+
export type LinkTypeConfig = {
|
|
46
|
+
type: string;
|
|
47
|
+
text: string;
|
|
48
|
+
render?: (props: LinkTypeRenderProps) => any;
|
|
49
|
+
onSave?: (props: LinkTypeSaveProps) => LinkTypeSavedValue | undefined;
|
|
50
|
+
onClick?: (props: LinkTypeClickProps) => void | boolean;
|
|
51
|
+
onHover?: (props: LinkTypeHoverProps) => void;
|
|
52
|
+
};
|
|
53
|
+
export type HyperlinkHoverInfo = LinkTypeClickProps & {
|
|
54
|
+
event: MouseEvent | TouchEvent;
|
|
55
|
+
};
|
|
56
|
+
export type HyperlinkClickInfo = LinkTypeClickProps & {
|
|
57
|
+
event: any;
|
|
58
|
+
};
|
|
3
59
|
export type Hooks = {
|
|
4
60
|
rowColChange?: (conf: {
|
|
5
61
|
action: "add" | "delete";
|
|
@@ -25,6 +81,8 @@ export type Hooks = {
|
|
|
25
81
|
afterUpdateCell?: (row: number, column: number, oldValue: any, newValue: any) => void;
|
|
26
82
|
afterSelectionChange?: (sheetId: string, selection: Selection) => void;
|
|
27
83
|
afterSheetChange?: (sheetId: string, prevSheetId: string) => void;
|
|
84
|
+
onHyperlinkHover?: (info: HyperlinkHoverInfo) => void;
|
|
85
|
+
onHyperlinkClick?: (info: HyperlinkClickInfo) => void;
|
|
28
86
|
beforeRenderRowHeaderCell?: (rowNumber: string, rowIndex: number, top: number, width: number, height: number, ctx: CanvasRenderingContext2D) => boolean;
|
|
29
87
|
afterRenderRowHeaderCell?: (rowNumber: string, rowIndex: number, top: number, width: number, height: number, ctx: CanvasRenderingContext2D) => void;
|
|
30
88
|
beforeRenderColumnHeaderCell?: (columnChar: string, columnIndex: number, left: number, width: number, height: number, ctx: CanvasRenderingContext2D) => boolean;
|
|
@@ -92,6 +150,7 @@ export type Hooks = {
|
|
|
92
150
|
afterUpdateSheetName?: (id: string, oldName: string, newName: string) => void;
|
|
93
151
|
};
|
|
94
152
|
export type Settings = {
|
|
153
|
+
detailLinkType?: string;
|
|
95
154
|
headerBgColor?: string;
|
|
96
155
|
toolbarRightRender?: any;
|
|
97
156
|
renderBottomToolbar?: any;
|
|
@@ -159,5 +218,6 @@ export type Settings = {
|
|
|
159
218
|
icon?: React.ReactNode;
|
|
160
219
|
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
161
220
|
}[];
|
|
221
|
+
customLinkTypes?: LinkTypeConfig[];
|
|
162
222
|
};
|
|
163
223
|
export declare const defaultSettings: Required<Settings>;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "father-build"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@leankylin-sheet/formula-parser": "6.0.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "6.0.2",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|