@fileverse-dev/fortune-core 1.0.4 → 1.0.6
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/packages/core/src → es}/api/cell.d.ts +10 -10
- package/es/api/cell.js +204 -0
- package/{dist/packages/core/src → es}/api/common.d.ts +66 -66
- package/es/api/common.js +79 -0
- package/{dist/packages/core/src → es}/api/errors.d.ts +2 -2
- package/es/api/errors.js +2 -0
- package/{dist/packages/core/src → es}/api/index.d.ts +9 -9
- package/es/api/index.js +8 -0
- package/{dist/packages/core/src → es}/api/merge.d.ts +5 -5
- package/es/api/merge.js +15 -0
- package/{dist/packages/core/src → es}/api/range.d.ts +22 -22
- package/es/api/range.js +123 -0
- package/{dist/packages/core/src → es}/api/rowcol.d.ts +14 -14
- package/es/api/rowcol.js +207 -0
- package/{dist/packages/core/src → es}/api/sheet.d.ts +10 -10
- package/es/api/sheet.js +128 -0
- package/{dist/packages/core/src → es}/api/workbook.d.ts +15 -15
- package/es/api/workbook.js +85 -0
- package/{dist/packages/core/src → es}/canvas.d.ts +46 -46
- package/es/canvas.js +1350 -0
- package/{dist/packages/core/src → es}/context.d.ts +197 -197
- package/es/context.js +380 -0
- package/{dist/packages/core/src → es}/events/copy.d.ts +2 -2
- package/es/events/copy.js +78 -0
- package/{dist/packages/core/src → es}/events/index.d.ts +4 -4
- package/es/events/index.js +4 -0
- package/{dist/packages/core/src → es}/events/keyboard.d.ts +6 -6
- package/es/events/keyboard.js +332 -0
- package/{dist/packages/core/src → es}/events/mouse.d.ts +22 -22
- package/es/events/mouse.js +1725 -0
- package/{dist/packages/core/src → es}/events/paste.d.ts +3 -3
- package/es/events/paste.js +1358 -0
- package/{dist/packages/core/src → es}/index.d.ts +10 -10
- package/es/index.js +10 -0
- package/{dist/packages/core/src → es}/locale/en.d.ts +992 -992
- package/es/locale/en.js +10564 -0
- package/{dist/packages/core/src → es}/locale/es.d.ts +1134 -1134
- package/es/locale/es.js +10010 -0
- package/{dist/packages/core/src → es}/locale/hi.d.ts +1030 -1030
- package/es/locale/hi.js +10550 -0
- package/{dist/packages/core/src → es}/locale/index.d.ts +1049 -1049
- package/es/locale/index.js +23 -0
- package/{dist/packages/core/src → es}/locale/zh.d.ts +1048 -1048
- package/es/locale/zh.js +10568 -0
- package/{dist/packages/core/src → es}/locale/zh_tw.d.ts +1187 -1187
- package/es/locale/zh_tw.js +10072 -0
- package/{dist/packages/core/src → es}/modules/ConditionFormat.d.ts +17 -17
- package/es/modules/ConditionFormat.js +1258 -0
- package/{dist/packages/core/src → es}/modules/border.d.ts +3 -3
- package/es/modules/border.js +1240 -0
- package/{dist/packages/core/src → es}/modules/cell.d.ts +32 -32
- package/es/modules/cell.js +1055 -0
- package/{dist/packages/core/src → es}/modules/clipboard.d.ts +3 -3
- package/es/modules/clipboard.js +36 -0
- package/{dist/packages/core/src → es}/modules/color.d.ts +1 -1
- package/es/modules/color.js +1 -0
- package/{dist/packages/core/src → es}/modules/comment.d.ts +97 -97
- package/es/modules/comment.js +597 -0
- package/{dist/packages/core/src → es}/modules/conditionalFormat.d.ts +2 -2
- package/es/modules/conditionalFormat.js +441 -0
- package/{dist/packages/core/src → es}/modules/cursor.d.ts +3 -3
- package/es/modules/cursor.js +62 -0
- package/{dist/packages/core/src → es}/modules/dataVerification.d.ts +11 -11
- package/es/modules/dataVerification.js +700 -0
- package/{dist/packages/core/src → es}/modules/dropCell.d.ts +10 -10
- package/es/modules/dropCell.js +2266 -0
- package/{dist/packages/core/src → es}/modules/filter.d.ts +45 -45
- package/es/modules/filter.js +434 -0
- package/{dist/packages/core/src → es}/modules/format.d.ts +6 -6
- package/es/modules/format.js +323 -0
- package/{dist/packages/core/src → es}/modules/formula.d.ts +54 -54
- package/es/modules/formula.js +2301 -0
- package/{dist/packages/core/src → es}/modules/freeze.d.ts +5 -5
- package/es/modules/freeze.js +148 -0
- package/{dist/packages/core/src → es}/modules/hyperlink.d.ts +21 -21
- package/es/modules/hyperlink.js +216 -0
- package/{dist/packages/core/src → es}/modules/iframe.d.ts +12 -12
- package/es/modules/iframe.js +220 -0
- package/{dist/packages/core/src → es}/modules/image.d.ts +31 -31
- package/es/modules/image.js +253 -0
- package/{dist/packages/core/src → es}/modules/index.d.ts +36 -36
- package/es/modules/index.js +36 -0
- package/{dist/packages/core/src → es}/modules/inline-string.d.ts +36 -36
- package/es/modules/inline-string.js +437 -0
- package/{dist/packages/core/src → es}/modules/location.d.ts +6 -6
- package/es/modules/location.js +46 -0
- package/{dist/packages/core/src → es}/modules/locationCondition.d.ts +21 -21
- package/es/modules/locationCondition.js +218 -0
- package/{dist/packages/core/src → es}/modules/merge.d.ts +3 -3
- package/es/modules/merge.js +216 -0
- package/{dist/packages/core/src → es}/modules/mobile.d.ts +5 -5
- package/es/modules/mobile.js +33 -0
- package/{dist/packages/core/src → es}/modules/moveCells.d.ts +5 -5
- package/es/modules/moveCells.js +348 -0
- package/{dist/packages/core/src → es}/modules/protection.d.ts +5 -5
- package/es/modules/protection.js +96 -0
- package/{dist/packages/core/src → es}/modules/refresh.d.ts +3 -3
- package/es/modules/refresh.js +34 -0
- package/{dist/packages/core/src → es}/modules/rowcol.d.ts +19 -19
- package/es/modules/rowcol.js +1922 -0
- package/{dist/packages/core/src → es}/modules/screenshot.d.ts +2 -2
- package/es/modules/screenshot.js +90 -0
- package/{dist/packages/core/src → es}/modules/searchReplace.d.ts +36 -36
- package/es/modules/searchReplace.js +388 -0
- package/{dist/packages/core/src → es}/modules/selection.d.ts +46 -46
- package/es/modules/selection.js +1674 -0
- package/{dist/packages/core/src → es}/modules/sheet.d.ts +10 -10
- package/es/modules/sheet.js +237 -0
- package/{dist/packages/core/src → es}/modules/sort.d.ts +7 -7
- package/es/modules/sort.js +150 -0
- package/{dist/packages/core/src → es}/modules/splitColumn.d.ts +5 -5
- package/es/modules/splitColumn.js +126 -0
- package/es/modules/ssf.js +1533 -0
- package/{dist/packages/core/src → es}/modules/text.d.ts +10 -10
- package/es/modules/text.js +1207 -0
- package/{dist/packages/core/src → es}/modules/toolbar.d.ts +32 -32
- package/es/modules/toolbar.js +970 -0
- package/{dist/packages/core/src → es}/modules/validation.d.ts +19 -19
- package/es/modules/validation.js +190 -0
- package/{dist/packages/core/src → es}/modules/zoom.d.ts +3 -3
- package/es/modules/zoom.js +29 -0
- package/{dist/packages/core/src → es}/settings.d.ts +100 -100
- package/es/settings.js +36 -0
- package/{dist/packages/core/src → es}/types.d.ts +371 -371
- package/es/types.js +1 -0
- package/{dist/packages/core/src → es}/utils/freeze.d.ts +7 -7
- package/es/utils/freeze.js +86 -0
- package/{dist/packages/core/src → es}/utils/index.d.ts +18 -18
- package/es/utils/index.js +173 -0
- package/{dist/packages/core/src → es}/utils/patch.d.ts +37 -37
- package/es/utils/patch.js +381 -0
- package/lib/api/cell.d.ts +10 -0
- package/lib/api/cell.js +215 -0
- package/lib/api/common.d.ts +66 -0
- package/lib/api/common.js +88 -0
- package/lib/api/errors.d.ts +2 -0
- package/lib/api/errors.js +8 -0
- package/lib/api/index.d.ts +9 -0
- package/lib/api/index.js +101 -0
- package/lib/api/merge.d.ts +5 -0
- package/lib/api/merge.js +22 -0
- package/lib/api/range.d.ts +22 -0
- package/lib/api/range.js +138 -0
- package/lib/api/rowcol.d.ts +14 -0
- package/lib/api/rowcol.js +222 -0
- package/lib/api/sheet.d.ts +10 -0
- package/lib/api/sheet.js +145 -0
- package/lib/api/workbook.d.ts +15 -0
- package/lib/api/workbook.js +98 -0
- package/lib/canvas.d.ts +46 -0
- package/lib/canvas.js +1356 -0
- package/lib/context.d.ts +197 -0
- package/lib/context.js +392 -0
- package/lib/events/copy.d.ts +2 -0
- package/lib/events/copy.js +85 -0
- package/lib/events/index.d.ts +4 -0
- package/lib/events/index.js +49 -0
- package/lib/events/keyboard.d.ts +6 -0
- package/lib/events/keyboard.js +342 -0
- package/lib/events/mouse.d.ts +22 -0
- package/lib/events/mouse.js +1744 -0
- package/lib/events/paste.d.ts +3 -0
- package/lib/events/paste.js +1366 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +109 -0
- package/lib/locale/en.d.ts +992 -0
- package/lib/locale/en.js +10570 -0
- package/lib/locale/es.d.ts +1134 -0
- package/lib/locale/es.js +10016 -0
- package/lib/locale/hi.d.ts +1030 -0
- package/lib/locale/hi.js +10556 -0
- package/lib/locale/index.d.ts +1049 -0
- package/lib/locale/index.js +29 -0
- package/lib/locale/zh.d.ts +1048 -0
- package/lib/locale/zh.js +10574 -0
- package/lib/locale/zh_tw.d.ts +1187 -0
- package/lib/locale/zh_tw.js +10078 -0
- package/lib/modules/ConditionFormat.d.ts +17 -0
- package/lib/modules/ConditionFormat.js +1273 -0
- package/lib/modules/border.d.ts +3 -0
- package/lib/modules/border.js +1248 -0
- package/lib/modules/cell.d.ts +32 -0
- package/lib/modules/cell.js +1085 -0
- package/lib/modules/clipboard.d.ts +3 -0
- package/lib/modules/clipboard.js +42 -0
- package/lib/modules/color.d.ts +1 -0
- package/lib/modules/color.js +7 -0
- package/lib/modules/comment.d.ts +97 -0
- package/lib/modules/comment.js +625 -0
- package/lib/modules/conditionalFormat.d.ts +2 -0
- package/lib/modules/conditionalFormat.js +447 -0
- package/lib/modules/cursor.d.ts +3 -0
- package/lib/modules/cursor.js +70 -0
- package/lib/modules/dataVerification.d.ts +11 -0
- package/lib/modules/dataVerification.js +715 -0
- package/lib/modules/dropCell.d.ts +10 -0
- package/lib/modules/dropCell.js +2282 -0
- package/lib/modules/filter.d.ts +45 -0
- package/lib/modules/filter.js +448 -0
- package/lib/modules/format.d.ts +6 -0
- package/lib/modules/format.js +334 -0
- package/lib/modules/formula.d.ts +54 -0
- package/lib/modules/formula.js +2330 -0
- package/lib/modules/freeze.d.ts +5 -0
- package/lib/modules/freeze.js +158 -0
- package/lib/modules/hyperlink.d.ts +21 -0
- package/lib/modules/hyperlink.js +232 -0
- package/lib/modules/iframe.d.ts +12 -0
- package/lib/modules/iframe.js +236 -0
- package/lib/modules/image.d.ts +31 -0
- package/lib/modules/image.js +272 -0
- package/lib/modules/index.d.ts +36 -0
- package/lib/modules/index.js +401 -0
- package/lib/modules/inline-string.d.ts +36 -0
- package/lib/modules/inline-string.js +452 -0
- package/lib/modules/location.d.ts +6 -0
- package/lib/modules/location.js +57 -0
- package/lib/modules/locationCondition.d.ts +21 -0
- package/lib/modules/locationCondition.js +229 -0
- package/lib/modules/merge.d.ts +3 -0
- package/lib/modules/merge.js +223 -0
- package/lib/modules/mobile.d.ts +5 -0
- package/lib/modules/mobile.js +41 -0
- package/lib/modules/moveCells.d.ts +5 -0
- package/lib/modules/moveCells.js +357 -0
- package/lib/modules/protection.d.ts +5 -0
- package/lib/modules/protection.js +106 -0
- package/lib/modules/refresh.d.ts +3 -0
- package/lib/modules/refresh.js +40 -0
- package/lib/modules/rowcol.d.ts +19 -0
- package/lib/modules/rowcol.js +1935 -0
- package/lib/modules/screenshot.d.ts +2 -0
- package/lib/modules/screenshot.js +96 -0
- package/lib/modules/searchReplace.d.ts +36 -0
- package/lib/modules/searchReplace.js +402 -0
- package/lib/modules/selection.d.ts +46 -0
- package/lib/modules/selection.js +1703 -0
- package/lib/modules/sheet.d.ts +10 -0
- package/lib/modules/sheet.js +250 -0
- package/lib/modules/sort.d.ts +7 -0
- package/lib/modules/sort.js +159 -0
- package/lib/modules/splitColumn.d.ts +5 -0
- package/lib/modules/splitColumn.js +136 -0
- package/lib/modules/ssf.js +1539 -0
- package/lib/modules/text.d.ts +10 -0
- package/lib/modules/text.js +1221 -0
- package/lib/modules/toolbar.d.ts +32 -0
- package/lib/modules/toolbar.js +1003 -0
- package/lib/modules/validation.d.ts +19 -0
- package/lib/modules/validation.js +205 -0
- package/lib/modules/zoom.d.ts +3 -0
- package/lib/modules/zoom.js +36 -0
- package/lib/settings.d.ts +100 -0
- package/lib/settings.js +42 -0
- package/lib/types.d.ts +371 -0
- package/lib/types.js +5 -0
- package/lib/utils/freeze.d.ts +7 -0
- package/lib/utils/freeze.js +92 -0
- package/lib/utils/index.d.ts +18 -0
- package/lib/utils/index.js +231 -0
- package/lib/utils/patch.d.ts +37 -0
- package/lib/utils/patch.js +392 -0
- package/package.json +7 -6
- package/dist/index.esm.js +0 -80255
- package/dist/index.js +0 -80601
- package/dist/packages/react/src/components/ChangeColor/index.d.ts +0 -7
- package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +0 -6
- package/dist/packages/react/src/components/ConditionFormat/index.d.ts +0 -7
- package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +0 -3
- package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +0 -3
- package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +0 -8
- package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +0 -4
- package/dist/packages/react/src/components/ContextMenu/index.d.ts +0 -5
- package/dist/packages/react/src/components/CustomSort/index.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/getDisplayedRangeTxt.d.ts +0 -2
- package/dist/packages/react/src/components/DataVerification/index.d.ts +0 -4
- package/dist/packages/react/src/components/Dialog/index.d.ts +0 -15
- package/dist/packages/react/src/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -11
- package/dist/packages/react/src/components/DunePreview/DunePreview.d.ts +0 -13
- package/dist/packages/react/src/components/FilterOption/index.d.ts +0 -5
- package/dist/packages/react/src/components/FormatSearch/index.d.ts +0 -6
- package/dist/packages/react/src/components/FormulaSearch/index.d.ts +0 -5
- package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +0 -3
- package/dist/packages/react/src/components/FxEditor/index.d.ts +0 -4
- package/dist/packages/react/src/components/IFrameBoxs/iFrameBoxs.d.ts +0 -4
- package/dist/packages/react/src/components/ImgBoxs/index.d.ts +0 -3
- package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +0 -5
- package/dist/packages/react/src/components/LocationCondition/index.d.ts +0 -3
- package/dist/packages/react/src/components/MessageBox/index.d.ts +0 -9
- package/dist/packages/react/src/components/NotationBoxes/index.d.ts +0 -3
- package/dist/packages/react/src/components/ResetColumnWidth/index.d.ts +0 -2
- package/dist/packages/react/src/components/SVGDefines.d.ts +0 -5
- package/dist/packages/react/src/components/SVGIcon.d.ts +0 -9
- package/dist/packages/react/src/components/SearchReplace/index.d.ts +0 -6
- package/dist/packages/react/src/components/Sheet/index.d.ts +0 -8
- package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +0 -8
- package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +0 -9
- package/dist/packages/react/src/components/SheetList/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +0 -11
- package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/constant.d.ts +0 -63
- package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
- package/dist/packages/react/src/components/SheetOverlay/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +0 -8
- package/dist/packages/react/src/components/SheetTab/index.d.ts +0 -4
- package/dist/packages/react/src/components/SplitColumn/index.d.ts +0 -3
- package/dist/packages/react/src/components/Toolbar/Button.d.ts +0 -12
- package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +0 -6
- package/dist/packages/react/src/components/Toolbar/Combo.d.ts +0 -12
- package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +0 -7
- package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +0 -11
- package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +0 -8
- package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +0 -9
- package/dist/packages/react/src/components/Toolbar/Divider.d.ts +0 -4
- package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +0 -6
- package/dist/packages/react/src/components/Toolbar/Select.d.ts +0 -14
- package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -10
- package/dist/packages/react/src/components/Workbook/api.d.ts +0 -1177
- package/dist/packages/react/src/components/Workbook/index.d.ts +0 -1185
- package/dist/packages/react/src/components/ZoomControl/index.d.ts +0 -4
- package/dist/packages/react/src/components/index.d.ts +0 -4
- package/dist/packages/react/src/constants.d.ts +0 -1
- package/dist/packages/react/src/context/index.d.ts +0 -25
- package/dist/packages/react/src/context/modal.d.ts +0 -10
- package/dist/packages/react/src/hooks/useAlert.d.ts +0 -4
- package/dist/packages/react/src/hooks/useDialog.d.ts +0 -5
- package/dist/packages/react/src/hooks/useOutsideClick.d.ts +0 -2
- package/dist/packages/react/src/hooks/usePrevious.d.ts +0 -2
- package/dist/packages/react/src/index.d.ts +0 -1
- package/dist/packages/react/src/utils/datepickerStyles.d.ts +0 -2
- package/dist/stories/API.stories.d.ts +0 -1210
- package/dist/stories/Collabration.stories.d.ts +0 -2359
- package/dist/stories/Features.stories.d.ts +0 -9430
- package/dist/stories/data/cell.d.ts +0 -983
- package/dist/stories/data/dataVerification.d.ts +0 -131
- package/dist/stories/data/empty.d.ts +0 -10
- package/dist/stories/data/formula.d.ts +0 -362
- package/dist/stories/data/freeze.d.ts +0 -34
- package/dist/stories/data/protected.d.ts +0 -40
- package/dist/stories/utils.d.ts +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { CommonOptions } from "./common";
|
|
3
|
-
export declare function freeze(ctx: Context, type: "row" | "column" | "both", range: {
|
|
4
|
-
row: number;
|
|
5
|
-
column: number;
|
|
6
|
-
}, options?: CommonOptions): void;
|
|
7
|
-
export declare function insertRowOrColumn(ctx: Context, type: "row" | "column", index: number, count: number, direction: "lefttop" | "rightbottom", options?: CommonOptions): void;
|
|
8
|
-
export declare function deleteRowOrColumn(ctx: Context, type: "row" | "column", start: number, end: number, options?: CommonOptions): void;
|
|
9
|
-
export declare function hideRowOrColumn(ctx: Context, rowColInfo: string[], type: "row" | "column"): void;
|
|
10
|
-
export declare function showRowOrColumn(ctx: Context, rowColInfo: string[], type: "row" | "column"): void;
|
|
11
|
-
export declare function setRowHeight(ctx: Context, rowInfo: Record<string, number>, options?: CommonOptions, custom?: boolean): void;
|
|
12
|
-
export declare function setColumnWidth(ctx: Context, columnInfo: Record<string, number>, options?: CommonOptions, custom?: boolean): void;
|
|
13
|
-
export declare function getRowHeight(ctx: Context, rows: number[], options?: CommonOptions): Record<number, number>;
|
|
14
|
-
export declare function getColumnWidth(ctx: Context, columns: number[], options?: CommonOptions): Record<number, number>;
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { CommonOptions } from "./common";
|
|
3
|
+
export declare function freeze(ctx: Context, type: "row" | "column" | "both", range: {
|
|
4
|
+
row: number;
|
|
5
|
+
column: number;
|
|
6
|
+
}, options?: CommonOptions): void;
|
|
7
|
+
export declare function insertRowOrColumn(ctx: Context, type: "row" | "column", index: number, count: number, direction: "lefttop" | "rightbottom", options?: CommonOptions): void;
|
|
8
|
+
export declare function deleteRowOrColumn(ctx: Context, type: "row" | "column", start: number, end: number, options?: CommonOptions): void;
|
|
9
|
+
export declare function hideRowOrColumn(ctx: Context, rowColInfo: string[], type: "row" | "column"): void;
|
|
10
|
+
export declare function showRowOrColumn(ctx: Context, rowColInfo: string[], type: "row" | "column"): void;
|
|
11
|
+
export declare function setRowHeight(ctx: Context, rowInfo: Record<string, number>, options?: CommonOptions, custom?: boolean): void;
|
|
12
|
+
export declare function setColumnWidth(ctx: Context, columnInfo: Record<string, number>, options?: CommonOptions, custom?: boolean): void;
|
|
13
|
+
export declare function getRowHeight(ctx: Context, rows: number[], options?: CommonOptions): Record<number, number>;
|
|
14
|
+
export declare function getColumnWidth(ctx: Context, columns: number[], options?: CommonOptions): Record<number, number>;
|
package/es/api/rowcol.js
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { deleteRowCol, insertRowCol } from "../modules";
|
|
3
|
+
import { getSheet } from "./common";
|
|
4
|
+
import { INVALID_PARAMS } from "./errors";
|
|
5
|
+
import { getSheetIndex } from "../utils";
|
|
6
|
+
export function freeze(ctx, type, range, options) {
|
|
7
|
+
if (options === void 0) {
|
|
8
|
+
options = {};
|
|
9
|
+
}
|
|
10
|
+
var sheet = getSheet(ctx, options);
|
|
11
|
+
var typeMap = {
|
|
12
|
+
row: "rangeRow",
|
|
13
|
+
column: "rangeColumn",
|
|
14
|
+
both: "rangeBoth"
|
|
15
|
+
};
|
|
16
|
+
var innerType = typeMap[type];
|
|
17
|
+
sheet.frozen = {
|
|
18
|
+
type: innerType,
|
|
19
|
+
range: {
|
|
20
|
+
column_focus: range.column,
|
|
21
|
+
row_focus: range.row
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function insertRowOrColumn(ctx, type, index, count, direction, options) {
|
|
26
|
+
if (options === void 0) {
|
|
27
|
+
options = {};
|
|
28
|
+
}
|
|
29
|
+
if (!["row", "column"].includes(type) || !_.isNumber(index) || !_.isNumber(count) || !["lefttop", "rightbottom"].includes(direction)) {
|
|
30
|
+
throw INVALID_PARAMS;
|
|
31
|
+
}
|
|
32
|
+
var sheet = getSheet(ctx, options);
|
|
33
|
+
try {
|
|
34
|
+
insertRowCol(ctx, {
|
|
35
|
+
type: type,
|
|
36
|
+
index: index,
|
|
37
|
+
count: count,
|
|
38
|
+
direction: direction,
|
|
39
|
+
id: sheet.id
|
|
40
|
+
});
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error(e);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function deleteRowOrColumn(ctx, type, start, end, options) {
|
|
46
|
+
if (options === void 0) {
|
|
47
|
+
options = {};
|
|
48
|
+
}
|
|
49
|
+
if (!["row", "column"].includes(type) || !_.isNumber(start) || !_.isNumber(end)) {
|
|
50
|
+
throw INVALID_PARAMS;
|
|
51
|
+
}
|
|
52
|
+
var sheet = getSheet(ctx, options);
|
|
53
|
+
deleteRowCol(ctx, {
|
|
54
|
+
type: type,
|
|
55
|
+
start: start,
|
|
56
|
+
end: end,
|
|
57
|
+
id: sheet.id
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function hideRowOrColumn(ctx, rowColInfo, type) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
if (!["row", "column"].includes(type)) {
|
|
63
|
+
throw INVALID_PARAMS;
|
|
64
|
+
}
|
|
65
|
+
if (!ctx || !ctx.config) return;
|
|
66
|
+
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
67
|
+
if (type === "row") {
|
|
68
|
+
var rowhidden_1 = (_a = ctx.config.rowhidden) !== null && _a !== void 0 ? _a : {};
|
|
69
|
+
rowColInfo.forEach(function (r) {
|
|
70
|
+
rowhidden_1[r] = 0;
|
|
71
|
+
});
|
|
72
|
+
ctx.config.rowhidden = rowhidden_1;
|
|
73
|
+
} else if (type === "column") {
|
|
74
|
+
var colhidden_1 = (_b = ctx.config.colhidden) !== null && _b !== void 0 ? _b : {};
|
|
75
|
+
rowColInfo.forEach(function (r) {
|
|
76
|
+
colhidden_1[r] = 0;
|
|
77
|
+
});
|
|
78
|
+
ctx.config.colhidden = colhidden_1;
|
|
79
|
+
}
|
|
80
|
+
ctx.luckysheetfile[index].config = ctx.config;
|
|
81
|
+
}
|
|
82
|
+
export function showRowOrColumn(ctx, rowColInfo, type) {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
if (!["row", "column"].includes(type)) {
|
|
85
|
+
throw INVALID_PARAMS;
|
|
86
|
+
}
|
|
87
|
+
if (!ctx || !ctx.config) return;
|
|
88
|
+
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
89
|
+
if (type === "row") {
|
|
90
|
+
var rowhidden_2 = (_a = ctx.config.rowhidden) !== null && _a !== void 0 ? _a : {};
|
|
91
|
+
rowColInfo.forEach(function (r) {
|
|
92
|
+
delete rowhidden_2[r];
|
|
93
|
+
});
|
|
94
|
+
ctx.config.rowhidden = rowhidden_2;
|
|
95
|
+
} else if (type === "column") {
|
|
96
|
+
var colhidden_2 = (_b = ctx.config.colhidden) !== null && _b !== void 0 ? _b : {};
|
|
97
|
+
rowColInfo.forEach(function (r) {
|
|
98
|
+
delete colhidden_2[r];
|
|
99
|
+
});
|
|
100
|
+
ctx.config.colhidden = colhidden_2;
|
|
101
|
+
}
|
|
102
|
+
ctx.luckysheetfile[index].config = ctx.config;
|
|
103
|
+
}
|
|
104
|
+
export function setRowHeight(ctx, rowInfo, options, custom) {
|
|
105
|
+
if (options === void 0) {
|
|
106
|
+
options = {};
|
|
107
|
+
}
|
|
108
|
+
if (custom === void 0) {
|
|
109
|
+
custom = false;
|
|
110
|
+
}
|
|
111
|
+
if (!_.isPlainObject(rowInfo)) {
|
|
112
|
+
throw INVALID_PARAMS;
|
|
113
|
+
}
|
|
114
|
+
var sheet = getSheet(ctx, options);
|
|
115
|
+
var cfg = sheet.config || {};
|
|
116
|
+
if (cfg.rowlen == null) {
|
|
117
|
+
cfg.rowlen = {};
|
|
118
|
+
}
|
|
119
|
+
_.forEach(rowInfo, function (len, r) {
|
|
120
|
+
var _a;
|
|
121
|
+
if (Number(r) >= 0) {
|
|
122
|
+
if (Number(len) >= 0) {
|
|
123
|
+
cfg.rowlen[Number(r)] = Number(len);
|
|
124
|
+
if (custom && _.isUndefined(cfg.customHeight)) {
|
|
125
|
+
cfg.customHeight = (_a = {}, _a[r] = 1, _a);
|
|
126
|
+
} else if (custom) {
|
|
127
|
+
cfg.customHeight[r] = 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
sheet.config = cfg;
|
|
133
|
+
if (ctx.currentSheetId === sheet.id) {
|
|
134
|
+
ctx.config = cfg;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export function setColumnWidth(ctx, columnInfo, options, custom) {
|
|
138
|
+
if (options === void 0) {
|
|
139
|
+
options = {};
|
|
140
|
+
}
|
|
141
|
+
if (custom === void 0) {
|
|
142
|
+
custom = false;
|
|
143
|
+
}
|
|
144
|
+
if (!_.isPlainObject(columnInfo)) {
|
|
145
|
+
throw INVALID_PARAMS;
|
|
146
|
+
}
|
|
147
|
+
var sheet = getSheet(ctx, options);
|
|
148
|
+
var cfg = sheet.config || {};
|
|
149
|
+
if (cfg.columnlen == null) {
|
|
150
|
+
cfg.columnlen = {};
|
|
151
|
+
}
|
|
152
|
+
_.forEach(columnInfo, function (len, c) {
|
|
153
|
+
var _a;
|
|
154
|
+
if (Number(c) >= 0) {
|
|
155
|
+
if (Number(len) >= 0) {
|
|
156
|
+
cfg.columnlen[Number(c)] = Number(len);
|
|
157
|
+
if (custom && _.isUndefined(cfg.customWidth)) {
|
|
158
|
+
cfg.customWidth = (_a = {}, _a[c] = 1, _a);
|
|
159
|
+
} else if (custom) {
|
|
160
|
+
cfg.customWidth[c] = 1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
sheet.config = cfg;
|
|
166
|
+
if (ctx.currentSheetId === sheet.id) {
|
|
167
|
+
ctx.config = cfg;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export function getRowHeight(ctx, rows, options) {
|
|
171
|
+
if (options === void 0) {
|
|
172
|
+
options = {};
|
|
173
|
+
}
|
|
174
|
+
if (!_.isArray(rows) || rows.length === 0) {
|
|
175
|
+
throw INVALID_PARAMS;
|
|
176
|
+
}
|
|
177
|
+
var sheet = getSheet(ctx, options);
|
|
178
|
+
var cfg = sheet.config || {};
|
|
179
|
+
var rowlen = cfg.rowlen || {};
|
|
180
|
+
var rowlenObj = {};
|
|
181
|
+
rows.forEach(function (item) {
|
|
182
|
+
if (Number(item) >= 0) {
|
|
183
|
+
var size = rowlen[Number(item)] || ctx.defaultrowlen;
|
|
184
|
+
rowlenObj[Number(item)] = size;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return rowlenObj;
|
|
188
|
+
}
|
|
189
|
+
export function getColumnWidth(ctx, columns, options) {
|
|
190
|
+
if (options === void 0) {
|
|
191
|
+
options = {};
|
|
192
|
+
}
|
|
193
|
+
if (!_.isArray(columns) || columns.length === 0) {
|
|
194
|
+
throw INVALID_PARAMS;
|
|
195
|
+
}
|
|
196
|
+
var sheet = getSheet(ctx, options);
|
|
197
|
+
var cfg = sheet.config || {};
|
|
198
|
+
var columnlen = cfg.columnlen || {};
|
|
199
|
+
var columnlenObj = {};
|
|
200
|
+
columns.forEach(function (item) {
|
|
201
|
+
if (Number(item) >= 0) {
|
|
202
|
+
var size = columnlen[Number(item)] || ctx.defaultcollen;
|
|
203
|
+
columnlenObj[Number(item)] = size;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return columnlenObj;
|
|
207
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getSheet } from "./common";
|
|
2
|
-
import { Context } from "../context";
|
|
3
|
-
import { CellMatrix, Sheet } from "../types";
|
|
4
|
-
export declare function getAllSheets(ctx: Context): Sheet[];
|
|
5
|
-
export { getSheet };
|
|
6
|
-
export declare function initSheetData(draftCtx: Context, index: number, newData: Sheet): CellMatrix | null;
|
|
7
|
-
export declare function hideSheet(ctx: Context, sheetId: string): void;
|
|
8
|
-
export declare function showSheet(ctx: Context, sheetId: string): void;
|
|
9
|
-
export declare function copySheet(ctx: Context, sheetId: string): void;
|
|
10
|
-
export declare function calculateSheetFromula(ctx: Context, id: string): void;
|
|
1
|
+
import { getSheet } from "./common";
|
|
2
|
+
import { Context } from "../context";
|
|
3
|
+
import { CellMatrix, Sheet } from "../types";
|
|
4
|
+
export declare function getAllSheets(ctx: Context): Sheet[];
|
|
5
|
+
export { getSheet };
|
|
6
|
+
export declare function initSheetData(draftCtx: Context, index: number, newData: Sheet): CellMatrix | null;
|
|
7
|
+
export declare function hideSheet(ctx: Context, sheetId: string): void;
|
|
8
|
+
export declare function showSheet(ctx: Context, sheetId: string): void;
|
|
9
|
+
export declare function copySheet(ctx: Context, sheetId: string): void;
|
|
10
|
+
export declare function calculateSheetFromula(ctx: Context, id: string): void;
|
package/es/api/sheet.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
3
|
+
import { dataToCelldata, getSheet } from "./common";
|
|
4
|
+
import { getSheetIndex } from "../utils";
|
|
5
|
+
import { api, execfunction, insertUpdateFunctionGroup, locale } from "..";
|
|
6
|
+
export function getAllSheets(ctx) {
|
|
7
|
+
return ctx.luckysheetfile;
|
|
8
|
+
}
|
|
9
|
+
export { getSheet };
|
|
10
|
+
export function initSheetData(draftCtx, index, newData) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
var celldata = newData.celldata,
|
|
13
|
+
row = newData.row,
|
|
14
|
+
column = newData.column;
|
|
15
|
+
var lastRow = _.maxBy(celldata, "r");
|
|
16
|
+
var lastCol = _.maxBy(celldata, "c");
|
|
17
|
+
var lastRowNum = ((_a = lastRow === null || lastRow === void 0 ? void 0 : lastRow.r) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
18
|
+
var lastColNum = ((_b = lastCol === null || lastCol === void 0 ? void 0 : lastCol.c) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
19
|
+
if (row != null && column != null && row > 0 && column > 0) {
|
|
20
|
+
lastRowNum = Math.max(lastRowNum, row);
|
|
21
|
+
lastColNum = Math.max(lastColNum, column);
|
|
22
|
+
} else {
|
|
23
|
+
lastRowNum = Math.max(lastRowNum, draftCtx.defaultrowNum);
|
|
24
|
+
lastColNum = Math.max(lastColNum, draftCtx.defaultcolumnNum);
|
|
25
|
+
}
|
|
26
|
+
if (lastRowNum && lastColNum) {
|
|
27
|
+
var expandedData_1 = _.times(lastRowNum, function () {
|
|
28
|
+
return _.times(lastColNum, function () {
|
|
29
|
+
return null;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
celldata === null || celldata === void 0 ? void 0 : celldata.forEach(function (d) {
|
|
33
|
+
expandedData_1[d.r][d.c] = d.v;
|
|
34
|
+
});
|
|
35
|
+
if (draftCtx.luckysheetfile[index] == null) {
|
|
36
|
+
newData.data = expandedData_1;
|
|
37
|
+
delete newData.celldata;
|
|
38
|
+
draftCtx.luckysheetfile.push(newData);
|
|
39
|
+
} else {
|
|
40
|
+
draftCtx.luckysheetfile[index].data = expandedData_1;
|
|
41
|
+
delete draftCtx.luckysheetfile[index].celldata;
|
|
42
|
+
}
|
|
43
|
+
return expandedData_1;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
export function hideSheet(ctx, sheetId) {
|
|
48
|
+
var index = getSheetIndex(ctx, sheetId);
|
|
49
|
+
ctx.luckysheetfile[index].hide = 1;
|
|
50
|
+
ctx.luckysheetfile[index].status = 0;
|
|
51
|
+
var shownSheets = ctx.luckysheetfile.filter(function (sheet) {
|
|
52
|
+
return _.isUndefined(sheet.hide) || (sheet === null || sheet === void 0 ? void 0 : sheet.hide) !== 1;
|
|
53
|
+
});
|
|
54
|
+
ctx.currentSheetId = shownSheets[0].id;
|
|
55
|
+
}
|
|
56
|
+
export function showSheet(ctx, sheetId) {
|
|
57
|
+
var index = getSheetIndex(ctx, sheetId);
|
|
58
|
+
ctx.luckysheetfile[index].hide = undefined;
|
|
59
|
+
}
|
|
60
|
+
function generateCopySheetName(ctx, sheetId) {
|
|
61
|
+
var info = locale(ctx).info;
|
|
62
|
+
var copyWord = "(".concat(info.copy);
|
|
63
|
+
var SheetIndex = getSheetIndex(ctx, sheetId);
|
|
64
|
+
var sheetName = ctx.luckysheetfile[SheetIndex].name;
|
|
65
|
+
var copy_i = sheetName.indexOf(copyWord);
|
|
66
|
+
var index = 0;
|
|
67
|
+
if (copy_i !== -1) {
|
|
68
|
+
sheetName = sheetName.toString().substring(0, copy_i);
|
|
69
|
+
}
|
|
70
|
+
var nameCopy = sheetName + copyWord;
|
|
71
|
+
var sheetNames = [];
|
|
72
|
+
for (var i = 0; i < ctx.luckysheetfile.length; i += 1) {
|
|
73
|
+
var fileName = ctx.luckysheetfile[i].name;
|
|
74
|
+
sheetNames.push(fileName);
|
|
75
|
+
var st_i = fileName.indexOf(nameCopy);
|
|
76
|
+
if (st_i === 0) {
|
|
77
|
+
index = index || 2;
|
|
78
|
+
var ed_i = fileName.indexOf(")", st_i + nameCopy.length);
|
|
79
|
+
var num = fileName.substring(st_i + nameCopy.length, ed_i);
|
|
80
|
+
if (_.isNumber(num)) {
|
|
81
|
+
if (Number.parseInt(num, 10) >= index) {
|
|
82
|
+
index = Number.parseInt(num, 10) + 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
var sheetCopyName;
|
|
88
|
+
do {
|
|
89
|
+
var postfix = "".concat(copyWord + (index || ""), ")");
|
|
90
|
+
var lengthLimit = 31 - postfix.length;
|
|
91
|
+
sheetCopyName = sheetName;
|
|
92
|
+
if (sheetCopyName.length > lengthLimit) {
|
|
93
|
+
sheetCopyName = "".concat(sheetCopyName.slice(0, lengthLimit - 1), "\u2026");
|
|
94
|
+
}
|
|
95
|
+
sheetCopyName += postfix;
|
|
96
|
+
index = (index || 1) + 1;
|
|
97
|
+
} while (sheetNames.indexOf(sheetCopyName) !== -1);
|
|
98
|
+
return sheetCopyName;
|
|
99
|
+
}
|
|
100
|
+
export function copySheet(ctx, sheetId) {
|
|
101
|
+
var index = getSheetIndex(ctx, sheetId);
|
|
102
|
+
var order = ctx.luckysheetfile[index].order + 1;
|
|
103
|
+
var sheetName = generateCopySheetName(ctx, sheetId);
|
|
104
|
+
var sheetData = _.cloneDeep(ctx.luckysheetfile[index]);
|
|
105
|
+
delete sheetData.id;
|
|
106
|
+
delete sheetData.status;
|
|
107
|
+
sheetData.celldata = dataToCelldata(sheetData.data);
|
|
108
|
+
delete sheetData.data;
|
|
109
|
+
api.addSheet(ctx, undefined, uuidv4(), ctx.luckysheetfile[index].isPivotTable, sheetName, sheetData);
|
|
110
|
+
var sheetOrderList = {};
|
|
111
|
+
sheetOrderList[ctx.luckysheetfile[ctx.luckysheetfile.length - 1].id] = order;
|
|
112
|
+
api.setSheetOrder(ctx, sheetOrderList);
|
|
113
|
+
}
|
|
114
|
+
export function calculateSheetFromula(ctx, id) {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
var index = getSheetIndex(ctx, id);
|
|
117
|
+
if (!ctx.luckysheetfile[index].data) return;
|
|
118
|
+
for (var r = 0; r < ctx.luckysheetfile[index].data.length; r += 1) {
|
|
119
|
+
for (var c = 0; c < ctx.luckysheetfile[index].data[r].length; c += 1) {
|
|
120
|
+
if (!((_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f)) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
var result = execfunction(ctx, (_b = ctx.luckysheetfile[index].data[r][c]) === null || _b === void 0 ? void 0 : _b.f, r, c, id);
|
|
124
|
+
api.setCellValue(ctx, r, c, result[1], null);
|
|
125
|
+
insertUpdateFunctionGroup(ctx, r, c, id);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Context, Sheet } from "..";
|
|
2
|
-
import { Settings } from "../settings";
|
|
3
|
-
import { CommonOptions } from "./common";
|
|
4
|
-
export declare function addSheet(ctx: Context, settings?: Required<Settings>, newSheetID?: string, isPivotTable?: boolean, sheetname?: string | undefined, sheetData?: Sheet | undefined): void;
|
|
5
|
-
export declare function deleteSheet(ctx: Context, options?: CommonOptions): void;
|
|
6
|
-
export declare function updateSheet(ctx: Context, data: Sheet[]): void;
|
|
7
|
-
export declare function activateSheet(ctx: Context, options?: CommonOptions): void;
|
|
8
|
-
export declare function setSheetName(ctx: Context, name: string, options?: CommonOptions): void;
|
|
9
|
-
export declare function setSheetOrder(ctx: Context, orderList: Record<string, number>): void;
|
|
10
|
-
export declare function scroll(ctx: Context, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, options: {
|
|
11
|
-
scrollLeft?: number;
|
|
12
|
-
scrollTop?: number;
|
|
13
|
-
targetRow?: number;
|
|
14
|
-
targetColumn?: number;
|
|
15
|
-
}): void;
|
|
1
|
+
import { Context, Sheet } from "..";
|
|
2
|
+
import { Settings } from "../settings";
|
|
3
|
+
import { CommonOptions } from "./common";
|
|
4
|
+
export declare function addSheet(ctx: Context, settings?: Required<Settings>, newSheetID?: string, isPivotTable?: boolean, sheetname?: string | undefined, sheetData?: Sheet | undefined): void;
|
|
5
|
+
export declare function deleteSheet(ctx: Context, options?: CommonOptions): void;
|
|
6
|
+
export declare function updateSheet(ctx: Context, data: Sheet[]): void;
|
|
7
|
+
export declare function activateSheet(ctx: Context, options?: CommonOptions): void;
|
|
8
|
+
export declare function setSheetName(ctx: Context, name: string, options?: CommonOptions): void;
|
|
9
|
+
export declare function setSheetOrder(ctx: Context, orderList: Record<string, number>): void;
|
|
10
|
+
export declare function scroll(ctx: Context, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, options: {
|
|
11
|
+
scrollLeft?: number;
|
|
12
|
+
scrollTop?: number;
|
|
13
|
+
targetRow?: number;
|
|
14
|
+
targetColumn?: number;
|
|
15
|
+
}): void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { addSheet as addSheetInternal, deleteSheet as deleteSheetInternal, updateSheet as updateSheetInternal } from "../modules";
|
|
3
|
+
import { getSheet } from "./common";
|
|
4
|
+
import { INVALID_PARAMS } from "./errors";
|
|
5
|
+
export function addSheet(ctx, settings, newSheetID, isPivotTable, sheetname, sheetData) {
|
|
6
|
+
if (isPivotTable === void 0) {
|
|
7
|
+
isPivotTable = false;
|
|
8
|
+
}
|
|
9
|
+
if (sheetname === void 0) {
|
|
10
|
+
sheetname = undefined;
|
|
11
|
+
}
|
|
12
|
+
if (sheetData === void 0) {
|
|
13
|
+
sheetData = undefined;
|
|
14
|
+
}
|
|
15
|
+
addSheetInternal(ctx, settings, newSheetID, isPivotTable, sheetname, sheetData);
|
|
16
|
+
}
|
|
17
|
+
export function deleteSheet(ctx, options) {
|
|
18
|
+
if (options === void 0) {
|
|
19
|
+
options = {};
|
|
20
|
+
}
|
|
21
|
+
var sheet = getSheet(ctx, options);
|
|
22
|
+
deleteSheetInternal(ctx, sheet.id);
|
|
23
|
+
}
|
|
24
|
+
export function updateSheet(ctx, data) {
|
|
25
|
+
updateSheetInternal(ctx, data);
|
|
26
|
+
}
|
|
27
|
+
export function activateSheet(ctx, options) {
|
|
28
|
+
if (options === void 0) {
|
|
29
|
+
options = {};
|
|
30
|
+
}
|
|
31
|
+
var sheet = getSheet(ctx, options);
|
|
32
|
+
ctx.currentSheetId = sheet.id;
|
|
33
|
+
}
|
|
34
|
+
export function setSheetName(ctx, name, options) {
|
|
35
|
+
if (options === void 0) {
|
|
36
|
+
options = {};
|
|
37
|
+
}
|
|
38
|
+
var sheet = getSheet(ctx, options);
|
|
39
|
+
sheet.name = name;
|
|
40
|
+
}
|
|
41
|
+
export function setSheetOrder(ctx, orderList) {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = ctx.luckysheetfile) === null || _a === void 0 ? void 0 : _a.forEach(function (sheet) {
|
|
44
|
+
if (sheet.id in orderList) {
|
|
45
|
+
sheet.order = orderList[sheet.id];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
_.sortBy(ctx.luckysheetfile, ["order"]).forEach(function (sheet, i) {
|
|
49
|
+
sheet.order = i;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export function scroll(ctx, scrollbarX, scrollbarY, options) {
|
|
53
|
+
if (options.scrollLeft != null) {
|
|
54
|
+
if (!_.isNumber(options.scrollLeft)) {
|
|
55
|
+
throw INVALID_PARAMS;
|
|
56
|
+
}
|
|
57
|
+
if (scrollbarX) {
|
|
58
|
+
scrollbarX.scrollLeft = options.scrollLeft;
|
|
59
|
+
}
|
|
60
|
+
} else if (options.targetColumn != null) {
|
|
61
|
+
if (!_.isNumber(options.targetColumn)) {
|
|
62
|
+
throw INVALID_PARAMS;
|
|
63
|
+
}
|
|
64
|
+
var col_pre = options.targetColumn <= 0 ? 0 : ctx.visibledatacolumn[options.targetColumn - 1];
|
|
65
|
+
if (scrollbarX) {
|
|
66
|
+
scrollbarX.scrollLeft = col_pre;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (options.scrollTop != null) {
|
|
70
|
+
if (!_.isNumber(options.scrollTop)) {
|
|
71
|
+
throw INVALID_PARAMS;
|
|
72
|
+
}
|
|
73
|
+
if (scrollbarY) {
|
|
74
|
+
scrollbarY.scrollTop = options.scrollTop;
|
|
75
|
+
}
|
|
76
|
+
} else if (options.targetRow != null) {
|
|
77
|
+
if (!_.isNumber(options.targetRow)) {
|
|
78
|
+
throw INVALID_PARAMS;
|
|
79
|
+
}
|
|
80
|
+
var row_pre = options.targetRow <= 0 ? 0 : ctx.visibledatarow[options.targetRow - 1];
|
|
81
|
+
if (scrollbarY) {
|
|
82
|
+
scrollbarY.scrollTop = row_pre;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { defaultContext } from "./context";
|
|
2
|
-
export declare const defaultStyle: {
|
|
3
|
-
fillStyle: string;
|
|
4
|
-
textBaseline: string;
|
|
5
|
-
strokeStyle: string;
|
|
6
|
-
rowFillStyle: string;
|
|
7
|
-
textAlign: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class Canvas {
|
|
10
|
-
canvasElement: HTMLCanvasElement;
|
|
11
|
-
sheetCtx: ReturnType<typeof defaultContext>;
|
|
12
|
-
measureTextCacheTimeOut: any;
|
|
13
|
-
cellOverflowMapCache: any;
|
|
14
|
-
constructor(canvasElement: HTMLCanvasElement, ctx: ReturnType<typeof defaultContext>);
|
|
15
|
-
drawRowHeader(scrollHeight: number, drawHeight?: number, offsetTop?: number): void;
|
|
16
|
-
drawColumnHeader(scrollWidth: number, drawWidth?: number, offsetLeft?: number): void;
|
|
17
|
-
drawMain({ scrollWidth, scrollHeight, drawWidth, drawHeight, offsetLeft, offsetTop, columnOffsetCell, rowOffsetCell, clear, }: {
|
|
18
|
-
scrollWidth: number;
|
|
19
|
-
scrollHeight: number;
|
|
20
|
-
drawWidth?: number;
|
|
21
|
-
drawHeight?: number;
|
|
22
|
-
offsetLeft?: number;
|
|
23
|
-
offsetTop?: number;
|
|
24
|
-
columnOffsetCell?: number;
|
|
25
|
-
rowOffsetCell?: number;
|
|
26
|
-
clear?: boolean;
|
|
27
|
-
}): void;
|
|
28
|
-
getCellOverflowMap(canvas: CanvasRenderingContext2D, colStart: number, colEnd: number, rowStart: number, rowEnd: number): any;
|
|
29
|
-
nullCellRender(r: number, c: number, startY: number, startX: number, endY: number, endX: number, renderCtx: CanvasRenderingContext2D, afCompute: any, cfCompute: any, offsetLeft: number, offsetTop: number, dynamicArrayCompute: any, cellOverflowMap: any, colStart: number, colEnd: number, scrollHeight: number, scrollWidth: number, bodrder05: any, isMerge?: boolean): void;
|
|
30
|
-
cellRender(r: number, c: number, startY: number, startX: number, endY: number, endX: number, value: any, renderCtx: CanvasRenderingContext2D, afCompute: any, cfCompute: any, offsetLeft: number, offsetTop: number, dynamicArrayCompute: any, cellOverflowMap: any, colStart: number, colEnd: number, scrollHeight: number, scrollWidth: number, bodrder05: number, isMerge?: boolean): void;
|
|
31
|
-
cellOverflowRender(r: number, c: number, stc: number, edc: number, renderCtx: CanvasRenderingContext2D, scrollHeight: number, scrollWidth: number, offsetLeft: number, offsetTop: number, afCompute: any, cfCompute: any): void;
|
|
32
|
-
cellOverflow_trace(r: number, curC: number, traceC: number, traceDir: string, horizonAlign: string, textMetrics: number): any;
|
|
33
|
-
cellOverflow_colIn(map: any, r: number, c: number, col_st: number, col_ed: number): {
|
|
34
|
-
colIn: boolean;
|
|
35
|
-
colLast: boolean;
|
|
36
|
-
rowIndex: number | undefined;
|
|
37
|
-
colIndex: number | undefined;
|
|
38
|
-
stc: number | undefined;
|
|
39
|
-
edc: number | undefined;
|
|
40
|
-
};
|
|
41
|
-
cellTextRender(textInfo: any, ctx: CanvasRenderingContext2D, option: any): void;
|
|
42
|
-
drawFreezeLine({ horizontalTop, verticalLeft, }: {
|
|
43
|
-
horizontalTop?: number;
|
|
44
|
-
verticalLeft?: number;
|
|
45
|
-
}): void;
|
|
46
|
-
}
|
|
1
|
+
import { defaultContext } from "./context";
|
|
2
|
+
export declare const defaultStyle: {
|
|
3
|
+
fillStyle: string;
|
|
4
|
+
textBaseline: string;
|
|
5
|
+
strokeStyle: string;
|
|
6
|
+
rowFillStyle: string;
|
|
7
|
+
textAlign: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class Canvas {
|
|
10
|
+
canvasElement: HTMLCanvasElement;
|
|
11
|
+
sheetCtx: ReturnType<typeof defaultContext>;
|
|
12
|
+
measureTextCacheTimeOut: any;
|
|
13
|
+
cellOverflowMapCache: any;
|
|
14
|
+
constructor(canvasElement: HTMLCanvasElement, ctx: ReturnType<typeof defaultContext>);
|
|
15
|
+
drawRowHeader(scrollHeight: number, drawHeight?: number, offsetTop?: number): void;
|
|
16
|
+
drawColumnHeader(scrollWidth: number, drawWidth?: number, offsetLeft?: number): void;
|
|
17
|
+
drawMain({ scrollWidth, scrollHeight, drawWidth, drawHeight, offsetLeft, offsetTop, columnOffsetCell, rowOffsetCell, clear, }: {
|
|
18
|
+
scrollWidth: number;
|
|
19
|
+
scrollHeight: number;
|
|
20
|
+
drawWidth?: number;
|
|
21
|
+
drawHeight?: number;
|
|
22
|
+
offsetLeft?: number;
|
|
23
|
+
offsetTop?: number;
|
|
24
|
+
columnOffsetCell?: number;
|
|
25
|
+
rowOffsetCell?: number;
|
|
26
|
+
clear?: boolean;
|
|
27
|
+
}): void;
|
|
28
|
+
getCellOverflowMap(canvas: CanvasRenderingContext2D, colStart: number, colEnd: number, rowStart: number, rowEnd: number): any;
|
|
29
|
+
nullCellRender(r: number, c: number, startY: number, startX: number, endY: number, endX: number, renderCtx: CanvasRenderingContext2D, afCompute: any, cfCompute: any, offsetLeft: number, offsetTop: number, dynamicArrayCompute: any, cellOverflowMap: any, colStart: number, colEnd: number, scrollHeight: number, scrollWidth: number, bodrder05: any, isMerge?: boolean): void;
|
|
30
|
+
cellRender(r: number, c: number, startY: number, startX: number, endY: number, endX: number, value: any, renderCtx: CanvasRenderingContext2D, afCompute: any, cfCompute: any, offsetLeft: number, offsetTop: number, dynamicArrayCompute: any, cellOverflowMap: any, colStart: number, colEnd: number, scrollHeight: number, scrollWidth: number, bodrder05: number, isMerge?: boolean): void;
|
|
31
|
+
cellOverflowRender(r: number, c: number, stc: number, edc: number, renderCtx: CanvasRenderingContext2D, scrollHeight: number, scrollWidth: number, offsetLeft: number, offsetTop: number, afCompute: any, cfCompute: any): void;
|
|
32
|
+
cellOverflow_trace(r: number, curC: number, traceC: number, traceDir: string, horizonAlign: string, textMetrics: number): any;
|
|
33
|
+
cellOverflow_colIn(map: any, r: number, c: number, col_st: number, col_ed: number): {
|
|
34
|
+
colIn: boolean;
|
|
35
|
+
colLast: boolean;
|
|
36
|
+
rowIndex: number | undefined;
|
|
37
|
+
colIndex: number | undefined;
|
|
38
|
+
stc: number | undefined;
|
|
39
|
+
edc: number | undefined;
|
|
40
|
+
};
|
|
41
|
+
cellTextRender(textInfo: any, ctx: CanvasRenderingContext2D, option: any): void;
|
|
42
|
+
drawFreezeLine({ horizontalTop, verticalLeft, }: {
|
|
43
|
+
horizontalTop?: number;
|
|
44
|
+
verticalLeft?: number;
|
|
45
|
+
}): void;
|
|
46
|
+
}
|