@fileverse-dev/fortune-core 1.3.1 → 1.3.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/es/events/mouse.d.ts +1 -0
- package/es/events/mouse.js +2 -1
- package/es/modules/selection.js +32 -27
- package/es/modules/toolbar.js +1 -0
- package/lib/events/mouse.d.ts +1 -0
- package/lib/events/mouse.js +2 -0
- package/lib/modules/selection.js +32 -27
- package/lib/modules/toolbar.js +1 -0
- package/package.json +1 -1
package/es/events/mouse.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function fixPositionOnFrozenCells(freeze: Freezen | undefined, x:
|
|
|
12
12
|
export declare function handleCellAreaMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null, canvas?: CanvasRenderingContext2D): void;
|
|
13
13
|
export declare function handleCellAreaDoubleClick(ctx: Context, globalCache: GlobalCache, settings: Settings, e: MouseEvent, container: HTMLElement): void;
|
|
14
14
|
export declare function handleContextMenu(ctx: Context, settings: Settings, e: MouseEvent, workbookContainer: HTMLDivElement, container: HTMLDivElement, area: "cell" | "rowHeader" | "columnHeader"): void;
|
|
15
|
+
export declare function mouseRender(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, scrollX: HTMLDivElement, scrollY: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null): void;
|
|
15
16
|
export declare function handleOverlayMouseMove(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, scrollX: HTMLDivElement, scrollY: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null): void;
|
|
16
17
|
export declare function handleOverlayMouseUp(ctx: Context, globalCache: GlobalCache, settings: Settings, e: MouseEvent, scrollbarX: HTMLDivElement, scrollbarY: HTMLDivElement, container: HTMLDivElement, cellInput: HTMLDivElement | null, fxInput: HTMLDivElement | null): void;
|
|
17
18
|
export declare function handleRowHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLDivElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
package/es/events/mouse.js
CHANGED
|
@@ -696,7 +696,7 @@ export function handleContextMenu(ctx, settings, e, workbookContainer, container
|
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container, fxInput) {
|
|
699
|
+
export function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container, fxInput) {
|
|
700
700
|
var _a, _b, _c, _d;
|
|
701
701
|
var rect = container.getBoundingClientRect();
|
|
702
702
|
if (ctx.luckysheet_scroll_status && !ctx.luckysheet_cols_change_size && !ctx.luckysheet_rows_change_size) {
|
|
@@ -733,6 +733,7 @@ function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container
|
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
735
|
if (ctx.luckysheet_select_status) {
|
|
736
|
+
console.log("ctx.scrollLeft", ctx.scrollLeft);
|
|
736
737
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
737
738
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
738
739
|
var _x = mouseX - ctx.rowHeaderWidth + ctx.scrollLeft;
|
package/es/modules/selection.js
CHANGED
|
@@ -180,6 +180,7 @@ export function selectTitlesRange(map) {
|
|
|
180
180
|
return rangeArr;
|
|
181
181
|
}
|
|
182
182
|
export function pasteHandlerOfPaintModel(ctx, copyRange) {
|
|
183
|
+
var _a;
|
|
183
184
|
var cfg = ctx.config;
|
|
184
185
|
if (cfg.merge == null) {
|
|
185
186
|
cfg.merge = {};
|
|
@@ -369,36 +370,40 @@ export function pasteHandlerOfPaintModel(ctx, copyRange) {
|
|
|
369
370
|
}
|
|
370
371
|
var currFile = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)];
|
|
371
372
|
currFile.config = cfg;
|
|
372
|
-
|
|
373
|
-
|
|
373
|
+
if (dataVerification != null) {
|
|
374
|
+
currFile.dataVerification = dataVerification;
|
|
375
|
+
}
|
|
374
376
|
var copyIndex = getSheetIndex(ctx, copySheetIndex);
|
|
375
|
-
if (
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
var
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
377
|
+
if (copyIndex != null) {
|
|
378
|
+
var ruleArr = _.cloneDeep(ctx.luckysheetfile[copyIndex].luckysheet_conditionformat_save);
|
|
379
|
+
if (!_.isNil(ruleArr) && ruleArr.length > 0) {
|
|
380
|
+
var currentIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
381
|
+
var existingCf = ctx.luckysheetfile[currentIndex].luckysheet_conditionformat_save;
|
|
382
|
+
var cdformat = (_a = _.cloneDeep(existingCf)) !== null && _a !== void 0 ? _a : [];
|
|
383
|
+
for (var i = 0; i < ruleArr.length; i += 1) {
|
|
384
|
+
var cdformat_cellrange = ruleArr[i].cellrange;
|
|
385
|
+
var emptyRange = [];
|
|
386
|
+
for (var j = 0; j < cdformat_cellrange.length; j += 1) {
|
|
387
|
+
var range = CFSplitRange(cdformat_cellrange[j], {
|
|
388
|
+
row: [c_r1, c_r2],
|
|
389
|
+
column: [c_c1, c_c2]
|
|
390
|
+
}, {
|
|
391
|
+
row: [minh, maxh],
|
|
392
|
+
column: [minc, maxc]
|
|
393
|
+
}, "operatePart");
|
|
394
|
+
if (range.length > 0) {
|
|
395
|
+
emptyRange = emptyRange.concat(range);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (emptyRange.length > 0) {
|
|
399
|
+
ruleArr[i].cellrange = [{
|
|
400
|
+
row: [minh, maxh],
|
|
401
|
+
column: [minc, maxc]
|
|
402
|
+
}];
|
|
403
|
+
cdformat.push(ruleArr[i]);
|
|
393
404
|
}
|
|
394
405
|
}
|
|
395
|
-
|
|
396
|
-
ruleArr[i].cellrange = [{
|
|
397
|
-
row: [minh, maxh],
|
|
398
|
-
column: [minc, maxc]
|
|
399
|
-
}];
|
|
400
|
-
cdformat.push(ruleArr[i]);
|
|
401
|
-
}
|
|
406
|
+
currFile.luckysheet_conditionformat_save = cdformat;
|
|
402
407
|
}
|
|
403
408
|
}
|
|
404
409
|
}
|
package/es/modules/toolbar.js
CHANGED
|
@@ -727,6 +727,7 @@ export function handleVerticalAlign(ctx, cellInput, value) {
|
|
|
727
727
|
setAttr(ctx, cellInput, "vt", value);
|
|
728
728
|
}
|
|
729
729
|
export function handleFormatPainter(ctx) {
|
|
730
|
+
console.log("handleFormatPainter", ctx);
|
|
730
731
|
var allowEdit = isAllowEdit(ctx);
|
|
731
732
|
if (!allowEdit) return;
|
|
732
733
|
if (ctx.luckysheet_select_save == null || ctx.luckysheet_select_save.length === 0) {
|
package/lib/events/mouse.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function fixPositionOnFrozenCells(freeze: Freezen | undefined, x:
|
|
|
12
12
|
export declare function handleCellAreaMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null, canvas?: CanvasRenderingContext2D): void;
|
|
13
13
|
export declare function handleCellAreaDoubleClick(ctx: Context, globalCache: GlobalCache, settings: Settings, e: MouseEvent, container: HTMLElement): void;
|
|
14
14
|
export declare function handleContextMenu(ctx: Context, settings: Settings, e: MouseEvent, workbookContainer: HTMLDivElement, container: HTMLDivElement, area: "cell" | "rowHeader" | "columnHeader"): void;
|
|
15
|
+
export declare function mouseRender(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, scrollX: HTMLDivElement, scrollY: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null): void;
|
|
15
16
|
export declare function handleOverlayMouseMove(ctx: Context, globalCache: GlobalCache, e: MouseEvent, cellInput: HTMLDivElement, scrollX: HTMLDivElement, scrollY: HTMLDivElement, container: HTMLDivElement, fxInput?: HTMLDivElement | null): void;
|
|
16
17
|
export declare function handleOverlayMouseUp(ctx: Context, globalCache: GlobalCache, settings: Settings, e: MouseEvent, scrollbarX: HTMLDivElement, scrollbarY: HTMLDivElement, container: HTMLDivElement, cellInput: HTMLDivElement | null, fxInput: HTMLDivElement | null): void;
|
|
17
18
|
export declare function handleRowHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLDivElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
package/lib/events/mouse.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.handleOverlayMouseUp = handleOverlayMouseUp;
|
|
|
16
16
|
exports.handleRowFreezeHandleMouseDown = handleRowFreezeHandleMouseDown;
|
|
17
17
|
exports.handleRowHeaderMouseDown = handleRowHeaderMouseDown;
|
|
18
18
|
exports.handleRowSizeHandleMouseDown = handleRowSizeHandleMouseDown;
|
|
19
|
+
exports.mouseRender = mouseRender;
|
|
19
20
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
20
21
|
var _context = require("../context");
|
|
21
22
|
var _modules = require("../modules");
|
|
@@ -752,6 +753,7 @@ function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container
|
|
|
752
753
|
return;
|
|
753
754
|
}
|
|
754
755
|
if (ctx.luckysheet_select_status) {
|
|
756
|
+
console.log("ctx.scrollLeft", ctx.scrollLeft);
|
|
755
757
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
756
758
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
757
759
|
var _x = mouseX - ctx.rowHeaderWidth + ctx.scrollLeft;
|
package/lib/modules/selection.js
CHANGED
|
@@ -215,6 +215,7 @@ function selectTitlesRange(map) {
|
|
|
215
215
|
return rangeArr;
|
|
216
216
|
}
|
|
217
217
|
function pasteHandlerOfPaintModel(ctx, copyRange) {
|
|
218
|
+
var _a;
|
|
218
219
|
var cfg = ctx.config;
|
|
219
220
|
if (cfg.merge == null) {
|
|
220
221
|
cfg.merge = {};
|
|
@@ -404,36 +405,40 @@ function pasteHandlerOfPaintModel(ctx, copyRange) {
|
|
|
404
405
|
}
|
|
405
406
|
var currFile = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)];
|
|
406
407
|
currFile.config = cfg;
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
if (dataVerification != null) {
|
|
409
|
+
currFile.dataVerification = dataVerification;
|
|
410
|
+
}
|
|
409
411
|
var copyIndex = (0, _utils.getSheetIndex)(ctx, copySheetIndex);
|
|
410
|
-
if (
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
412
|
+
if (copyIndex != null) {
|
|
413
|
+
var ruleArr = _lodash.default.cloneDeep(ctx.luckysheetfile[copyIndex].luckysheet_conditionformat_save);
|
|
414
|
+
if (!_lodash.default.isNil(ruleArr) && ruleArr.length > 0) {
|
|
415
|
+
var currentIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
|
|
416
|
+
var existingCf = ctx.luckysheetfile[currentIndex].luckysheet_conditionformat_save;
|
|
417
|
+
var cdformat = (_a = _lodash.default.cloneDeep(existingCf)) !== null && _a !== void 0 ? _a : [];
|
|
418
|
+
for (var i = 0; i < ruleArr.length; i += 1) {
|
|
419
|
+
var cdformat_cellrange = ruleArr[i].cellrange;
|
|
420
|
+
var emptyRange = [];
|
|
421
|
+
for (var j = 0; j < cdformat_cellrange.length; j += 1) {
|
|
422
|
+
var range = (0, _ConditionFormat.CFSplitRange)(cdformat_cellrange[j], {
|
|
423
|
+
row: [c_r1, c_r2],
|
|
424
|
+
column: [c_c1, c_c2]
|
|
425
|
+
}, {
|
|
426
|
+
row: [minh, maxh],
|
|
427
|
+
column: [minc, maxc]
|
|
428
|
+
}, "operatePart");
|
|
429
|
+
if (range.length > 0) {
|
|
430
|
+
emptyRange = emptyRange.concat(range);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (emptyRange.length > 0) {
|
|
434
|
+
ruleArr[i].cellrange = [{
|
|
435
|
+
row: [minh, maxh],
|
|
436
|
+
column: [minc, maxc]
|
|
437
|
+
}];
|
|
438
|
+
cdformat.push(ruleArr[i]);
|
|
428
439
|
}
|
|
429
440
|
}
|
|
430
|
-
|
|
431
|
-
ruleArr[i].cellrange = [{
|
|
432
|
-
row: [minh, maxh],
|
|
433
|
-
column: [minc, maxc]
|
|
434
|
-
}];
|
|
435
|
-
cdformat.push(ruleArr[i]);
|
|
436
|
-
}
|
|
441
|
+
currFile.luckysheet_conditionformat_save = cdformat;
|
|
437
442
|
}
|
|
438
443
|
}
|
|
439
444
|
}
|
package/lib/modules/toolbar.js
CHANGED
|
@@ -760,6 +760,7 @@ function handleVerticalAlign(ctx, cellInput, value) {
|
|
|
760
760
|
setAttr(ctx, cellInput, "vt", value);
|
|
761
761
|
}
|
|
762
762
|
function handleFormatPainter(ctx) {
|
|
763
|
+
console.log("handleFormatPainter", ctx);
|
|
763
764
|
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
764
765
|
if (!allowEdit) return;
|
|
765
766
|
if (ctx.luckysheet_select_save == null || ctx.luckysheet_select_save.length === 0) {
|