@leankylin-sheet/react 5.2.35 → 5.2.37
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/components/Workbook/api.d.ts +3 -0
- package/dist/components/Workbook/index.d.ts +3 -0
- package/dist/index.esm.js +24 -3
- package/dist/index.js +24 -3
- package/dist/index.umd.js +24 -3
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
|
@@ -15,6 +15,9 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
15
15
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
16
16
|
type?: keyof Cell;
|
|
17
17
|
}) => void;
|
|
18
|
+
setCellValueForce: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
19
|
+
type?: keyof Cell;
|
|
20
|
+
}) => void;
|
|
18
21
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
19
22
|
setCellFormat: (row: number, column: number, attr: keyof Cell, value: any, options?: api.CommonOptions) => void;
|
|
20
23
|
autoFillCell: (copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
@@ -23,6 +23,9 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
23
23
|
setCellValue: (row: number, column: number, value: any, options?: import("@leankylin-sheet/core/dist/api").CommonOptions & {
|
|
24
24
|
type?: "v" | "m" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "rt" | "ps" | "tip" | "hl" | keyof import("@leankylin-sheet/core").CellStyle | undefined;
|
|
25
25
|
}) => void;
|
|
26
|
+
setCellValueForce: (row: number, column: number, value: any, options?: import("@leankylin-sheet/core/dist/api").CommonOptions & {
|
|
27
|
+
type?: "v" | "m" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "rt" | "ps" | "tip" | "hl" | keyof import("@leankylin-sheet/core").CellStyle | undefined;
|
|
28
|
+
}) => void;
|
|
26
29
|
clearCell: (row: number, column: number, options?: import("@leankylin-sheet/core/dist/api").CommonOptions) => void;
|
|
27
30
|
setCellFormat: (row: number, column: number, attr: "v" | "m" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "rt" | "ps" | "tip" | "hl" | keyof import("@leankylin-sheet/core").CellStyle, value: any, options?: import("@leankylin-sheet/core/dist/api").CommonOptions) => void;
|
|
28
31
|
autoFillCell: (copyRange: import("@leankylin-sheet/core").SingleRange, applyRange: import("@leankylin-sheet/core").SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -7222,11 +7222,9 @@ var FxEditor = function FxEditor() {
|
|
|
7222
7222
|
var prevFirstSelection = usePrevious(firstSelection);
|
|
7223
7223
|
var prevSheetId = usePrevious(context.currentSheetId);
|
|
7224
7224
|
var recentText = useRef("");
|
|
7225
|
+
var prevCellRef = useRef();
|
|
7225
7226
|
useEffect(function () {
|
|
7226
7227
|
setIsHidenRC(isShowHidenCR(context));
|
|
7227
|
-
if (_.isEqual(prevFirstSelection, firstSelection) && context.currentSheetId === prevSheetId) {
|
|
7228
|
-
return;
|
|
7229
|
-
}
|
|
7230
7228
|
var d = getFlowdata(context);
|
|
7231
7229
|
if (context.active_f) {
|
|
7232
7230
|
return;
|
|
@@ -7238,6 +7236,16 @@ var FxEditor = function FxEditor() {
|
|
|
7238
7236
|
var c = firstSelection.column_focus;
|
|
7239
7237
|
if (_.isNil(r) || _.isNil(c)) return;
|
|
7240
7238
|
var cell = d === null || d === void 0 ? void 0 : (_d$r = d[r]) === null || _d$r === void 0 ? void 0 : _d$r[c];
|
|
7239
|
+
var selectionChanged = !_.isEqual(prevFirstSelection, firstSelection) || context.currentSheetId !== prevSheetId;
|
|
7240
|
+
var cellChanged = !prevCellRef.current || prevCellRef.current.r !== r || prevCellRef.current.c !== c || prevCellRef.current.cell !== cell;
|
|
7241
|
+
if (!selectionChanged && !cellChanged) {
|
|
7242
|
+
return;
|
|
7243
|
+
}
|
|
7244
|
+
prevCellRef.current = {
|
|
7245
|
+
r: r,
|
|
7246
|
+
c: c,
|
|
7247
|
+
cell: cell
|
|
7248
|
+
};
|
|
7241
7249
|
if (cell) {
|
|
7242
7250
|
if (isInlineStringCell(cell)) {
|
|
7243
7251
|
value = getInlineStringNoStyle(r, c, d);
|
|
@@ -7249,6 +7257,7 @@ var FxEditor = function FxEditor() {
|
|
|
7249
7257
|
}
|
|
7250
7258
|
refs.fxInput.current.innerHTML = escapeHTMLTag(escapeScriptTag(value));
|
|
7251
7259
|
} else {
|
|
7260
|
+
prevCellRef.current = undefined;
|
|
7252
7261
|
refs.fxInput.current.innerHTML = "";
|
|
7253
7262
|
}
|
|
7254
7263
|
}, [context.active_f, context.luckysheetfile, context.currentSheetId, context.luckysheet_select_save]);
|
|
@@ -10346,6 +10355,18 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10346
10355
|
return api.setCellValue(draftCtx, row, column, value, cellInput, options);
|
|
10347
10356
|
});
|
|
10348
10357
|
},
|
|
10358
|
+
setCellValueForce: function setCellValueForce(row, column, value) {
|
|
10359
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
10360
|
+
return setContext(function (draftCtx) {
|
|
10361
|
+
updateCell(draftCtx, row, column, cellInput, value, undefined, options.id);
|
|
10362
|
+
draftCtx.luckysheet_select_save = [{
|
|
10363
|
+
row: [row, row],
|
|
10364
|
+
column: [column, column],
|
|
10365
|
+
row_focus: row,
|
|
10366
|
+
column_focus: column
|
|
10367
|
+
}];
|
|
10368
|
+
});
|
|
10369
|
+
},
|
|
10349
10370
|
clearCell: function clearCell(row, column) {
|
|
10350
10371
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10351
10372
|
return setContext(function (draftCtx) {
|
package/dist/index.js
CHANGED
|
@@ -7232,11 +7232,9 @@ var FxEditor = function FxEditor() {
|
|
|
7232
7232
|
var prevFirstSelection = usePrevious(firstSelection);
|
|
7233
7233
|
var prevSheetId = usePrevious(context.currentSheetId);
|
|
7234
7234
|
var recentText = React.useRef("");
|
|
7235
|
+
var prevCellRef = React.useRef();
|
|
7235
7236
|
React.useEffect(function () {
|
|
7236
7237
|
setIsHidenRC(core.isShowHidenCR(context));
|
|
7237
|
-
if (___default['default'].isEqual(prevFirstSelection, firstSelection) && context.currentSheetId === prevSheetId) {
|
|
7238
|
-
return;
|
|
7239
|
-
}
|
|
7240
7238
|
var d = core.getFlowdata(context);
|
|
7241
7239
|
if (context.active_f) {
|
|
7242
7240
|
return;
|
|
@@ -7248,6 +7246,16 @@ var FxEditor = function FxEditor() {
|
|
|
7248
7246
|
var c = firstSelection.column_focus;
|
|
7249
7247
|
if (___default['default'].isNil(r) || ___default['default'].isNil(c)) return;
|
|
7250
7248
|
var cell = d === null || d === void 0 ? void 0 : (_d$r = d[r]) === null || _d$r === void 0 ? void 0 : _d$r[c];
|
|
7249
|
+
var selectionChanged = !___default['default'].isEqual(prevFirstSelection, firstSelection) || context.currentSheetId !== prevSheetId;
|
|
7250
|
+
var cellChanged = !prevCellRef.current || prevCellRef.current.r !== r || prevCellRef.current.c !== c || prevCellRef.current.cell !== cell;
|
|
7251
|
+
if (!selectionChanged && !cellChanged) {
|
|
7252
|
+
return;
|
|
7253
|
+
}
|
|
7254
|
+
prevCellRef.current = {
|
|
7255
|
+
r: r,
|
|
7256
|
+
c: c,
|
|
7257
|
+
cell: cell
|
|
7258
|
+
};
|
|
7251
7259
|
if (cell) {
|
|
7252
7260
|
if (core.isInlineStringCell(cell)) {
|
|
7253
7261
|
value = core.getInlineStringNoStyle(r, c, d);
|
|
@@ -7259,6 +7267,7 @@ var FxEditor = function FxEditor() {
|
|
|
7259
7267
|
}
|
|
7260
7268
|
refs.fxInput.current.innerHTML = core.escapeHTMLTag(core.escapeScriptTag(value));
|
|
7261
7269
|
} else {
|
|
7270
|
+
prevCellRef.current = undefined;
|
|
7262
7271
|
refs.fxInput.current.innerHTML = "";
|
|
7263
7272
|
}
|
|
7264
7273
|
}, [context.active_f, context.luckysheetfile, context.currentSheetId, context.luckysheet_select_save]);
|
|
@@ -10356,6 +10365,18 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10356
10365
|
return core.api.setCellValue(draftCtx, row, column, value, cellInput, options);
|
|
10357
10366
|
});
|
|
10358
10367
|
},
|
|
10368
|
+
setCellValueForce: function setCellValueForce(row, column, value) {
|
|
10369
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
10370
|
+
return setContext(function (draftCtx) {
|
|
10371
|
+
core.updateCell(draftCtx, row, column, cellInput, value, undefined, options.id);
|
|
10372
|
+
draftCtx.luckysheet_select_save = [{
|
|
10373
|
+
row: [row, row],
|
|
10374
|
+
column: [column, column],
|
|
10375
|
+
row_focus: row,
|
|
10376
|
+
column_focus: column
|
|
10377
|
+
}];
|
|
10378
|
+
});
|
|
10379
|
+
},
|
|
10359
10380
|
clearCell: function clearCell(row, column) {
|
|
10360
10381
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10361
10382
|
return setContext(function (draftCtx) {
|
package/dist/index.umd.js
CHANGED
|
@@ -112253,11 +112253,9 @@
|
|
|
112253
112253
|
var prevFirstSelection = usePrevious(firstSelection);
|
|
112254
112254
|
var prevSheetId = usePrevious(context.currentSheetId);
|
|
112255
112255
|
var recentText = React.useRef("");
|
|
112256
|
+
var prevCellRef = React.useRef();
|
|
112256
112257
|
React.useEffect(function () {
|
|
112257
112258
|
setIsHidenRC(isShowHidenCR(context));
|
|
112258
|
-
if (lodash.isEqual(prevFirstSelection, firstSelection) && context.currentSheetId === prevSheetId) {
|
|
112259
|
-
return;
|
|
112260
|
-
}
|
|
112261
112259
|
var d = getFlowdata(context);
|
|
112262
112260
|
if (context.active_f) {
|
|
112263
112261
|
return;
|
|
@@ -112269,6 +112267,16 @@
|
|
|
112269
112267
|
var c = firstSelection.column_focus;
|
|
112270
112268
|
if (lodash.isNil(r) || lodash.isNil(c)) return;
|
|
112271
112269
|
var cell = d === null || d === void 0 ? void 0 : (_d$r = d[r]) === null || _d$r === void 0 ? void 0 : _d$r[c];
|
|
112270
|
+
var selectionChanged = !lodash.isEqual(prevFirstSelection, firstSelection) || context.currentSheetId !== prevSheetId;
|
|
112271
|
+
var cellChanged = !prevCellRef.current || prevCellRef.current.r !== r || prevCellRef.current.c !== c || prevCellRef.current.cell !== cell;
|
|
112272
|
+
if (!selectionChanged && !cellChanged) {
|
|
112273
|
+
return;
|
|
112274
|
+
}
|
|
112275
|
+
prevCellRef.current = {
|
|
112276
|
+
r: r,
|
|
112277
|
+
c: c,
|
|
112278
|
+
cell: cell
|
|
112279
|
+
};
|
|
112272
112280
|
if (cell) {
|
|
112273
112281
|
if (isInlineStringCell(cell)) {
|
|
112274
112282
|
value = getInlineStringNoStyle(r, c, d);
|
|
@@ -112280,6 +112288,7 @@
|
|
|
112280
112288
|
}
|
|
112281
112289
|
refs.fxInput.current.innerHTML = escapeHTMLTag(escapeScriptTag(value));
|
|
112282
112290
|
} else {
|
|
112291
|
+
prevCellRef.current = undefined;
|
|
112283
112292
|
refs.fxInput.current.innerHTML = "";
|
|
112284
112293
|
}
|
|
112285
112294
|
}, [context.active_f, context.luckysheetfile, context.currentSheetId, context.luckysheet_select_save]);
|
|
@@ -115377,6 +115386,18 @@
|
|
|
115377
115386
|
return index.setCellValue(draftCtx, row, column, value, cellInput, options);
|
|
115378
115387
|
});
|
|
115379
115388
|
},
|
|
115389
|
+
setCellValueForce: function setCellValueForce(row, column, value) {
|
|
115390
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
115391
|
+
return setContext(function (draftCtx) {
|
|
115392
|
+
updateCell(draftCtx, row, column, cellInput, value, undefined, options.id);
|
|
115393
|
+
draftCtx.luckysheet_select_save = [{
|
|
115394
|
+
row: [row, row],
|
|
115395
|
+
column: [column, column],
|
|
115396
|
+
row_focus: row,
|
|
115397
|
+
column_focus: column
|
|
115398
|
+
}];
|
|
115399
|
+
});
|
|
115400
|
+
},
|
|
115380
115401
|
clearCell: function clearCell(row, column) {
|
|
115381
115402
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
115382
115403
|
return setContext(function (draftCtx) {
|