@odoo/o-spreadsheet 18.1.0 → 18.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 18.1.0
6
- * @date 2024-12-26T06:37:07.879Z
7
- * @hash c520e89
5
+ * @version 18.2.0-alpha.0
6
+ * @date 2024-12-26T08:02:39.123Z
7
+ * @hash 0f45915
8
8
  */
9
9
 
10
10
  'use strict';
@@ -74833,6 +74833,6 @@ exports.tokenColors = tokenColors;
74833
74833
  exports.tokenize = tokenize;
74834
74834
 
74835
74835
 
74836
- __info__.version = "18.1.0";
74837
- __info__.date = "2024-12-26T06:37:07.879Z";
74838
- __info__.hash = "c520e89";
74836
+ __info__.version = "18.2.0-alpha.0";
74837
+ __info__.date = "2024-12-26T08:02:39.123Z";
74838
+ __info__.hash = "0f45915";
@@ -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 18.1.0
6
- * @date 2024-12-26T06:37:07.879Z
7
- * @hash c520e89
5
+ * @version 18.2.0-alpha.0
6
+ * @date 2024-12-26T08:02:39.123Z
7
+ * @hash 0f45915
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -74787,6 +74787,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
74787
74787
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
74788
74788
 
74789
74789
 
74790
- __info__.version = "18.1.0";
74791
- __info__.date = "2024-12-26T06:37:07.879Z";
74792
- __info__.hash = "c520e89";
74790
+ __info__.version = "18.2.0-alpha.0";
74791
+ __info__.date = "2024-12-26T08:02:39.123Z";
74792
+ __info__.hash = "0f45915";
@@ -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 18.1.0
6
- * @date 2024-12-26T06:37:07.879Z
7
- * @hash c520e89
5
+ * @version 18.2.0-alpha.0
6
+ * @date 2024-12-26T08:02:39.123Z
7
+ * @hash 0f45915
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -74832,9 +74832,9 @@ stores.inject(MyMetaStore, storeInstance);
74832
74832
  exports.tokenize = tokenize;
74833
74833
 
74834
74834
 
74835
- __info__.version = "18.1.0";
74836
- __info__.date = "2024-12-26T06:37:07.879Z";
74837
- __info__.hash = "c520e89";
74835
+ __info__.version = "18.2.0-alpha.0";
74836
+ __info__.date = "2024-12-26T08:02:39.123Z";
74837
+ __info__.hash = "0f45915";
74838
74838
 
74839
74839
 
74840
74840
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -3259,4 +3259,4 @@
3259
3259
  <tableParts count="${e.tables.length}">
3260
3260
  ${Rw(a)}
3261
3261
  </tableParts>
