@odoo/o-spreadsheet 17.1.24 → 17.1.25

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.1.24
6
- * @date 2024-07-18T14:21:58.787Z
7
- * @hash 46a558e
5
+ * @version 17.1.25
6
+ * @date 2024-07-24T10:26:01.576Z
7
+ * @hash 0edff47
8
8
  */
9
9
 
10
10
  'use strict';
@@ -28871,10 +28871,13 @@ function useCellHovered(env, gridRef, callback) {
28871
28871
  row: undefined,
28872
28872
  };
28873
28873
  const { Date } = window;
28874
- let x = 0;
28875
- let y = 0;
28874
+ let x = undefined;
28875
+ let y = undefined;
28876
28876
  let lastMoved = 0;
28877
28877
  function getPosition() {
28878
+ if (x === undefined || y === undefined) {
28879
+ return { col: -1, row: -1 };
28880
+ }
28878
28881
  const col = env.model.getters.getColIndex(x);
28879
28882
  const row = env.model.getters.getRowIndex(y);
28880
28883
  return { col, row };
@@ -57879,6 +57882,6 @@ exports.setTranslationMethod = setTranslationMethod;
57879
57882
  exports.tokenize = tokenize;
57880
57883
 
57881
57884
 
57882
- __info__.version = "17.1.24";
57883
- __info__.date = "2024-07-18T14:21:58.787Z";
57884
- __info__.hash = "46a558e";
57885
+ __info__.version = "17.1.25";
57886
+ __info__.date = "2024-07-24T10:26:01.576Z";
57887
+ __info__.hash = "0edff47";
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.1.24
6
- * @date 2024-07-18T14:21:58.787Z
7
- * @hash 46a558e
5
+ * @version 17.1.25
6
+ * @date 2024-07-24T10:26:01.576Z
7
+ * @hash 0edff47
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, onWillUnmount, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -28869,10 +28869,13 @@ function useCellHovered(env, gridRef, callback) {
28869
28869
  row: undefined,
28870
28870
  };
28871
28871
  const { Date } = window;
28872
- let x = 0;
28873
- let y = 0;
28872
+ let x = undefined;
28873
+ let y = undefined;
28874
28874
  let lastMoved = 0;
28875
28875
  function getPosition() {
28876
+ if (x === undefined || y === undefined) {
28877
+ return { col: -1, row: -1 };
28878
+ }
28876
28879
  const col = env.model.getters.getColIndex(x);
28877
28880
  const row = env.model.getters.getRowIndex(y);
28878
28881
  return { col, row };
@@ -57841,6 +57844,6 @@ const constants = {
57841
57844
  export { AbstractChart, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
57842
57845
 
57843
57846
 
57844
- __info__.version = "17.1.24";
57845
- __info__.date = "2024-07-18T14:21:58.787Z";
57846
- __info__.hash = "46a558e";
57847
+ __info__.version = "17.1.25";
57848
+ __info__.date = "2024-07-24T10:26:01.576Z";
57849
+ __info__.hash = "0edff47";
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.1.24
6
- * @date 2024-07-18T14:21:58.787Z
7
- * @hash 46a558e
5
+ * @version 17.1.25
6
+ * @date 2024-07-24T10:26:01.576Z
7
+ * @hash 0edff47
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -28870,10 +28870,13 @@
28870
28870
  row: undefined,
28871
28871
  };
28872
28872
  const { Date } = window;
28873
- let x = 0;
28874
- let y = 0;
28873
+ let x = undefined;
28874
+ let y = undefined;
28875
28875
  let lastMoved = 0;
28876
28876
  function getPosition() {
28877
+ if (x === undefined || y === undefined) {
28878
+ return { col: -1, row: -1 };
28879
+ }
28877
28880
  const col = env.model.getters.getColIndex(x);
28878
28881
  const row = env.model.getters.getRowIndex(y);
28879
28882
  return { col, row };
@@ -57878,9 +57881,9 @@
57878
57881
  exports.tokenize = tokenize;
57879
57882
 
57880
57883
 
57881
- __info__.version = "17.1.24";
57882
- __info__.date = "2024-07-18T14:21:58.787Z";
57883
- __info__.hash = "46a558e";
57884
+ __info__.version = "17.1.25";
57885
+ __info__.date = "2024-07-24T10:26:01.576Z";
57886
+ __info__.hash = "0edff47";
57884
57887
 
57885
57888
 
57886
57889
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -1254,7 +1254,7 @@
1254
1254
  margin-left: 8px;
1255
1255
  }
1256
1256
  }
1257
- `;class EE extends t.Component{static template="o-spreadsheet-GridAddRowsFooter";static props={focusGrid:Function};static components={ValidationMessages:IS};inputRef=t.useRef("inputRef");state=t.useState({inputValue:"100",errorFlag:!1});setup(){t.useExternalListener(window,"click",this.onExternalClick,{capture:!0})}get addRowsPosition(){const e=this.env.model.getters.getActiveSheetId(),{numberOfRows:t}=this.env.model.getters.getSheetSize(e),{scrollY:o}=this.env.model.getters.getActiveSheetScrollInfo();return mr({top:`${this.env.model.getters.getRowDimensions(e,t-1).end-o}px`})}get errorMessages(){return[eo("Please enter a number between 0 and 10000.")]}onKeydown(e){"ESCAPE"===e.key.toUpperCase()?this.props.focusGrid():"ENTER"===e.key.toUpperCase()&&this.onConfirm()}onInput(e){const t=e.target.value;this.state.inputValue=t;const o=Number(t);this.state.errorFlag=Number.isNaN(o)||o<=0||o>1e4}onConfirm(){if(this.state.errorFlag)return;const e=Number(this.state.inputValue),t=this.env.model.getters.getActiveSheetId(),o=this.env.model.getters.getNumberRows(t);this.env.model.dispatch("ADD_COLUMNS_ROWS",{sheetId:t,position:"after",base:o-1,quantity:e,dimension:"ROW"}),this.props.focusGrid();const{scrollX:s}=this.env.model.getters.getActiveSheetDOMScrollInfo(),{end:n}=this.env.model.getters.getRowDimensions(t,o+e-1);this.env.model.dispatch("SET_VIEWPORT_OFFSET",{offsetX:s,offsetY:n})}onExternalClick(e){this.inputRef.el===document.activeElement&&e.target!==this.inputRef.el&&this.props.focusGrid()}}function wE(e,...o){t.useEffect((e=>(e?.addEventListener(...o),()=>e?.removeEventListener(...o))),(()=>[e.el]))}function yE(e,o,s){let n={col:void 0,row:void 0};const{Date:i}=window;let r=0,a=0,l=0;function c(){return{col:e.model.getters.getColIndex(r),row:e.model.getters.getRowIndex(a)}}const{pause:h,resume:d}=function(e,o){let s;const{setInterval:n,clearInterval:i}=window;return t.useEffect((()=>(s=n(e,o),()=>i(s))),(()=>[o])),{pause:()=>{i(s),s=void 0},resume:()=>{void 0===s&&(s=n(e,o))}}}((function(){const{col:e,row:t}=c(),o=i.now()-l;o>300&&(e!==n.col||t!==n.row)&&g(void 0,void 0);if(o>300){if(e<0||t<0)return;g(e,t)}}),200);function u(e){o.el===e.target&&(r=e.offsetX,a=e.offsetY,l=i.now())}function g(e,t){e===n.col&&t===n.row||(n.col=e,n.row=t,s({col:e,row:t}))}return wE(o,"mousemove",u),wE(o,"mouseleave",(function(e){const t=e.offsetX,s=e.offsetY,n=Rr(o.el);return s<0||s>n.height||t<0||t>n.width?u(e):h()})),wE(o,"mouseenter",d),wE(o,"mousedown",(function(){const{col:e,row:t}=c();e===n.col&&t===n.row||g(void 0,void 0)})),t.useExternalListener(window,"click",(function(e){const t=e.target;o.el.contains(t)||g(void 0,void 0)})),n}ur`
1257
+ `;class EE extends t.Component{static template="o-spreadsheet-GridAddRowsFooter";static props={focusGrid:Function};static components={ValidationMessages:IS};inputRef=t.useRef("inputRef");state=t.useState({inputValue:"100",errorFlag:!1});setup(){t.useExternalListener(window,"click",this.onExternalClick,{capture:!0})}get addRowsPosition(){const e=this.env.model.getters.getActiveSheetId(),{numberOfRows:t}=this.env.model.getters.getSheetSize(e),{scrollY:o}=this.env.model.getters.getActiveSheetScrollInfo();return mr({top:`${this.env.model.getters.getRowDimensions(e,t-1).end-o}px`})}get errorMessages(){return[eo("Please enter a number between 0 and 10000.")]}onKeydown(e){"ESCAPE"===e.key.toUpperCase()?this.props.focusGrid():"ENTER"===e.key.toUpperCase()&&this.onConfirm()}onInput(e){const t=e.target.value;this.state.inputValue=t;const o=Number(t);this.state.errorFlag=Number.isNaN(o)||o<=0||o>1e4}onConfirm(){if(this.state.errorFlag)return;const e=Number(this.state.inputValue),t=this.env.model.getters.getActiveSheetId(),o=this.env.model.getters.getNumberRows(t);this.env.model.dispatch("ADD_COLUMNS_ROWS",{sheetId:t,position:"after",base:o-1,quantity:e,dimension:"ROW"}),this.props.focusGrid();const{scrollX:s}=this.env.model.getters.getActiveSheetDOMScrollInfo(),{end:n}=this.env.model.getters.getRowDimensions(t,o+e-1);this.env.model.dispatch("SET_VIEWPORT_OFFSET",{offsetX:s,offsetY:n})}onExternalClick(e){this.inputRef.el===document.activeElement&&e.target!==this.inputRef.el&&this.props.focusGrid()}}function wE(e,...o){t.useEffect((e=>(e?.addEventListener(...o),()=>e?.removeEventListener(...o))),(()=>[e.el]))}function yE(e,o,s){let n={col:void 0,row:void 0};const{Date:i}=window;let r,a,l=0;function c(){if(void 0===r||void 0===a)return{col:-1,row:-1};return{col:e.model.getters.getColIndex(r),row:e.model.getters.getRowIndex(a)}}const{pause:h,resume:d}=function(e,o){let s;const{setInterval:n,clearInterval:i}=window;return t.useEffect((()=>(s=n(e,o),()=>i(s))),(()=>[o])),{pause:()=>{i(s),s=void 0},resume:()=>{void 0===s&&(s=n(e,o))}}}((function(){const{col:e,row:t}=c(),o=i.now()-l;o>300&&(e!==n.col||t!==n.row)&&g(void 0,void 0);if(o>300){if(e<0||t<0)return;g(e,t)}}),200);function u(e){o.el===e.target&&(r=e.offsetX,a=e.offsetY,l=i.now())}function g(e,t){e===n.col&&t===n.row||(n.col=e,n.row=t,s({col:e,row:t}))}return wE(o,"mousemove",u),wE(o,"mouseleave",(function(e){const t=e.offsetX,s=e.offsetY,n=Rr(o.el);return s<0||s>n.height||t<0||t>n.width?u(e):h()})),wE(o,"mouseenter",d),wE(o,"mousedown",(function(){const{col:e,row:t}=c();e===n.col&&t===n.row||g(void 0,void 0)})),t.useExternalListener(window,"click",(function(e){const t=e.target;o.el.contains(t)||g(void 0,void 0)})),n}ur`
1258
1258
  .o-paint-format-cursor {
1259
1259
  cursor: url("data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="16"><path d="M6.5.4c1.3-.8 2.9-.1 3.8 1.4l2.9 5.1c.2.4.9 1.6-.4 2.3l-1.6.9 1.8 3.1c.2.4.1 1-.2 1.2l-1.6 1c-.3.1-.9 0-1.1-.4l-1.8-3.1-1.6 1c-.6.4-1.7 0-2.2-.8L0 4.3"/><path fill="#fff" d="M9.1 2a1.4 1.1 60 0 0-1.7-.6L5.5 2.5l.9 1.6-1 .6-.9-1.6-.6.4 1.8 3.1-1.3.7-1.8-3.1-1 .6 3.8 6.6 6.8-3.98M3.9 8.8 10.82 5l.795 1.4-6.81 3.96"/></svg>\n')}"), auto;
1260
1260
  }
@@ -2599,4 +2599,4 @@
2599
2599
  <tableParts count="${e.filterTables.length}">
2600
2600
  ${Py(a)}
2601
2601
  </tableParts>
2602
- `}var hA;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(hA||(hA={}));function dA(e,t={}){const o=le(t);return o.type=e,o}const uA={},gA={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:I,HEADER_WIDTH:R,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:T,DEFAULT_CELL_HEIGHT:A,SCROLLBAR_WIDTH:O},pA={autofillModifiersRegistry:sr,autofillRulesRegistry:nr,cellMenuRegistry:Ov,colMenuRegistry:mS,errorTypes:wo,linkMenuRegistry:Ta,functionRegistry:Jf,featurePluginRegistry:DR,statefulUIPluginRegistry:LR,coreViewsPluginRegistry:PR,corePluginRegistry:FR,rowMenuRegistry:bS,sidePanelRegistry:PC,figureRegistry:Rl,chartSidePanelComponentRegistry:ZS,chartComponentRegistry:El,chartRegistry:Cl,topbarMenuRegistry:SS,topbarComponentRegistry:kC,clickableCellRegistry:kR,otRegistry:CS,inverseCommandRegistry:_l,urlRegistry:Gi,cellPopoverRegistry:_a,numberFormatMenuRegistry:fS,repeatLocalCommandTransformRegistry:ER,repeatCommandTransformRegistry:CR},mA={arg:Sc,isEvaluationError:Mo,toBoolean:Go,toJsDate:Wo,toNumber:Fo,toString:Bo,toXC:pt,toZone:dn,toUnboundedZone:hn,toCartesian:gt,numberToLetters:lt,lettersToNumber:ht,UuidGenerator:oi,formatValue:xs,createCurrencyFormat:Bs,computeTextWidth:Zn,createEmptyWorkbookData:vx,createEmptySheet:fx,createEmptyExcelSheet:bx,getDefaultChartJsRuntime:Ya,chartFontColor:Ei,ChartColors:Ci,getFillingMode:Qa,rgbaToHex:ot,colorToRGBA:st,positionToZone:Fn,isDefined:Ie,isMatrix:bo,lazy:_e,genericRepeat:wR,createAction:ii,createActions:si,transformRangeData:ai,deepEquals:Fe},fA={isMarkdownLink:ve,parseMarkdownLink:Ce,markdownLink:Se,openLink:Yi,urlRepresentation:Zi},vA={Checkbox:RS,Section:TS,ChartColor:US,ChartDataSeries:AS,ChartErrorSection:OS,ChartLabelRange:_S,ChartTitle:BS,ChartPanel:YS,ChartFigure:yl,ChartJsComponent:li,Grid:UE,GridOverlay:xE,ScorecardChart:Bi,LineConfigPanel:WS,LineBarPieDesignPanel:HS,BarConfigPanel:NS,LineBarPieConfigPanel:MS,GaugeChartConfigPanel:zS,GaugeChartDesignPanel:GS,ScorecardChartConfigPanel:$S,ScorecardChartDesignPanel:qS,FigureComponent:VC,Menu:Hr,SelectionInput:xS,ValidationMessages:IS},bA={useDragAndDropListItems:JS};const SA={DEFAULT_LOCALE:fo};e.AbstractChart=ci,e.CellErrorType=Eo,e.CorePlugin=Cx,e.DispatchResult=ho,e.EvaluationError=yo,e.Model=class extends YI{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=[],n=new oi,i=!0){super(),Kt===jt&&Qt===Xt&&(Qt=()=>!0),s=gx(e,s);const r=dx(e,i);this.state=new wT,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(r.revisionId),this.coreGetters={},this.range=new iI(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 ET(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of FR.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of PR.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 LR.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of DR.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(this.exportData())}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 iR(bT({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:eo("Anonymous").toString()},o=e.transportService||new cT;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})}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(mo));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}}checkDispatchAllowed(e){const t=co(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new ho(t.flat()):ho.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}canDispatch=(e,t)=>this.checkDispatchAllowed(dA(e,t));dispatch=(e,t)=>{const o=dA(e,t);let s=this.status;if(this.getters.isReadonly()&&(n=o,!ao.has(n.type)))return new ho("Readonly");var n;if(!this.session.canApplyOptimisticUpdate())return new ho("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:n}=this.state.recordChanges((()=>{co(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,n,s),this.status=0,this.trigger("update");break;case 1:if(co(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(co(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return ho.Success};dispatchFromCorePlugin=(e,t)=>{const o=dA(e,t),s=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,o),this.status=s,ho.Success};dispatchToHandlers(e,t){const o=co(t);for(const s of e)!o&&s instanceof Cx||s.beforeHandle(t);for(const s of e)!o&&s instanceof Cx||s.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=vx();for(let t of this.handlers)t instanceof Cx&&t.export(e);return e.revisionId=this.session.getRevisionId()||$,e=le(e),e}updateMode(e){"normal"!==e&&this.dispatch("CANCEL_EDITION"),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...vx(),sheets:[bx(hx,"Sheet1")]};for(let t of this.handlers)t instanceof Sx&&t.exportForExcel(e);return e=le(e),lA(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Hi,e.Revision=sR,e.SPREADSHEET_DIMENSIONS=gA,e.Spreadsheet=lT,e.UIPlugin=rI,e.__info__=uA,e.addFunction=function e(t,o){return Jf.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.astToFormula=Bx,e.compile=Zx,e.compileTokens=Yx,e.components=vA,e.constants=SA,e.convertAstNodes=Px,e.coreTypes=lo,e.findCellInNewZone=Mn,e.functionCache=qx,e.helpers=mA,e.hooks=bA,e.invalidateCFEvaluationCommands=ro,e.invalidateDependenciesCommands=io,e.invalidateEvaluationCommands=no,e.iterateAstNodes=kx,e.links=fA,e.load=dx,e.parse=Dx,e.parseTokens=Lx,e.readonlyAllowedCommands=ao,e.registries=pA,e.setDefaultSheetViewSize=function(e){oe=e},e.setTranslationMethod=function(e,t=(()=>!0)){Kt=e,Qt=t},e.tokenize=qr,uA.version="17.1.24",uA.date="2024-07-18T14:21:58.787Z",uA.hash="46a558e"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2602
+ `}var hA;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(hA||(hA={}));function dA(e,t={}){const o=le(t);return o.type=e,o}const uA={},gA={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:I,HEADER_WIDTH:R,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:T,DEFAULT_CELL_HEIGHT:A,SCROLLBAR_WIDTH:O},pA={autofillModifiersRegistry:sr,autofillRulesRegistry:nr,cellMenuRegistry:Ov,colMenuRegistry:mS,errorTypes:wo,linkMenuRegistry:Ta,functionRegistry:Jf,featurePluginRegistry:DR,statefulUIPluginRegistry:LR,coreViewsPluginRegistry:PR,corePluginRegistry:FR,rowMenuRegistry:bS,sidePanelRegistry:PC,figureRegistry:Rl,chartSidePanelComponentRegistry:ZS,chartComponentRegistry:El,chartRegistry:Cl,topbarMenuRegistry:SS,topbarComponentRegistry:kC,clickableCellRegistry:kR,otRegistry:CS,inverseCommandRegistry:_l,urlRegistry:Gi,cellPopoverRegistry:_a,numberFormatMenuRegistry:fS,repeatLocalCommandTransformRegistry:ER,repeatCommandTransformRegistry:CR},mA={arg:Sc,isEvaluationError:Mo,toBoolean:Go,toJsDate:Wo,toNumber:Fo,toString:Bo,toXC:pt,toZone:dn,toUnboundedZone:hn,toCartesian:gt,numberToLetters:lt,lettersToNumber:ht,UuidGenerator:oi,formatValue:xs,createCurrencyFormat:Bs,computeTextWidth:Zn,createEmptyWorkbookData:vx,createEmptySheet:fx,createEmptyExcelSheet:bx,getDefaultChartJsRuntime:Ya,chartFontColor:Ei,ChartColors:Ci,getFillingMode:Qa,rgbaToHex:ot,colorToRGBA:st,positionToZone:Fn,isDefined:Ie,isMatrix:bo,lazy:_e,genericRepeat:wR,createAction:ii,createActions:si,transformRangeData:ai,deepEquals:Fe},fA={isMarkdownLink:ve,parseMarkdownLink:Ce,markdownLink:Se,openLink:Yi,urlRepresentation:Zi},vA={Checkbox:RS,Section:TS,ChartColor:US,ChartDataSeries:AS,ChartErrorSection:OS,ChartLabelRange:_S,ChartTitle:BS,ChartPanel:YS,ChartFigure:yl,ChartJsComponent:li,Grid:UE,GridOverlay:xE,ScorecardChart:Bi,LineConfigPanel:WS,LineBarPieDesignPanel:HS,BarConfigPanel:NS,LineBarPieConfigPanel:MS,GaugeChartConfigPanel:zS,GaugeChartDesignPanel:GS,ScorecardChartConfigPanel:$S,ScorecardChartDesignPanel:qS,FigureComponent:VC,Menu:Hr,SelectionInput:xS,ValidationMessages:IS},bA={useDragAndDropListItems:JS};const SA={DEFAULT_LOCALE:fo};e.AbstractChart=ci,e.CellErrorType=Eo,e.CorePlugin=Cx,e.DispatchResult=ho,e.EvaluationError=yo,e.Model=class extends YI{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=[],n=new oi,i=!0){super(),Kt===jt&&Qt===Xt&&(Qt=()=>!0),s=gx(e,s);const r=dx(e,i);this.state=new wT,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(r.revisionId),this.coreGetters={},this.range=new iI(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 ET(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of FR.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of PR.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 LR.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of DR.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(this.exportData())}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 iR(bT({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:eo("Anonymous").toString()},o=e.transportService||new cT;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})}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(mo));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}}checkDispatchAllowed(e){const t=co(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new ho(t.flat()):ho.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}canDispatch=(e,t)=>this.checkDispatchAllowed(dA(e,t));dispatch=(e,t)=>{const o=dA(e,t);let s=this.status;if(this.getters.isReadonly()&&(n=o,!ao.has(n.type)))return new ho("Readonly");var n;if(!this.session.canApplyOptimisticUpdate())return new ho("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:n}=this.state.recordChanges((()=>{co(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,n,s),this.status=0,this.trigger("update");break;case 1:if(co(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(co(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return ho.Success};dispatchFromCorePlugin=(e,t)=>{const o=dA(e,t),s=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,o),this.status=s,ho.Success};dispatchToHandlers(e,t){const o=co(t);for(const s of e)!o&&s instanceof Cx||s.beforeHandle(t);for(const s of e)!o&&s instanceof Cx||s.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=vx();for(let t of this.handlers)t instanceof Cx&&t.export(e);return e.revisionId=this.session.getRevisionId()||$,e=le(e),e}updateMode(e){"normal"!==e&&this.dispatch("CANCEL_EDITION"),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...vx(),sheets:[bx(hx,"Sheet1")]};for(let t of this.handlers)t instanceof Sx&&t.exportForExcel(e);return e=le(e),lA(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Hi,e.Revision=sR,e.SPREADSHEET_DIMENSIONS=gA,e.Spreadsheet=lT,e.UIPlugin=rI,e.__info__=uA,e.addFunction=function e(t,o){return Jf.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.astToFormula=Bx,e.compile=Zx,e.compileTokens=Yx,e.components=vA,e.constants=SA,e.convertAstNodes=Px,e.coreTypes=lo,e.findCellInNewZone=Mn,e.functionCache=qx,e.helpers=mA,e.hooks=bA,e.invalidateCFEvaluationCommands=ro,e.invalidateDependenciesCommands=io,e.invalidateEvaluationCommands=no,e.iterateAstNodes=kx,e.links=fA,e.load=dx,e.parse=Dx,e.parseTokens=Lx,e.readonlyAllowedCommands=ao,e.registries=pA,e.setDefaultSheetViewSize=function(e){oe=e},e.setTranslationMethod=function(e,t=(()=>!0)){Kt=e,Qt=t},e.tokenize=qr,uA.version="17.1.25",uA.date="2024-07-24T10:26:01.576Z",uA.hash="0edff47"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
@@ -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.1.24
5
- @date 2024-07-18T14:22:32.492Z
6
- @hash 46a558e
4
+ @version 17.1.25
5
+ @date 2024-07-24T10:26:35.452Z
6
+ @hash 0edff47
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.1.24",
3
+ "version": "17.1.25",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",