@odoo/o-spreadsheet 16.4.0 → 16.5.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.
@@ -50516,6 +50516,6 @@ exports.setTranslationMethod = setTranslationMethod;
50516
50516
  exports.tokenize = tokenize;
50517
50517
 
50518
50518
 
50519
- __info__.version = '16.4.0';
50520
- __info__.date = '2023-07-24T06:26:19.494Z';
50521
- __info__.hash = '4eb614c';
50519
+ __info__.version = '16.5.0-alpha.0';
50520
+ __info__.date = '2023-07-24T06:48:58.196Z';
50521
+ __info__.hash = '3ba2c3c';
@@ -50480,6 +50480,6 @@ const constants = {
50480
50480
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
50481
50481
 
50482
50482
 
50483
- __info__.version = '16.4.0';
50484
- __info__.date = '2023-07-24T06:26:19.494Z';
50485
- __info__.hash = '4eb614c';
50483
+ __info__.version = '16.5.0-alpha.0';
50484
+ __info__.date = '2023-07-24T06:48:58.196Z';
50485
+ __info__.hash = '3ba2c3c';
@@ -50515,9 +50515,9 @@
50515
50515
  Object.defineProperty(exports, '__esModule', { value: true });
50516
50516
 
50517
50517
 
50518
- __info__.version = '16.4.0';
50519
- __info__.date = '2023-07-24T06:26:19.494Z';
50520
- __info__.hash = '4eb614c';
50518
+ __info__.version = '16.5.0-alpha.0';
50519
+ __info__.date = '2023-07-24T06:48:58.196Z';
50520
+ __info__.hash = '3ba2c3c';
50521
50521
 
50522
50522
 
50523
50523
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -2533,4 +2533,4 @@
2533
2533
  <tableParts count="${e.filterTables.length}">
2534
2534
  ${dE(a)}
2535
2535
  </tableParts>
2536
- `}var vx;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(vx||(vx={}));function Sx(e,t={}){const o=Ce(t);return o.type=e,o}const Cx={},Ex={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:_,HEADER_WIDTH:F,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:D,DEFAULT_CELL_HEIGHT:L,SCROLLBAR_WIDTH:P},wx={autofillModifiersRegistry:rr,autofillRulesRegistry:nr,cellMenuRegistry:pf,colMenuRegistry:Lb,linkMenuRegistry:Ag,functionRegistry:au,featurePluginRegistry:Ww,statefulUIPluginRegistry:Gw,coreViewsPluginRegistry:qw,corePluginRegistry:$w,rowMenuRegistry:Ub,sidePanelRegistry:Sv,figureRegistry:Bp,chartSidePanelComponentRegistry:nv,chartComponentRegistry:Pp,chartRegistry:Lp,topbarMenuRegistry:Vb,topbarComponentRegistry:Cv,clickableCellRegistry:Zw,otRegistry:zb,inverseCommandRegistry:Gp,urlRegistry:Ki,cellPopoverRegistry:Mg,numberFormatMenuRegistry:Pb,repeatLocalCommandTransformRegistry:Rw,repeatCommandTransformRegistry:Iw},yx={arg:Pr,toBoolean:Os,toJsDate:Ns,toNumber:Es,toString:Rs,toXC:wt,toZone:Xo,toCartesian:Et,numberToLetters:ft,UuidGenerator:Pi,formatValue:go,createCurrencyFormat:Oo,computeTextWidth:Oi,createEmptyWorkbookData:kE,createEmptySheet:PE,createEmptyExcelSheet:UE,getDefaultChartJsRuntime:cp,chartFontColor:qg,ChartColors:Gg,EvaluationError:c,CellErrorLevel:l,getFillingMode:gp,rgbaToHex:ht,colorToRGBA:dt,positionToZone:vi,isDefined:ke,lazy:Be,genericRepeat:Tw},xx={isMarkdownLink:Oe,parseMarkdownLink:_e,markdownLink:Me,openLink:os,urlRepresentation:ts},Ix={ChartPanel:av,ChartFigure:Up,ChartJsComponent:ki,Grid:mS,GridOverlay:Jv,ScorecardChart:qi,LineConfigPanel:iv,LineBarPieDesignPanel:ev,BarConfigPanel:Zb,LineBarPieConfigPanel:qb,GaugeChartConfigPanel:tv,GaugeChartDesignPanel:ov,ScorecardChartConfigPanel:sv,ScorecardChartDesignPanel:rv,FigureComponent:Ev};const Rx={DEFAULT_LOCALE:Kt};e.AbstractChart=Fg,e.CorePlugin=zE,e.DispatchResult=us,e.EvaluationError=c,e.Model=class extends nw{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={},i=[],s=new Pi,r=!0){super(),i=DE(e,i);const n=_E(e,r);this.state=new Ny,this.uuidGenerator=s,this.config=this.setupConfig(o),this.session=this.setupSession(n.revisionId),this.coreGetters={},this.range=new ZE(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.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Oy(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of $w.getAll())this.setupCorePlugin(e,n);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(i);for(let e of qw.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 Gw.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of Ww.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)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),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 mw(Ry({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:r("Anonymous").toString()},o=e.transportService||new by;return{...e,mode:e.mode||"normal",custom:e.custom||{},defaultCurrencyFormat:e.defaultCurrencyFormat||"[$$]#,##0.00",external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Xt));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}}checkDispatchAllowed(e){return ds(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e)}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),new us(t.flat())}checkDispatchAllowedLocalCommand(e){const t=this.uiHandlers.map((t=>t.allowDispatch(e)));return new us(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(Sx(e,t));dispatch=(e,t)=>{const o=Sx(e,t);let i=this.status;if(this.getters.isReadonly()&&(s=o,!cs.has(s.type)))return new us(68);var s;if(!this.session.canApplyOptimisticUpdate())return new us(65);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:s}=this.state.recordChanges((()=>{ds(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,s,i),this.status=0,this.trigger("update");break;case 1:if(ds(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(ds(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return us.Success};dispatchFromCorePlugin=(e,t)=>{const o=Sx(e,t),i=this.status;this.status=2;const s=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(s,o),this.status=i,us.Success};dispatchToHandlers(e,t){for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=kE();for(let t of this.handlers)t instanceof zE&&t.export(e);return e.revisionId=this.session.getRevisionId()||ee,e=Ce(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...kE(),sheets:[UE(ME,"Sheet1")]};for(let t of this.handlers)t instanceof VE&&t.exportForExcel(e);return e=Ce(e),fx(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Yi,e.Revision=gw,e.SPREADSHEET_DIMENSIONS=Ex,e.Spreadsheet=fy,e.UIPlugin=jE,e.__info__=Cx,e.addFunction=function(e,t){au.add(e,t)},e.astToFormula=Hu,e.compile=tg,e.components=Ix,e.constants=Rx,e.convertAstNodes=Uu,e.coreTypes=hs,e.findCellInNewZone=fi,e.functionCache=eg,e.helpers=yx,e.invalidateCFEvaluationCommands=ls,e.invalidateDependenciesCommands=as,e.invalidateEvaluationCommands=ns,e.iterateAstNodes=Vu,e.links=xx,e.load=_E,e.parse=Pu,e.readonlyAllowedCommands=cs,e.registries=wx,e.setDefaultSheetViewSize=function(e){ge=e},e.setTranslationMethod=function(e){o=e},e.tokenize=pu,Object.defineProperty(e,"__esModule",{value:!0}),Cx.version="16.4.0",Cx.date="2023-07-24T06:26:19.494Z",Cx.hash="4eb614c"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2536
+ `}var vx;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(vx||(vx={}));function Sx(e,t={}){const o=Ce(t);return o.type=e,o}const Cx={},Ex={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:_,HEADER_WIDTH:F,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:D,DEFAULT_CELL_HEIGHT:L,SCROLLBAR_WIDTH:P},wx={autofillModifiersRegistry:rr,autofillRulesRegistry:nr,cellMenuRegistry:pf,colMenuRegistry:Lb,linkMenuRegistry:Ag,functionRegistry:au,featurePluginRegistry:Ww,statefulUIPluginRegistry:Gw,coreViewsPluginRegistry:qw,corePluginRegistry:$w,rowMenuRegistry:Ub,sidePanelRegistry:Sv,figureRegistry:Bp,chartSidePanelComponentRegistry:nv,chartComponentRegistry:Pp,chartRegistry:Lp,topbarMenuRegistry:Vb,topbarComponentRegistry:Cv,clickableCellRegistry:Zw,otRegistry:zb,inverseCommandRegistry:Gp,urlRegistry:Ki,cellPopoverRegistry:Mg,numberFormatMenuRegistry:Pb,repeatLocalCommandTransformRegistry:Rw,repeatCommandTransformRegistry:Iw},yx={arg:Pr,toBoolean:Os,toJsDate:Ns,toNumber:Es,toString:Rs,toXC:wt,toZone:Xo,toCartesian:Et,numberToLetters:ft,UuidGenerator:Pi,formatValue:go,createCurrencyFormat:Oo,computeTextWidth:Oi,createEmptyWorkbookData:kE,createEmptySheet:PE,createEmptyExcelSheet:UE,getDefaultChartJsRuntime:cp,chartFontColor:qg,ChartColors:Gg,EvaluationError:c,CellErrorLevel:l,getFillingMode:gp,rgbaToHex:ht,colorToRGBA:dt,positionToZone:vi,isDefined:ke,lazy:Be,genericRepeat:Tw},xx={isMarkdownLink:Oe,parseMarkdownLink:_e,markdownLink:Me,openLink:os,urlRepresentation:ts},Ix={ChartPanel:av,ChartFigure:Up,ChartJsComponent:ki,Grid:mS,GridOverlay:Jv,ScorecardChart:qi,LineConfigPanel:iv,LineBarPieDesignPanel:ev,BarConfigPanel:Zb,LineBarPieConfigPanel:qb,GaugeChartConfigPanel:tv,GaugeChartDesignPanel:ov,ScorecardChartConfigPanel:sv,ScorecardChartDesignPanel:rv,FigureComponent:Ev};const Rx={DEFAULT_LOCALE:Kt};e.AbstractChart=Fg,e.CorePlugin=zE,e.DispatchResult=us,e.EvaluationError=c,e.Model=class extends nw{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={},i=[],s=new Pi,r=!0){super(),i=DE(e,i);const n=_E(e,r);this.state=new Ny,this.uuidGenerator=s,this.config=this.setupConfig(o),this.session=this.setupSession(n.revisionId),this.coreGetters={},this.range=new ZE(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.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Oy(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of $w.getAll())this.setupCorePlugin(e,n);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(i);for(let e of qw.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 Gw.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of Ww.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)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),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 mw(Ry({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:r("Anonymous").toString()},o=e.transportService||new by;return{...e,mode:e.mode||"normal",custom:e.custom||{},defaultCurrencyFormat:e.defaultCurrencyFormat||"[$$]#,##0.00",external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Xt));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}}checkDispatchAllowed(e){return ds(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e)}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),new us(t.flat())}checkDispatchAllowedLocalCommand(e){const t=this.uiHandlers.map((t=>t.allowDispatch(e)));return new us(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(Sx(e,t));dispatch=(e,t)=>{const o=Sx(e,t);let i=this.status;if(this.getters.isReadonly()&&(s=o,!cs.has(s.type)))return new us(68);var s;if(!this.session.canApplyOptimisticUpdate())return new us(65);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:s}=this.state.recordChanges((()=>{ds(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,s,i),this.status=0,this.trigger("update");break;case 1:if(ds(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(ds(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return us.Success};dispatchFromCorePlugin=(e,t)=>{const o=Sx(e,t),i=this.status;this.status=2;const s=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(s,o),this.status=i,us.Success};dispatchToHandlers(e,t){for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=kE();for(let t of this.handlers)t instanceof zE&&t.export(e);return e.revisionId=this.session.getRevisionId()||ee,e=Ce(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...kE(),sheets:[UE(ME,"Sheet1")]};for(let t of this.handlers)t instanceof VE&&t.exportForExcel(e);return e=Ce(e),fx(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Yi,e.Revision=gw,e.SPREADSHEET_DIMENSIONS=Ex,e.Spreadsheet=fy,e.UIPlugin=jE,e.__info__=Cx,e.addFunction=function(e,t){au.add(e,t)},e.astToFormula=Hu,e.compile=tg,e.components=Ix,e.constants=Rx,e.convertAstNodes=Uu,e.coreTypes=hs,e.findCellInNewZone=fi,e.functionCache=eg,e.helpers=yx,e.invalidateCFEvaluationCommands=ls,e.invalidateDependenciesCommands=as,e.invalidateEvaluationCommands=ns,e.iterateAstNodes=Vu,e.links=xx,e.load=_E,e.parse=Pu,e.readonlyAllowedCommands=cs,e.registries=wx,e.setDefaultSheetViewSize=function(e){ge=e},e.setTranslationMethod=function(e){o=e},e.tokenize=pu,Object.defineProperty(e,"__esModule",{value:!0}),Cx.version="16.5.0-alpha.0",Cx.date="2023-07-24T06:48:58.196Z",Cx.hash="3ba2c3c"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "16.4.0",
3
+ "version": "16.5.0-alpha.0",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",
@@ -133,6 +133,6 @@
133
133
  "*": "prettier --write"
134
134
  },
135
135
  "publishConfig": {
136
- "tag": "latest"
136
+ "tag": "alpha"
137
137
  }
138
138
  }