@odoo/o-spreadsheet 18.0.0 → 18.1.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.0.0
6
- * @date 2024-09-25T12:54:19.974Z
7
- * @hash cee2e47
5
+ * @version 18.1.0-alpha.0
6
+ * @date 2024-09-25T13:17:49.636Z
7
+ * @hash 288f0b7
8
8
  */
9
9
 
10
10
  'use strict';
@@ -72175,6 +72175,6 @@ exports.tokenColors = tokenColors;
72175
72175
  exports.tokenize = tokenize;
72176
72176
 
72177
72177
 
72178
- __info__.version = "18.0.0";
72179
- __info__.date = "2024-09-25T12:54:19.974Z";
72180
- __info__.hash = "cee2e47";
72178
+ __info__.version = "18.1.0-alpha.0";
72179
+ __info__.date = "2024-09-25T13:17:49.636Z";
72180
+ __info__.hash = "288f0b7";
@@ -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.0.0
6
- * @date 2024-09-25T12:54:19.974Z
7
- * @hash cee2e47
5
+ * @version 18.1.0-alpha.0
6
+ * @date 2024-09-25T13:17:49.636Z
7
+ * @hash 288f0b7
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';
@@ -72130,6 +72130,6 @@ const constants = {
72130
72130
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, 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 };
72131
72131
 
72132
72132
 
72133
- __info__.version = "18.0.0";
72134
- __info__.date = "2024-09-25T12:54:19.974Z";
72135
- __info__.hash = "cee2e47";
72133
+ __info__.version = "18.1.0-alpha.0";
72134
+ __info__.date = "2024-09-25T13:17:49.636Z";
72135
+ __info__.hash = "288f0b7";
@@ -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.0.0
6
- * @date 2024-09-25T12:54:19.974Z
7
- * @hash cee2e47
5
+ * @version 18.1.0-alpha.0
6
+ * @date 2024-09-25T13:17:49.636Z
7
+ * @hash 288f0b7
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -72174,9 +72174,9 @@ stores.inject(MyMetaStore, storeInstance);
72174
72174
  exports.tokenize = tokenize;
72175
72175
 
72176
72176
 
72177
- __info__.version = "18.0.0";
72178
- __info__.date = "2024-09-25T12:54:19.974Z";
72179
- __info__.hash = "cee2e47";
72177
+ __info__.version = "18.1.0-alpha.0";
72178
+ __info__.date = "2024-09-25T13:17:49.636Z";
72179
+ __info__.hash = "288f0b7";
72180
72180
 
72181
72181
 
72182
72182
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -3187,4 +3187,4 @@
3187
3187
  <tableParts count="${e.tables.length}">
3188
3188
  ${dw(a)}
3189
3189
  </tableParts>
