@odoo/o-spreadsheet 16.0.11 → 16.0.12

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.
@@ -42802,6 +42802,6 @@ exports.setTranslationMethod = setTranslationMethod;
42802
42802
  exports.tokenize = tokenize;
42803
42803
 
42804
42804
 
42805
- __info__.version = '16.0.11';
42806
- __info__.date = '2023-05-25T12:57:28.152Z';
42807
- __info__.hash = 'd27e998';
42805
+ __info__.version = '16.0.12';
42806
+ __info__.date = '2023-06-02T10:12:20.596Z';
42807
+ __info__.hash = '9718465';
@@ -42770,6 +42770,6 @@ function addFunction(functionName, functionDescription) {
42770
42770
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
42771
42771
 
42772
42772
 
42773
- __info__.version = '16.0.11';
42774
- __info__.date = '2023-05-25T12:57:28.152Z';
42775
- __info__.hash = 'd27e998';
42773
+ __info__.version = '16.0.12';
42774
+ __info__.date = '2023-06-02T10:12:20.596Z';
42775
+ __info__.hash = '9718465';
@@ -42801,9 +42801,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42801
42801
  Object.defineProperty(exports, '__esModule', { value: true });
42802
42802
 
42803
42803
 
42804
- __info__.version = '16.0.11';
42805
- __info__.date = '2023-05-25T12:57:28.152Z';
42806
- __info__.hash = 'd27e998';
42804
+ __info__.version = '16.0.12';
42805
+ __info__.date = '2023-06-02T10:12:20.596Z';
42806
+ __info__.hash = '9718465';
42807
42807
 
42808
42808
 
42809
42809
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -2432,4 +2432,4 @@
2432
2432
  <tableParts count="${e.filterTables.length}">
2433
2433
  ${sf(a)}
2434
2434
  </tableParts>
2435
- `}var Kb;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(Kb||(Kb={}));const Qb={},Jb={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:M,HEADER_WIDTH:O,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},eS={autofillModifiersRegistry:ji,autofillRulesRegistry:ro,cellMenuRegistry:In,colMenuRegistry:Tn,linkMenuRegistry:No,functionRegistry:yu,uiPluginRegistry:zv,corePluginRegistry:Vv,rowMenuRegistry:An,sidePanelRegistry:os,figureRegistry:Lo,sheetMenuRegistry:On,chartSidePanelComponentRegistry:jr,chartComponentRegistry:qi,chartRegistry:Gi,topbarMenuRegistry:Pn,topbarComponentRegistry:ns,clickableCellRegistry:Bv,otRegistry:Un,inverseCommandRegistry:Po,cellRegistry:ko,cellPopoverRegistry:Do},tS={LinkCell:dp},iS={args:vs,toBoolean:As,toJsDate:Ms,toNumber:ys,toString:Rs,toXC:_t,toZone:Si,toCartesian:Nt,numberToLetters:Mt,createFullMenuItem:Ao,UuidGenerator:vi,formatValue:Bt,computeTextWidth:Oe,isMarkdownLink:Ve,parseMarkdownLink:Be,markdownLink:ze,createEmptyWorkbookData:_f,createEmptySheet:Nf,createEmptyExcelSheet:Ff,getDefaultChartJsRuntime:ur,chartFontColor:or,getMenuChildren:bo,ChartColors:ir,EvaluationError:c,CellErrorLevel:l,getFillingMode:mr,rgbaToHex:pt,colorToRGBA:mt,positionToZone:Vi},oS={ChartPanel:Xr,ChartFigure:cs,ChartJsComponent:Zi,Grid:np,GridOverlay:Bg,ScorecardChart:ss,LineConfigPanel:Wr,LineBarPieDesignPanel:Vr,BarConfigPanel:Hn,LineBarPieConfigPanel:Bn,GaugeChartConfigPanel:Br,GaugeChartDesignPanel:Hr,ScorecardChartConfigPanel:qr,ScorecardChartDesignPanel:Zr};e.AbstractChart=Wn,e.CorePlugin=Df,e.DATETIME_FORMAT=j,e.DispatchResult=to,e.EvaluationError=c,e.Model=class extends yv{constructor(e={},i={},o=[],n=new vi,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let o=this.status;if(this.getters.isReadonly()&&(n=i,!Qi.has(n.type)))return new to(66);var n;if(!this.session.canApplyOptimisticUpdate())return new to(63);switch(o){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:o,commands:n}=this.state.recordChanges((()=>{eo(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(n,o),this.status=0,this.trigger("update");break;case 1:if(eo(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(eo(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return to.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},o=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,i),this.status=o,to.Success},o=Mf(e,o);const s=Tf(e,r);this.state=new ub,this.uuidGenerator=n,this.config=this.setupConfig(i),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new lb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new cb(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.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of Vv.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of zv.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(o),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new _v(sb(e,this.state.recordChanges.bind(this.state),(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-redone",this,this.finalize),this.session.on("revision-undone",this,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()},i=e.transportService||new Kv;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new to(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Ie(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=_f();for(let t of this.handlers)t instanceof Df&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Ie(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={..._f(),sheets:[Ff(If,"Sheet1")]};for(let t of this.handlers)t instanceof vg&&t.exportForExcel(e);return e=Ie(e),Xb(e)}},e.Registry=Wi,e.Revision=Ov,e.SPREADSHEET_DIMENSIONS=Jb,e.Spreadsheet=Yv,e.UIPlugin=bg,e.__info__=Qb,e.addFunction=function(e,t){yu.add(e,t)},e.astToFormula=Qu,e.cellTypes=tS,e.compile=ug,e.components=oS,e.convertAstNodes=Ku,e.coreTypes=Ji,e.findCellInNewZone=Pi,e.functionCache=dg,e.helpers=iS,e.invalidateEvaluationCommands=Yi,e.load=Tf,e.parse=Xu,e.readonlyAllowedCommands=Qi,e.registries=eS,e.setTranslationMethod=function(e){i=e},e.tokenize=Tu,Object.defineProperty(e,"__esModule",{value:!0}),Qb.version="16.0.11",Qb.date="2023-05-25T12:57:28.152Z",Qb.hash="d27e998"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2435
+ `}var Kb;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(Kb||(Kb={}));const Qb={},Jb={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:M,HEADER_WIDTH:O,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},eS={autofillModifiersRegistry:ji,autofillRulesRegistry:ro,cellMenuRegistry:In,colMenuRegistry:Tn,linkMenuRegistry:No,functionRegistry:yu,uiPluginRegistry:zv,corePluginRegistry:Vv,rowMenuRegistry:An,sidePanelRegistry:os,figureRegistry:Lo,sheetMenuRegistry:On,chartSidePanelComponentRegistry:jr,chartComponentRegistry:qi,chartRegistry:Gi,topbarMenuRegistry:Pn,topbarComponentRegistry:ns,clickableCellRegistry:Bv,otRegistry:Un,inverseCommandRegistry:Po,cellRegistry:ko,cellPopoverRegistry:Do},tS={LinkCell:dp},iS={args:vs,toBoolean:As,toJsDate:Ms,toNumber:ys,toString:Rs,toXC:_t,toZone:Si,toCartesian:Nt,numberToLetters:Mt,createFullMenuItem:Ao,UuidGenerator:vi,formatValue:Bt,computeTextWidth:Oe,isMarkdownLink:Ve,parseMarkdownLink:Be,markdownLink:ze,createEmptyWorkbookData:_f,createEmptySheet:Nf,createEmptyExcelSheet:Ff,getDefaultChartJsRuntime:ur,chartFontColor:or,getMenuChildren:bo,ChartColors:ir,EvaluationError:c,CellErrorLevel:l,getFillingMode:mr,rgbaToHex:pt,colorToRGBA:mt,positionToZone:Vi},oS={ChartPanel:Xr,ChartFigure:cs,ChartJsComponent:Zi,Grid:np,GridOverlay:Bg,ScorecardChart:ss,LineConfigPanel:Wr,LineBarPieDesignPanel:Vr,BarConfigPanel:Hn,LineBarPieConfigPanel:Bn,GaugeChartConfigPanel:Br,GaugeChartDesignPanel:Hr,ScorecardChartConfigPanel:qr,ScorecardChartDesignPanel:Zr};e.AbstractChart=Wn,e.CorePlugin=Df,e.DATETIME_FORMAT=j,e.DispatchResult=to,e.EvaluationError=c,e.Model=class extends yv{constructor(e={},i={},o=[],n=new vi,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let o=this.status;if(this.getters.isReadonly()&&(n=i,!Qi.has(n.type)))return new to(66);var n;if(!this.session.canApplyOptimisticUpdate())return new to(63);switch(o){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:o,commands:n}=this.state.recordChanges((()=>{eo(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(n,o),this.status=0,this.trigger("update");break;case 1:if(eo(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(eo(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return to.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},o=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,i),this.status=o,to.Success},o=Mf(e,o);const s=Tf(e,r);this.state=new ub,this.uuidGenerator=n,this.config=this.setupConfig(i),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new lb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new cb(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.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of Vv.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of zv.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(o),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new _v(sb(e,this.state.recordChanges.bind(this.state),(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-redone",this,this.finalize),this.session.on("revision-undone",this,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()},i=e.transportService||new Kv;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new to(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Ie(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=_f();for(let t of this.handlers)t instanceof Df&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Ie(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={..._f(),sheets:[Ff(If,"Sheet1")]};for(let t of this.handlers)t instanceof vg&&t.exportForExcel(e);return e=Ie(e),Xb(e)}},e.Registry=Wi,e.Revision=Ov,e.SPREADSHEET_DIMENSIONS=Jb,e.Spreadsheet=Yv,e.UIPlugin=bg,e.__info__=Qb,e.addFunction=function(e,t){yu.add(e,t)},e.astToFormula=Qu,e.cellTypes=tS,e.compile=ug,e.components=oS,e.convertAstNodes=Ku,e.coreTypes=Ji,e.findCellInNewZone=Pi,e.functionCache=dg,e.helpers=iS,e.invalidateEvaluationCommands=Yi,e.load=Tf,e.parse=Xu,e.readonlyAllowedCommands=Qi,e.registries=eS,e.setTranslationMethod=function(e){i=e},e.tokenize=Tu,Object.defineProperty(e,"__esModule",{value:!0}),Qb.version="16.0.12",Qb.date="2023-06-02T10:12:20.596Z",Qb.hash="9718465"}(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.0.11",
3
+ "version": "16.0.12",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",