@leankylin-sheet/core 5.2.53 → 5.2.54
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/context.d.ts +4 -0
- package/dist/index.esm.js +13 -2
- package/dist/index.js +13 -2
- package/dist/settings.d.ts +4 -0
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -179,6 +179,10 @@ export type Context = {
|
|
|
179
179
|
zoomRatio: number;
|
|
180
180
|
showGridLines: boolean;
|
|
181
181
|
allowEdit: boolean;
|
|
182
|
+
showAddSheetButton: boolean;
|
|
183
|
+
onAddSheetClick?: () => void;
|
|
184
|
+
onSheetRename?: (newName: string) => void;
|
|
185
|
+
onSheetDelete?: (sheetId: string, sheet: Sheet) => void;
|
|
182
186
|
fontList: any[];
|
|
183
187
|
defaultFontSize: number;
|
|
184
188
|
luckysheetPaintModelOn: boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -43126,6 +43126,10 @@ function defaultContext(refs) {
|
|
|
43126
43126
|
zoomRatio: 1,
|
|
43127
43127
|
showGridLines: true,
|
|
43128
43128
|
allowEdit: true,
|
|
43129
|
+
showAddSheetButton: true,
|
|
43130
|
+
onAddSheetClick: undefined,
|
|
43131
|
+
onSheetRename: undefined,
|
|
43132
|
+
onSheetDelete: undefined,
|
|
43129
43133
|
fontList: [],
|
|
43130
43134
|
defaultFontSize: 10,
|
|
43131
43135
|
luckysheetPaintModelOn: false,
|
|
@@ -47240,7 +47244,7 @@ function addSheet(ctx, settings) {
|
|
|
47240
47244
|
}
|
|
47241
47245
|
}
|
|
47242
47246
|
function deleteSheet(ctx, id) {
|
|
47243
|
-
var _ctx$hooks$beforeDele, _ctx$hooks5;
|
|
47247
|
+
var _ctx$hooks$beforeDele, _ctx$hooks5, _ctx$onSheetDelete;
|
|
47244
47248
|
if (ctx.allowEdit === false) {
|
|
47245
47249
|
return;
|
|
47246
47250
|
}
|
|
@@ -47251,11 +47255,13 @@ function deleteSheet(ctx, id) {
|
|
|
47251
47255
|
if (((_ctx$hooks$beforeDele = (_ctx$hooks5 = ctx.hooks).beforeDeleteSheet) === null || _ctx$hooks$beforeDele === void 0 ? void 0 : _ctx$hooks$beforeDele.call(_ctx$hooks5, id)) === false) {
|
|
47252
47256
|
return;
|
|
47253
47257
|
}
|
|
47258
|
+
var deletedSheet = ctx.luckysheetfile[arrIndex];
|
|
47254
47259
|
ctx.luckysheetfile = ctx.luckysheetfile.map(function (sheet) {
|
|
47255
47260
|
sheet.order = sheet.order < ctx.luckysheetfile[arrIndex].order ? sheet.order : sheet.order - 1;
|
|
47256
47261
|
return sheet;
|
|
47257
47262
|
});
|
|
47258
47263
|
ctx.luckysheetfile.splice(arrIndex, 1);
|
|
47264
|
+
(_ctx$onSheetDelete = ctx.onSheetDelete) === null || _ctx$onSheetDelete === void 0 ? void 0 : _ctx$onSheetDelete.call(ctx, id, deletedSheet);
|
|
47259
47265
|
if (id === ctx.currentSheetId) {
|
|
47260
47266
|
var _orderSheets$;
|
|
47261
47267
|
var shownSheets = _.cloneDeep(ctx.luckysheetfile).filter(function (singleSheet) {
|
|
@@ -47311,7 +47317,7 @@ function updateSheet(ctx, newData) {
|
|
|
47311
47317
|
});
|
|
47312
47318
|
}
|
|
47313
47319
|
function editSheetName(ctx, editable) {
|
|
47314
|
-
var _ctx$hooks$beforeUpda, _ctx$hooks7;
|
|
47320
|
+
var _ctx$hooks$beforeUpda, _ctx$hooks7, _ctx$onSheetRename;
|
|
47315
47321
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
47316
47322
|
if (ctx.allowEdit === false) {
|
|
47317
47323
|
if (index == null) return;
|
|
@@ -47341,6 +47347,7 @@ function editSheetName(ctx, editable) {
|
|
|
47341
47347
|
}
|
|
47342
47348
|
}
|
|
47343
47349
|
ctx.luckysheetfile[index].name = txt;
|
|
47350
|
+
(_ctx$onSheetRename = ctx.onSheetRename) === null || _ctx$onSheetRename === void 0 ? void 0 : _ctx$onSheetRename.call(ctx, txt);
|
|
47344
47351
|
for (var SheetIndex = 0; SheetIndex < ctx.luckysheetfile.length; SheetIndex += 1) {
|
|
47345
47352
|
if (_.isNil(ctx.luckysheetfile[SheetIndex].calcChain) || ctx.luckysheetfile.length === 0) {
|
|
47346
47353
|
continue;
|
|
@@ -57186,6 +57193,10 @@ var defaultSettings = {
|
|
|
57186
57193
|
showToolbar: true,
|
|
57187
57194
|
showFormulaBar: true,
|
|
57188
57195
|
showSheetTabs: true,
|
|
57196
|
+
showAddSheetButton: true,
|
|
57197
|
+
onAddSheetClick: undefined,
|
|
57198
|
+
onSheetRename: undefined,
|
|
57199
|
+
onSheetDelete: undefined,
|
|
57189
57200
|
data: [],
|
|
57190
57201
|
config: {},
|
|
57191
57202
|
devicePixelRatio: 0,
|
package/dist/index.js
CHANGED
|
@@ -43136,6 +43136,10 @@ function defaultContext(refs) {
|
|
|
43136
43136
|
zoomRatio: 1,
|
|
43137
43137
|
showGridLines: true,
|
|
43138
43138
|
allowEdit: true,
|
|
43139
|
+
showAddSheetButton: true,
|
|
43140
|
+
onAddSheetClick: undefined,
|
|
43141
|
+
onSheetRename: undefined,
|
|
43142
|
+
onSheetDelete: undefined,
|
|
43139
43143
|
fontList: [],
|
|
43140
43144
|
defaultFontSize: 10,
|
|
43141
43145
|
luckysheetPaintModelOn: false,
|
|
@@ -47250,7 +47254,7 @@ function addSheet(ctx, settings) {
|
|
|
47250
47254
|
}
|
|
47251
47255
|
}
|
|
47252
47256
|
function deleteSheet(ctx, id) {
|
|
47253
|
-
var _ctx$hooks$beforeDele, _ctx$hooks5;
|
|
47257
|
+
var _ctx$hooks$beforeDele, _ctx$hooks5, _ctx$onSheetDelete;
|
|
47254
47258
|
if (ctx.allowEdit === false) {
|
|
47255
47259
|
return;
|
|
47256
47260
|
}
|
|
@@ -47261,11 +47265,13 @@ function deleteSheet(ctx, id) {
|
|
|
47261
47265
|
if (((_ctx$hooks$beforeDele = (_ctx$hooks5 = ctx.hooks).beforeDeleteSheet) === null || _ctx$hooks$beforeDele === void 0 ? void 0 : _ctx$hooks$beforeDele.call(_ctx$hooks5, id)) === false) {
|
|
47262
47266
|
return;
|
|
47263
47267
|
}
|
|
47268
|
+
var deletedSheet = ctx.luckysheetfile[arrIndex];
|
|
47264
47269
|
ctx.luckysheetfile = ctx.luckysheetfile.map(function (sheet) {
|
|
47265
47270
|
sheet.order = sheet.order < ctx.luckysheetfile[arrIndex].order ? sheet.order : sheet.order - 1;
|
|
47266
47271
|
return sheet;
|
|
47267
47272
|
});
|
|
47268
47273
|
ctx.luckysheetfile.splice(arrIndex, 1);
|
|
47274
|
+
(_ctx$onSheetDelete = ctx.onSheetDelete) === null || _ctx$onSheetDelete === void 0 ? void 0 : _ctx$onSheetDelete.call(ctx, id, deletedSheet);
|
|
47269
47275
|
if (id === ctx.currentSheetId) {
|
|
47270
47276
|
var _orderSheets$;
|
|
47271
47277
|
var shownSheets = ___default['default'].cloneDeep(ctx.luckysheetfile).filter(function (singleSheet) {
|
|
@@ -47321,7 +47327,7 @@ function updateSheet(ctx, newData) {
|
|
|
47321
47327
|
});
|
|
47322
47328
|
}
|
|
47323
47329
|
function editSheetName(ctx, editable) {
|
|
47324
|
-
var _ctx$hooks$beforeUpda, _ctx$hooks7;
|
|
47330
|
+
var _ctx$hooks$beforeUpda, _ctx$hooks7, _ctx$onSheetRename;
|
|
47325
47331
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
47326
47332
|
if (ctx.allowEdit === false) {
|
|
47327
47333
|
if (index == null) return;
|
|
@@ -47351,6 +47357,7 @@ function editSheetName(ctx, editable) {
|
|
|
47351
47357
|
}
|
|
47352
47358
|
}
|
|
47353
47359
|
ctx.luckysheetfile[index].name = txt;
|
|
47360
|
+
(_ctx$onSheetRename = ctx.onSheetRename) === null || _ctx$onSheetRename === void 0 ? void 0 : _ctx$onSheetRename.call(ctx, txt);
|
|
47354
47361
|
for (var SheetIndex = 0; SheetIndex < ctx.luckysheetfile.length; SheetIndex += 1) {
|
|
47355
47362
|
if (___default['default'].isNil(ctx.luckysheetfile[SheetIndex].calcChain) || ctx.luckysheetfile.length === 0) {
|
|
47356
47363
|
continue;
|
|
@@ -57196,6 +57203,10 @@ var defaultSettings = {
|
|
|
57196
57203
|
showToolbar: true,
|
|
57197
57204
|
showFormulaBar: true,
|
|
57198
57205
|
showSheetTabs: true,
|
|
57206
|
+
showAddSheetButton: true,
|
|
57207
|
+
onAddSheetClick: undefined,
|
|
57208
|
+
onSheetRename: undefined,
|
|
57209
|
+
onSheetDelete: undefined,
|
|
57199
57210
|
data: [],
|
|
57200
57211
|
config: {},
|
|
57201
57212
|
devicePixelRatio: 0,
|
package/dist/settings.d.ts
CHANGED
|
@@ -118,6 +118,10 @@ export type Settings = {
|
|
|
118
118
|
showToolbar?: boolean;
|
|
119
119
|
showFormulaBar?: boolean;
|
|
120
120
|
showSheetTabs?: boolean;
|
|
121
|
+
showAddSheetButton?: boolean;
|
|
122
|
+
onAddSheetClick?: (() => void) | undefined;
|
|
123
|
+
onSheetRename?: ((newName: string) => void) | undefined;
|
|
124
|
+
onSheetDelete?: ((sheetId: string, sheet: Sheet) => void) | undefined;
|
|
121
125
|
data: Sheet[];
|
|
122
126
|
config?: any;
|
|
123
127
|
devicePixelRatio?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.54",
|
|
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.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "5.2.54",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|