@odoo/o-spreadsheet 16.0.0 → 16.0.1

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.
@@ -8847,7 +8847,6 @@ class ChartPanel extends owl.Component {
8847
8847
  ...this.getChartDefinition(),
8848
8848
  ...updateDefinition,
8849
8849
  };
8850
- // TODORAR add a putain de test - c'est faux de nouveau ...
8851
8850
  return this.env.model.dispatch("UPDATE_CHART", {
8852
8851
  definition,
8853
8852
  id: this.figureId,
@@ -8860,7 +8859,6 @@ class ChartPanel extends owl.Component {
8860
8859
  throw new Error("Chart not defined.");
8861
8860
  }
8862
8861
  const definition = getChartDefinitionFromContextCreation(context, type);
8863
- // TODORAR add a putain de test - c'est faux de nouveau ...
8864
8862
  this.env.model.dispatch("UPDATE_CHART", {
8865
8863
  definition,
8866
8864
  id: this.figureId,
@@ -27657,9 +27655,6 @@ class ChartPlugin extends CorePlugin {
27657
27655
  return figureId in (this.charts[sheetId] || {});
27658
27656
  }
27659
27657
  getChartIds(sheetId) {
27660
- // TODORAR refaire ce shit truc
27661
- // on veut un truc du genre Object.keys(this.charts[sheetId] || {} a mon avis
27662
- // return (Object.values(this.charts[sheetId] || {}).filter(isDefined) as AbstractChart[]).map((chart) => chart.id);
27663
27658
  return Object.keys(this.charts[sheetId] || {});
27664
27659
  }
27665
27660
  getChartDefinition(sheetId, figureId) {
@@ -42411,6 +42406,6 @@ exports.setTranslationMethod = setTranslationMethod;
42411
42406
  exports.tokenize = tokenize;
42412
42407
 
42413
42408
 
42414
- __info__.version = '16.0.0';
42415
- __info__.date = '2023-02-27T14:34:11.940Z';
42416
- __info__.hash = '7081532';
42409
+ __info__.version = '16.0.1';
42410
+ __info__.date = '2023-03-01T14:43:41.736Z';
42411
+ __info__.hash = '2ac9223';
@@ -8843,7 +8843,6 @@ class ChartPanel extends Component {
8843
8843
  ...this.getChartDefinition(),
8844
8844
  ...updateDefinition,
8845
8845
  };
8846
- // TODORAR add a putain de test - c'est faux de nouveau ...
8847
8846
  return this.env.model.dispatch("UPDATE_CHART", {
8848
8847
  definition,
8849
8848
  id: this.figureId,
@@ -8856,7 +8855,6 @@ class ChartPanel extends Component {
8856
8855
  throw new Error("Chart not defined.");
8857
8856
  }
8858
8857
  const definition = getChartDefinitionFromContextCreation(context, type);
8859
- // TODORAR add a putain de test - c'est faux de nouveau ...
8860
8858
  this.env.model.dispatch("UPDATE_CHART", {
8861
8859
  definition,
8862
8860
  id: this.figureId,
@@ -27653,9 +27651,6 @@ class ChartPlugin extends CorePlugin {
27653
27651
  return figureId in (this.charts[sheetId] || {});
27654
27652
  }
27655
27653
  getChartIds(sheetId) {
27656
- // TODORAR refaire ce shit truc
27657
- // on veut un truc du genre Object.keys(this.charts[sheetId] || {} a mon avis
27658
- // return (Object.values(this.charts[sheetId] || {}).filter(isDefined) as AbstractChart[]).map((chart) => chart.id);
27659
27654
  return Object.keys(this.charts[sheetId] || {});
27660
27655
  }
27661
27656
  getChartDefinition(sheetId, figureId) {
@@ -42379,6 +42374,6 @@ function addFunction(functionName, functionDescription) {
42379
42374
  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 };
42380
42375
 
42381
42376
 
42382
- __info__.version = '16.0.0';
42383
- __info__.date = '2023-02-27T14:34:11.940Z';
42384
- __info__.hash = '7081532';
42377
+ __info__.version = '16.0.1';
42378
+ __info__.date = '2023-03-01T14:43:41.736Z';
42379
+ __info__.hash = '2ac9223';
@@ -8844,7 +8844,6 @@
8844
8844
  ...this.getChartDefinition(),
8845
8845
  ...updateDefinition,
8846
8846
  };
8847
- // TODORAR add a putain de test - c'est faux de nouveau ...
8848
8847
  return this.env.model.dispatch("UPDATE_CHART", {
8849
8848
  definition,
8850
8849
  id: this.figureId,
@@ -8857,7 +8856,6 @@
8857
8856
  throw new Error("Chart not defined.");
8858
8857
  }
8859
8858
  const definition = getChartDefinitionFromContextCreation(context, type);
8860
- // TODORAR add a putain de test - c'est faux de nouveau ...
8861
8859
  this.env.model.dispatch("UPDATE_CHART", {
8862
8860
  definition,
8863
8861
  id: this.figureId,
@@ -27654,9 +27652,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27654
27652
  return figureId in (this.charts[sheetId] || {});
27655
27653
  }
27656
27654
  getChartIds(sheetId) {
27657
- // TODORAR refaire ce shit truc
27658
- // on veut un truc du genre Object.keys(this.charts[sheetId] || {} a mon avis
27659
- // return (Object.values(this.charts[sheetId] || {}).filter(isDefined) as AbstractChart[]).map((chart) => chart.id);
27660
27655
  return Object.keys(this.charts[sheetId] || {});
27661
27656
  }
27662
27657
  getChartDefinition(sheetId, figureId) {
@@ -42410,9 +42405,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42410
42405
  Object.defineProperty(exports, '__esModule', { value: true });
42411
42406
 
42412
42407
 
42413
- __info__.version = '16.0.0';
42414
- __info__.date = '2023-02-27T14:34:11.940Z';
42415
- __info__.hash = '7081532';
42408
+ __info__.version = '16.0.1';
42409
+ __info__.date = '2023-03-01T14:43:41.736Z';
42410
+ __info__.hash = '2ac9223';
42416
42411
 
42417
42412
 
42418
42413
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -2413,4 +2413,4 @@
2413
2413
  <tableParts count="${e.filterTables.length}">
2414
2414
  ${tm(a)}
2415
2415
  </tableParts>
2416
- `}var qb;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(qb||(qb={}));const Zb={},jb={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},Xb={autofillModifiersRegistry:Go,autofillRulesRegistry:on,cellMenuRegistry:wi,colMenuRegistry:yi,linkMenuRegistry:An,functionRegistry:Su,uiPluginRegistry:$v,corePluginRegistry:kv,rowMenuRegistry:xi,sidePanelRegistry:Jr,figureRegistry:Dn,sheetMenuRegistry:Ii,chartSidePanelComponentRegistry:Wr,chartComponentRegistry:Ho,chartRegistry:Bo,topbarMenuRegistry:Di,topbarComponentRegistry:es,clickableCellRegistry:Lv,otRegistry:ki,inverseCommandRegistry:kn,cellRegistry:_n,cellPopoverRegistry:Nn},Yb={LinkCell:ap},Kb={args:gs,toBoolean:xs,toJsDate:Rs,toNumber:Ss,toString:Es,toXC:Ot,toZone:mo,toCartesian:At,numberToLetters:It,createFullMenuItem:Rn,UuidGenerator:po,formatValue:Ut,computeTextWidth:Me,isMarkdownLink:Ve,parseMarkdownLink:Be,markdownLink:ze,createEmptyWorkbookData:Tm,createEmptySheet:Im,createEmptyExcelSheet:Am,getDefaultChartJsRuntime:lr,chartFontColor:Ji,getMenuChildren:fn,ChartColors:Qi,EvaluationError:c,CellErrorLevel:l,getFillingMode:dr,rgbaToHex:dt,colorToRGBA:ut,positionToZone:Lo},Qb={ChartPanel:Gr,ChartFigure:rs,ChartJsComponent:Wo,Grid:ep,GridOverlay:Pg,ScorecardChart:os,LineConfigPanel:Vr,LineBarPieDesignPanel:$r,BarConfigPanel:Ui,LineBarPieConfigPanel:Pi,GaugeChartConfigPanel:Pr,GaugeChartDesignPanel:Ur,ScorecardChartConfigPanel:Br,ScorecardChartDesignPanel:Hr};e.AbstractChart=Vi,e.CorePlugin=Om,e.DATETIME_FORMAT=j,e.DispatchResult=Qo,e.EvaluationError=c,e.Model=class extends bv{constructor(e={},o={},n=[],i=new po,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.dispatch=(e,t)=>{const o={type:e,...t};let n=this.status;if(this.getters.isReadonly()&&(i=o,!Xo.has(i.type)))return new Qo(66);var i;if(!this.session.canApplyOptimisticUpdate())return new Qo(63);switch(n){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:n,commands:i}=this.state.recordChanges((()=>{Ko(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(i,n),this.status=0,this.trigger("update");break;case 1:if(Ko(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o)}else this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Ko(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Qo.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={type:e,...t},n=this.status;this.status=2;const i=this.isReplayingCommand?[this.range,...this.corePlugins]:this.handlers;return this.dispatchToHandlers(i,o),this.status=n,Qo.Success},n=xm(e,n);const s=wm(e,r);this.state=new ab,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new nb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new ib(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 sb(this.getters);for(let e of kv.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of $v.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(n),this.joinSession(),o.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this)}get handlers(){return[this.range,...this.corePlugins,...this.uiPlugins,this.history]}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 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)}this.uiPlugins.push(t);const o=e.layers.map((e=>[t,e]));this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const o=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);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)}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 Tv(tb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins],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 qv;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:o,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 Qo(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 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=Tm();for(let t of this.handlers)t instanceof Om&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=JSON.parse(JSON.stringify(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={...Tm(),sheets:[Am(Em,"Sheet1")]};for(let t of this.handlers)t instanceof gg&&t.exportForExcel(e);return e=JSON.parse(JSON.stringify(e)),Wb(e)}},e.Registry=zo,e.Revision=Rv,e.SPREADSHEET_DIMENSIONS=jb,e.Spreadsheet=Gv,e.UIPlugin=pg,e.__info__=Zb,e.addFunction=function(e,t){Su.add(e,t)},e.astToFormula=ju,e.cellTypes=Yb,e.compile=lg,e.components=Qb,e.convertAstNodes=Zu,e.coreTypes=Yo,e.findCellInNewZone=ko,e.functionCache=ag,e.helpers=Kb,e.invalidateEvaluationCommands=Zo,e.load=wm,e.parse=Gu,e.readonlyAllowedCommands=Xo,e.registries=Xb,e.setTranslationMethod=function(e){o=e},e.tokenize=yu,Object.defineProperty(e,"__esModule",{value:!0}),Zb.version="16.0.0",Zb.date="2023-02-27T14:34:11.940Z",Zb.hash="7081532"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2416
+ `}var qb;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(qb||(qb={}));const Zb={},jb={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},Xb={autofillModifiersRegistry:Go,autofillRulesRegistry:on,cellMenuRegistry:wi,colMenuRegistry:yi,linkMenuRegistry:An,functionRegistry:Su,uiPluginRegistry:$v,corePluginRegistry:kv,rowMenuRegistry:xi,sidePanelRegistry:Jr,figureRegistry:Dn,sheetMenuRegistry:Ii,chartSidePanelComponentRegistry:Wr,chartComponentRegistry:Ho,chartRegistry:Bo,topbarMenuRegistry:Di,topbarComponentRegistry:es,clickableCellRegistry:Lv,otRegistry:ki,inverseCommandRegistry:kn,cellRegistry:_n,cellPopoverRegistry:Nn},Yb={LinkCell:ap},Kb={args:gs,toBoolean:xs,toJsDate:Rs,toNumber:Ss,toString:Es,toXC:Ot,toZone:mo,toCartesian:At,numberToLetters:It,createFullMenuItem:Rn,UuidGenerator:po,formatValue:Ut,computeTextWidth:Me,isMarkdownLink:Ve,parseMarkdownLink:Be,markdownLink:ze,createEmptyWorkbookData:Tm,createEmptySheet:Im,createEmptyExcelSheet:Am,getDefaultChartJsRuntime:lr,chartFontColor:Ji,getMenuChildren:fn,ChartColors:Qi,EvaluationError:c,CellErrorLevel:l,getFillingMode:dr,rgbaToHex:dt,colorToRGBA:ut,positionToZone:Lo},Qb={ChartPanel:Gr,ChartFigure:rs,ChartJsComponent:Wo,Grid:ep,GridOverlay:Pg,ScorecardChart:os,LineConfigPanel:Vr,LineBarPieDesignPanel:$r,BarConfigPanel:Ui,LineBarPieConfigPanel:Pi,GaugeChartConfigPanel:Pr,GaugeChartDesignPanel:Ur,ScorecardChartConfigPanel:Br,ScorecardChartDesignPanel:Hr};e.AbstractChart=Vi,e.CorePlugin=Om,e.DATETIME_FORMAT=j,e.DispatchResult=Qo,e.EvaluationError=c,e.Model=class extends bv{constructor(e={},o={},n=[],i=new po,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.dispatch=(e,t)=>{const o={type:e,...t};let n=this.status;if(this.getters.isReadonly()&&(i=o,!Xo.has(i.type)))return new Qo(66);var i;if(!this.session.canApplyOptimisticUpdate())return new Qo(63);switch(n){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:n,commands:i}=this.state.recordChanges((()=>{Ko(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(i,n),this.status=0,this.trigger("update");break;case 1:if(Ko(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o)}else this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Ko(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Qo.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={type:e,...t},n=this.status;this.status=2;const i=this.isReplayingCommand?[this.range,...this.corePlugins]:this.handlers;return this.dispatchToHandlers(i,o),this.status=n,Qo.Success},n=xm(e,n);const s=wm(e,r);this.state=new ab,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new nb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new ib(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 sb(this.getters);for(let e of kv.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of $v.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(n),this.joinSession(),o.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this)}get handlers(){return[this.range,...this.corePlugins,...this.uiPlugins,this.history]}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 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)}this.uiPlugins.push(t);const o=e.layers.map((e=>[t,e]));this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const o=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);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)}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 Tv(tb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins],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 qv;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:o,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 Qo(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 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=Tm();for(let t of this.handlers)t instanceof Om&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=JSON.parse(JSON.stringify(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={...Tm(),sheets:[Am(Em,"Sheet1")]};for(let t of this.handlers)t instanceof gg&&t.exportForExcel(e);return e=JSON.parse(JSON.stringify(e)),Wb(e)}},e.Registry=zo,e.Revision=Rv,e.SPREADSHEET_DIMENSIONS=jb,e.Spreadsheet=Gv,e.UIPlugin=pg,e.__info__=Zb,e.addFunction=function(e,t){Su.add(e,t)},e.astToFormula=ju,e.cellTypes=Yb,e.compile=lg,e.components=Qb,e.convertAstNodes=Zu,e.coreTypes=Yo,e.findCellInNewZone=ko,e.functionCache=ag,e.helpers=Kb,e.invalidateEvaluationCommands=Zo,e.load=wm,e.parse=Gu,e.readonlyAllowedCommands=Xo,e.registries=Xb,e.setTranslationMethod=function(e){o=e},e.tokenize=yu,Object.defineProperty(e,"__esModule",{value:!0}),Zb.version="16.0.1",Zb.date="2023-03-01T14:43:41.736Z",Zb.hash="2ac9223"}(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.0",
3
+ "version": "16.0.1",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",
@@ -11,20 +11,20 @@
11
11
  "dist/*.d.ts"
12
12
  ],
13
13
  "scripts": {
14
- "serve-static": "live-server --open=demo --watch=dist/o_spreadsheet.js,dist/o_spreadsheet.xml,demo",
14
+ "serve-static": "live-server --open=demo --watch=build/o_spreadsheet.js,build/o_spreadsheet.xml,demo",
15
15
  "dev": "npm-run-all build --parallel server serve-static watch:*",
16
16
  "server": "node tools/server/main.js",
17
17
  "build:js": "tsc --module es6 --incremental",
18
18
  "bundle:js": "rollup -c -m dev",
19
19
  "bundle:xml": "node tools/bundle_xml/main.js",
20
- "build": "npm-run-all build:js bundle:*",
20
+ "build": "npm-run-all build:js bundle:js 'bundle:xml -- --outDir build'",
21
21
  "doc": "typedoc",
22
22
  "precommit": "npm run prettier && npm run doc",
23
23
  "test": "jest",
24
24
  "test:watch": "jest --watch",
25
25
  "prettier": "prettier . --write",
26
26
  "check-formatting": "prettier . --check",
27
- "dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run bundle:xml",
27
+ "dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run bundle:xml -- --outDir dist",
28
28
  "prepare": "husky install",
29
29
  "watch:bundle": "npm run bundle:js -- --watch",
30
30
  "watch:ts": "npm run build:js -- --watch",
@@ -129,5 +129,8 @@
129
129
  },
130
130
  "lint-staged": {
131
131
  "*": "prettier --write"
132
+ },
133
+ "publishConfig": {
134
+ "tag": "16-0"
132
135
  }
133
136
  }