@odoo/o-spreadsheet 16.3.0-alpha.8 → 16.3.1
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/o-spreadsheet.cjs.js +126 -53
- package/dist/o-spreadsheet.d.ts +27 -8
- package/dist/o-spreadsheet.esm.js +126 -53
- package/dist/o-spreadsheet.iife.js +126 -53
- package/dist/o-spreadsheet.iife.min.js +30 -7
- package/package.json +2 -2
|
@@ -4400,6 +4400,7 @@ exports.CommandResult = void 0;
|
|
|
4400
4400
|
CommandResult[CommandResult["EmptySplitSeparator"] = 89] = "EmptySplitSeparator";
|
|
4401
4401
|
CommandResult[CommandResult["SplitWillOverwriteContent"] = 90] = "SplitWillOverwriteContent";
|
|
4402
4402
|
CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 91] = "NoSplitSeparatorInSelection";
|
|
4403
|
+
CommandResult[CommandResult["NoActiveSheet"] = 92] = "NoActiveSheet";
|
|
4403
4404
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
4404
4405
|
|
|
4405
4406
|
const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
|
|
@@ -16872,6 +16873,7 @@ const unFreezePane = {
|
|
|
16872
16873
|
execute: (env) => env.model.dispatch("UNFREEZE_COLUMNS_ROWS", {
|
|
16873
16874
|
sheetId: env.model.getters.getActiveSheetId(),
|
|
16874
16875
|
}),
|
|
16876
|
+
icon: "o-spreadsheet-Icon.UNFREEZE",
|
|
16875
16877
|
};
|
|
16876
16878
|
const freezePane = {
|
|
16877
16879
|
name: _lt("Freeze"),
|
|
@@ -17549,7 +17551,7 @@ topbarMenuRegistry
|
|
|
17549
17551
|
})
|
|
17550
17552
|
.addChild("sort_range", ["data"], {
|
|
17551
17553
|
...sortRange,
|
|
17552
|
-
sequence:
|
|
17554
|
+
sequence: 10,
|
|
17553
17555
|
separator: true,
|
|
17554
17556
|
})
|
|
17555
17557
|
.addChild("sort_ascending", ["data", "sort_range"], {
|
|
@@ -17562,16 +17564,16 @@ topbarMenuRegistry
|
|
|
17562
17564
|
})
|
|
17563
17565
|
.addChild("split_to_columns", ["data"], {
|
|
17564
17566
|
...splitToColumns,
|
|
17565
|
-
sequence:
|
|
17567
|
+
sequence: 20,
|
|
17566
17568
|
separator: true,
|
|
17567
17569
|
})
|
|
17568
17570
|
.addChild("add_data_filter", ["data"], {
|
|
17569
17571
|
...addDataFilter,
|
|
17570
|
-
sequence:
|
|
17572
|
+
sequence: 30,
|
|
17571
17573
|
})
|
|
17572
17574
|
.addChild("remove_data_filter", ["data"], {
|
|
17573
17575
|
...removeDataFilter,
|
|
17574
|
-
sequence:
|
|
17576
|
+
sequence: 30,
|
|
17575
17577
|
});
|
|
17576
17578
|
|
|
17577
17579
|
class OTRegistry extends Registry {
|
|
@@ -17943,6 +17945,18 @@ css /* scss */ `
|
|
|
17943
17945
|
grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
|
|
17944
17946
|
grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
|
|
17945
17947
|
}
|
|
17948
|
+
.o-color-picker-toggler-button {
|
|
17949
|
+
display: flex;
|
|
17950
|
+
.o-color-picker-toggler-sign {
|
|
17951
|
+
margin: auto auto;
|
|
17952
|
+
width: 55%;
|
|
17953
|
+
height: 55%;
|
|
17954
|
+
.o-icon {
|
|
17955
|
+
width: 100%;
|
|
17956
|
+
height: 100%;
|
|
17957
|
+
}
|
|
17958
|
+
}
|
|
17959
|
+
}
|
|
17946
17960
|
.o-color-picker-line-item {
|
|
17947
17961
|
width: ${ITEM_EDGE_LENGTH}px;
|
|
17948
17962
|
height: ${ITEM_EDGE_LENGTH}px;
|
|
@@ -18678,6 +18692,18 @@ ChartPanel.props = {
|
|
|
18678
18692
|
onCloseSidePanel: Function,
|
|
18679
18693
|
};
|
|
18680
18694
|
|
|
18695
|
+
css /* scss */ `
|
|
18696
|
+
.o-spreadsheet {
|
|
18697
|
+
.o-icon {
|
|
18698
|
+
.small-text {
|
|
18699
|
+
font: bold 9px sans-serif;
|
|
18700
|
+
}
|
|
18701
|
+
.heavy-text {
|
|
18702
|
+
font: bold 16px sans-serif;
|
|
18703
|
+
}
|
|
18704
|
+
}
|
|
18705
|
+
}
|
|
18706
|
+
`;
|
|
18681
18707
|
// -----------------------------------------------------------------------------
|
|
18682
18708
|
// We need here the svg of the icons that we need to convert to images for the renderer
|
|
18683
18709
|
// -----------------------------------------------------------------------------
|
|
@@ -20603,7 +20629,14 @@ class ContentEditableHelper {
|
|
|
20603
20629
|
current = it.next();
|
|
20604
20630
|
}
|
|
20605
20631
|
if (current.value !== nodeToFind) {
|
|
20606
|
-
|
|
20632
|
+
/** This situation can happen if the code is called while the selection is not currently on the ContentEditableHelper.
|
|
20633
|
+
* In this case, we return 0 because we don't know the size of the text before the selection.
|
|
20634
|
+
*
|
|
20635
|
+
* A known occurence is triggered since the introduction of commit d4663158 (PR #2038).
|
|
20636
|
+
*
|
|
20637
|
+
* FIXME: find a way to test eventhough the selection API is not available in jsDOM.
|
|
20638
|
+
*/
|
|
20639
|
+
return 0;
|
|
20607
20640
|
}
|
|
20608
20641
|
else {
|
|
20609
20642
|
if (!current.value.hasChildNodes()) {
|
|
@@ -32194,6 +32227,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
32194
32227
|
"getSheetSize",
|
|
32195
32228
|
"getSheetZone",
|
|
32196
32229
|
"getPaneDivisions",
|
|
32230
|
+
"checkZonesExistInSheet",
|
|
32231
|
+
"getCommandZones",
|
|
32197
32232
|
];
|
|
32198
32233
|
sheetIdsMapName = {};
|
|
32199
32234
|
orderedSheetIds = [];
|
|
@@ -32203,7 +32238,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
32203
32238
|
// Command Handling
|
|
32204
32239
|
// ---------------------------------------------------------------------------
|
|
32205
32240
|
allowDispatch(cmd) {
|
|
32206
|
-
const genericChecks = this.chainValidations(this.checkSheetExists, this.
|
|
32241
|
+
const genericChecks = this.chainValidations(this.checkSheetExists, this.checkZonesAreInSheet)(cmd);
|
|
32207
32242
|
if (genericChecks !== 0 /* CommandResult.Success */) {
|
|
32208
32243
|
return genericChecks;
|
|
32209
32244
|
}
|
|
@@ -32543,6 +32578,37 @@ class SheetPlugin extends CorePlugin {
|
|
|
32543
32578
|
.map(({ col, row }) => this.getCell({ sheetId, col, row }))
|
|
32544
32579
|
.every((cell) => !cell || cell.content === "");
|
|
32545
32580
|
}
|
|
32581
|
+
getCommandZones(cmd) {
|
|
32582
|
+
const zones = [];
|
|
32583
|
+
if ("zone" in cmd) {
|
|
32584
|
+
zones.push(cmd.zone);
|
|
32585
|
+
}
|
|
32586
|
+
if ("target" in cmd) {
|
|
32587
|
+
zones.push(...cmd.target);
|
|
32588
|
+
}
|
|
32589
|
+
if ("ranges" in cmd) {
|
|
32590
|
+
zones.push(...cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone));
|
|
32591
|
+
}
|
|
32592
|
+
if ("col" in cmd && "row" in cmd) {
|
|
32593
|
+
zones.push({ top: cmd.row, left: cmd.col, bottom: cmd.row, right: cmd.col });
|
|
32594
|
+
}
|
|
32595
|
+
return zones;
|
|
32596
|
+
}
|
|
32597
|
+
/**
|
|
32598
|
+
* Check if zones in the command are well formed and
|
|
32599
|
+
* not outside the sheet.
|
|
32600
|
+
*/
|
|
32601
|
+
checkZonesExistInSheet(sheetId, zones) {
|
|
32602
|
+
if (!zones.every(isZoneValid))
|
|
32603
|
+
return 25 /* CommandResult.InvalidRange */;
|
|
32604
|
+
if (zones.length) {
|
|
32605
|
+
const sheetZone = this.getSheetZone(sheetId);
|
|
32606
|
+
return zones.every((zone) => isZoneInside(zone, sheetZone))
|
|
32607
|
+
? 0 /* CommandResult.Success */
|
|
32608
|
+
: 18 /* CommandResult.TargetOutOfSheet */;
|
|
32609
|
+
}
|
|
32610
|
+
return 0 /* CommandResult.Success */;
|
|
32611
|
+
}
|
|
32546
32612
|
updateCellPosition(cmd) {
|
|
32547
32613
|
const { sheetId, cellId, col, row } = cmd;
|
|
32548
32614
|
if (cellId) {
|
|
@@ -32991,9 +33057,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
32991
33057
|
}
|
|
32992
33058
|
return { rowNumber, colNumber };
|
|
32993
33059
|
}
|
|
32994
|
-
// ----------------------------------------------------
|
|
32995
|
-
// HIDE / SHOW
|
|
32996
|
-
// ----------------------------------------------------
|
|
32997
33060
|
/**
|
|
32998
33061
|
* Check that any "sheetId" in the command matches an existing
|
|
32999
33062
|
* sheet.
|
|
@@ -33011,27 +33074,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
33011
33074
|
* Check if zones in the command are well formed and
|
|
33012
33075
|
* not outside the sheet.
|
|
33013
33076
|
*/
|
|
33014
|
-
|
|
33015
|
-
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
}
|
|
33019
|
-
if ("target" in cmd && Array.isArray(cmd.target)) {
|
|
33020
|
-
zones.push(...cmd.target);
|
|
33021
|
-
}
|
|
33022
|
-
if ("ranges" in cmd && Array.isArray(cmd.ranges)) {
|
|
33023
|
-
zones.push(...cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone));
|
|
33024
|
-
}
|
|
33025
|
-
if (!zones.every(isZoneValid)) {
|
|
33026
|
-
return 25 /* CommandResult.InvalidRange */;
|
|
33027
|
-
}
|
|
33028
|
-
else if (zones.length && "sheetId" in cmd) {
|
|
33029
|
-
const sheetZone = this.getSheetZone(cmd.sheetId);
|
|
33030
|
-
return zones.every((zone) => isZoneInside(zone, sheetZone))
|
|
33031
|
-
? 0 /* CommandResult.Success */
|
|
33032
|
-
: 18 /* CommandResult.TargetOutOfSheet */;
|
|
33033
|
-
}
|
|
33034
|
-
return 0 /* CommandResult.Success */;
|
|
33077
|
+
checkZonesAreInSheet(cmd) {
|
|
33078
|
+
if (!("sheetId" in cmd))
|
|
33079
|
+
return 0 /* CommandResult.Success */;
|
|
33080
|
+
return this.checkZonesExistInSheet(cmd.sheetId, this.getCommandZones(cmd));
|
|
33035
33081
|
}
|
|
33036
33082
|
}
|
|
33037
33083
|
|
|
@@ -33622,7 +33668,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
33622
33668
|
}
|
|
33623
33669
|
break;
|
|
33624
33670
|
case "PASTE_CONDITIONAL_FORMAT":
|
|
33625
|
-
this.pasteCf(cmd.
|
|
33671
|
+
this.pasteCf(cmd.originPosition, cmd.targetPosition, cmd.operation);
|
|
33626
33672
|
break;
|
|
33627
33673
|
}
|
|
33628
33674
|
}
|
|
@@ -38607,18 +38653,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
38607
38653
|
// Command Handling
|
|
38608
38654
|
// ---------------------------------------------------------------------------
|
|
38609
38655
|
allowDispatch(cmd) {
|
|
38610
|
-
|
|
38611
|
-
case "AUTORESIZE_ROWS":
|
|
38612
|
-
case "AUTORESIZE_COLUMNS":
|
|
38613
|
-
try {
|
|
38614
|
-
this.getters.getSheet(cmd.sheetId);
|
|
38615
|
-
break;
|
|
38616
|
-
}
|
|
38617
|
-
catch (error) {
|
|
38618
|
-
return 27 /* CommandResult.InvalidSheetId */;
|
|
38619
|
-
}
|
|
38620
|
-
}
|
|
38621
|
-
return 0 /* CommandResult.Success */;
|
|
38656
|
+
return this.chainValidations(this.checkSheetExists, this.checkZonesAreInSheet)(cmd);
|
|
38622
38657
|
}
|
|
38623
38658
|
handle(cmd) {
|
|
38624
38659
|
switch (cmd.type) {
|
|
@@ -38653,7 +38688,8 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
38653
38688
|
getCellWidth(position) {
|
|
38654
38689
|
const text = this.getCellText(position);
|
|
38655
38690
|
const style = this.getters.getCellComputedStyle(position);
|
|
38656
|
-
|
|
38691
|
+
const multiLineText = text.split(NEWLINE);
|
|
38692
|
+
let contentWidth = Math.max(...multiLineText.map((line) => this.getTextWidth(line, style)));
|
|
38657
38693
|
const icon = this.getters.getConditionalIcon(position);
|
|
38658
38694
|
if (icon) {
|
|
38659
38695
|
contentWidth += computeIconWidth(this.getters.getCellStyle(position));
|
|
@@ -38818,6 +38854,31 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
38818
38854
|
splitWord.push(wordPart);
|
|
38819
38855
|
return splitWord;
|
|
38820
38856
|
}
|
|
38857
|
+
/**
|
|
38858
|
+
* Check that any "sheetId" in the command matches an existing
|
|
38859
|
+
* sheet.
|
|
38860
|
+
*/
|
|
38861
|
+
checkSheetExists(cmd) {
|
|
38862
|
+
if ("sheetId" in cmd && this.getters.tryGetSheet(cmd.sheetId) === undefined) {
|
|
38863
|
+
return 27 /* CommandResult.InvalidSheetId */;
|
|
38864
|
+
}
|
|
38865
|
+
return 0 /* CommandResult.Success */;
|
|
38866
|
+
}
|
|
38867
|
+
/**
|
|
38868
|
+
* Check if zones in the command are well formed and
|
|
38869
|
+
* not outside the sheet.
|
|
38870
|
+
*/
|
|
38871
|
+
checkZonesAreInSheet(cmd) {
|
|
38872
|
+
const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
|
|
38873
|
+
const zones = this.getters.getCommandZones(cmd);
|
|
38874
|
+
if (!sheetId && zones.length > 0) {
|
|
38875
|
+
return 92 /* CommandResult.NoActiveSheet */;
|
|
38876
|
+
}
|
|
38877
|
+
if (sheetId && zones.length > 0) {
|
|
38878
|
+
return this.getters.checkZonesExistInSheet(sheetId, zones);
|
|
38879
|
+
}
|
|
38880
|
+
return 0 /* CommandResult.Success */;
|
|
38881
|
+
}
|
|
38821
38882
|
}
|
|
38822
38883
|
|
|
38823
38884
|
const genericRepeatsTransforms = [
|
|
@@ -39642,8 +39703,8 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
39642
39703
|
this.pasteCell(origin, position, this.operation, clipboardOptions);
|
|
39643
39704
|
if (shouldPasteCF) {
|
|
39644
39705
|
this.dispatch("PASTE_CONDITIONAL_FORMAT", {
|
|
39645
|
-
|
|
39646
|
-
|
|
39706
|
+
originPosition: origin.position,
|
|
39707
|
+
targetPosition: position,
|
|
39647
39708
|
operation: this.operation,
|
|
39648
39709
|
});
|
|
39649
39710
|
}
|
|
@@ -40034,7 +40095,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
40034
40095
|
allowDispatch(cmd) {
|
|
40035
40096
|
switch (cmd.type) {
|
|
40036
40097
|
case "CUT":
|
|
40037
|
-
const zones = cmd.
|
|
40098
|
+
const zones = cmd.cutTarget || this.getters.getSelectedZones();
|
|
40038
40099
|
const state = this.getClipboardState(zones, cmd.type);
|
|
40039
40100
|
return state.isCutAllowed(zones);
|
|
40040
40101
|
case "PASTE":
|
|
@@ -40064,7 +40125,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
40064
40125
|
switch (cmd.type) {
|
|
40065
40126
|
case "COPY":
|
|
40066
40127
|
case "CUT":
|
|
40067
|
-
const zones = ("
|
|
40128
|
+
const zones = ("cutTarget" in cmd && cmd.cutTarget) || this.getters.getSelectedZones();
|
|
40068
40129
|
this.state = this.getClipboardState(zones, cmd.type);
|
|
40069
40130
|
this.status = "visible";
|
|
40070
40131
|
break;
|
|
@@ -41020,6 +41081,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41020
41081
|
"isSelected",
|
|
41021
41082
|
"isSingleColSelected",
|
|
41022
41083
|
"getElementsFromSelection",
|
|
41084
|
+
"tryGetActiveSheetId",
|
|
41023
41085
|
];
|
|
41024
41086
|
gridSelection = {
|
|
41025
41087
|
anchor: {
|
|
@@ -41235,6 +41297,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41235
41297
|
getActiveSheetId() {
|
|
41236
41298
|
return this.activeSheet.id;
|
|
41237
41299
|
}
|
|
41300
|
+
tryGetActiveSheetId() {
|
|
41301
|
+
return this.activeSheet?.id;
|
|
41302
|
+
}
|
|
41238
41303
|
getActiveCell() {
|
|
41239
41304
|
return this.getters.getEvaluatedCell(this.getActivePosition());
|
|
41240
41305
|
}
|
|
@@ -41481,7 +41546,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41481
41546
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
41482
41547
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
41483
41548
|
this.dispatch("CUT", {
|
|
41484
|
-
|
|
41549
|
+
cutTarget: [
|
|
41485
41550
|
{
|
|
41486
41551
|
left: isCol ? start + deltaCol : 0,
|
|
41487
41552
|
right: isCol ? end + deltaCol : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
@@ -43753,6 +43818,10 @@ class Spreadsheet extends owl.Component {
|
|
|
43753
43818
|
}
|
|
43754
43819
|
checkViewportSize() {
|
|
43755
43820
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
43821
|
+
if (!isFinite(xRatio) || !isFinite(yRatio)) {
|
|
43822
|
+
// before mounting, the ratios can be NaN or Infinity if the viewport size is 0
|
|
43823
|
+
return;
|
|
43824
|
+
}
|
|
43756
43825
|
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
43757
43826
|
if (this.isViewportTooSmall) {
|
|
43758
43827
|
return;
|
|
@@ -46975,6 +47044,7 @@ class Model extends EventBus {
|
|
|
46975
47044
|
coreGetters;
|
|
46976
47045
|
uuidGenerator;
|
|
46977
47046
|
handlers = [];
|
|
47047
|
+
uiHandlers = [];
|
|
46978
47048
|
coreHandlers = [];
|
|
46979
47049
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
46980
47050
|
super();
|
|
@@ -47014,17 +47084,20 @@ class Model extends EventBus {
|
|
|
47014
47084
|
const plugin = this.setupUiPlugin(Plugin);
|
|
47015
47085
|
this.statefulUIPlugins.push(plugin);
|
|
47016
47086
|
this.handlers.push(plugin);
|
|
47087
|
+
this.uiHandlers.push(plugin);
|
|
47017
47088
|
}
|
|
47018
47089
|
for (let Plugin of coreViewsPluginRegistry.getAll()) {
|
|
47019
47090
|
const plugin = this.setupUiPlugin(Plugin);
|
|
47020
47091
|
this.coreViewsPlugins.push(plugin);
|
|
47021
47092
|
this.handlers.push(plugin);
|
|
47093
|
+
this.uiHandlers.push(plugin);
|
|
47022
47094
|
this.coreHandlers.push(plugin);
|
|
47023
47095
|
}
|
|
47024
47096
|
for (let Plugin of featurePluginRegistry.getAll()) {
|
|
47025
47097
|
const plugin = this.setupUiPlugin(Plugin);
|
|
47026
47098
|
this.featurePlugins.push(plugin);
|
|
47027
47099
|
this.handlers.push(plugin);
|
|
47100
|
+
this.uiHandlers.push(plugin);
|
|
47028
47101
|
}
|
|
47029
47102
|
this.uuidGenerator.setIsFastStrategy(false);
|
|
47030
47103
|
// starting plugins
|
|
@@ -47193,7 +47266,7 @@ class Model extends EventBus {
|
|
|
47193
47266
|
return new DispatchResult(results.flat());
|
|
47194
47267
|
}
|
|
47195
47268
|
checkDispatchAllowedLocalCommand(command) {
|
|
47196
|
-
const results = this.
|
|
47269
|
+
const results = this.uiHandlers.map((handler) => handler.allowDispatch(command));
|
|
47197
47270
|
return new DispatchResult(results.flat());
|
|
47198
47271
|
}
|
|
47199
47272
|
finalize() {
|
|
@@ -47510,6 +47583,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
47510
47583
|
exports.tokenize = tokenize;
|
|
47511
47584
|
|
|
47512
47585
|
|
|
47513
|
-
__info__.version = '16.3.
|
|
47514
|
-
__info__.date = '2023-05-
|
|
47515
|
-
__info__.hash = '
|
|
47586
|
+
__info__.version = '16.3.1';
|
|
47587
|
+
__info__.date = '2023-05-25T13:00:27.320Z';
|
|
47588
|
+
__info__.hash = 'b3cfd2c';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1179,6 +1179,7 @@ declare class Model extends EventBus<any> implements CommandDispatcher {
|
|
|
1179
1179
|
private coreGetters;
|
|
1180
1180
|
uuidGenerator: UuidGenerator;
|
|
1181
1181
|
private readonly handlers;
|
|
1182
|
+
private readonly uiHandlers;
|
|
1182
1183
|
private readonly coreHandlers;
|
|
1183
1184
|
constructor(data?: any, config?: Partial<ModelConfig>, stateUpdateMessages?: StateUpdateMessage[], uuidGenerator?: UuidGenerator, verboseImport?: boolean);
|
|
1184
1185
|
joinSession(): void;
|
|
@@ -1880,7 +1881,7 @@ interface CopyCommand {
|
|
|
1880
1881
|
interface CutCommand {
|
|
1881
1882
|
type: "CUT";
|
|
1882
1883
|
/** Zones to cut. If none were given, will copy the zones in the selection*/
|
|
1883
|
-
|
|
1884
|
+
cutTarget?: Zone[];
|
|
1884
1885
|
}
|
|
1885
1886
|
interface PasteCommand {
|
|
1886
1887
|
type: "PASTE";
|
|
@@ -2191,8 +2192,8 @@ interface InsertCellCommand {
|
|
|
2191
2192
|
}
|
|
2192
2193
|
interface PasteCFCommand {
|
|
2193
2194
|
type: "PASTE_CONDITIONAL_FORMAT";
|
|
2194
|
-
|
|
2195
|
-
|
|
2195
|
+
originPosition: CellPosition;
|
|
2196
|
+
targetPosition: CellPosition;
|
|
2196
2197
|
operation: "CUT" | "COPY";
|
|
2197
2198
|
}
|
|
2198
2199
|
interface ActivateNextSheetCommand {
|
|
@@ -2353,7 +2354,8 @@ declare const enum CommandResult {
|
|
|
2353
2354
|
MoreThanOneColumnSelected = 88,
|
|
2354
2355
|
EmptySplitSeparator = 89,
|
|
2355
2356
|
SplitWillOverwriteContent = 90,
|
|
2356
|
-
NoSplitSeparatorInSelection = 91
|
|
2357
|
+
NoSplitSeparatorInSelection = 91,
|
|
2358
|
+
NoActiveSheet = 92
|
|
2357
2359
|
}
|
|
2358
2360
|
interface CommandHandler<T> {
|
|
2359
2361
|
allowDispatch(command: T): CommandResult | CommandResult[];
|
|
@@ -3543,7 +3545,7 @@ interface SheetState$1 {
|
|
|
3543
3545
|
readonly cellPosition: Record<UID, CellPosition | undefined>;
|
|
3544
3546
|
}
|
|
3545
3547
|
declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
|
|
3546
|
-
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions"];
|
|
3548
|
+
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones"];
|
|
3547
3549
|
readonly sheetIdsMapName: Record<string, UID | undefined>;
|
|
3548
3550
|
readonly orderedSheetIds: UID[];
|
|
3549
3551
|
readonly sheets: Record<UID, Sheet | undefined>;
|
|
@@ -3589,6 +3591,12 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
|
|
|
3589
3591
|
* Check if a zone only contains empty cells
|
|
3590
3592
|
*/
|
|
3591
3593
|
isEmpty(sheetId: UID, zone: Zone): boolean;
|
|
3594
|
+
getCommandZones(cmd: Command): Zone[];
|
|
3595
|
+
/**
|
|
3596
|
+
* Check if zones in the command are well formed and
|
|
3597
|
+
* not outside the sheet.
|
|
3598
|
+
*/
|
|
3599
|
+
checkZonesExistInSheet(sheetId: UID, zones: Zone[]): CommandResult;
|
|
3592
3600
|
private updateCellPosition;
|
|
3593
3601
|
/**
|
|
3594
3602
|
* Set the cell at a new position and clear its previous position.
|
|
@@ -3682,7 +3690,7 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
|
|
|
3682
3690
|
* Check if zones in the command are well formed and
|
|
3683
3691
|
* not outside the sheet.
|
|
3684
3692
|
*/
|
|
3685
|
-
private
|
|
3693
|
+
private checkZonesAreInSheet;
|
|
3686
3694
|
}
|
|
3687
3695
|
|
|
3688
3696
|
/**
|
|
@@ -4562,7 +4570,7 @@ declare class UIOptionsPlugin extends UIPlugin {
|
|
|
4562
4570
|
declare class SheetUIPlugin extends UIPlugin {
|
|
4563
4571
|
static getters: readonly ["getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getColDimensions", "getRowDimensions", "getColRowOffset"];
|
|
4564
4572
|
private ctx;
|
|
4565
|
-
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
4573
|
+
allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
|
|
4566
4574
|
handle(cmd: Command): void;
|
|
4567
4575
|
getCellWidth(position: CellPosition): number;
|
|
4568
4576
|
getTextWidth(text: string, style: Style): Pixel;
|
|
@@ -4590,6 +4598,16 @@ declare class SheetUIPlugin extends UIPlugin {
|
|
|
4590
4598
|
getColRowOffset(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex, sheetId?: UID): Pixel;
|
|
4591
4599
|
private getColMaxWidth;
|
|
4592
4600
|
private splitWordToSpecificWidth;
|
|
4601
|
+
/**
|
|
4602
|
+
* Check that any "sheetId" in the command matches an existing
|
|
4603
|
+
* sheet.
|
|
4604
|
+
*/
|
|
4605
|
+
private checkSheetExists;
|
|
4606
|
+
/**
|
|
4607
|
+
* Check if zones in the command are well formed and
|
|
4608
|
+
* not outside the sheet.
|
|
4609
|
+
*/
|
|
4610
|
+
private checkZonesAreInSheet;
|
|
4593
4611
|
}
|
|
4594
4612
|
|
|
4595
4613
|
/**
|
|
@@ -4637,7 +4655,7 @@ declare class ClipboardPlugin extends UIPlugin {
|
|
|
4637
4655
|
*/
|
|
4638
4656
|
declare class GridSelectionPlugin extends UIPlugin {
|
|
4639
4657
|
static layers: LAYERS[];
|
|
4640
|
-
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection"];
|
|
4658
|
+
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection", "tryGetActiveSheetId"];
|
|
4641
4659
|
private gridSelection;
|
|
4642
4660
|
private selectedFigureId;
|
|
4643
4661
|
private sheetsData;
|
|
@@ -4649,6 +4667,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4649
4667
|
handle(cmd: Command): void;
|
|
4650
4668
|
getActiveSheet(): Readonly<Sheet>;
|
|
4651
4669
|
getActiveSheetId(): UID;
|
|
4670
|
+
tryGetActiveSheetId(): UID | undefined;
|
|
4652
4671
|
getActiveCell(): EvaluatedCell;
|
|
4653
4672
|
getActiveCols(): Set<number>;
|
|
4654
4673
|
getActiveRows(): Set<number>;
|