3190
- `}var VN;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(VN||(VN={}));function UN(e,t={}){const o=Oe(t);return o.type=e,o}const HN={},zN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:q,HEADER_WIDTH:Z,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:j,DEFAULT_CELL_HEIGHT:Y,SCROLLBAR_WIDTH:X},BN={autoCompleteProviders:Fc,autofillModifiersRegistry:pS,autofillRulesRegistry:mS,cellMenuRegistry:sR,colMenuRegistry:$T,errorTypes:si,linkMenuRegistry:Ax,functionRegistry:Zv,featurePluginRegistry:sM,iconsOnCellRegistry:hy,statefulUIPluginRegistry:iM,coreViewsPluginRegistry:nM,corePluginRegistry:oM,rowMenuRegistry:ZT,sidePanelRegistry:ID,figureRegistry:jE,chartSidePanelComponentRegistry:FA,chartComponentRegistry:zE,chartRegistry:HE,chartSubtypeRegistry:$E,topbarMenuRegistry:KT,topbarComponentRegistry:RD,clickableCellRegistry:rM,otRegistry:QT,inverseCommandRegistry:QE,urlRegistry:tS,cellPopoverRegistry:CS,numberFormatMenuRegistry:GT,repeatLocalCommandTransformRegistry:QF,repeatCommandTransformRegistry:KF,clipboardHandlersRegistries:Il,pivotRegistry:Q_,pivotTimeAdapterRegistry:$a,pivotSidePanelRegistry:oD,pivotNormalizationValueRegistry:Sl,supportedPivotPositionalFormulaRegistry:Jb,pivotToFunctionValueRegistry:yl,migrationStepRegistry:Mw},$N={arg:kc,isEvaluationError:gi,toBoolean:Ri,toJsDate:Ti,toNumber:mi,toString:Ei,toNormalizedPivotValue:ml,toXC:Kt,toZone:To,toUnboundedZone:Ro,toCartesian:Xt,numberToLetters:Zt,lettersToNumber:jt,UuidGenerator:wr,formatValue:In,createCurrencyFormat:Un,ColorGenerator:qt,computeTextWidth:cr,createEmptyWorkbookData:zw,createEmptySheet:Hw,createEmptyExcelSheet:Bw,getDefaultChartJsRuntime:aE,chartFontColor:ec,getChartAxisTitleRuntime:ic,getChartAxisType:CE,getTrendDatasetForBarChart:ac,getTrendDatasetForLineChart:IE,getFillingMode:dE,rgbaToHex:Ot,colorToRGBA:Ft,positionToZone:jo,isDefined:Ye,isMatrix:Qs,lazy:et,genericRepeat:JF,createAction:Ir,createActions:Er,transformRangeData:Tl,deepEquals:st,overlap:Vo,union:Po,isInside:Uo,deepCopy:Oe,expandZoneOnInsertion:Oo,reduceZoneOnDeletion:No,unquote:Me,getMaxObjectId:al,getFunctionsFromTokens:Wb,getFirstPivotFunction:Kb,getNumberOfPivotFunctions:Qb,parseDimension:hl,isDateOrDatetimeField:dl,makeFieldProposal:Zb,insertTokenAfterArgSeparator:jb,insertTokenAfterLeftParenthesis:Yb,mergeContiguousZones:Jo,getPivotHighlights:jT,pivotTimeAdapter:Ga,UNDO_REDO_PIVOT_COMMANDS:xF,createPivotFormula:pl,areDomainArgsFieldsValid:gl,splitReference:xo,formatTickValue:hc},GN={isMarkdownLink:ze,parseMarkdownLink:Ge,markdownLink:$e,openLink:rS,urlRepresentation:nS},WN={Checkbox:JT,Section:eA,RoundColorPicker:SA,ChartDataSeries:iA,ChartErrorSection:rA,ChartLabelRange:aA,ChartTitle:CA,ChartPanel:PA,ChartFigure:WE,ChartJsComponent:vc,Grid:RO,GridOverlay:nO,ScorecardChart:Oc,LineConfigPanel:TA,BarConfigPanel:cA,PieChartDesignPanel:AA,GenericChartConfigPanel:lA,ChartWithAxisDesignPanel:xA,GaugeChartConfigPanel:IA,GaugeChartDesignPanel:RA,ScorecardChartConfigPanel:_A,ScorecardChartDesignPanel:DA,ChartTypePicker:MA,FigureComponent:TD,Menu:_x,Popover:lx,SelectionInput:sA,ValidationMessages:nA,AddDimensionButton:A_,PivotDimensionGranularity:F_,PivotDimensionOrder:M_,PivotDimension:O_,PivotLayoutConfigurator:P_,EditableName:TO,PivotDeferUpdate:T_,PivotTitleSection:k_,CogWheelMenu:D_,TextInput:__,SidePanelCollapsible:dA},qN={useDragAndDropListItems:zA,useHighlights:jA,useHighlightsOnHover:ZA},ZN={useStoreProvider:Fl,DependencyContainer:_l,CellPopoverStore:ix,ComposerFocusStore:$l,CellComposerStore:VD,FindAndReplaceStore:C_,HighlightStore:XT,HoveredCellStore:sx,ModelStore:Vl,NotificationStore:kA,RendererStore:Hl,SelectionInputStore:oA,SpreadsheetStore:zl,useStore:Ml,useLocalStore:Nl,SidePanelStore:wO,PivotSidePanelStore:eD,PivotMeasureDisplayPanelStore:I_};const jN={DEFAULT_LOCALE:Xs,HIGHLIGHT_COLOR:s,PIVOT_TABLE_CONFIG:Te,TREND_LINE_XAXIS_ID:Gl,CHART_AXIS_CHOICES:uc};e.AbstractCellClipboardHandler=Dr,e.AbstractChart=bc,e.AbstractFigureClipboardHandler=xl,e.CellErrorType=oi,e.CorePlugin=_O,e.DispatchResult=qs,e.EvaluationError=ii,e.Model=class extends Al{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=[],i=new wr,n=!1){const r=performance.now();console.group("Model creation"),super(),ro===io&&ao===no&&(ao=()=>!0),s=Vw(e,s);const a=Lw(e,n);this.state=new ZM,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new kO(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.uuidGenerator.setIsFastStrategy(!0),this.selection=new WM(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of oM.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of nM.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 iM.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of sM.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.info("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.info("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.info("Model created in",performance.now()-r,"ms"),console.groupEnd()}joinSession(){this.session.join(this.config.client)}async leaveSession(){await this.session.leave(et((()=>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)}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 UF(BM({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:co("Anonymous").toString()},o=e.transportService||new NM;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(Ys));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,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||[]}}checkDispatchAllowed(e){const t=Ws(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new qs(t.flat()):qs.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(UN(e,t));dispatch=(e,t)=>{const o=UN(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!$s.has(i.type)))return new qs("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new qs("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();Ws(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.info(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(Ws(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(Ws(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return qs.Success};dispatchFromCorePlugin=(e,t)=>{const o=UN(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,qs.Success};dispatchToHandlers(e,t){const o=Ws(t);for(const s of e)!o&&s instanceof _O||s.beforeHandle(t);for(const s of e)!o&&s instanceof _O||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=zw();for(let t of this.handlers)t instanceof _O&&t.export(e);return e.revisionId=this.session.getRevisionId()||de,e=Oe(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...zw(),sheets:[Bw(kw,"Sheet1")]};for(let t of this.handlers)t instanceof AO&&t.exportForExcel(e);return e=Oe(e),kN(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=L_,e.Registry=Rr,e.Revision=LF,e.SPREADSHEET_DIMENSIONS=zN,e.Spreadsheet=MM,e.SpreadsheetPivotTable=H_,e.UIPlugin=VO,e.__info__=HN,e.addFunction=function e(t,o){return Zv.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(ei[e])throw new Error(`Layer ${e} already exists`);ei[e]=t},e.astToFormula=Lm,e.compile=Hb,e.compileTokens=zb,e.components=WN,e.constants=jN,e.convertAstNodes=Mm,e.coreTypes=Gs,e.findCellInNewZone=Zo,e.functionCache=Ub,e.helpers=$N,e.hooks=qN,e.invalidateCFEvaluationCommands=zs,e.invalidateDependenciesCommands=Hs,e.invalidateEvaluationCommands=Vs,e.iterateAstNodes=Nm,e.links=GN,e.load=Lw,e.parse=Om,e.parseTokens=Fm,e.readonlyAllowedCommands=$s,e.registries=BN,e.setDefaultSheetViewSize=function(e){Ee=e},e.setTranslationMethod=function(e,t=(()=>!0)){ro=e,ao=t},e.stores=ZN,e.tokenColors=Db,e.tokenize=Mr,HN.version="18.0.0",HN.date="2024-09-25T12:54:19.974Z",HN.hash="cee2e47"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
3190
+ `}var VN;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(VN||(VN={}));function UN(e,t={}){const o=Oe(t);return o.type=e,o}const HN={},zN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:q,HEADER_WIDTH:Z,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:j,DEFAULT_CELL_HEIGHT:Y,SCROLLBAR_WIDTH:X},BN={autoCompleteProviders:Fc,autofillModifiersRegistry:pS,autofillRulesRegistry:mS,cellMenuRegistry:sR,colMenuRegistry:$T,errorTypes:si,linkMenuRegistry:Ax,functionRegistry:Zv,featurePluginRegistry:sM,iconsOnCellRegistry:hy,statefulUIPluginRegistry:iM,coreViewsPluginRegistry:nM,corePluginRegistry:oM,rowMenuRegistry:ZT,sidePanelRegistry:ID,figureRegistry:jE,chartSidePanelComponentRegistry:FA,chartComponentRegistry:zE,chartRegistry:HE,chartSubtypeRegistry:$E,topbarMenuRegistry:KT,topbarComponentRegistry:RD,clickableCellRegistry:rM,otRegistry:QT,inverseCommandRegistry:QE,urlRegistry:tS,cellPopoverRegistry:CS,numberFormatMenuRegistry:GT,repeatLocalCommandTransformRegistry:QF,repeatCommandTransformRegistry:KF,clipboardHandlersRegistries:Il,pivotRegistry:Q_,pivotTimeAdapterRegistry:$a,pivotSidePanelRegistry:oD,pivotNormalizationValueRegistry:Sl,supportedPivotPositionalFormulaRegistry:Jb,pivotToFunctionValueRegistry:yl,migrationStepRegistry:Mw},$N={arg:kc,isEvaluationError:gi,toBoolean:Ri,toJsDate:Ti,toNumber:mi,toString:Ei,toNormalizedPivotValue:ml,toXC:Kt,toZone:To,toUnboundedZone:Ro,toCartesian:Xt,numberToLetters:Zt,lettersToNumber:jt,UuidGenerator:wr,formatValue:In,createCurrencyFormat:Un,ColorGenerator:qt,computeTextWidth:cr,createEmptyWorkbookData:zw,createEmptySheet:Hw,createEmptyExcelSheet:Bw,getDefaultChartJsRuntime:aE,chartFontColor:ec,getChartAxisTitleRuntime:ic,getChartAxisType:CE,getTrendDatasetForBarChart:ac,getTrendDatasetForLineChart:IE,getFillingMode:dE,rgbaToHex:Ot,colorToRGBA:Ft,positionToZone:jo,isDefined:Ye,isMatrix:Qs,lazy:et,genericRepeat:JF,createAction:Ir,createActions:Er,transformRangeData:Tl,deepEquals:st,overlap:Vo,union:Po,isInside:Uo,deepCopy:Oe,expandZoneOnInsertion:Oo,reduceZoneOnDeletion:No,unquote:Me,getMaxObjectId:al,getFunctionsFromTokens:Wb,getFirstPivotFunction:Kb,getNumberOfPivotFunctions:Qb,parseDimension:hl,isDateOrDatetimeField:dl,makeFieldProposal:Zb,insertTokenAfterArgSeparator:jb,insertTokenAfterLeftParenthesis:Yb,mergeContiguousZones:Jo,getPivotHighlights:jT,pivotTimeAdapter:Ga,UNDO_REDO_PIVOT_COMMANDS:xF,createPivotFormula:pl,areDomainArgsFieldsValid:gl,splitReference:xo,formatTickValue:hc},GN={isMarkdownLink:ze,parseMarkdownLink:Ge,markdownLink:$e,openLink:rS,urlRepresentation:nS},WN={Checkbox:JT,Section:eA,RoundColorPicker:SA,ChartDataSeries:iA,ChartErrorSection:rA,ChartLabelRange:aA,ChartTitle:CA,ChartPanel:PA,ChartFigure:WE,ChartJsComponent:vc,Grid:RO,GridOverlay:nO,ScorecardChart:Oc,LineConfigPanel:TA,BarConfigPanel:cA,PieChartDesignPanel:AA,GenericChartConfigPanel:lA,ChartWithAxisDesignPanel:xA,GaugeChartConfigPanel:IA,GaugeChartDesignPanel:RA,ScorecardChartConfigPanel:_A,ScorecardChartDesignPanel:DA,ChartTypePicker:MA,FigureComponent:TD,Menu:_x,Popover:lx,SelectionInput:sA,ValidationMessages:nA,AddDimensionButton:A_,PivotDimensionGranularity:F_,PivotDimensionOrder:M_,PivotDimension:O_,PivotLayoutConfigurator:P_,EditableName:TO,PivotDeferUpdate:T_,PivotTitleSection:k_,CogWheelMenu:D_,TextInput:__,SidePanelCollapsible:dA},qN={useDragAndDropListItems:zA,useHighlights:jA,useHighlightsOnHover:ZA},ZN={useStoreProvider:Fl,DependencyContainer:_l,CellPopoverStore:ix,ComposerFocusStore:$l,CellComposerStore:VD,FindAndReplaceStore:C_,HighlightStore:XT,HoveredCellStore:sx,ModelStore:Vl,NotificationStore:kA,RendererStore:Hl,SelectionInputStore:oA,SpreadsheetStore:zl,useStore:Ml,useLocalStore:Nl,SidePanelStore:wO,PivotSidePanelStore:eD,PivotMeasureDisplayPanelStore:I_};const jN={DEFAULT_LOCALE:Xs,HIGHLIGHT_COLOR:s,PIVOT_TABLE_CONFIG:Te,TREND_LINE_XAXIS_ID:Gl,CHART_AXIS_CHOICES:uc};e.AbstractCellClipboardHandler=Dr,e.AbstractChart=bc,e.AbstractFigureClipboardHandler=xl,e.CellErrorType=oi,e.CorePlugin=_O,e.DispatchResult=qs,e.EvaluationError=ii,e.Model=class extends Al{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=[],i=new wr,n=!1){const r=performance.now();console.group("Model creation"),super(),ro===io&&ao===no&&(ao=()=>!0),s=Vw(e,s);const a=Lw(e,n);this.state=new ZM,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new kO(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.uuidGenerator.setIsFastStrategy(!0),this.selection=new WM(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of oM.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of nM.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 iM.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of sM.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested){const e=performance.now();console.info("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.info("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.info("Model created in",performance.now()-r,"ms"),console.groupEnd()}joinSession(){this.session.join(this.config.client)}async leaveSession(){await this.session.leave(et((()=>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)}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 UF(BM({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:co("Anonymous").toString()},o=e.transportService||new NM;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(Ys));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,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||[]}}checkDispatchAllowed(e){const t=Ws(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new qs(t.flat()):qs.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(UN(e,t));dispatch=(e,t)=>{const o=UN(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!$s.has(i.type)))return new qs("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new qs("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();Ws(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.info(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(Ws(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(Ws(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return qs.Success};dispatchFromCorePlugin=(e,t)=>{const o=UN(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,qs.Success};dispatchToHandlers(e,t){const o=Ws(t);for(const s of e)!o&&s instanceof _O||s.beforeHandle(t);for(const s of e)!o&&s instanceof _O||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=zw();for(let t of this.handlers)t instanceof _O&&t.export(e);return e.revisionId=this.session.getRevisionId()||de,e=Oe(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...zw(),sheets:[Bw(kw,"Sheet1")]};for(let t of this.handlers)t instanceof AO&&t.exportForExcel(e);return e=Oe(e),kN(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=L_,e.Registry=Rr,e.Revision=LF,e.SPREADSHEET_DIMENSIONS=zN,e.Spreadsheet=MM,e.SpreadsheetPivotTable=H_,e.UIPlugin=VO,e.__info__=HN,e.addFunction=function e(t,o){return Zv.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(ei[e])throw new Error(`Layer ${e} already exists`);ei[e]=t},e.astToFormula=Lm,e.compile=Hb,e.compileTokens=zb,e.components=WN,e.constants=jN,e.convertAstNodes=Mm,e.coreTypes=Gs,e.findCellInNewZone=Zo,e.functionCache=Ub,e.helpers=$N,e.hooks=qN,e.invalidateCFEvaluationCommands=zs,e.invalidateDependenciesCommands=Hs,e.invalidateEvaluationCommands=Vs,e.iterateAstNodes=Nm,e.links=GN,e.load=Lw,e.parse=Om,e.parseTokens=Fm,e.readonlyAllowedCommands=$s,e.registries=BN,e.setDefaultSheetViewSize=function(e){Ee=e},e.setTranslationMethod=function(e,t=(()=>!0)){ro=e,ao=t},e.stores=ZN,e.tokenColors=Db,e.tokenize=Mr,HN.version="18.1.0-alpha.0",HN.date="2024-09-25T13:17:49.636Z",HN.hash="288f0b7"}(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.0.0
5
- @date 2024-09-25T12:55:18.745Z
6
- @hash cee2e47
4
+ @version 18.1.0-alpha.0
5
+ @date 2024-09-25T13:18:46.133Z
6
+ @hash 288f0b7
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.0.0",
3
+ "version": "18.1.0-alpha.0",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",
@@ -136,6 +136,6 @@
136
136
  "*": "prettier --write"
137
137
  },
138
138
  "publishConfig": {
139
- "tag": "latest"
139
+ "tag": "alpha"
140
140
  }
141
141
  }