@odoo/o-spreadsheet 16.1.11 → 16.1.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.
@@ -20033,6 +20033,18 @@ css /* scss */ `
20033
20033
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
20034
20034
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
20035
20035
  }
20036
+ .o-color-picker-toggler {
20037
+ display: flex;
20038
+ .o-color-picker-toggler-sign {
20039
+ margin: auto auto;
20040
+ width: 55%;
20041
+ height: 55%;
20042
+ .o-icon {
20043
+ width: 100%;
20044
+ height: 100%;
20045
+ }
20046
+ }
20047
+ }
20036
20048
  .o-color-picker-line-item {
20037
20049
  width: ${ITEM_EDGE_LENGTH}px;
20038
20050
  height: ${ITEM_EDGE_LENGTH}px;
@@ -44259,6 +44271,6 @@ exports.setTranslationMethod = setTranslationMethod;
44259
44271
  exports.tokenize = tokenize;
44260
44272
 
44261
44273
 
44262
- __info__.version = '16.1.11';
44263
- __info__.date = '2023-05-12T10:58:24.113Z';
44264
- __info__.hash = 'd9a2cce';
44274
+ __info__.version = '16.1.12';
44275
+ __info__.date = '2023-05-25T12:56:29.735Z';
44276
+ __info__.hash = 'b80dc51';
@@ -20029,6 +20029,18 @@ css /* scss */ `
20029
20029
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
20030
20030
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
20031
20031
  }
