@leankylin-sheet/core 5.2.62 → 5.2.64

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/index.esm.js CHANGED
@@ -57274,6 +57274,7 @@ var defaultSettings = {
57274
57274
  onAddSheetClick: undefined,
57275
57275
  onSheetRename: undefined,
57276
57276
  onSheetDelete: undefined,
57277
+ onDeleteSheetCheck: undefined,
57277
57278
  data: [],
57278
57279
  config: {},
57279
57280
  devicePixelRatio: 0,
@@ -57304,6 +57305,7 @@ var defaultSettings = {
57304
57305
  };
57305
57306
 
57306
57307
  function handleCopy(ctx) {
57308
+ var _ctx$hooks$onCopyChec, _ctx$hooks;
57307
57309
  if (ctx.luckysheetPaintModelOn) {
57308
57310
  cancelPaintModel(ctx);
57309
57311
  }
@@ -57311,6 +57313,9 @@ function handleCopy(ctx) {
57311
57313
  if (!selection || _.isEmpty(selection)) {
57312
57314
  return;
57313
57315
  }
57316
+ if (((_ctx$hooks$onCopyChec = (_ctx$hooks = ctx.hooks).onCopyCheck) === null || _ctx$hooks$onCopyChec === void 0 ? void 0 : _ctx$hooks$onCopyChec.call(_ctx$hooks, selection)) === false) {
57317
+ return;
57318
+ }
57314
57319
  if (ctx.config.merge != null) {
57315
57320
  var has_PartMC = false;
57316
57321
  for (var s = 0; s < selection.length; s += 1) {
package/dist/index.js CHANGED
@@ -57284,6 +57284,7 @@ var defaultSettings = {
57284
57284
  onAddSheetClick: undefined,
57285
57285
  onSheetRename: undefined,
57286
57286
  onSheetDelete: undefined,
57287
+ onDeleteSheetCheck: undefined,
57287
57288
  data: [],
57288
57289
  config: {},
57289
57290
  devicePixelRatio: 0,
@@ -57314,6 +57315,7 @@ var defaultSettings = {
57314
57315
  };
57315
57316
 
57316
57317
  function handleCopy(ctx) {
57318
+ var _ctx$hooks$onCopyChec, _ctx$hooks;
57317
57319
  if (ctx.luckysheetPaintModelOn) {
57318
57320
  cancelPaintModel(ctx);
57319
57321
  }
@@ -57321,6 +57323,9 @@ function handleCopy(ctx) {
57321
57323
  if (!selection || ___default['default'].isEmpty(selection)) {
57322
57324
  return;
57323
57325
  }
57326
+ if (((_ctx$hooks$onCopyChec = (_ctx$hooks = ctx.hooks).onCopyCheck) === null || _ctx$hooks$onCopyChec === void 0 ? void 0 : _ctx$hooks$onCopyChec.call(_ctx$hooks, selection)) === false) {
57327
+ return;
57328
+ }
57324
57329
  if (ctx.config.merge != null) {
57325
57330
  var has_PartMC = false;
57326
57331
  for (var s = 0; s < selection.length; s += 1) {
@@ -11,6 +11,7 @@ export type Hooks = {
11
11
  }) => void;
12
12
  onCopySheet?: (oldSheetId: string, newSheetId: string) => void;
13
13
  onCopySheetBefore?: (oldSheetId: any, sheetData: any) => any;
14
+ onCopyCheck?: (selection: Selection[]) => boolean;
14
15
  commentsPreRender?: (r: number, c: number) => any;
15
16
  showCommentsMenu?: (item: {
16
17
  text: string;
@@ -123,6 +124,7 @@ export type Settings = {
123
124
  onAddSheetClick?: (() => void) | undefined;
124
125
  onSheetRename?: ((newName: string) => void) | undefined;
125
126
  onSheetDelete?: ((sheetId: string, sheet: Sheet) => void) | undefined;
127
+ onDeleteSheetCheck?: (sheetId: string, sheet: Sheet) => boolean | Promise<boolean>;
126
128
  data: Sheet[];
127
129
  config?: any;
128
130
  devicePixelRatio?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "5.2.62",
3
+ "version": "5.2.64",
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": "5.2.62",
16
+ "@leankylin-sheet/formula-parser": "5.2.64",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",