@fileverse-dev/fortune-core 1.1.0 → 1.1.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/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 +71 -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 +198 -197
- package/es/context.js +381 -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 +360 -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 +4 -3
- package/es/events/paste.js +1416 -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 +993 -992
- package/es/locale/en.js +10140 -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 +1092 -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 +701 -0
- package/{dist/packages/core/src → es}/modules/dropCell.d.ts +10 -10
- package/es/modules/dropCell.js +2267 -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 +2346 -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 +50 -46
- package/es/modules/selection.js +1856 -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 +134 -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 +380 -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 +19 -18
- package/es/utils/index.js +198 -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 +71 -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 +198 -0
- package/lib/context.js +393 -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 +370 -0
- package/lib/events/mouse.d.ts +22 -0
- package/lib/events/mouse.js +1744 -0
- package/lib/events/paste.d.ts +4 -0
- package/lib/events/paste.js +1425 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +109 -0
- package/lib/locale/en.d.ts +993 -0
- package/lib/locale/en.js +10146 -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 +1122 -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 +716 -0
- package/lib/modules/dropCell.d.ts +10 -0
- package/lib/modules/dropCell.js +2283 -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 +2375 -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 +50 -0
- package/lib/modules/selection.js +1889 -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 +143 -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 +380 -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 +19 -0
- package/lib/utils/index.js +258 -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,10 +1,10 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { Cell, SingleRange } from "../types";
|
|
3
|
-
import { CommonOptions } from "./common";
|
|
4
|
-
export declare function getCellValue(ctx: Context, row: number, column: number, options?: CommonOptions & {
|
|
5
|
-
type?: keyof Cell;
|
|
6
|
-
}): any;
|
|
7
|
-
export declare function setCellValue(ctx: Context, row: number, column: number, value: any, cellInput: HTMLDivElement | null, options?: CommonOptions): void;
|
|
8
|
-
export declare function clearCell(ctx: Context, row: number, column: number, options?: CommonOptions): void;
|
|
9
|
-
export declare function setCellFormat(ctx: Context, row: number, column: number, attr: keyof Cell, value: any, options?: CommonOptions): void;
|
|
10
|
-
export declare function autoFillCell(ctx: Context, copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right"): void;
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { Cell, SingleRange } from "../types";
|
|
3
|
+
import { CommonOptions } from "./common";
|
|
4
|
+
export declare function getCellValue(ctx: Context, row: number, column: number, options?: CommonOptions & {
|
|
5
|
+
type?: keyof Cell;
|
|
6
|
+
}): any;
|
|
7
|
+
export declare function setCellValue(ctx: Context, row: number, column: number, value: any, cellInput: HTMLDivElement | null, options?: CommonOptions): void;
|
|
8
|
+
export declare function clearCell(ctx: Context, row: number, column: number, options?: CommonOptions): void;
|
|
9
|
+
export declare function setCellFormat(ctx: Context, row: number, column: number, attr: keyof Cell, value: any, options?: CommonOptions): void;
|
|
10
|
+
export declare function autoFillCell(ctx: Context, copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right"): void;
|
package/es/api/cell.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import _ from "lodash";
|
|
12
|
+
import { delFunctionGroup, dropCellCache, functionHTMLGenerate, getTypeItemHide, setCellValue as setCellValueInternal, updateCell, updateDropCell, updateFormatCell } from "../modules";
|
|
13
|
+
import { getSheet } from "./common";
|
|
14
|
+
import { SHEET_NOT_FOUND } from "./errors";
|
|
15
|
+
import SSF from "../modules/ssf";
|
|
16
|
+
export function getCellValue(ctx, row, column, options) {
|
|
17
|
+
var _a;
|
|
18
|
+
if (options === void 0) {
|
|
19
|
+
options = {};
|
|
20
|
+
}
|
|
21
|
+
if (!_.isNumber(row) || !_.isNumber(column)) {
|
|
22
|
+
throw new Error("row or column cannot be null or undefined");
|
|
23
|
+
}
|
|
24
|
+
var sheet = getSheet(ctx, options);
|
|
25
|
+
var _b = options.type,
|
|
26
|
+
type = _b === void 0 ? "v" : _b;
|
|
27
|
+
var targetSheetData = sheet.data;
|
|
28
|
+
if (!targetSheetData) {
|
|
29
|
+
throw SHEET_NOT_FOUND;
|
|
30
|
+
}
|
|
31
|
+
var cellData = targetSheetData[row][column];
|
|
32
|
+
var ret;
|
|
33
|
+
if (cellData && _.isPlainObject(cellData)) {
|
|
34
|
+
ret = cellData[type];
|
|
35
|
+
if (type === "f" && ret != null) {
|
|
36
|
+
ret = functionHTMLGenerate(ret);
|
|
37
|
+
} else if (type === "f") {
|
|
38
|
+
ret = cellData.v;
|
|
39
|
+
} else if (cellData && cellData.ct && cellData.ct.fa === "yyyy-MM-dd") {
|
|
40
|
+
ret = cellData.m;
|
|
41
|
+
} else if (((_a = cellData.ct) === null || _a === void 0 ? void 0 : _a.t) === "inlineStr") {
|
|
42
|
+
ret = cellData.ct.s.reduce(function (prev, cur) {
|
|
43
|
+
var _a;
|
|
44
|
+
return prev + ((_a = cur.v) !== null && _a !== void 0 ? _a : "");
|
|
45
|
+
}, "");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (ret === undefined) {
|
|
49
|
+
ret = null;
|
|
50
|
+
}
|
|
51
|
+
return ret;
|
|
52
|
+
}
|
|
53
|
+
export function setCellValue(ctx, row, column, value, cellInput, options) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (options === void 0) {
|
|
56
|
+
options = {};
|
|
57
|
+
}
|
|
58
|
+
if (!_.isNumber(row) || !_.isNumber(column)) {
|
|
59
|
+
throw new Error("row or column cannot be null or undefined");
|
|
60
|
+
}
|
|
61
|
+
var sheet = getSheet(ctx, options);
|
|
62
|
+
var data = sheet.data;
|
|
63
|
+
if (!data) return;
|
|
64
|
+
var formatList = {
|
|
65
|
+
bg: 1,
|
|
66
|
+
ff: 1,
|
|
67
|
+
fc: 1,
|
|
68
|
+
bl: 1,
|
|
69
|
+
it: 1,
|
|
70
|
+
fs: 1,
|
|
71
|
+
cl: 1,
|
|
72
|
+
un: 1,
|
|
73
|
+
vt: 1,
|
|
74
|
+
ht: 1,
|
|
75
|
+
mc: 1,
|
|
76
|
+
tr: 1,
|
|
77
|
+
tb: 1,
|
|
78
|
+
rt: 1,
|
|
79
|
+
qp: 1
|
|
80
|
+
};
|
|
81
|
+
if (value == null || value.toString().length === 0) {
|
|
82
|
+
delFunctionGroup(ctx, row, column);
|
|
83
|
+
setCellValueInternal(ctx, row, column, data, value);
|
|
84
|
+
} else if (value instanceof Object) {
|
|
85
|
+
var curv = {};
|
|
86
|
+
if (((_a = data === null || data === void 0 ? void 0 : data[row]) === null || _a === void 0 ? void 0 : _a[column]) == null) {
|
|
87
|
+
data[row][column] = {};
|
|
88
|
+
}
|
|
89
|
+
var cell_1 = data[row][column];
|
|
90
|
+
if (value.f != null && value.v == null) {
|
|
91
|
+
curv.f = value.f;
|
|
92
|
+
if (value.ct != null) {
|
|
93
|
+
curv.ct = value.ct;
|
|
94
|
+
}
|
|
95
|
+
updateCell(ctx, row, column, cellInput, curv);
|
|
96
|
+
} else {
|
|
97
|
+
if (value.ct != null) {
|
|
98
|
+
curv.ct = value.ct;
|
|
99
|
+
}
|
|
100
|
+
if (value.f != null) {
|
|
101
|
+
curv.f = value.f;
|
|
102
|
+
}
|
|
103
|
+
if (value.v != null) {
|
|
104
|
+
curv.v = value.v;
|
|
105
|
+
} else {
|
|
106
|
+
curv.v = cell_1.v;
|
|
107
|
+
}
|
|
108
|
+
if (value.m != null) {
|
|
109
|
+
curv.m = value.m;
|
|
110
|
+
}
|
|
111
|
+
delFunctionGroup(ctx, row, column);
|
|
112
|
+
setCellValueInternal(ctx, row, column, data, curv);
|
|
113
|
+
}
|
|
114
|
+
_.forEach(value, function (v, attr) {
|
|
115
|
+
if (attr in formatList) {
|
|
116
|
+
updateFormatCell(ctx, data, attr, v, row, row, column, column);
|
|
117
|
+
} else {
|
|
118
|
+
cell_1[attr] = v;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
data[row][column] = cell_1;
|
|
122
|
+
} else {
|
|
123
|
+
if (value.toString().substr(0, 1) === "=" || value.toString().substr(0, 5) === "<span") {
|
|
124
|
+
updateCell(ctx, row, column, cellInput, value);
|
|
125
|
+
} else {
|
|
126
|
+
delFunctionGroup(ctx, row, column);
|
|
127
|
+
setCellValueInternal(ctx, row, column, data, value);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export function clearCell(ctx, row, column, options) {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
if (options === void 0) {
|
|
134
|
+
options = {};
|
|
135
|
+
}
|
|
136
|
+
if (!_.isNumber(row) || !_.isNumber(column)) {
|
|
137
|
+
throw new Error("row or column cannot be null or undefined");
|
|
138
|
+
}
|
|
139
|
+
var sheet = getSheet(ctx, options);
|
|
140
|
+
var cell = (_b = (_a = sheet.data) === null || _a === void 0 ? void 0 : _a[row]) === null || _b === void 0 ? void 0 : _b[column];
|
|
141
|
+
if (cell && _.isPlainObject(cell)) {
|
|
142
|
+
delete cell.m;
|
|
143
|
+
delete cell.v;
|
|
144
|
+
if (cell.f != null) {
|
|
145
|
+
delete cell.f;
|
|
146
|
+
delFunctionGroup(ctx, row, column, sheet.id);
|
|
147
|
+
delete cell.spl;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function setCellFormat(ctx, row, column, attr, value, options) {
|
|
152
|
+
var _a;
|
|
153
|
+
if (options === void 0) {
|
|
154
|
+
options = {};
|
|
155
|
+
}
|
|
156
|
+
if (!_.isNumber(row) || !_.isNumber(column)) {
|
|
157
|
+
throw new Error("row or column cannot be null or undefined");
|
|
158
|
+
}
|
|
159
|
+
if (!attr) {
|
|
160
|
+
throw new Error("attr cannot be null or undefined");
|
|
161
|
+
}
|
|
162
|
+
var sheet = getSheet(ctx, options);
|
|
163
|
+
var targetSheetData = sheet.data;
|
|
164
|
+
var cellData = ((_a = targetSheetData === null || targetSheetData === void 0 ? void 0 : targetSheetData[row]) === null || _a === void 0 ? void 0 : _a[column]) || {};
|
|
165
|
+
var cfg = sheet.config || {};
|
|
166
|
+
if (attr === "ct" && (!value || value.fa == null || value.t == null)) {
|
|
167
|
+
throw new Error("'fa' and 't' should be present in value when attr is 'ct'");
|
|
168
|
+
} else if (attr === "ct" && !_.isNil(cellData.v)) {
|
|
169
|
+
cellData.m = SSF.format(value.fa, cellData.v);
|
|
170
|
+
}
|
|
171
|
+
if (attr === "bd") {
|
|
172
|
+
if (cfg.borderInfo == null) {
|
|
173
|
+
cfg.borderInfo = [];
|
|
174
|
+
}
|
|
175
|
+
var borderInfo = __assign({
|
|
176
|
+
rangeType: "range",
|
|
177
|
+
borderType: "border-all",
|
|
178
|
+
color: "#000",
|
|
179
|
+
style: "1",
|
|
180
|
+
range: [{
|
|
181
|
+
column: [column, column],
|
|
182
|
+
row: [row, row]
|
|
183
|
+
}]
|
|
184
|
+
}, value);
|
|
185
|
+
cfg.borderInfo.push(borderInfo);
|
|
186
|
+
} else {
|
|
187
|
+
cellData[attr] = value;
|
|
188
|
+
}
|
|
189
|
+
targetSheetData[row][column] = cellData;
|
|
190
|
+
sheet.config = cfg;
|
|
191
|
+
ctx.config = cfg;
|
|
192
|
+
}
|
|
193
|
+
export function autoFillCell(ctx, copyRange, applyRange, direction) {
|
|
194
|
+
dropCellCache.copyRange = copyRange;
|
|
195
|
+
dropCellCache.applyRange = applyRange;
|
|
196
|
+
dropCellCache.direction = direction;
|
|
197
|
+
var typeItemHide = getTypeItemHide(ctx);
|
|
198
|
+
if (!typeItemHide[0] && !typeItemHide[1] && !typeItemHide[2] && !typeItemHide[3] && !typeItemHide[4] && !typeItemHide[5] && !typeItemHide[6]) {
|
|
199
|
+
dropCellCache.applyType = "0";
|
|
200
|
+
} else {
|
|
201
|
+
dropCellCache.applyType = "1";
|
|
202
|
+
}
|
|
203
|
+
updateDropCell(ctx);
|
|
204
|
+
}
|
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { CellMatrix, CellWithRowAndCol, Sheet } from "../types";
|
|
3
|
-
export type CommonOptions = {
|
|
4
|
-
index?: number;
|
|
5
|
-
id?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
|
|
8
|
-
export declare const celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number, colCount?: number) => CellMatrix | null;
|
|
9
|
-
export declare function getSheet(ctx: Context, options?: CommonOptions): Sheet;
|
|
10
|
-
export declare function getSheetWithLatestCelldata(ctx: Context, options?: CommonOptions): {
|
|
11
|
-
celldata: CellWithRowAndCol[];
|
|
12
|
-
name: string;
|
|
13
|
-
config?: import("../types").SheetConfig | undefined;
|
|
14
|
-
order?: number | undefined;
|
|
15
|
-
color?: string | undefined;
|
|
16
|
-
data?: CellMatrix | undefined;
|
|
17
|
-
id?: string | undefined;
|
|
18
|
-
images?: import("../types").Image[] | undefined;
|
|
19
|
-
iframes?: {
|
|
20
|
-
id: string;
|
|
21
|
-
src: string;
|
|
22
|
-
left: number;
|
|
23
|
-
top: number;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
}[] | undefined;
|
|
27
|
-
zoomRatio?: number | undefined;
|
|
28
|
-
column?: number | undefined;
|
|
29
|
-
row?: number | undefined;
|
|
30
|
-
addRows?: number | undefined;
|
|
31
|
-
status?: number | undefined;
|
|
32
|
-
hide?: number | undefined;
|
|
33
|
-
luckysheet_select_save?: import("../types").Selection[] | undefined;
|
|
34
|
-
luckysheet_selection_range?: {
|
|
35
|
-
row: number[];
|
|
36
|
-
column: number[];
|
|
37
|
-
}[] | undefined;
|
|
38
|
-
calcChain?: any[] | undefined;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { CellMatrix, CellWithRowAndCol, Sheet } from "../types";
|
|
3
|
+
export type CommonOptions = {
|
|
4
|
+
index?: number;
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
|
|
8
|
+
export declare const celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number, colCount?: number) => CellMatrix | null;
|
|
9
|
+
export declare function getSheet(ctx: Context, options?: CommonOptions): Sheet;
|
|
10
|
+
export declare function getSheetWithLatestCelldata(ctx: Context, options?: CommonOptions): {
|
|
11
|
+
celldata: CellWithRowAndCol[];
|
|
12
|
+
name: string;
|
|
13
|
+
config?: import("../types").SheetConfig | undefined;
|
|
14
|
+
order?: number | undefined;
|
|
15
|
+
color?: string | undefined;
|
|
16
|
+
data?: CellMatrix | undefined;
|
|
17
|
+
id?: string | undefined;
|
|
18
|
+
images?: import("../types").Image[] | undefined;
|
|
19
|
+
iframes?: {
|
|
20
|
+
id: string;
|
|
21
|
+
src: string;
|
|
22
|
+
left: number;
|
|
23
|
+
top: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
zoomRatio?: number | undefined;
|
|
28
|
+
column?: number | undefined;
|
|
29
|
+
row?: number | undefined;
|
|
30
|
+
addRows?: number | undefined;
|
|
31
|
+
status?: number | undefined;
|
|
32
|
+
hide?: number | undefined;
|
|
33
|
+
luckysheet_select_save?: import("../types").Selection[] | undefined;
|
|
34
|
+
luckysheet_selection_range?: {
|
|
35
|
+
row: number[];
|
|
36
|
+
column: number[];
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
calcChain?: any[] | undefined;
|
|
39
|
+
dataBlockCalcFunction?: {
|
|
40
|
+
[key: string]: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
} | undefined;
|
|
44
|
+
defaultRowHeight?: number | undefined;
|
|
45
|
+
defaultColWidth?: number | undefined;
|
|
46
|
+
showGridLines?: number | boolean | undefined;
|
|
47
|
+
pivotTable?: any;
|
|
48
|
+
isPivotTable?: boolean | undefined;
|
|
49
|
+
filter?: Record<string, any> | undefined;
|
|
50
|
+
filter_select?: {
|
|
51
|
+
row: number[];
|
|
52
|
+
column: number[];
|
|
53
|
+
} | undefined;
|
|
54
|
+
luckysheet_conditionformat_save?: any[] | undefined;
|
|
55
|
+
luckysheet_alternateformat_save?: any[] | undefined;
|
|
56
|
+
dataVerification?: any;
|
|
57
|
+
conditionRules?: import("../types").ConditionRulesProps | undefined;
|
|
58
|
+
hyperlink?: Record<string, {
|
|
59
|
+
linkType: string;
|
|
60
|
+
linkAddress: string;
|
|
61
|
+
}> | undefined;
|
|
62
|
+
dynamicArray_compute?: any;
|
|
63
|
+
dynamicArray?: any[] | undefined;
|
|
64
|
+
frozen?: {
|
|
65
|
+
type: "row" | "column" | "both" | "rangeRow" | "rangeColumn" | "rangeBoth";
|
|
66
|
+
range?: {
|
|
67
|
+
row_focus: number;
|
|
68
|
+
column_focus: number;
|
|
69
|
+
} | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
};
|
package/es/api/common.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import _ from "lodash";
|
|
12
|
+
import { getSheetIndex } from "../utils";
|
|
13
|
+
import { SHEET_NOT_FOUND } from "./errors";
|
|
14
|
+
export var dataToCelldata = function dataToCelldata(data) {
|
|
15
|
+
var celldata = [];
|
|
16
|
+
if (data == null) {
|
|
17
|
+
return celldata;
|
|
18
|
+
}
|
|
19
|
+
for (var r = 0; r < data.length; r += 1) {
|
|
20
|
+
for (var c = 0; c < data[r].length; c += 1) {
|
|
21
|
+
var v = data[r][c];
|
|
22
|
+
if (v != null) {
|
|
23
|
+
celldata.push({
|
|
24
|
+
r: r,
|
|
25
|
+
c: c,
|
|
26
|
+
v: v
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return celldata;
|
|
32
|
+
};
|
|
33
|
+
export var celldataToData = function celldataToData(celldata, rowCount, colCount) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
var lastRow = _.maxBy(celldata, "r");
|
|
36
|
+
var lastCol = _.maxBy(celldata, "c");
|
|
37
|
+
var lastRowNum = ((_a = lastRow === null || lastRow === void 0 ? void 0 : lastRow.r) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
38
|
+
var lastColNum = ((_b = lastCol === null || lastCol === void 0 ? void 0 : lastCol.c) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
39
|
+
if (rowCount != null && colCount != null && rowCount > 0 && colCount > 0) {
|
|
40
|
+
lastRowNum = Math.max(lastRowNum, rowCount);
|
|
41
|
+
lastColNum = Math.max(lastColNum, colCount);
|
|
42
|
+
}
|
|
43
|
+
if (lastRowNum && lastColNum) {
|
|
44
|
+
var expandedData_1 = _.times(lastRowNum, function () {
|
|
45
|
+
return _.times(lastColNum, function () {
|
|
46
|
+
return null;
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
celldata === null || celldata === void 0 ? void 0 : celldata.forEach(function (d) {
|
|
50
|
+
expandedData_1[d.r][d.c] = d.v;
|
|
51
|
+
});
|
|
52
|
+
return expandedData_1;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
export function getSheet(ctx, options) {
|
|
57
|
+
if (options === void 0) {
|
|
58
|
+
options = {};
|
|
59
|
+
}
|
|
60
|
+
var _a = options.index,
|
|
61
|
+
index = _a === void 0 ? getSheetIndex(ctx, options.id || ctx.currentSheetId) : _a;
|
|
62
|
+
if (index == null) {
|
|
63
|
+
throw SHEET_NOT_FOUND;
|
|
64
|
+
}
|
|
65
|
+
var sheet = ctx.luckysheetfile[index];
|
|
66
|
+
if (sheet == null) {
|
|
67
|
+
throw SHEET_NOT_FOUND;
|
|
68
|
+
}
|
|
69
|
+
return sheet;
|
|
70
|
+
}
|
|
71
|
+
export function getSheetWithLatestCelldata(ctx, options) {
|
|
72
|
+
if (options === void 0) {
|
|
73
|
+
options = {};
|
|
74
|
+
}
|
|
75
|
+
var sheet = getSheet(ctx, options);
|
|
76
|
+
return __assign(__assign({}, sheet), {
|
|
77
|
+
celldata: dataToCelldata(sheet.data)
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const INVALID_PARAMS: Error;
|
|
2
|
-
export declare const SHEET_NOT_FOUND: Error;
|
|
1
|
+
export declare const INVALID_PARAMS: Error;
|
|
2
|
+
export declare const SHEET_NOT_FOUND: Error;
|
package/es/api/errors.js
ADDED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getSheetWithLatestCelldata, CommonOptions, dataToCelldata, celldataToData } from "./common";
|
|
2
|
-
export type { CommonOptions };
|
|
3
|
-
export { getSheetWithLatestCelldata, dataToCelldata, celldataToData };
|
|
4
|
-
export * from "./cell";
|
|
5
|
-
export * from "./rowcol";
|
|
6
|
-
export * from "./range";
|
|
7
|
-
export * from "./merge";
|
|
8
|
-
export * from "./sheet";
|
|
9
|
-
export * from "./workbook";
|
|
1
|
+
import { getSheetWithLatestCelldata, CommonOptions, dataToCelldata, celldataToData } from "./common";
|
|
2
|
+
export type { CommonOptions };
|
|
3
|
+
export { getSheetWithLatestCelldata, dataToCelldata, celldataToData };
|
|
4
|
+
export * from "./cell";
|
|
5
|
+
export * from "./rowcol";
|
|
6
|
+
export * from "./range";
|
|
7
|
+
export * from "./merge";
|
|
8
|
+
export * from "./sheet";
|
|
9
|
+
export * from "./workbook";
|
package/es/api/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getSheetWithLatestCelldata, dataToCelldata, celldataToData } from "./common";
|
|
2
|
+
export { getSheetWithLatestCelldata, dataToCelldata, celldataToData };
|
|
3
|
+
export * from "./cell";
|
|
4
|
+
export * from "./rowcol";
|
|
5
|
+
export * from "./range";
|
|
6
|
+
export * from "./merge";
|
|
7
|
+
export * from "./sheet";
|
|
8
|
+
export * from "./workbook";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "..";
|
|
2
|
-
import { Range } from "../types";
|
|
3
|
-
import { CommonOptions } from "./common";
|
|
4
|
-
export declare function mergeCells(ctx: Context, ranges: Range, type: string, options?: CommonOptions): void;
|
|
5
|
-
export declare function cancelMerge(ctx: Context, ranges: Range, options?: CommonOptions): void;
|
|
1
|
+
import { Context } from "..";
|
|
2
|
+
import { Range } from "../types";
|
|
3
|
+
import { CommonOptions } from "./common";
|
|
4
|
+
export declare function mergeCells(ctx: Context, ranges: Range, type: string, options?: CommonOptions): void;
|
|
5
|
+
export declare function cancelMerge(ctx: Context, ranges: Range, options?: CommonOptions): void;
|
package/es/api/merge.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getSheet } from "./common";
|
|
2
|
+
import { mergeCells as mergeCellsInternal } from "../modules";
|
|
3
|
+
export function mergeCells(ctx, ranges, type, options) {
|
|
4
|
+
if (options === void 0) {
|
|
5
|
+
options = {};
|
|
6
|
+
}
|
|
7
|
+
var sheet = getSheet(ctx, options);
|
|
8
|
+
mergeCellsInternal(ctx, sheet.id, ranges, type);
|
|
9
|
+
}
|
|
10
|
+
export function cancelMerge(ctx, ranges, options) {
|
|
11
|
+
if (options === void 0) {
|
|
12
|
+
options = {};
|
|
13
|
+
}
|
|
14
|
+
mergeCells(ctx, ranges, "merge-cancel", options);
|
|
15
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Selection } from "..";
|
|
2
|
-
import { Context } from "../context";
|
|
3
|
-
import { Cell, Range, SingleRange } from "../types";
|
|
4
|
-
import { CommonOptions } from "./common";
|
|
5
|
-
export declare function getSelection(ctx: Context): {
|
|
6
|
-
row: number[];
|
|
7
|
-
column: number[];
|
|
8
|
-
}[] | undefined;
|
|
9
|
-
export declare function getFlattenRange(ctx: Context, range?: Range): {
|
|
10
|
-
r: number;
|
|
11
|
-
c: number;
|
|
12
|
-
}[];
|
|
13
|
-
export declare function getCellsByFlattenRange(ctx: Context, range?: {
|
|
14
|
-
r: number;
|
|
15
|
-
c: number;
|
|
16
|
-
}[]): (Cell | null)[];
|
|
17
|
-
export declare function getSelectionCoordinates(ctx: Context): string[];
|
|
18
|
-
export declare function getCellsByRange(ctx: Context, range: Selection, options?: CommonOptions): (Cell | null)[][];
|
|
19
|
-
export declare function getHtmlByRange(ctx: Context, range: Range, options?: CommonOptions): string | null;
|
|
20
|
-
export declare function setSelection(ctx: Context, range: Range, options: CommonOptions): void;
|
|
21
|
-
export declare function setCellValuesByRange(ctx: Context, data: any[][], range: SingleRange, cellInput: HTMLDivElement | null, options?: CommonOptions): void;
|
|
22
|
-
export declare function setCellFormatByRange(ctx: Context, attr: keyof Cell, value: any, range: Range | SingleRange, options?: CommonOptions): void;
|
|
1
|
+
import { Selection } from "..";
|
|
2
|
+
import { Context } from "../context";
|
|
3
|
+
import { Cell, Range, SingleRange } from "../types";
|
|
4
|
+
import { CommonOptions } from "./common";
|
|
5
|
+
export declare function getSelection(ctx: Context): {
|
|
6
|
+
row: number[];
|
|
7
|
+
column: number[];
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
export declare function getFlattenRange(ctx: Context, range?: Range): {
|
|
10
|
+
r: number;
|
|
11
|
+
c: number;
|
|
12
|
+
}[];
|
|
13
|
+
export declare function getCellsByFlattenRange(ctx: Context, range?: {
|
|
14
|
+
r: number;
|
|
15
|
+
c: number;
|
|
16
|
+
}[]): (Cell | null)[];
|
|
17
|
+
export declare function getSelectionCoordinates(ctx: Context): string[];
|
|
18
|
+
export declare function getCellsByRange(ctx: Context, range: Selection, options?: CommonOptions): (Cell | null)[][];
|
|
19
|
+
export declare function getHtmlByRange(ctx: Context, range: Range, options?: CommonOptions): string | null;
|
|
20
|
+
export declare function setSelection(ctx: Context, range: Range, options: CommonOptions): void;
|
|
21
|
+
export declare function setCellValuesByRange(ctx: Context, data: any[][], range: SingleRange, cellInput: HTMLDivElement | null, options?: CommonOptions): void;
|
|
22
|
+
export declare function setCellFormatByRange(ctx: Context, attr: keyof Cell, value: any, range: Range | SingleRange, options?: CommonOptions): void;
|