@leankylin-sheet/core 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/common.d.ts +1 -0
- package/dist/index.esm.js +12 -5
- package/dist/index.js +12 -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
|
@@ -48041,16 +48041,21 @@ function getCellHyperlink(ctx, r, c) {
|
|
|
48041
48041
|
}
|
|
48042
48042
|
return undefined;
|
|
48043
48043
|
}
|
|
48044
|
-
function
|
|
48044
|
+
function getCellHyperlinkWithPayload(ctx, r, c) {
|
|
48045
|
+
return getCellHyperlink(ctx, r, c);
|
|
48046
|
+
}
|
|
48047
|
+
function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress, payload) {
|
|
48045
48048
|
var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
48046
48049
|
var flowdata = getFlowdata(ctx);
|
|
48047
48050
|
if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
|
|
48048
48051
|
var cell = flowdata[r][c];
|
|
48049
48052
|
if (cell == null) cell = {};
|
|
48050
|
-
_.set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], {
|
|
48053
|
+
_.set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], _objectSpread2({
|
|
48051
48054
|
linkType: linkType,
|
|
48052
48055
|
linkAddress: linkAddress
|
|
48053
|
-
}
|
|
48056
|
+
}, payload != null ? {
|
|
48057
|
+
payload: payload
|
|
48058
|
+
} : {}));
|
|
48054
48059
|
cell.fc = "rgb(0, 0, 255)";
|
|
48055
48060
|
cell.un = 1;
|
|
48056
48061
|
cell.v = linkText || linkAddress;
|
|
@@ -48103,7 +48108,7 @@ function showLinkCard(ctx, r, c) {
|
|
|
48103
48108
|
c: c,
|
|
48104
48109
|
rc: "".concat(r, "_").concat(c),
|
|
48105
48110
|
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) || "
|
|
48111
|
+
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "",
|
|
48107
48112
|
originAddress: (link === null || link === void 0 ? void 0 : link.linkAddress) || "",
|
|
48108
48113
|
position: {
|
|
48109
48114
|
cellLeft: col_pre,
|
|
@@ -57401,6 +57406,8 @@ var defaultSettings = {
|
|
|
57401
57406
|
renderTopToolbar: undefined,
|
|
57402
57407
|
renderBottomToolbar: undefined,
|
|
57403
57408
|
headerBgColor: "#fff",
|
|
57409
|
+
detailLinkType: "",
|
|
57410
|
+
customLinkTypes: [],
|
|
57404
57411
|
toolbarRightRender: undefined,
|
|
57405
57412
|
onClickContentEditable: undefined,
|
|
57406
57413
|
renderCustomColor: undefined,
|
|
@@ -61344,4 +61351,4 @@ function handlePasteByClick(ctx, triggerType) {
|
|
|
61344
61351
|
} else if (data.indexOf("leankylin-copy-action-image") > -1) ; else ;
|
|
61345
61352
|
}
|
|
61346
61353
|
|
|
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 };
|
|
61354
|
+
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
|
@@ -48051,16 +48051,21 @@ function getCellHyperlink(ctx, r, c) {
|
|
|
48051
48051
|
}
|
|
48052
48052
|
return undefined;
|
|
48053
48053
|
}
|
|
48054
|
-
function
|
|
48054
|
+
function getCellHyperlinkWithPayload(ctx, r, c) {
|
|
48055
|
+
return getCellHyperlink(ctx, r, c);
|
|
48056
|
+
}
|
|
48057
|
+
function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress, payload) {
|
|
48055
48058
|
var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
48056
48059
|
var flowdata = getFlowdata(ctx);
|
|
48057
48060
|
if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
|
|
48058
48061
|
var cell = flowdata[r][c];
|
|
48059
48062
|
if (cell == null) cell = {};
|
|
48060
|
-
___default['default'].set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], {
|
|
48063
|
+
___default['default'].set(ctx.luckysheetfile[sheetIndex], ["hyperlink", "".concat(r, "_").concat(c)], _objectSpread2({
|
|
48061
48064
|
linkType: linkType,
|
|
48062
48065
|
linkAddress: linkAddress
|
|
48063
|
-
}
|
|
48066
|
+
}, payload != null ? {
|
|
48067
|
+
payload: payload
|
|
48068
|
+
} : {}));
|
|
48064
48069
|
cell.fc = "rgb(0, 0, 255)";
|
|
48065
48070
|
cell.un = 1;
|
|
48066
48071
|
cell.v = linkText || linkAddress;
|
|
@@ -48113,7 +48118,7 @@ function showLinkCard(ctx, r, c) {
|
|
|
48113
48118
|
c: c,
|
|
48114
48119
|
rc: "".concat(r, "_").concat(c),
|
|
48115
48120
|
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) || "
|
|
48121
|
+
originType: (link === null || link === void 0 ? void 0 : link.linkType) || "",
|
|
48117
48122
|
originAddress: (link === null || link === void 0 ? void 0 : link.linkAddress) || "",
|
|
48118
48123
|
position: {
|
|
48119
48124
|
cellLeft: col_pre,
|
|
@@ -57411,6 +57416,8 @@ var defaultSettings = {
|
|
|
57411
57416
|
renderTopToolbar: undefined,
|
|
57412
57417
|
renderBottomToolbar: undefined,
|
|
57413
57418
|
headerBgColor: "#fff",
|
|
57419
|
+
detailLinkType: "",
|
|
57420
|
+
customLinkTypes: [],
|
|
57414
57421
|
toolbarRightRender: undefined,
|
|
57415
57422
|
onClickContentEditable: undefined,
|
|
57416
57423
|
renderCustomColor: undefined,
|
|
@@ -61441,6 +61448,7 @@ exports.getArrowCanvasSize = getArrowCanvasSize;
|
|
|
61441
61448
|
exports.getBorderInfoCompute = getBorderInfoCompute;
|
|
61442
61449
|
exports.getBorderInfoComputeRange = getBorderInfoComputeRange;
|
|
61443
61450
|
exports.getCellHyperlink = getCellHyperlink;
|
|
61451
|
+
exports.getCellHyperlinkWithPayload = getCellHyperlinkWithPayload;
|
|
61444
61452
|
exports.getCellRowColumn = getCellRowColumn;
|
|
61445
61453
|
exports.getCellTextInfo = getCellTextInfo;
|
|
61446
61454
|
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.1",
|
|
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.1",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|