@odoo/o-spreadsheet 17.2.0 → 17.3.0-alpha.0
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.
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
5
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.
|
|
7
|
-
* @date 2024-03-
|
|
8
|
-
* @hash
|
|
6
|
+
* @version 17.3.0-alpha.0
|
|
7
|
+
* @date 2024-03-20T13:42:32.042Z
|
|
8
|
+
* @hash 073e154
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
@@ -60167,6 +60167,6 @@ exports.tokenColors = tokenColors;
|
|
|
60167
60167
|
exports.tokenize = tokenize;
|
|
60168
60168
|
|
|
60169
60169
|
|
|
60170
|
-
__info__.version = "17.
|
|
60171
|
-
__info__.date = "2024-03-
|
|
60172
|
-
__info__.hash = "
|
|
60170
|
+
__info__.version = "17.3.0-alpha.0";
|
|
60171
|
+
__info__.date = "2024-03-20T13:42:32.042Z";
|
|
60172
|
+
__info__.hash = "073e154";
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
5
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.
|
|
7
|
-
* @date 2024-03-
|
|
8
|
-
* @hash
|
|
6
|
+
* @version 17.3.0-alpha.0
|
|
7
|
+
* @date 2024-03-20T13:42:32.042Z
|
|
8
|
+
* @hash 073e154
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { reactive, useEnv, useSubEnv, useState, onWillUnmount, markRaw, toRaw, Component, useRef, onMounted, useEffect, onPatched, useComponent, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv } from '@odoo/owl';
|
|
@@ -60124,6 +60124,6 @@ const constants = {
|
|
|
60124
60124
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, 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 };
|
|
60125
60125
|
|
|
60126
60126
|
|
|
60127
|
-
__info__.version = "17.
|
|
60128
|
-
__info__.date = "2024-03-
|
|
60129
|
-
__info__.hash = "
|
|
60127
|
+
__info__.version = "17.3.0-alpha.0";
|
|
60128
|
+
__info__.date = "2024-03-20T13:42:32.042Z";
|
|
60129
|
+
__info__.hash = "073e154";
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
5
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.
|
|
7
|
-
* @date 2024-03-
|
|
8
|
-
* @hash
|
|
6
|
+
* @version 17.3.0-alpha.0
|
|
7
|
+
* @date 2024-03-20T13:42:32.042Z
|
|
8
|
+
* @hash 073e154
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function (exports, owl) {
|
|
@@ -60166,9 +60166,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60166
60166
|
exports.tokenize = tokenize;
|
|
60167
60167
|
|
|
60168
60168
|
|
|
60169
|
-
__info__.version = "17.
|
|
60170
|
-
__info__.date = "2024-03-
|
|
60171
|
-
__info__.hash = "
|
|
60169
|
+
__info__.version = "17.3.0-alpha.0";
|
|
60170
|
+
__info__.date = "2024-03-20T13:42:32.042Z";
|
|
60171
|
+
__info__.hash = "073e154";
|
|
60172
60172
|
|
|
60173
60173
|
|
|
60174
60174
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -2692,4 +2692,4 @@
|
|
|
2692
2692
|
<tableParts count="${e.tables.length}">
|
|
2693
2693
|
${dI(a)}
|
|
2694
2694
|
</tableParts>
|
|
2695
|
-
`}var eM;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(eM||(eM={}));function tM(e,t={}){const o=ce(t);return o.type=e,o}const oM={},sM={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:I,HEADER_WIDTH:T,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:A,DEFAULT_CELL_HEIGHT:O,SCROLLBAR_WIDTH:M},iM={autoCompleteProviders:Br,autofillModifiersRegistry:Um,autofillRulesRegistry:Bm,cellMenuRegistry:HS,colMenuRegistry:wy,errorTypes:xo,linkMenuRegistry:zb,functionRegistry:Vm,featurePluginRegistry:wA,statefulUIPluginRegistry:xA,coreViewsPluginRegistry:RA,corePluginRegistry:EA,rowMenuRegistry:Iy,sidePanelRegistry:rw,figureRegistry:ab,chartSidePanelComponentRegistry:sE,chartComponentRegistry:Xf,chartRegistry:Yf,topbarMenuRegistry:Ty,topbarComponentRegistry:aw,clickableCellRegistry:IA,otRegistry:Ay,inverseCommandRegistry:db,urlRegistry:wr,cellPopoverRegistry:qm,numberFormatMenuRegistry:xy,repeatLocalCommandTransformRegistry:bA,repeatCommandTransformRegistry:fA,clipboardHandlersRegistries:jn},nM={arg:al,isEvaluationError:Fo,toBoolean:Wo,toJsDate:qo,toNumber:Lo,toString:zo,toXC:bt,toZone:gi,toUnboundedZone:ui,toCartesian:ft,numberToLetters:dt,lettersToNumber:gt,UuidGenerator:rn,formatValue:Ts,createCurrencyFormat:Gs,computeTextWidth:Yi,createEmptyWorkbookData:BI,createEmptySheet:UI,createEmptyExcelSheet:HI,getDefaultChartJsRuntime:Cf,chartFontColor:Va,ChartColors:ka,getFillingMode:xf,rgbaToHex:st,colorToRGBA:it,positionToZone:Li,isDefined:Te,isMatrix:So,lazy:Fe,genericRepeat:vA,createAction:cn,createActions:an,transformRangeData:Xn,deepEquals:Pe,overlap:xi,union:yi,isInside:Ri,deepCopy:ce,expandZoneOnInsertion:bi,reduceZoneOnDeletion:Ci,unquote:de},rM={isMarkdownLink:Se,parseMarkdownLink:Ee,markdownLink:ye,openLink:Ar,urlRepresentation:Tr},aM={Checkbox:Ly,Section:Py,ChartColor:jy,ChartDataSeries:ky,ChartErrorSection:Vy,ChartLabelRange:Uy,ChartTitle:Yy,ChartPanel:nE,ChartFigure:ib,ChartJsComponent:Ra,Grid:hx,GridOverlay:Zw,ScorecardChart:sl,LineConfigPanel:Jy,LineBarPieDesignPanel:Xy,BarConfigPanel:Hy,LineBarPieConfigPanel:By,GaugeChartConfigPanel:Ky,GaugeChartDesignPanel:Qy,ScorecardChartConfigPanel:tE,ScorecardChartDesignPanel:oE,FigureComponent:lw,Menu:Jb,Popover:wb,SelectionInput:Fy,ValidationMessages:Dy},lM={useDragAndDropListItems:hE,useHighlights:bE,useHighlightsOnHover:fE},cM={useStoreProvider:ua,DependencyContainer:aa,CellPopoverStore:bb,ComposerFocusStore:xa,ComposerStore:wa,FindAndReplaceStore:kE,HighlightStore:Ca,HoveredCellStore:fb,ModelStore:fa,NotificationStore:ya,RendererStore:ba,SelectionInputStore:Ny,SpreadsheetStore:va,useStore:ga,useLocalStore:pa,SidePanelStore:lx};const hM={DEFAULT_LOCALE:bo,HIGHLIGHT_COLOR:s};e.AbstractCellClipboardHandler=pn,e.AbstractChart=Ia,e.AbstractFigureClipboardHandler=Zn,e.CellErrorType=wo,e.CorePlugin=GI,e.DispatchResult=uo,e.EvaluationError=Ro,e.Model=class extends jT{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 rn,n=!0){super(),s=PI(e,s);const r=DI(e,n);this.state=new uO,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(r.revisionId),this.coreGetters={},this.range=new cT(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.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.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dO(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of EA.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of RA.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 xA.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of wA.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}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 rA(lO({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:to("Anonymous").toString()},o=e.transportService||new JA;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(fo));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,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=ho(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new uo(t.flat()):uo.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(tM(e,t));dispatch=(e,t)=>{const o=tM(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!lo.has(i.type)))return new uo("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new uo("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((()=>{ho(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(ho(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(ho(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return uo.Success};dispatchFromCorePlugin=(e,t)=>{const o=tM(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,uo.Success};dispatchToHandlers(e,t){const o=ho(t);for(const s of e)!o&&s instanceof GI||s.beforeHandle(t);for(const s of e)!o&&s instanceof GI||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=BI();for(let t of this.handlers)t instanceof GI&&t.export(e);return e.revisionId=this.session.getRevisionId()||W,e=ce(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...BI(),sheets:[HI(FI,"Sheet1")]};for(let t of this.handlers)t instanceof zI&&t.exportForExcel(e);return e=ce(e),QO(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=hn,e.Revision=iA,e.SPREADSHEET_DIMENSIONS=sM,e.Spreadsheet=QA,e.UIPlugin=hT,e.__info__=oM,e.addFunction=function e(t,o){return Vm.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(yo[e])throw new Error(`Layer ${e} already exists`);yo[e]=t},e.astToFormula=ur,e.compile=QI,e.compileTokens=JI,e.components=aM,e.constants=hM,e.convertAstNodes=lr,e.coreTypes=co,e.findCellInNewZone=Fi,e.functionCache=KI,e.helpers=nM,e.hooks=lM,e.invalidateCFEvaluationCommands=ao,e.invalidateDependenciesCommands=ro,e.invalidateEvaluationCommands=no,e.iterateAstNodes=cr,e.links=rM,e.load=DI,e.parse=rr,e.parseTokens=ar,e.readonlyAllowedCommands=lo,e.registries=iM,e.setDefaultSheetViewSize=function(e){se=e},e.setTranslationMethod=function(e,t=(()=>!0)){Qt=e,Jt=t},e.stores=cM,e.tokenColors=Iw,e.tokenize=bn,oM.version="17.2.0",oM.date="2024-03-20T08:12:44.398Z",oM.hash="1869c24"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
2695
|
+
`}var eM;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(eM||(eM={}));function tM(e,t={}){const o=ce(t);return o.type=e,o}const oM={},sM={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:I,HEADER_WIDTH:T,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:A,DEFAULT_CELL_HEIGHT:O,SCROLLBAR_WIDTH:M},iM={autoCompleteProviders:Br,autofillModifiersRegistry:Um,autofillRulesRegistry:Bm,cellMenuRegistry:HS,colMenuRegistry:wy,errorTypes:xo,linkMenuRegistry:zb,functionRegistry:Vm,featurePluginRegistry:wA,statefulUIPluginRegistry:xA,coreViewsPluginRegistry:RA,corePluginRegistry:EA,rowMenuRegistry:Iy,sidePanelRegistry:rw,figureRegistry:ab,chartSidePanelComponentRegistry:sE,chartComponentRegistry:Xf,chartRegistry:Yf,topbarMenuRegistry:Ty,topbarComponentRegistry:aw,clickableCellRegistry:IA,otRegistry:Ay,inverseCommandRegistry:db,urlRegistry:wr,cellPopoverRegistry:qm,numberFormatMenuRegistry:xy,repeatLocalCommandTransformRegistry:bA,repeatCommandTransformRegistry:fA,clipboardHandlersRegistries:jn},nM={arg:al,isEvaluationError:Fo,toBoolean:Wo,toJsDate:qo,toNumber:Lo,toString:zo,toXC:bt,toZone:gi,toUnboundedZone:ui,toCartesian:ft,numberToLetters:dt,lettersToNumber:gt,UuidGenerator:rn,formatValue:Ts,createCurrencyFormat:Gs,computeTextWidth:Yi,createEmptyWorkbookData:BI,createEmptySheet:UI,createEmptyExcelSheet:HI,getDefaultChartJsRuntime:Cf,chartFontColor:Va,ChartColors:ka,getFillingMode:xf,rgbaToHex:st,colorToRGBA:it,positionToZone:Li,isDefined:Te,isMatrix:So,lazy:Fe,genericRepeat:vA,createAction:cn,createActions:an,transformRangeData:Xn,deepEquals:Pe,overlap:xi,union:yi,isInside:Ri,deepCopy:ce,expandZoneOnInsertion:bi,reduceZoneOnDeletion:Ci,unquote:de},rM={isMarkdownLink:Se,parseMarkdownLink:Ee,markdownLink:ye,openLink:Ar,urlRepresentation:Tr},aM={Checkbox:Ly,Section:Py,ChartColor:jy,ChartDataSeries:ky,ChartErrorSection:Vy,ChartLabelRange:Uy,ChartTitle:Yy,ChartPanel:nE,ChartFigure:ib,ChartJsComponent:Ra,Grid:hx,GridOverlay:Zw,ScorecardChart:sl,LineConfigPanel:Jy,LineBarPieDesignPanel:Xy,BarConfigPanel:Hy,LineBarPieConfigPanel:By,GaugeChartConfigPanel:Ky,GaugeChartDesignPanel:Qy,ScorecardChartConfigPanel:tE,ScorecardChartDesignPanel:oE,FigureComponent:lw,Menu:Jb,Popover:wb,SelectionInput:Fy,ValidationMessages:Dy},lM={useDragAndDropListItems:hE,useHighlights:bE,useHighlightsOnHover:fE},cM={useStoreProvider:ua,DependencyContainer:aa,CellPopoverStore:bb,ComposerFocusStore:xa,ComposerStore:wa,FindAndReplaceStore:kE,HighlightStore:Ca,HoveredCellStore:fb,ModelStore:fa,NotificationStore:ya,RendererStore:ba,SelectionInputStore:Ny,SpreadsheetStore:va,useStore:ga,useLocalStore:pa,SidePanelStore:lx};const hM={DEFAULT_LOCALE:bo,HIGHLIGHT_COLOR:s};e.AbstractCellClipboardHandler=pn,e.AbstractChart=Ia,e.AbstractFigureClipboardHandler=Zn,e.CellErrorType=wo,e.CorePlugin=GI,e.DispatchResult=uo,e.EvaluationError=Ro,e.Model=class extends jT{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 rn,n=!0){super(),s=PI(e,s);const r=DI(e,n);this.state=new uO,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(r.revisionId),this.coreGetters={},this.range=new cT(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.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.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dO(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of EA.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of RA.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 xA.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of wA.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}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 rA(lO({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:to("Anonymous").toString()},o=e.transportService||new JA;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(fo));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,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=ho(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new uo(t.flat()):uo.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(tM(e,t));dispatch=(e,t)=>{const o=tM(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!lo.has(i.type)))return new uo("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new uo("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((()=>{ho(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(ho(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(ho(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return uo.Success};dispatchFromCorePlugin=(e,t)=>{const o=tM(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,uo.Success};dispatchToHandlers(e,t){const o=ho(t);for(const s of e)!o&&s instanceof GI||s.beforeHandle(t);for(const s of e)!o&&s instanceof GI||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=BI();for(let t of this.handlers)t instanceof GI&&t.export(e);return e.revisionId=this.session.getRevisionId()||W,e=ce(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...BI(),sheets:[HI(FI,"Sheet1")]};for(let t of this.handlers)t instanceof zI&&t.exportForExcel(e);return e=ce(e),QO(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=hn,e.Revision=iA,e.SPREADSHEET_DIMENSIONS=sM,e.Spreadsheet=QA,e.UIPlugin=hT,e.__info__=oM,e.addFunction=function e(t,o){return Vm.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(yo[e])throw new Error(`Layer ${e} already exists`);yo[e]=t},e.astToFormula=ur,e.compile=QI,e.compileTokens=JI,e.components=aM,e.constants=hM,e.convertAstNodes=lr,e.coreTypes=co,e.findCellInNewZone=Fi,e.functionCache=KI,e.helpers=nM,e.hooks=lM,e.invalidateCFEvaluationCommands=ao,e.invalidateDependenciesCommands=ro,e.invalidateEvaluationCommands=no,e.iterateAstNodes=cr,e.links=rM,e.load=DI,e.parse=rr,e.parseTokens=ar,e.readonlyAllowedCommands=lo,e.registries=iM,e.setDefaultSheetViewSize=function(e){se=e},e.setTranslationMethod=function(e,t=(()=>!0)){Qt=e,Jt=t},e.stores=cM,e.tokenColors=Iw,e.tokenize=bn,oM.version="17.3.0-alpha.0",oM.date="2024-03-20T13:42:32.042Z",oM.hash="073e154"}(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.
|
|
5
|
-
@date 2024-03-
|
|
6
|
-
@hash
|
|
4
|
+
@version 17.3.0-alpha.0
|
|
5
|
+
@date 2024-03-20T13:43:11.141Z
|
|
6
|
+
@hash 073e154
|
|
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.
|
|
3
|
+
"version": "17.3.0-alpha.0",
|
|
4
4
|
"description": "A spreadsheet component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/o-spreadsheet.cjs.js",
|
|
@@ -139,6 +139,6 @@
|
|
|
139
139
|
"*": "prettier --write"
|
|
140
140
|
},
|
|
141
141
|
"publishConfig": {
|
|
142
|
-
"tag": "
|
|
142
|
+
"tag": "alpha"
|
|
143
143
|
}
|
|
144
144
|
}
|