3262
- `}var jk;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(jk||(jk={}));function Yk(e,t={}){const o=Be(t);return o.type=e,o}const Xk={},Kk={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:ee,HEADER_WIDTH:te,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:oe,DEFAULT_CELL_HEIGHT:se,SCROLLBAR_WIDTH:ie},Jk={autoCompleteProviders:bh,autofillModifiersRegistry:mS,autofillRulesRegistry:fS,cellMenuRegistry:HT,colMenuRegistry:__,errorTypes:Ii,linkMenuRegistry:GI,functionRegistry:Pb,featurePluginRegistry:nN,iconsOnCellRegistry:hy,statefulUIPluginRegistry:aN,coreViewsPluginRegistry:lN,corePluginRegistry:rN,rowMenuRegistry:M_,sidePanelRegistry:DF,figureRegistry:lI,chartSidePanelComponentRegistry:TD,chartComponentRegistry:tI,chartRegistry:eI,chartSubtypeRegistry:sI,topbarMenuRegistry:N_,topbarComponentRegistry:OF,clickableCellRegistry:cN,otRegistry:k_,inverseCommandRegistry:uI,urlRegistry:yr,cellPopoverRegistry:ES,numberFormatMenuRegistry:D_,repeatLocalCommandTransformRegistry:tN,repeatCommandTransformRegistry:eN,clipboardHandlersRegistries:dc,pivotRegistry:oF,pivotTimeAdapterRegistry:Rl,pivotSidePanelRegistry:nF,pivotNormalizationValueRegistry:oc,supportedPivotPositionalFormulaRegistry:pS,pivotToFunctionValueRegistry:sc,migrationStepRegistry:Yw},Qk={arg:wh,isEvaluationError:Ni,toBoolean:ji,toJsDate:Yi,toNumber:Li,toString:Gi,toNormalizedPivotValue:Jl,toXC:So,toZone:jo,toUnboundedZone:Zo,toCartesian:bo,numberToLetters:mo,lettersToNumber:fo,UuidGenerator:na,formatValue:Xr,createCurrencyFormat:dn,ColorGenerator:co,computeTextWidth:Zn,createEmptyWorkbookData:sE,createEmptySheet:oE,createEmptyExcelSheet:iE,rgbaToHex:Gt,colorToRGBA:qt,positionToZone:ms,isDefined:at,isMatrix:yi,lazy:ut,genericRepeat:oN,createAction:i,createActions:o,transformRangeData:gc,deepEquals:mt,overlap:rs,union:os,isInside:ns,deepCopy:Be,expandZoneOnInsertion:Jo,reduceZoneOnDeletion:ts,unquote:$e,getMaxObjectId:Wl,getFunctionsFromTokens:nS,getFirstPivotFunction:uS,getNumberOfPivotFunctions:gS,parseDimension:Zl,isDateOrDatetimeField:jl,makeFieldProposal:lS,insertTokenAfterArgSeparator:cS,insertTokenAfterLeftParenthesis:hS,mergeContiguousZones:ys,getPivotHighlights:P_,pivotTimeAdapter:Tl,UNDO_REDO_PIVOT_COMMANDS:AP,createPivotFormula:Kl,areDomainArgsFieldsValid:Xl,splitReference:Go,sanitizeSheetName:Ge},eL={isMarkdownLink:Qe,parseMarkdownLink:ot,markdownLink:tt,openLink:Ir,urlRepresentation:xr},tL={Checkbox:DI,Section:L_,RoundColorPicker:aD,ChartDataSeries:$_,ChartErrorSection:G_,ChartLabelRange:q_,ChartTitle:rD,ChartPanel:DD,ChartFigure:rI,ChartJsComponent:oh,Grid:OM,GridOverlay:hM,ScorecardChart:vh,LineConfigPanel:CD,BarConfigPanel:j_,PieChartDesignPanel:wD,GenericChartConfigPanel:Z_,ChartWithAxisDesignPanel:gD,GaugeChartConfigPanel:mD,GaugeChartDesignPanel:fD,ScorecardChartConfigPanel:xD,ScorecardChartDesignPanel:ID,RadarChartDesignPanel:ED,WaterfallChartDesignPanel:RD,ComboChartDesignPanel:pD,ChartTypePicker:AD,FigureComponent:FF,Menu:oR,Popover:xI,SelectionInput:z_,ValidationMessages:W_,AddDimensionButton:OO,PivotDimensionGranularity:NO,PivotDimensionOrder:kO,PivotDimension:PO,PivotLayoutConfigurator:HO,PivotDeferUpdate:DO,PivotTitleSection:UO,CogWheelMenu:MO,TextInput:FO,SidePanelCollapsible:X_,RadioSelection:hD},oL={useDragAndDropListItems:GD,useHighlights:JD,useHighlightsOnHover:KD},sL={useStoreProvider:bc,DependencyContainer:mc,CellPopoverStore:bI,ComposerFocusStore:_c,CellComposerStore:$F,FindAndReplaceStore:xO,HighlightStore:Bb,HoveredCellStore:vI,ModelStore:xc,NotificationStore:zb,RendererStore:Rc,SelectionInputStore:B_,SpreadsheetStore:Tc,useStore:Sc,useLocalStore:yc,SidePanelStore:TM,PivotSidePanelStore:iF,PivotMeasureDisplayPanelStore:AO};const iL={DEFAULT_LOCALE:bi,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:ke,ChartTerms:dE},rL={...hR,...Fx};e.AbstractCellClipboardHandler=da,e.AbstractChart=sh,e.AbstractFigureClipboardHandler=lc,e.CellErrorType=xi,e.CorePlugin=MM,e.DispatchResult=pi,e.EvaluationError=Ri,e.Model=class extends pc{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new na,r=!1){const n=performance.now();console.debug("##### Model creation #####"),super(),Ao===Ro&&_o===To&&(_o=()=>!0),s=eE(e,s);const a=Qw(e,r);this.state=new YN,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new HM(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.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new ZN(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of rN.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of lN.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of aN.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of nN.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t)}if(this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-n,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:ut((()=>this.exportData()));await this.session.leave(e)}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)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return 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 $P(WN({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:Oo("Anonymous").toString()},o=e.transportService||new kN;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}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(vi));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}checkDispatchAllowed(e){const t=gi(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new pi(t.flat()):pi.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,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(Yk(e,t));dispatch=(e,t)=>{const o=Yk(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!di.has(i.type)))return new pi("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new pi("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();gi(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(gi(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(gi(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return pi.Success};dispatchFromCorePlugin=(e,t)=>{const o=Yk(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,pi.Success};dispatchToHandlers(e,t){const o=gi(t);for(const s of e)!o&&s instanceof MM||s.beforeHandle(t);for(const s of e)!o&&s instanceof MM||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=sE();for(let t of this.handlers)t instanceof MM&&t.export(e);return e.revisionId=this.session.getRevisionId()||Se,e=Be(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...sE(),sheets:[iE(Jw,"Sheet1")]};for(let t of this.handlers)t instanceof FM&&t.exportForExcel(e);return e=Be(e),qk(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=BO,e.Registry=r,e.Revision=BP,e.SPREADSHEET_DIMENSIONS=Kk,e.Spreadsheet=NN,e.SpreadsheetPivotTable=WO,e.UIPlugin=zM,e.__info__=Xk,e.addFunction=function e(t,o){return Pb.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(wi[e])throw new Error(`Layer ${e} already exists`);wi[e]=t},e.astToFormula=If,e.chartHelpers=rL,e.compile=tS,e.compileTokens=oS,e.components=tL,e.constants=iL,e.convertAstNodes=Cf,e.coreTypes=ui,e.findCellInNewZone=ps,e.functionCache=eS,e.helpers=Qk,e.hooks=oL,e.invalidateCFEvaluationCommands=ci,e.invalidateDependenciesCommands=li,e.invalidateEvaluationCommands=ni,e.iterateAstNodes=wf,e.links=eL,e.load=Qw,e.parse=Sf,e.parseTokens=yf,e.readonlyAllowedCommands=di,e.registries=Jk,e.setDefaultSheetViewSize=function(e){Fe=e},e.setTranslationMethod=function(e,t=(()=>!0)){Ao=e,_o=t},e.stores=sL,e.tokenColors=Gb,e.tokenize=ma,Xk.version="18.1.0",Xk.date="2024-12-26T06:37:07.879Z",Xk.hash="c520e89"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
3262
+ `}var jk;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(jk||(jk={}));function Yk(e,t={}){const o=Be(t);return o.type=e,o}const Xk={},Kk={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:ee,HEADER_WIDTH:te,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:oe,DEFAULT_CELL_HEIGHT:se,SCROLLBAR_WIDTH:ie},Jk={autoCompleteProviders:bh,autofillModifiersRegistry:mS,autofillRulesRegistry:fS,cellMenuRegistry:HT,colMenuRegistry:__,errorTypes:Ii,linkMenuRegistry:GI,functionRegistry:Pb,featurePluginRegistry:nN,iconsOnCellRegistry:hy,statefulUIPluginRegistry:aN,coreViewsPluginRegistry:lN,corePluginRegistry:rN,rowMenuRegistry:M_,sidePanelRegistry:DF,figureRegistry:lI,chartSidePanelComponentRegistry:TD,chartComponentRegistry:tI,chartRegistry:eI,chartSubtypeRegistry:sI,topbarMenuRegistry:N_,topbarComponentRegistry:OF,clickableCellRegistry:cN,otRegistry:k_,inverseCommandRegistry:uI,urlRegistry:yr,cellPopoverRegistry:ES,numberFormatMenuRegistry:D_,repeatLocalCommandTransformRegistry:tN,repeatCommandTransformRegistry:eN,clipboardHandlersRegistries:dc,pivotRegistry:oF,pivotTimeAdapterRegistry:Rl,pivotSidePanelRegistry:nF,pivotNormalizationValueRegistry:oc,supportedPivotPositionalFormulaRegistry:pS,pivotToFunctionValueRegistry:sc,migrationStepRegistry:Yw},Qk={arg:wh,isEvaluationError:Ni,toBoolean:ji,toJsDate:Yi,toNumber:Li,toString:Gi,toNormalizedPivotValue:Jl,toXC:So,toZone:jo,toUnboundedZone:Zo,toCartesian:bo,numberToLetters:mo,lettersToNumber:fo,UuidGenerator:na,formatValue:Xr,createCurrencyFormat:dn,ColorGenerator:co,computeTextWidth:Zn,createEmptyWorkbookData:sE,createEmptySheet:oE,createEmptyExcelSheet:iE,rgbaToHex:Gt,colorToRGBA:qt,positionToZone:ms,isDefined:at,isMatrix:yi,lazy:ut,genericRepeat:oN,createAction:i,createActions:o,transformRangeData:gc,deepEquals:mt,overlap:rs,union:os,isInside:ns,deepCopy:Be,expandZoneOnInsertion:Jo,reduceZoneOnDeletion:ts,unquote:$e,getMaxObjectId:Wl,getFunctionsFromTokens:nS,getFirstPivotFunction:uS,getNumberOfPivotFunctions:gS,parseDimension:Zl,isDateOrDatetimeField:jl,makeFieldProposal:lS,insertTokenAfterArgSeparator:cS,insertTokenAfterLeftParenthesis:hS,mergeContiguousZones:ys,getPivotHighlights:P_,pivotTimeAdapter:Tl,UNDO_REDO_PIVOT_COMMANDS:AP,createPivotFormula:Kl,areDomainArgsFieldsValid:Xl,splitReference:Go,sanitizeSheetName:Ge},eL={isMarkdownLink:Qe,parseMarkdownLink:ot,markdownLink:tt,openLink:Ir,urlRepresentation:xr},tL={Checkbox:DI,Section:L_,RoundColorPicker:aD,ChartDataSeries:$_,ChartErrorSection:G_,ChartLabelRange:q_,ChartTitle:rD,ChartPanel:DD,ChartFigure:rI,ChartJsComponent:oh,Grid:OM,GridOverlay:hM,ScorecardChart:vh,LineConfigPanel:CD,BarConfigPanel:j_,PieChartDesignPanel:wD,GenericChartConfigPanel:Z_,ChartWithAxisDesignPanel:gD,GaugeChartConfigPanel:mD,GaugeChartDesignPanel:fD,ScorecardChartConfigPanel:xD,ScorecardChartDesignPanel:ID,RadarChartDesignPanel:ED,WaterfallChartDesignPanel:RD,ComboChartDesignPanel:pD,ChartTypePicker:AD,FigureComponent:FF,Menu:oR,Popover:xI,SelectionInput:z_,ValidationMessages:W_,AddDimensionButton:OO,PivotDimensionGranularity:NO,PivotDimensionOrder:kO,PivotDimension:PO,PivotLayoutConfigurator:HO,PivotDeferUpdate:DO,PivotTitleSection:UO,CogWheelMenu:MO,TextInput:FO,SidePanelCollapsible:X_,RadioSelection:hD},oL={useDragAndDropListItems:GD,useHighlights:JD,useHighlightsOnHover:KD},sL={useStoreProvider:bc,DependencyContainer:mc,CellPopoverStore:bI,ComposerFocusStore:_c,CellComposerStore:$F,FindAndReplaceStore:xO,HighlightStore:Bb,HoveredCellStore:vI,ModelStore:xc,NotificationStore:zb,RendererStore:Rc,SelectionInputStore:B_,SpreadsheetStore:Tc,useStore:Sc,useLocalStore:yc,SidePanelStore:TM,PivotSidePanelStore:iF,PivotMeasureDisplayPanelStore:AO};const iL={DEFAULT_LOCALE:bi,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:ke,ChartTerms:dE},rL={...hR,...Fx};e.AbstractCellClipboardHandler=da,e.AbstractChart=sh,e.AbstractFigureClipboardHandler=lc,e.CellErrorType=xi,e.CorePlugin=MM,e.DispatchResult=pi,e.EvaluationError=Ri,e.Model=class extends pc{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new na,r=!1){const n=performance.now();console.debug("##### Model creation #####"),super(),Ao===Ro&&_o===To&&(_o=()=>!0),s=eE(e,s);const a=Qw(e,r);this.state=new YN,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new HM(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.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new ZN(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of rN.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of lN.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of aN.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of nN.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t)}if(this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-n,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:ut((()=>this.exportData()));await this.session.leave(e)}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)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return 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 $P(WN({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:Oo("Anonymous").toString()},o=e.transportService||new kN;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}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(vi));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}checkDispatchAllowed(e){const t=gi(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new pi(t.flat()):pi.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,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(Yk(e,t));dispatch=(e,t)=>{const o=Yk(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!di.has(i.type)))return new pi("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new pi("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();gi(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(gi(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(gi(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return pi.Success};dispatchFromCorePlugin=(e,t)=>{const o=Yk(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,pi.Success};dispatchToHandlers(e,t){const o=gi(t);for(const s of e)!o&&s instanceof MM||s.beforeHandle(t);for(const s of e)!o&&s instanceof MM||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=sE();for(let t of this.handlers)t instanceof MM&&t.export(e);return e.revisionId=this.session.getRevisionId()||Se,e=Be(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...sE(),sheets:[iE(Jw,"Sheet1")]};for(let t of this.handlers)t instanceof FM&&t.exportForExcel(e);return e=Be(e),qk(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=BO,e.Registry=r,e.Revision=BP,e.SPREADSHEET_DIMENSIONS=Kk,e.Spreadsheet=NN,e.SpreadsheetPivotTable=WO,e.UIPlugin=zM,e.__info__=Xk,e.addFunction=function e(t,o){return Pb.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(wi[e])throw new Error(`Layer ${e} already exists`);wi[e]=t},e.astToFormula=If,e.chartHelpers=rL,e.compile=tS,e.compileTokens=oS,e.components=tL,e.constants=iL,e.convertAstNodes=Cf,e.coreTypes=ui,e.findCellInNewZone=ps,e.functionCache=eS,e.helpers=Qk,e.hooks=oL,e.invalidateCFEvaluationCommands=ci,e.invalidateDependenciesCommands=li,e.invalidateEvaluationCommands=ni,e.iterateAstNodes=wf,e.links=eL,e.load=Qw,e.parse=Sf,e.parseTokens=yf,e.readonlyAllowedCommands=di,e.registries=Jk,e.setDefaultSheetViewSize=function(e){Fe=e},e.setTranslationMethod=function(e,t=(()=>!0)){Ao=e,_o=t},e.stores=sL,e.tokenColors=Gb,e.tokenize=ma,Xk.version="18.2.0-alpha.0",Xk.date="2024-12-26T08:02:39.123Z",Xk.hash="0f45915"}(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 18.1.0
5
- @date 2024-12-26T06:37:49.767Z
6
- @hash c520e89
4
+ @version 18.2.0-alpha.0
5
+ @date 2024-12-26T08:03:23.646Z
6
+ @hash 0f45915
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": "18.1.0",
3
+ "version": "18.2.0-alpha.0",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",
@@ -137,6 +137,6 @@
137
137
  "*": "prettier --write"
138
138
  },
139
139
  "publishConfig": {
140
- "tag": "latest"
140
+ "tag": "alpha"
141
141
  }
142
142
  }