@odoo/o-spreadsheet 17.4.1 → 17.4.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/dist/o-spreadsheet.cjs.js +18 -10
- package/dist/o-spreadsheet.esm.js +18 -10
- package/dist/o-spreadsheet.iife.js +18 -10
- package/dist/o-spreadsheet.iife.min.js +3 -3
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +4 -7
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2024-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.2
|
|
6
|
+
* @date 2024-07-24T10:26:00.237Z
|
|
7
|
+
* @hash f5ede5b
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -35871,6 +35871,7 @@ class PivotLayoutConfigurator extends owl.Component {
|
|
|
35871
35871
|
"__rows_title__",
|
|
35872
35872
|
...rows.map((row) => row.nameWithGranularity),
|
|
35873
35873
|
];
|
|
35874
|
+
const allDimensions = columns.concat(rows);
|
|
35874
35875
|
const offset = 1; // column title
|
|
35875
35876
|
const draggableItems = draggableIds.map((id, index) => ({
|
|
35876
35877
|
id,
|
|
@@ -35893,8 +35894,12 @@ class PivotLayoutConfigurator extends owl.Component {
|
|
|
35893
35894
|
const columns = draggedItems.slice(0, draggedItems.indexOf("__rows_title__"));
|
|
35894
35895
|
const rows = draggedItems.slice(draggedItems.indexOf("__rows_title__") + 1);
|
|
35895
35896
|
this.props.onDimensionsUpdated({
|
|
35896
|
-
columns: columns
|
|
35897
|
-
|
|
35897
|
+
columns: columns
|
|
35898
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35899
|
+
.filter(isDefined),
|
|
35900
|
+
rows: rows
|
|
35901
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35902
|
+
.filter(isDefined),
|
|
35898
35903
|
});
|
|
35899
35904
|
},
|
|
35900
35905
|
});
|
|
@@ -40207,10 +40212,13 @@ function useCellHovered(env, gridRef, callback) {
|
|
|
40207
40212
|
row: undefined,
|
|
40208
40213
|
};
|
|
40209
40214
|
const { Date } = window;
|
|
40210
|
-
let x =
|
|
40211
|
-
let y =
|
|
40215
|
+
let x = undefined;
|
|
40216
|
+
let y = undefined;
|
|
40212
40217
|
let lastMoved = 0;
|
|
40213
40218
|
function getPosition() {
|
|
40219
|
+
if (x === undefined || y === undefined) {
|
|
40220
|
+
return { col: -1, row: -1 };
|
|
40221
|
+
}
|
|
40214
40222
|
const col = env.model.getters.getColIndex(x);
|
|
40215
40223
|
const row = env.model.getters.getRowIndex(y);
|
|
40216
40224
|
return { col, row };
|
|
@@ -68399,6 +68407,6 @@ exports.tokenColors = tokenColors;
|
|
|
68399
68407
|
exports.tokenize = tokenize;
|
|
68400
68408
|
|
|
68401
68409
|
|
|
68402
|
-
__info__.version = "17.4.
|
|
68403
|
-
__info__.date = "2024-07-
|
|
68404
|
-
__info__.hash = "
|
|
68410
|
+
__info__.version = "17.4.2";
|
|
68411
|
+
__info__.date = "2024-07-24T10:26:00.237Z";
|
|
68412
|
+
__info__.hash = "f5ede5b";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2024-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.2
|
|
6
|
+
* @date 2024-07-24T10:26:00.237Z
|
|
7
|
+
* @hash f5ede5b
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -35869,6 +35869,7 @@ class PivotLayoutConfigurator extends Component {
|
|
|
35869
35869
|
"__rows_title__",
|
|
35870
35870
|
...rows.map((row) => row.nameWithGranularity),
|
|
35871
35871
|
];
|
|
35872
|
+
const allDimensions = columns.concat(rows);
|
|
35872
35873
|
const offset = 1; // column title
|
|
35873
35874
|
const draggableItems = draggableIds.map((id, index) => ({
|
|
35874
35875
|
id,
|
|
@@ -35891,8 +35892,12 @@ class PivotLayoutConfigurator extends Component {
|
|
|
35891
35892
|
const columns = draggedItems.slice(0, draggedItems.indexOf("__rows_title__"));
|
|
35892
35893
|
const rows = draggedItems.slice(draggedItems.indexOf("__rows_title__") + 1);
|
|
35893
35894
|
this.props.onDimensionsUpdated({
|
|
35894
|
-
columns: columns
|
|
35895
|
-
|
|
35895
|
+
columns: columns
|
|
35896
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35897
|
+
.filter(isDefined),
|
|
35898
|
+
rows: rows
|
|
35899
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35900
|
+
.filter(isDefined),
|
|
35896
35901
|
});
|
|
35897
35902
|
},
|
|
35898
35903
|
});
|
|
@@ -40205,10 +40210,13 @@ function useCellHovered(env, gridRef, callback) {
|
|
|
40205
40210
|
row: undefined,
|
|
40206
40211
|
};
|
|
40207
40212
|
const { Date } = window;
|
|
40208
|
-
let x =
|
|
40209
|
-
let y =
|
|
40213
|
+
let x = undefined;
|
|
40214
|
+
let y = undefined;
|
|
40210
40215
|
let lastMoved = 0;
|
|
40211
40216
|
function getPosition() {
|
|
40217
|
+
if (x === undefined || y === undefined) {
|
|
40218
|
+
return { col: -1, row: -1 };
|
|
40219
|
+
}
|
|
40212
40220
|
const col = env.model.getters.getColIndex(x);
|
|
40213
40221
|
const row = env.model.getters.getRowIndex(y);
|
|
40214
40222
|
return { col, row };
|
|
@@ -68354,6 +68362,6 @@ const constants = {
|
|
|
68354
68362
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
68355
68363
|
|
|
68356
68364
|
|
|
68357
|
-
__info__.version = "17.4.
|
|
68358
|
-
__info__.date = "2024-07-
|
|
68359
|
-
__info__.hash = "
|
|
68365
|
+
__info__.version = "17.4.2";
|
|
68366
|
+
__info__.date = "2024-07-24T10:26:00.237Z";
|
|
68367
|
+
__info__.hash = "f5ede5b";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2024-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.2
|
|
6
|
+
* @date 2024-07-24T10:26:00.237Z
|
|
7
|
+
* @hash f5ede5b
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -35870,6 +35870,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35870
35870
|
"__rows_title__",
|
|
35871
35871
|
...rows.map((row) => row.nameWithGranularity),
|
|
35872
35872
|
];
|
|
35873
|
+
const allDimensions = columns.concat(rows);
|
|
35873
35874
|
const offset = 1; // column title
|
|
35874
35875
|
const draggableItems = draggableIds.map((id, index) => ({
|
|
35875
35876
|
id,
|
|
@@ -35892,8 +35893,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35892
35893
|
const columns = draggedItems.slice(0, draggedItems.indexOf("__rows_title__"));
|
|
35893
35894
|
const rows = draggedItems.slice(draggedItems.indexOf("__rows_title__") + 1);
|
|
35894
35895
|
this.props.onDimensionsUpdated({
|
|
35895
|
-
columns: columns
|
|
35896
|
-
|
|
35896
|
+
columns: columns
|
|
35897
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35898
|
+
.filter(isDefined),
|
|
35899
|
+
rows: rows
|
|
35900
|
+
.map((nameWithGranularity) => allDimensions.find((dimension) => dimension.nameWithGranularity === nameWithGranularity))
|
|
35901
|
+
.filter(isDefined),
|
|
35897
35902
|
});
|
|
35898
35903
|
},
|
|
35899
35904
|
});
|
|
@@ -40206,10 +40211,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40206
40211
|
row: undefined,
|
|
40207
40212
|
};
|
|
40208
40213
|
const { Date } = window;
|
|
40209
|
-
let x =
|
|
40210
|
-
let y =
|
|
40214
|
+
let x = undefined;
|
|
40215
|
+
let y = undefined;
|
|
40211
40216
|
let lastMoved = 0;
|
|
40212
40217
|
function getPosition() {
|
|
40218
|
+
if (x === undefined || y === undefined) {
|
|
40219
|
+
return { col: -1, row: -1 };
|
|
40220
|
+
}
|
|
40213
40221
|
const col = env.model.getters.getColIndex(x);
|
|
40214
40222
|
const row = env.model.getters.getRowIndex(y);
|
|
40215
40223
|
return { col, row };
|
|
@@ -68398,9 +68406,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68398
68406
|
exports.tokenize = tokenize;
|
|
68399
68407
|
|
|
68400
68408
|
|
|
68401
|
-
__info__.version = "17.4.
|
|
68402
|
-
__info__.date = "2024-07-
|
|
68403
|
-
__info__.hash = "
|
|
68409
|
+
__info__.version = "17.4.2";
|
|
68410
|
+
__info__.date = "2024-07-24T10:26:00.237Z";
|
|
68411
|
+
__info__.hash = "f5ede5b";
|
|
68404
68412
|
|
|
68405
68413
|
|
|
68406
68414
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -1208,7 +1208,7 @@
|
|
|
1208
1208
|
min-width: 120px;
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
|
-
`;class _I extends t.Component{static template="o-spreadsheet-PivotDimension";static props={dimension:Object,onRemoved:{type:Function,optional:!0},slots:{type:Object,optional:!0}}}class DI extends t.Component{static template="o-spreadsheet-PivotDimensionGranularity";static props={dimension:Object,onUpdated:Function,availableGranularities:Set,allGranularities:Array};periods=qr}class FI extends t.Component{static template="o-spreadsheet-PivotDimensionOrder";static props={dimension:Object,onUpdated:Function}}class MI extends t.Component{static template="o-spreadsheet-PivotLayoutConfigurator";static components={AddDimensionButton:OI,PivotDimension:_I,PivotDimensionOrder:FI,PivotDimensionGranularity:DI};static props={definition:Object,onDimensionsUpdated:Function,unusedGroupableFields:Array,unusedMeasureFields:Array,unusedDateTimeGranularities:Object,allGranularities:Array};dimensionsRef=t.useRef("pivot-dimensions");dragAndDrop=KE();AGGREGATORS=$r;isDateField=Yr;startDragAndDrop(e,t){if(0!==t.button||"SELECT"===t.target.tagName)return;const o=this.getDimensionElementsRects(),s=this.props.definition,{columns:i,rows:n}=s,r=[...i.map((e=>e.nameWithGranularity)),"__rows_title__",...n.map((e=>e.nameWithGranularity))],a=r.map(((e,t)=>({id:e,size:o[t+1].height,position:o[t+1].y})));this.dragAndDrop.start("vertical",{draggedItemId:e.nameWithGranularity,initialMousePosition:t.clientY,items:
|
|
1211
|
+
`;class _I extends t.Component{static template="o-spreadsheet-PivotDimension";static props={dimension:Object,onRemoved:{type:Function,optional:!0},slots:{type:Object,optional:!0}}}class DI extends t.Component{static template="o-spreadsheet-PivotDimensionGranularity";static props={dimension:Object,onUpdated:Function,availableGranularities:Set,allGranularities:Array};periods=qr}class FI extends t.Component{static template="o-spreadsheet-PivotDimensionOrder";static props={dimension:Object,onUpdated:Function}}class MI extends t.Component{static template="o-spreadsheet-PivotLayoutConfigurator";static components={AddDimensionButton:OI,PivotDimension:_I,PivotDimensionOrder:FI,PivotDimensionGranularity:DI};static props={definition:Object,onDimensionsUpdated:Function,unusedGroupableFields:Array,unusedMeasureFields:Array,unusedDateTimeGranularities:Object,allGranularities:Array};dimensionsRef=t.useRef("pivot-dimensions");dragAndDrop=KE();AGGREGATORS=$r;isDateField=Yr;startDragAndDrop(e,t){if(0!==t.button||"SELECT"===t.target.tagName)return;const o=this.getDimensionElementsRects(),s=this.props.definition,{columns:i,rows:n}=s,r=[...i.map((e=>e.nameWithGranularity)),"__rows_title__",...n.map((e=>e.nameWithGranularity))],a=i.concat(n),l=r.map(((e,t)=>({id:e,size:o[t+1].height,position:o[t+1].y})));this.dragAndDrop.start("vertical",{draggedItemId:e.nameWithGranularity,initialMousePosition:t.clientY,items:l,containerEl:this.dimensionsRef.el,onDragEnd:(e,t)=>{const o=r.findIndex((t=>t===e));if(o===t)return;const s=[...r];s.splice(o,1),s.splice(t,0,e);const i=s.slice(0,s.indexOf("__rows_title__")),n=s.slice(s.indexOf("__rows_title__")+1);this.props.onDimensionsUpdated({columns:i.map((e=>a.find((t=>t.nameWithGranularity===e)))).filter(De),rows:n.map((e=>a.find((t=>t.nameWithGranularity===e)))).filter(De)})}})}startDragAndDropMeasures(e,t){if(0!==t.button||"SELECT"===t.target.tagName)return;const o=this.getDimensionElementsRects(),s=this.props.definition,{measures:i,columns:n,rows:r}=s,a=i.map((e=>e.name)),l=3+n.length+r.length,c=a.map(((e,t)=>({id:e,size:o[t+l].height,position:o[t+l].y})));this.dragAndDrop.start("vertical",{draggedItemId:e.name,initialMousePosition:t.clientY,items:c,containerEl:this.dimensionsRef.el,onDragEnd:(e,t)=>{const o=a.findIndex((t=>t===e));if(o===t)return;const s=[...a];s.splice(o,1),s.splice(t,0,e),this.props.onDimensionsUpdated({measures:s.map((e=>i.find((t=>t.name===e)))).filter(De)})}})}getDimensionElementsRects(){return Array.from(this.dimensionsRef.el.children).map((e=>{const t=getComputedStyle(e),o=e.getBoundingClientRect();return{x:o.x,y:o.y,width:o.width+parseInt(t.marginLeft||"0")+parseInt(t.marginRight||"0"),height:o.height+parseInt(t.marginTop||"0")+parseInt(t.marginBottom||"0")}}))}removeDimension(e){const{columns:t,rows:o}=this.props.definition;this.props.onDimensionsUpdated({columns:t.filter((t=>t.nameWithGranularity!==e.nameWithGranularity)),rows:o.filter((t=>t.nameWithGranularity!==e.nameWithGranularity))})}removeMeasureDimension(e){const{measures:t}=this.props.definition;this.props.onDimensionsUpdated({measures:t.filter((t=>t.name!==e.name))})}addColumnDimension(e){const{columns:t}=this.props.definition;this.props.onDimensionsUpdated({columns:t.concat([{name:e,order:"asc"}])})}addRowDimension(e){const{rows:t}=this.props.definition;this.props.onDimensionsUpdated({rows:t.concat([{name:e,order:"asc"}])})}addMeasureDimension(e){const{measures:t}=this.props.definition;this.props.onDimensionsUpdated({measures:t.concat([{name:e,aggregator:this.getDefaultMeasureAggregator(e)}])})}getDefaultMeasureAggregator(e){const t=this.props.unusedMeasureFields.find((t=>t.name===e));return t?.aggregator?t.aggregator:"count"}updateAggregator(e,t){const{measures:o}=this.props.definition;this.props.onDimensionsUpdated({measures:o.map((o=>o===e?{...o,aggregator:t}:o))})}updateOrder(e,t){const{rows:o,columns:s}=this.props.definition;this.props.onDimensionsUpdated({rows:o.map((o=>o.nameWithGranularity===e.nameWithGranularity?{...o,order:t||void 0}:o)),columns:s.map((o=>o.nameWithGranularity===e.nameWithGranularity?{...o,order:t||void 0}:o))})}updateGranularity(e,t){const{rows:o,columns:s}=this.props.definition;this.props.onDimensionsUpdated({rows:o.map((o=>o.nameWithGranularity===e.nameWithGranularity?{...o,granularity:t}:o)),columns:s.map((o=>o.nameWithGranularity===e.nameWithGranularity?{...o,granularity:t}:o))})}}Rb`
|
|
1212
1212
|
.os-cog-wheel-menu-icon {
|
|
1213
1213
|
cursor: pointer;
|
|
1214
1214
|
}
|
|
@@ -1576,7 +1576,7 @@
|
|
|
1576
1576
|
margin-left: 8px;
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
`;class QR extends t.Component{static template="o-spreadsheet-GridAddRowsFooter";static props={focusGrid:Function};static components={ValidationMessages:mE};inputRef=t.useRef("inputRef");state=t.useState({inputValue:"100",errorFlag:!1});setup(){t.useExternalListener(window,"click",this.onExternalClick,{capture:!0})}get addRowsPosition(){const e=this.env.model.getters.getActiveSheetId(),{numberOfRows:t}=this.env.model.getters.getSheetSize(e),{scrollY:o}=this.env.model.getters.getActiveSheetScrollInfo();return Ob({top:`${this.env.model.getters.getRowDimensions(e,t-1).end-o}px`})}get errorMessages(){return[uo("Please enter a number between 0 and 10000.")]}onKeydown(e){"ESCAPE"===e.key.toUpperCase()?this.props.focusGrid():"ENTER"===e.key.toUpperCase()&&this.onConfirm()}onInput(e){const t=e.target.value;this.state.inputValue=t;const o=Number(t);this.state.errorFlag=Number.isNaN(o)||o<=0||o>1e4}onConfirm(){if(this.state.errorFlag)return;const e=Number(this.state.inputValue),t=this.env.model.getters.getActiveSheetId(),o=this.env.model.getters.getNumberRows(t);this.env.model.dispatch("ADD_COLUMNS_ROWS",{sheetId:t,position:"after",base:o-1,quantity:e,dimension:"ROW"}),this.props.focusGrid();const{scrollX:s}=this.env.model.getters.getActiveSheetDOMScrollInfo(),{end:i}=this.env.model.getters.getRowDimensions(t,o+e-1);this.env.model.dispatch("SET_VIEWPORT_OFFSET",{offsetX:s,offsetY:i})}onExternalClick(e){this.inputRef.el===document.activeElement&&e.target!==this.inputRef.el&&this.props.focusGrid()}}function JR(e,o,s){let i={col:void 0,row:void 0};const{Date:n}=window;let r
|
|
1579
|
+
`;class QR extends t.Component{static template="o-spreadsheet-GridAddRowsFooter";static props={focusGrid:Function};static components={ValidationMessages:mE};inputRef=t.useRef("inputRef");state=t.useState({inputValue:"100",errorFlag:!1});setup(){t.useExternalListener(window,"click",this.onExternalClick,{capture:!0})}get addRowsPosition(){const e=this.env.model.getters.getActiveSheetId(),{numberOfRows:t}=this.env.model.getters.getSheetSize(e),{scrollY:o}=this.env.model.getters.getActiveSheetScrollInfo();return Ob({top:`${this.env.model.getters.getRowDimensions(e,t-1).end-o}px`})}get errorMessages(){return[uo("Please enter a number between 0 and 10000.")]}onKeydown(e){"ESCAPE"===e.key.toUpperCase()?this.props.focusGrid():"ENTER"===e.key.toUpperCase()&&this.onConfirm()}onInput(e){const t=e.target.value;this.state.inputValue=t;const o=Number(t);this.state.errorFlag=Number.isNaN(o)||o<=0||o>1e4}onConfirm(){if(this.state.errorFlag)return;const e=Number(this.state.inputValue),t=this.env.model.getters.getActiveSheetId(),o=this.env.model.getters.getNumberRows(t);this.env.model.dispatch("ADD_COLUMNS_ROWS",{sheetId:t,position:"after",base:o-1,quantity:e,dimension:"ROW"}),this.props.focusGrid();const{scrollX:s}=this.env.model.getters.getActiveSheetDOMScrollInfo(),{end:i}=this.env.model.getters.getRowDimensions(t,o+e-1);this.env.model.dispatch("SET_VIEWPORT_OFFSET",{offsetX:s,offsetY:i})}onExternalClick(e){this.inputRef.el===document.activeElement&&e.target!==this.inputRef.el&&this.props.focusGrid()}}function JR(e,o,s){let i={col:void 0,row:void 0};const{Date:n}=window;let r,a,l=0;function c(){if(void 0===r||void 0===a)return{col:-1,row:-1};return{col:e.model.getters.getColIndex(r),row:e.model.getters.getRowIndex(a)}}const{pause:h,resume:d}=function(e,o){let s;const{setInterval:i,clearInterval:n}=window;return t.useEffect((()=>(s=i(e,o),()=>n(s))),(()=>[o])),{pause:()=>{n(s),s=void 0},resume:()=>{void 0===s&&(s=i(e,o))}}}((function(){const{col:e,row:t}=c(),o=n.now()-l;o>300&&(e!==i.col||t!==i.row)&&g(void 0,void 0);if(o>300){if(e<0||t<0)return;g(e,t)}}),200);function u(e){o.el===e.target&&(r=e.offsetX,a=e.offsetY,l=n.now())}function g(e,t){e===i.col&&t===i.row||(i.col=e,i.row=t,s({col:e,row:t}))}return oI(o,"pointermove",u),oI(o,"mouseleave",(function(e){const t=e.offsetX,s=e.offsetY,i=Nb(o.el);return s<0||s>i.height||t<0||t>i.width?u(e):h()})),oI(o,"mouseenter",d),oI(o,"pointerdown",(function(){const{col:e,row:t}=c();e===i.col&&t===i.row||g(void 0,void 0)})),t.useExternalListener(window,"click",(function(e){const t=e.target;o.el.contains(t)||g(void 0,void 0)})),i}Rb`
|
|
1580
1580
|
.o-paint-format-cursor {
|
|
1581
1581
|
cursor: url("data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="16"><path d="M6.5.4c1.3-.8 2.9-.1 3.8 1.4l2.9 5.1c.2.4.9 1.6-.4 2.3l-1.6.9 1.8 3.1c.2.4.1 1-.2 1.2l-1.6 1c-.3.1-.9 0-1.1-.4l-1.8-3.1-1.6 1c-.6.4-1.7 0-2.2-.8L0 4.3"/><path fill="#fff" d="M9.1 2a1.4 1.1 60 0 0-1.7-.6L5.5 2.5l.9 1.6-1 .6-.9-1.6-.6.4 1.8 3.1-1.3.7-1.8-3.1-1 .6 3.8 6.6 6.8-3.98M3.9 8.8 10.82 5l.795 1.4-6.81 3.96"/></svg>\n')}"), auto;
|
|
1582
1582
|
}
|
|
@@ -3100,4 +3100,4 @@
|
|
|
3100
3100
|
<tableParts count="${e.tables.length}">
|
|
3101
3101
|
${SO(a)}
|
|
3102
3102
|
</tableParts>
|
|
3103
|
-
`}var tM;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(tM||(tM={}));function oM(e,t={}){const o=ge(t);return o.type=e,o}const sM={},iM={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:_,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:D,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:M},nM={autoCompleteProviders:Ja,autofillModifiersRegistry:yv,autofillRulesRegistry:Cv,cellMenuRegistry:fw,colMenuRegistry:tE,errorTypes:Po,linkMenuRegistry:Cy,functionRegistry:bb,featurePluginRegistry:wD,iconsOnCellRegistry:qE,statefulUIPluginRegistry:xD,coreViewsPluginRegistry:ED,corePluginRegistry:CD,rowMenuRegistry:nE,sidePanelRegistry:xR,figureRegistry:HS,chartSidePanelComponentRegistry:BE,chartComponentRegistry:MS,chartRegistry:FS,chartSubtypeRegistry:PS,topbarMenuRegistry:aE,topbarComponentRegistry:ER,clickableCellRegistry:ID,otRegistry:lE,inverseCommandRegistry:WS,urlRegistry:La,cellPopoverRegistry:Tv,numberFormatMenuRegistry:oE,repeatLocalCommandTransformRegistry:bD,repeatCommandTransformRegistry:fD,clipboardHandlersRegistries:aa,pivotRegistry:KI,pivotTimeAdapterRegistry:Dr,pivotSidePanelRegistry:eR,pivotNormalizationValueRegistry:sa,supportedPivotPositionalFormulaRegistry:Sv,pivotToFunctionValueRegistry:ia},rM={arg:Ic,isEvaluationError:Go,toBoolean:is,toJsDate:ns,toNumber:Zo,toString:ts,toNormalizedPivotValue:Jr,toXC:It,toZone:Li,toUnboundedZone:Pi,toCartesian:Et,numberToLetters:Ct,lettersToNumber:wt,UuidGenerator:Pn,formatValue:zs,createCurrencyFormat:si,ColorGenerator:yt,computeTextWidth:yn,createEmptyWorkbookData:jO,createEmptySheet:ZO,createEmptyExcelSheet:YO,getDefaultChartJsRuntime:eS,chartFontColor:Yl,getChartAxisTitleRuntime:Jl,getFillingMode:iS,rgbaToHex:ht,colorToRGBA:dt,positionToZone:on,isDefined:De,isMatrix:_o,lazy:ke,genericRepeat:vD,createAction:Vn,createActions:Ln,transformRangeData:ca,deepEquals:He,overlap:Zi,union:Wi,isInside:ji,deepCopy:ge,expandZoneOnInsertion:Hi,reduceZoneOnDeletion:$i,unquote:me,getMaxObjectId:Gr,getFunctionsFromTokens:dv,getFirstPivotFunction:bv,getNumberOfPivotFunctions:vv,parseDimension:jr,isDateField:Yr,makeFieldProposal:gv,insertTokenAfterArgSeparator:pv,insertTokenAfterLeftParenthesis:mv,mergeContiguousZones:ln,getPivotHighlights:rE,pivotTimeAdapter:Fr,UNDO_REDO_PIVOT_COMMANDS:$_,createPivotFormula:Qr,areDomainArgsFieldsValid:Kr},aM={isMarkdownLink:xe,parseMarkdownLink:Re,markdownLink:Ie,openLink:za,urlRepresentation:Ha},lM={Checkbox:cE,Section:hE,RoundColorPicker:_E,ChartDataSeries:pE,ChartErrorSection:fE,ChartLabelRange:bE,ChartTitle:DE,ChartPanel:GE,ChartFigure:kS,ChartJsComponent:nc,Grid:CT,GridOverlay:eT,ScorecardChart:Cc,LineConfigPanel:kE,BarConfigPanel:SE,PieChartDesignPanel:VE,GenericChartConfigPanel:vE,ChartWithAxisDesignPanel:NE,GaugeChartConfigPanel:PE,GaugeChartDesignPanel:LE,ScorecardChartConfigPanel:UE,ScorecardChartDesignPanel:HE,ChartTypePicker:$E,FigureComponent:IR,Menu:wy,Popover:oy,SelectionInput:gE,ValidationMessages:mE,AddDimensionButton:OI,PivotDimensionGranularity:DI,PivotDimensionOrder:FI,PivotDimension:_I,PivotLayoutConfigurator:MI,EditableName:PI,PivotDeferUpdate:AI,PivotTitleSection:LI,CogWheelMenu:NI},cM={useDragAndDropListItems:KE,useHighlights:iI,useHighlightsOnHover:sI},hM={useStoreProvider:El,DependencyContainer:Cl,CellPopoverStore:XS,ComposerFocusStore:Ul,ComposerStore:Vl,FindAndReplaceStore:EI,HighlightStore:Pl,HoveredCellStore:YS,ModelStore:_l,NotificationStore:Ll,RendererStore:Fl,SelectionInputStore:uE,SpreadsheetStore:Ml,useStore:Il,useLocalStore:Rl,SidePanelStore:bT,PivotSidePanelStore:QI};const dM={DEFAULT_LOCALE:Ao,HIGHLIGHT_COLOR:s,PIVOT_TABLE_CONFIG:he,ChartTerms:rl};e.AbstractCellClipboardHandler=$n,e.AbstractChart=rc,e.AbstractFigureClipboardHandler=ra,e.CellErrorType=No,e.CorePlugin=KO,e.DispatchResult=xo,e.EvaluationError=Lo,e.Model=class extends yl{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new Pn,n=!0){const r=performance.now();console.group("Model creation"),super(),lo===ro&&co===ao&&(co=()=>!0),s=WO(e,s);const a=BO(e,n);this.state=new gF,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new s_(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dF(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of CD.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of ED.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of xD.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of wD.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.info("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.info("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.info("Model created in",performance.now()-r,"ms"),console.groupEnd()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave(this.exportData())}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new iD(lF({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:uo("Anonymous").toString()},o=e.transportService||new eF;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(To));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat,customColors:this.config.customColors||[]}}checkDispatchAllowed(e){const t=wo(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new xo(t.flat()):xo.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(oM(e,t));dispatch=(e,t)=>{const o=oM(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!yo.has(i.type)))return new xo("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new xo("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();wo(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.info(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(wo(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(wo(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return xo.Success};dispatchFromCorePlugin=(e,t)=>{const o=oM(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,xo.Success};dispatchToHandlers(e,t){const o=wo(t);for(const s of e)!o&&s instanceof KO||s.beforeHandle(t);for(const s of e)!o&&s instanceof KO||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=jO();for(let t of this.handlers)t instanceof KO&&t.export(e);return e.revisionId=this.session.getRevisionId()||j,e=ge(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...jO(),sheets:[YO(zO,"Sheet1")]};for(let t of this.handlers)t instanceof XO&&t.exportForExcel(e);return e=ge(e),JF(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=kI,e.Registry=Un,e.Revision=oD,e.SPREADSHEET_DIMENSIONS=iM,e.Spreadsheet=JD,e.SpreadsheetPivotTable=HI,e.UIPlugin=n_,e.__info__=sM,e.addFunction=function e(t,o){return bb.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(Fo[e])throw new Error(`Layer ${e} already exists`);Fo[e]=t},e.astToFormula=Da,e.compile=av,e.compileTokens=lv,e.components=lM,e.constants=dM,e.convertAstNodes=Ta,e.coreTypes=Co,e.findCellInNewZone=tn,e.functionCache=rv,e.helpers=rM,e.hooks=cM,e.invalidateCFEvaluationCommands=vo,e.invalidateDependenciesCommands=bo,e.invalidateEvaluationCommands=fo,e.iterateAstNodes=Aa,e.links=aM,e.load=BO,e.parse=Ia,e.parseTokens=Ra,e.readonlyAllowedCommands=yo,e.registries=nM,e.setDefaultSheetViewSize=function(e){re=e},e.setTranslationMethod=function(e,t=(()=>!0)){lo=e,co=t},e.stores=hM,e.tokenColors=Kb,e.tokenize=qn,sM.version="17.4.1",sM.date="2024-07-18T14:25:54.421Z",sM.hash="fd7deaa"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
3103
|
+
`}var tM;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(tM||(tM={}));function oM(e,t={}){const o=ge(t);return o.type=e,o}const sM={},iM={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:_,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:D,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:M},nM={autoCompleteProviders:Ja,autofillModifiersRegistry:yv,autofillRulesRegistry:Cv,cellMenuRegistry:fw,colMenuRegistry:tE,errorTypes:Po,linkMenuRegistry:Cy,functionRegistry:bb,featurePluginRegistry:wD,iconsOnCellRegistry:qE,statefulUIPluginRegistry:xD,coreViewsPluginRegistry:ED,corePluginRegistry:CD,rowMenuRegistry:nE,sidePanelRegistry:xR,figureRegistry:HS,chartSidePanelComponentRegistry:BE,chartComponentRegistry:MS,chartRegistry:FS,chartSubtypeRegistry:PS,topbarMenuRegistry:aE,topbarComponentRegistry:ER,clickableCellRegistry:ID,otRegistry:lE,inverseCommandRegistry:WS,urlRegistry:La,cellPopoverRegistry:Tv,numberFormatMenuRegistry:oE,repeatLocalCommandTransformRegistry:bD,repeatCommandTransformRegistry:fD,clipboardHandlersRegistries:aa,pivotRegistry:KI,pivotTimeAdapterRegistry:Dr,pivotSidePanelRegistry:eR,pivotNormalizationValueRegistry:sa,supportedPivotPositionalFormulaRegistry:Sv,pivotToFunctionValueRegistry:ia},rM={arg:Ic,isEvaluationError:Go,toBoolean:is,toJsDate:ns,toNumber:Zo,toString:ts,toNormalizedPivotValue:Jr,toXC:It,toZone:Li,toUnboundedZone:Pi,toCartesian:Et,numberToLetters:Ct,lettersToNumber:wt,UuidGenerator:Pn,formatValue:zs,createCurrencyFormat:si,ColorGenerator:yt,computeTextWidth:yn,createEmptyWorkbookData:jO,createEmptySheet:ZO,createEmptyExcelSheet:YO,getDefaultChartJsRuntime:eS,chartFontColor:Yl,getChartAxisTitleRuntime:Jl,getFillingMode:iS,rgbaToHex:ht,colorToRGBA:dt,positionToZone:on,isDefined:De,isMatrix:_o,lazy:ke,genericRepeat:vD,createAction:Vn,createActions:Ln,transformRangeData:ca,deepEquals:He,overlap:Zi,union:Wi,isInside:ji,deepCopy:ge,expandZoneOnInsertion:Hi,reduceZoneOnDeletion:$i,unquote:me,getMaxObjectId:Gr,getFunctionsFromTokens:dv,getFirstPivotFunction:bv,getNumberOfPivotFunctions:vv,parseDimension:jr,isDateField:Yr,makeFieldProposal:gv,insertTokenAfterArgSeparator:pv,insertTokenAfterLeftParenthesis:mv,mergeContiguousZones:ln,getPivotHighlights:rE,pivotTimeAdapter:Fr,UNDO_REDO_PIVOT_COMMANDS:$_,createPivotFormula:Qr,areDomainArgsFieldsValid:Kr},aM={isMarkdownLink:xe,parseMarkdownLink:Re,markdownLink:Ie,openLink:za,urlRepresentation:Ha},lM={Checkbox:cE,Section:hE,RoundColorPicker:_E,ChartDataSeries:pE,ChartErrorSection:fE,ChartLabelRange:bE,ChartTitle:DE,ChartPanel:GE,ChartFigure:kS,ChartJsComponent:nc,Grid:CT,GridOverlay:eT,ScorecardChart:Cc,LineConfigPanel:kE,BarConfigPanel:SE,PieChartDesignPanel:VE,GenericChartConfigPanel:vE,ChartWithAxisDesignPanel:NE,GaugeChartConfigPanel:PE,GaugeChartDesignPanel:LE,ScorecardChartConfigPanel:UE,ScorecardChartDesignPanel:HE,ChartTypePicker:$E,FigureComponent:IR,Menu:wy,Popover:oy,SelectionInput:gE,ValidationMessages:mE,AddDimensionButton:OI,PivotDimensionGranularity:DI,PivotDimensionOrder:FI,PivotDimension:_I,PivotLayoutConfigurator:MI,EditableName:PI,PivotDeferUpdate:AI,PivotTitleSection:LI,CogWheelMenu:NI},cM={useDragAndDropListItems:KE,useHighlights:iI,useHighlightsOnHover:sI},hM={useStoreProvider:El,DependencyContainer:Cl,CellPopoverStore:XS,ComposerFocusStore:Ul,ComposerStore:Vl,FindAndReplaceStore:EI,HighlightStore:Pl,HoveredCellStore:YS,ModelStore:_l,NotificationStore:Ll,RendererStore:Fl,SelectionInputStore:uE,SpreadsheetStore:Ml,useStore:Il,useLocalStore:Rl,SidePanelStore:bT,PivotSidePanelStore:QI};const dM={DEFAULT_LOCALE:Ao,HIGHLIGHT_COLOR:s,PIVOT_TABLE_CONFIG:he,ChartTerms:rl};e.AbstractCellClipboardHandler=$n,e.AbstractChart=rc,e.AbstractFigureClipboardHandler=ra,e.CellErrorType=No,e.CorePlugin=KO,e.DispatchResult=xo,e.EvaluationError=Lo,e.Model=class extends yl{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new Pn,n=!0){const r=performance.now();console.group("Model creation"),super(),lo===ro&&co===ao&&(co=()=>!0),s=WO(e,s);const a=BO(e,n);this.state=new gF,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new s_(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dF(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of CD.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of ED.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of xD.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of wD.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.info("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.info("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.info("Model created in",performance.now()-r,"ms"),console.groupEnd()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave(this.exportData())}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new iD(lF({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:uo("Anonymous").toString()},o=e.transportService||new eF;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(To));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat,customColors:this.config.customColors||[]}}checkDispatchAllowed(e){const t=wo(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new xo(t.flat()):xo.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(oM(e,t));dispatch=(e,t)=>{const o=oM(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!yo.has(i.type)))return new xo("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new xo("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();wo(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.info(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(wo(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(wo(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return xo.Success};dispatchFromCorePlugin=(e,t)=>{const o=oM(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,xo.Success};dispatchToHandlers(e,t){const o=wo(t);for(const s of e)!o&&s instanceof KO||s.beforeHandle(t);for(const s of e)!o&&s instanceof KO||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=jO();for(let t of this.handlers)t instanceof KO&&t.export(e);return e.revisionId=this.session.getRevisionId()||j,e=ge(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...jO(),sheets:[YO(zO,"Sheet1")]};for(let t of this.handlers)t instanceof XO&&t.exportForExcel(e);return e=ge(e),JF(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=kI,e.Registry=Un,e.Revision=oD,e.SPREADSHEET_DIMENSIONS=iM,e.Spreadsheet=JD,e.SpreadsheetPivotTable=HI,e.UIPlugin=n_,e.__info__=sM,e.addFunction=function e(t,o){return bb.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(Fo[e])throw new Error(`Layer ${e} already exists`);Fo[e]=t},e.astToFormula=Da,e.compile=av,e.compileTokens=lv,e.components=lM,e.constants=dM,e.convertAstNodes=Ta,e.coreTypes=Co,e.findCellInNewZone=tn,e.functionCache=rv,e.helpers=rM,e.hooks=cM,e.invalidateCFEvaluationCommands=vo,e.invalidateDependenciesCommands=bo,e.invalidateEvaluationCommands=fo,e.iterateAstNodes=Aa,e.links=aM,e.load=BO,e.parse=Ia,e.parseTokens=Ra,e.readonlyAllowedCommands=yo,e.registries=nM,e.setDefaultSheetViewSize=function(e){re=e},e.setTranslationMethod=function(e,t=(()=>!0)){lo=e,co=t},e.stores=hM,e.tokenColors=Kb,e.tokenize=qn,sM.version="17.4.2",sM.date="2024-07-24T10:26:00.237Z",sM.hash="f5ede5b"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
3
3
|
@see https://github.com/odoo/o-spreadsheet
|
|
4
|
-
@version 17.4.
|
|
5
|
-
@date 2024-07-
|
|
6
|
-
@hash
|
|
4
|
+
@version 17.4.2
|
|
5
|
+
@date 2024-07-24T10:26:49.691Z
|
|
6
|
+
@hash f5ede5b
|
|
7
7
|
-->
|
|
8
8
|
<odoo>
|
|
9
9
|
<t t-name="o-spreadsheet-ActionButton">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/o-spreadsheet",
|
|
3
|
-
"version": "17.4.
|
|
3
|
+
"version": "17.4.2",
|
|
4
4
|
"description": "A spreadsheet component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/o-spreadsheet.cjs.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build": "npm-run-all build:js build:bundleJs \"build:bundleXml -- --outDir build\"",
|
|
25
25
|
"doc": "typedoc",
|
|
26
26
|
"precommit": "npm run prettier && npm run doc",
|
|
27
|
-
"test": "jest",
|
|
27
|
+
"test": "tsc --noEmit --project tsconfig.jest.json && jest",
|
|
28
28
|
"test:watch": "jest --watch",
|
|
29
29
|
"prettier": "prettier . --write",
|
|
30
30
|
"check-formatting": "prettier . --check",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@prettier/plugin-xml": "^2.2.0",
|
|
60
60
|
"@rollup/plugin-node-resolve": "^15.2.0",
|
|
61
61
|
"@rollup/plugin-terser": "^0.4.3",
|
|
62
|
+
"@swc/jest": "^0.2.36",
|
|
62
63
|
"@types/jest": "^27.0.1",
|
|
63
64
|
"@types/node": "^13.13.23",
|
|
64
65
|
"@types/rbush": "^3.0.3",
|
|
@@ -89,7 +90,6 @@
|
|
|
89
90
|
"rollup": "^3.28.0",
|
|
90
91
|
"rollup-plugin-dts": "^5.3.1",
|
|
91
92
|
"rollup-plugin-typescript2": "^0.35.0",
|
|
92
|
-
"ts-jest": "^29.1.0",
|
|
93
93
|
"typedoc": "0.25.12",
|
|
94
94
|
"typedoc-plugin-markdown": "3.17.1",
|
|
95
95
|
"typescript": "^5.4.3",
|
|
@@ -114,10 +114,7 @@
|
|
|
114
114
|
],
|
|
115
115
|
"transform": {
|
|
116
116
|
"^.+\\.ts?$": [
|
|
117
|
-
"
|
|
118
|
-
{
|
|
119
|
-
"tsconfig": "tsconfig.jest.json"
|
|
120
|
-
}
|
|
117
|
+
"@swc/jest"
|
|
121
118
|
]
|
|
122
119
|
},
|
|
123
120
|
"verbose": false,
|