20032
+ .o-color-picker-toggler {
20033
+ display: flex;
20034
+ .o-color-picker-toggler-sign {
20035
+ margin: auto auto;
20036
+ width: 55%;
20037
+ height: 55%;
20038
+ .o-icon {
20039
+ width: 100%;
20040
+ height: 100%;
20041
+ }
20042
+ }
20043
+ }
20032
20044
  .o-color-picker-line-item {
20033
20045
  width: ${ITEM_EDGE_LENGTH}px;
20034
20046
  height: ${ITEM_EDGE_LENGTH}px;
@@ -44227,6 +44239,6 @@ function addFunction(functionName, functionDescription) {
44227
44239
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
44228
44240
 
44229
44241
 
44230
- __info__.version = '16.1.11';
44231
- __info__.date = '2023-05-12T10:58:24.113Z';
44232
- __info__.hash = 'd9a2cce';
44242
+ __info__.version = '16.1.12';
44243
+ __info__.date = '2023-05-25T12:56:29.735Z';
44244
+ __info__.hash = 'b80dc51';
@@ -20030,6 +20030,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20030
20030
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
20031
20031
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
20032
20032
  }
20033
+ .o-color-picker-toggler {
20034
+ display: flex;
20035
+ .o-color-picker-toggler-sign {
20036
+ margin: auto auto;
20037
+ width: 55%;
20038
+ height: 55%;
20039
+ .o-icon {
20040
+ width: 100%;
20041
+ height: 100%;
20042
+ }
20043
+ }
20044
+ }
20033
20045
  .o-color-picker-line-item {
20034
20046
  width: ${ITEM_EDGE_LENGTH}px;
20035
20047
  height: ${ITEM_EDGE_LENGTH}px;
@@ -44258,9 +44270,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44258
44270
  Object.defineProperty(exports, '__esModule', { value: true });
44259
44271
 
44260
44272
 
44261
- __info__.version = '16.1.11';
44262
- __info__.date = '2023-05-12T10:58:24.113Z';
44263
- __info__.hash = 'd9a2cce';
44273
+ __info__.version = '16.1.12';
44274
+ __info__.date = '2023-05-25T12:56:29.735Z';
44275
+ __info__.hash = 'b80dc51';
44264
44276
 
44265
44277
 
44266
44278
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -608,6 +608,18 @@
608
608
  grid-template-columns: repeat(${10}, 1fr);
609
609
  grid-gap: ${2}px;
610
610
  }
611
+ .o-color-picker-toggler {
612
+ display: flex;
613
+ .o-color-picker-toggler-sign {
614
+ margin: auto auto;
615
+ width: 55%;
616
+ height: 55%;
617
+ .o-icon {
618
+ width: 100%;
619
+ height: 100%;
620
+ }
621
+ }
622
+ }
611
623
  .o-color-picker-line-item {
612
624
  width: ${18}px;
613
625
  height: ${18}px;
@@ -2458,4 +2470,4 @@
2458
2470
  <tableParts count="${e.filterTables.length}">
2459
2471
  ${Ff(a)}
2460
2472
  </tableParts>
2461
- `}var MC;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(MC||(MC={}));const NC={},_C={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},FC={autofillModifiersRegistry:Tg,autofillRulesRegistry:Ag,cellMenuRegistry:Mr,colMenuRegistry:Nr,linkMenuRegistry:Pg,functionRegistry:Xd,featurePluginRegistry:fb,statefulUIPluginRegistry:vb,coreViewsPluginRegistry:bb,corePluginRegistry:mb,rowMenuRegistry:_r,sidePanelRegistry:wp,figureRegistry:Hg,sheetMenuRegistry:Zg,chartSidePanelComponentRegistry:gp,chartComponentRegistry:In,chartRegistry:xn,topbarMenuRegistry:Xg,topbarComponentRegistry:yp,clickableCellRegistry:Cb,otRegistry:Yg,inverseCommandRegistry:Wg,urlRegistry:ug,cellPopoverRegistry:Vg},DC={args:Vr,toBoolean:Kr,toJsDate:Qr,toNumber:qr,toString:jr,toXC:kt,toZone:Ao,toCartesian:Dt,numberToLetters:_t,createFullMenuItem:Tn,UuidGenerator:Ro,formatValue:no,computeTextWidth:ke,createEmptyWorkbookData:rv,createEmptySheet:nv,createEmptyExcelSheet:sv,getDefaultChartJsRuntime:Ki,chartFontColor:ki,getMenuChildren:_n,ChartColors:Di,EvaluationError:c,CellErrorLevel:l,getFillingMode:en,rgbaToHex:vt,colorToRGBA:bt,positionToZone:Xo,isDefined:Qe},kC={isMarkdownLink:We,parseMarkdownLink:Ze,markdownLink:qe,openLink:vg,urlRepresentation:fg},$C={ChartPanel:pp,ChartFigure:Bn,ChartJsComponent:Jo,Grid:Hp,GridOverlay:Tp,ScorecardChart:li,LineConfigPanel:cp,LineBarPieDesignPanel:rp,BarConfigPanel:ep,LineBarPieConfigPanel:Jg,GaugeChartConfigPanel:ap,GaugeChartDesignPanel:lp,ScorecardChartConfigPanel:dp,ScorecardChartDesignPanel:up};e.AbstractChart=ui,e.CorePlugin=av,e.DATETIME_FORMAT=j,e.DispatchResult=Ei,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},o={},i=[],n=new Ro,r=!0){super(),this.corePlugins=[],this.featurePlugins=[],this.statefulUIPlugins=[],this.coreViewsPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const o={...t,type:e};let i=this.status;if(this.getters.isReadonly()&&(n=o,!bi.has(n.type)))return new Ei(67);var n;if(!this.session.canApplyOptimisticUpdate())return new Ei(64);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:n}=this.state.recordChanges((()=>{Si(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(n,i),this.status=0,this.trigger("update");break;case 1:if(Si(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(Si(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Ei.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={...t,type:e},i=this.status;this.status=2;const n=this.isReplayingCommand?[this.range,...this.corePlugins,...this.coreViewsPlugins]:this.handlers;return this.dispatchToHandlers(n,o),this.status=i,Ei.Success},i=ov(e,i);const s=ev(e,r);this.state=new Gb,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.history=new Bb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new xv(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 Wb(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of mb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of vb.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t)}for(let e of bb.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.coreHandlers.push(t)}for(let e of fb.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t)}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(i),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 eb(Vb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins,...this.coreViewsPlugins],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()},o=e.transportService||new Nb;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:e.external||{},transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),lazyEvaluation:!("lazyEvaluation"in e)||e.lazyEvaluation}}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,lazyEvaluation:this.config.lazyEvaluation}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new Ei(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Me(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=rv();for(let t of this.handlers)t instanceof av&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Me(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={...rv(),sheets:[sv(Jf,"Sheet1")]};for(let t of this.handlers)t instanceof Hu&&t.exportForExcel(e);return e=Me(e),AC(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=yn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=_C,e.Spreadsheet=Mb,e.UIPlugin=Wu,e.__info__=NC,e.addFunction=function(e,t){Xd.add(e,t)},e.astToFormula=xu,e.compile=Lu,e.components=$C,e.convertAstNodes=yu,e.coreTypes=Ci,e.findCellInNewZone=Zo,e.functionCache=Pu,e.helpers=DC,e.invalidateEvaluationCommands=fi,e.links=kC,e.load=ev,e.parse=Eu,e.readonlyAllowedCommands=bi,e.registries=FC,e.setTranslationMethod=function(e){o=e},e.tokenize=Jd,Object.defineProperty(e,"__esModule",{value:!0}),NC.version="16.1.11",NC.date="2023-05-12T10:58:24.113Z",NC.hash="d9a2cce"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2473
+ `}var MC;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(MC||(MC={}));const NC={},_C={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},FC={autofillModifiersRegistry:Tg,autofillRulesRegistry:Ag,cellMenuRegistry:Mr,colMenuRegistry:Nr,linkMenuRegistry:Pg,functionRegistry:Xd,featurePluginRegistry:fb,statefulUIPluginRegistry:vb,coreViewsPluginRegistry:bb,corePluginRegistry:mb,rowMenuRegistry:_r,sidePanelRegistry:wp,figureRegistry:Hg,sheetMenuRegistry:Zg,chartSidePanelComponentRegistry:gp,chartComponentRegistry:In,chartRegistry:xn,topbarMenuRegistry:Xg,topbarComponentRegistry:yp,clickableCellRegistry:Cb,otRegistry:Yg,inverseCommandRegistry:Wg,urlRegistry:ug,cellPopoverRegistry:Vg},DC={args:Vr,toBoolean:Kr,toJsDate:Qr,toNumber:qr,toString:jr,toXC:kt,toZone:Ao,toCartesian:Dt,numberToLetters:_t,createFullMenuItem:Tn,UuidGenerator:Ro,formatValue:no,computeTextWidth:ke,createEmptyWorkbookData:rv,createEmptySheet:nv,createEmptyExcelSheet:sv,getDefaultChartJsRuntime:Ki,chartFontColor:ki,getMenuChildren:_n,ChartColors:Di,EvaluationError:c,CellErrorLevel:l,getFillingMode:en,rgbaToHex:vt,colorToRGBA:bt,positionToZone:Xo,isDefined:Qe},kC={isMarkdownLink:We,parseMarkdownLink:Ze,markdownLink:qe,openLink:vg,urlRepresentation:fg},$C={ChartPanel:pp,ChartFigure:Bn,ChartJsComponent:Jo,Grid:Hp,GridOverlay:Tp,ScorecardChart:li,LineConfigPanel:cp,LineBarPieDesignPanel:rp,BarConfigPanel:ep,LineBarPieConfigPanel:Jg,GaugeChartConfigPanel:ap,GaugeChartDesignPanel:lp,ScorecardChartConfigPanel:dp,ScorecardChartDesignPanel:up};e.AbstractChart=ui,e.CorePlugin=av,e.DATETIME_FORMAT=j,e.DispatchResult=Ei,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},o={},i=[],n=new Ro,r=!0){super(),this.corePlugins=[],this.featurePlugins=[],this.statefulUIPlugins=[],this.coreViewsPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const o={...t,type:e};let i=this.status;if(this.getters.isReadonly()&&(n=o,!bi.has(n.type)))return new Ei(67);var n;if(!this.session.canApplyOptimisticUpdate())return new Ei(64);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:n}=this.state.recordChanges((()=>{Si(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(n,i),this.status=0,this.trigger("update");break;case 1:if(Si(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(Si(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Ei.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={...t,type:e},i=this.status;this.status=2;const n=this.isReplayingCommand?[this.range,...this.corePlugins,...this.coreViewsPlugins]:this.handlers;return this.dispatchToHandlers(n,o),this.status=i,Ei.Success},i=ov(e,i);const s=ev(e,r);this.state=new Gb,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.history=new Bb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new xv(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 Wb(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of mb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of vb.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t)}for(let e of bb.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.coreHandlers.push(t)}for(let e of fb.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t)}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(i),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 eb(Vb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins,...this.coreViewsPlugins],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()},o=e.transportService||new Nb;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:e.external||{},transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),lazyEvaluation:!("lazyEvaluation"in e)||e.lazyEvaluation}}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,lazyEvaluation:this.config.lazyEvaluation}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new Ei(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Me(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=rv();for(let t of this.handlers)t instanceof av&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Me(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={...rv(),sheets:[sv(Jf,"Sheet1")]};for(let t of this.handlers)t instanceof Hu&&t.exportForExcel(e);return e=Me(e),AC(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=yn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=_C,e.Spreadsheet=Mb,e.UIPlugin=Wu,e.__info__=NC,e.addFunction=function(e,t){Xd.add(e,t)},e.astToFormula=xu,e.compile=Lu,e.components=$C,e.convertAstNodes=yu,e.coreTypes=Ci,e.findCellInNewZone=Zo,e.functionCache=Pu,e.helpers=DC,e.invalidateEvaluationCommands=fi,e.links=kC,e.load=ev,e.parse=Eu,e.readonlyAllowedCommands=bi,e.registries=FC,e.setTranslationMethod=function(e){o=e},e.tokenize=Jd,Object.defineProperty(e,"__esModule",{value:!0}),NC.version="16.1.12",NC.date="2023-05-25T12:56:29.735Z",NC.hash="b80dc51"}(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.1.11",
3
+ "version": "16.1.12",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",