@odoo/o-spreadsheet 15.0.27 → 15.0.28
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.
|
@@ -24926,35 +24926,27 @@ function addFormula(cell) {
|
|
|
24926
24926
|
const isExported = tokens
|
|
24927
24927
|
.filter((tk) => tk.type === "FUNCTION")
|
|
24928
24928
|
.every((tk) => functions[tk.value.toUpperCase()].isExported);
|
|
24929
|
+
const type = getCellType(cell.value);
|
|
24929
24930
|
if (isExported) {
|
|
24930
|
-
let cycle = escapeXml ``;
|
|
24931
24931
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
24932
|
-
// hack for cycles : if we don't set a value (be it 0 or #VALUE!), it will appear as invisible on excel,
|
|
24933
|
-
// Making it very hard for the client to find where the recursion is.
|
|
24934
|
-
if (cell.value === "#CYCLE") {
|
|
24935
|
-
attrs.push(["t", "str"]);
|
|
24936
|
-
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24937
|
-
}
|
|
24938
24932
|
node = escapeXml /*xml*/ `
|
|
24939
24933
|
<f>
|
|
24940
24934
|
${XlsxFormula}
|
|
24941
24935
|
</f>
|
|
24942
|
-
${
|
|
24936
|
+
${escapeXml /*xml*/ `<v>${cell.value}</v>`}
|
|
24943
24937
|
`;
|
|
24938
|
+
attrs.push(["t", type]);
|
|
24944
24939
|
return { attrs, node };
|
|
24945
24940
|
}
|
|
24946
24941
|
else {
|
|
24947
|
-
// Shouldn't we always output the value then ?
|
|
24948
|
-
const value = cell.value;
|
|
24949
24942
|
// If the cell contains a non-exported formula and that is evaluates to
|
|
24950
24943
|
// nothing* ,we don't export it.
|
|
24951
24944
|
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
24952
24945
|
// the empty string.
|
|
24953
|
-
if (value === "")
|
|
24946
|
+
if (cell.value === "")
|
|
24954
24947
|
return undefined;
|
|
24955
|
-
const type = getCellType(value);
|
|
24956
24948
|
attrs.push(["t", type]);
|
|
24957
|
-
node = escapeXml /*xml*/ `<v>${value}</v>`;
|
|
24949
|
+
node = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24958
24950
|
return { attrs, node };
|
|
24959
24951
|
}
|
|
24960
24952
|
}
|
|
@@ -31579,6 +31571,6 @@ exports.registries = registries;
|
|
|
31579
31571
|
exports.setTranslationMethod = setTranslationMethod;
|
|
31580
31572
|
|
|
31581
31573
|
|
|
31582
|
-
__info__.version = '15.0.
|
|
31583
|
-
__info__.date = '2024-
|
|
31584
|
-
__info__.hash = '
|
|
31574
|
+
__info__.version = '15.0.28';
|
|
31575
|
+
__info__.date = '2024-09-05T09:27:39.727Z';
|
|
31576
|
+
__info__.hash = '0f4c167';
|
|
@@ -24903,35 +24903,27 @@ function addFormula(cell) {
|
|
|
24903
24903
|
const isExported = tokens
|
|
24904
24904
|
.filter((tk) => tk.type === "FUNCTION")
|
|
24905
24905
|
.every((tk) => functions[tk.value.toUpperCase()].isExported);
|
|
24906
|
+
const type = getCellType(cell.value);
|
|
24906
24907
|
if (isExported) {
|
|
24907
|
-
let cycle = escapeXml ``;
|
|
24908
24908
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
24909
|
-
// hack for cycles : if we don't set a value (be it 0 or #VALUE!), it will appear as invisible on excel,
|
|
24910
|
-
// Making it very hard for the client to find where the recursion is.
|
|
24911
|
-
if (cell.value === "#CYCLE") {
|
|
24912
|
-
attrs.push(["t", "str"]);
|
|
24913
|
-
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24914
|
-
}
|
|
24915
24909
|
node = escapeXml /*xml*/ `
|
|
24916
24910
|
<f>
|
|
24917
24911
|
${XlsxFormula}
|
|
24918
24912
|
</f>
|
|
24919
|
-
${
|
|
24913
|
+
${escapeXml /*xml*/ `<v>${cell.value}</v>`}
|
|
24920
24914
|
`;
|
|
24915
|
+
attrs.push(["t", type]);
|
|
24921
24916
|
return { attrs, node };
|
|
24922
24917
|
}
|
|
24923
24918
|
else {
|
|
24924
|
-
// Shouldn't we always output the value then ?
|
|
24925
|
-
const value = cell.value;
|
|
24926
24919
|
// If the cell contains a non-exported formula and that is evaluates to
|
|
24927
24920
|
// nothing* ,we don't export it.
|
|
24928
24921
|
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
24929
24922
|
// the empty string.
|
|
24930
|
-
if (value === "")
|
|
24923
|
+
if (cell.value === "")
|
|
24931
24924
|
return undefined;
|
|
24932
|
-
const type = getCellType(value);
|
|
24933
24925
|
attrs.push(["t", type]);
|
|
24934
|
-
node = escapeXml /*xml*/ `<v>${value}</v>`;
|
|
24926
|
+
node = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24935
24927
|
return { attrs, node };
|
|
24936
24928
|
}
|
|
24937
24929
|
}
|
|
@@ -31534,6 +31526,6 @@ const helpers = {
|
|
|
31534
31526
|
export { CommandResult, CorePlugin, DATETIME_FORMAT, DataSource, DispatchResult, Model, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, DEBUG as __DEBUG__, __info__, astToFormula, cellTypes, convertAstNodes, coreTypes, functionCache, helpers, invalidateEvaluationCommands, normalize, parse, readonlyAllowedCommands, registries, setTranslationMethod };
|
|
31535
31527
|
|
|
31536
31528
|
|
|
31537
|
-
__info__.version = '15.0.
|
|
31538
|
-
__info__.date = '2024-
|
|
31539
|
-
__info__.hash = '
|
|
31529
|
+
__info__.version = '15.0.28';
|
|
31530
|
+
__info__.date = '2024-09-05T09:27:39.727Z';
|
|
31531
|
+
__info__.hash = '0f4c167';
|
|
@@ -24923,35 +24923,27 @@
|
|
|
24923
24923
|
const isExported = tokens
|
|
24924
24924
|
.filter((tk) => tk.type === "FUNCTION")
|
|
24925
24925
|
.every((tk) => functions[tk.value.toUpperCase()].isExported);
|
|
24926
|
+
const type = getCellType(cell.value);
|
|
24926
24927
|
if (isExported) {
|
|
24927
|
-
let cycle = escapeXml ``;
|
|
24928
24928
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
24929
|
-
// hack for cycles : if we don't set a value (be it 0 or #VALUE!), it will appear as invisible on excel,
|
|
24930
|
-
// Making it very hard for the client to find where the recursion is.
|
|
24931
|
-
if (cell.value === "#CYCLE") {
|
|
24932
|
-
attrs.push(["t", "str"]);
|
|
24933
|
-
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24934
|
-
}
|
|
24935
24929
|
node = escapeXml /*xml*/ `
|
|
24936
24930
|
<f>
|
|
24937
24931
|
${XlsxFormula}
|
|
24938
24932
|
</f>
|
|
24939
|
-
${
|
|
24933
|
+
${escapeXml /*xml*/ `<v>${cell.value}</v>`}
|
|
24940
24934
|
`;
|
|
24935
|
+
attrs.push(["t", type]);
|
|
24941
24936
|
return { attrs, node };
|
|
24942
24937
|
}
|
|
24943
24938
|
else {
|
|
24944
|
-
// Shouldn't we always output the value then ?
|
|
24945
|
-
const value = cell.value;
|
|
24946
24939
|
// If the cell contains a non-exported formula and that is evaluates to
|
|
24947
24940
|
// nothing* ,we don't export it.
|
|
24948
24941
|
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
24949
24942
|
// the empty string.
|
|
24950
|
-
if (value === "")
|
|
24943
|
+
if (cell.value === "")
|
|
24951
24944
|
return undefined;
|
|
24952
|
-
const type = getCellType(value);
|
|
24953
24945
|
attrs.push(["t", type]);
|
|
24954
|
-
node = escapeXml /*xml*/ `<v>${value}</v>`;
|
|
24946
|
+
node = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
24955
24947
|
return { attrs, node };
|
|
24956
24948
|
}
|
|
24957
24949
|
}
|
|
@@ -31578,9 +31570,9 @@
|
|
|
31578
31570
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
31579
31571
|
|
|
31580
31572
|
|
|
31581
|
-
__info__.version = '15.0.
|
|
31582
|
-
__info__.date = '2024-
|
|
31583
|
-
__info__.hash = '
|
|
31573
|
+
__info__.version = '15.0.28';
|
|
31574
|
+
__info__.date = '2024-09-05T09:27:39.727Z';
|
|
31575
|
+
__info__.hash = '0f4c167';
|
|
31584
31576
|
|
|
31585
31577
|
|
|
31586
31578
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -1234,12 +1234,12 @@
|
|
|
1234
1234
|
<c:f>${e}</c:f>
|
|
1235
1235
|
<c:numCache />
|
|
1236
1236
|
</c:numRef>
|
|
1237
|
-
`}function hu(e){const t=e.content,s=ar.content,i=[];let o=Qd``;
|
|
1237
|
+
`}function hu(e){const t=e.content,s=ar.content,i=[];let o=Qd``;const n=dr(t).filter((e=>"FUNCTION"===e.type)).every((e=>s[e.value.toUpperCase()].isExported)),r=function(e){switch(typeof e){case"boolean":return"b";case"string":return"str";case"number":return"n"}}(e.value);if(n){return o=Qd`
|
|
1238
1238
|
<f>
|
|
1239
|
-
${
|
|
1239
|
+
${uu(t)}
|
|
1240
1240
|
</f>
|
|
1241
|
-
${
|
|
1242
|
-
`,{attrs:i,node:o}}
|
|
1241
|
+
${Qd`<v>${e.value}</v>`}
|
|
1242
|
+
`,i.push(["t",r]),{attrs:i,node:o}}if(""!==e.value)return i.push(["t",r]),o=Qd`<v>${e.value}</v>`,{attrs:i,node:o}}function du(e,t){let s=e;const i=[];return["TRUE","FALSE"].includes(s.trim())?(s="TRUE"===s?"1":"0",i.push(["t","b"])):J(s)||(s=Vd(e,t),i.push(["t","s"])),{attrs:i,node:Qd`<v>${s}</v>`}}function uu(e){let t;"="===e[0]&&(e=e.slice(1));try{t=Or(e)}catch(t){return e}return t=Nr(t,"STRING",pu),t=Nr(t,"FUNCALL",(e=>(e=function(e){const t=e.value.toUpperCase(),s=e.args,i=Nd[t];if(i){const o=ar.content[t].args.filter((e=>!e.optional)),n=o.length-e.args.length;if(n)for(let t=e.args.length;t<o.length;t++){const e=i[t-n];s.push({type:e.type,value:e.value})}}return{...e,args:s}}(e=function(e){const t=e.value.toUpperCase();return{...e,value:kd.includes(t)?`_xlfn.${t}`:t}}(e={...e,value:e.value.toUpperCase()})),e))),t?kr(t):e}function pu(e){const t=e.value.replace(new RegExp('"',"g"),""),s=G(t);if(s){let i=[];return(t.match(H)||t.match(z))&&i.push("yyyy-mm-dd"),t.match(Z)&&i.push("hh:mm:ss"),{...e,value:`"${j({value:s.value,format:i.join(" ")})}"`}}return{...e,value:e.value.replace(/\\"/g,'""')}}function gu(e,t){const s=[];for(const i of t)switch(i.rule.type){case"CellIsRule":s.push(fu(i,i.rule,e));break;case"ColorScaleRule":s.push(mu(i,i.rule));break;case"IconSetRule":s.push(vu(i,i.rule));break;default:console.warn(`Conditional formatting ${i.rule.type} not implemented`)}return s}function fu(e,t,s){const i=Eu(e),o=Fd(t.operator);i.push(...function(e){const t=Fd(e.operator);switch(e.operator){case"ContainsText":case"NotContains":case"BeginsWith":case"EndsWith":return[["type",t],["text",e.values[0]]];case"IsEmpty":case"IsNotEmpty":return[["type",t]];case"Equal":case"NotEqual":case"GreaterThan":case"GreaterThanOrEqual":case"LessThan":case"LessThanOrEqual":case"Between":case"NotBetween":return[["type","cellIs"]]}}(t),["operator",o]);const n=function(e,t){const s=e[0].split(":")[0],i=t.values;switch(t.operator){case"ContainsText":return[`NOT(ISERROR(SEARCH("${i[0]}",${s})))`];case"NotContains":return[`ISERROR(SEARCH("${i[0]}",${s}))`];case"BeginsWith":return[`LEFT(${s},LEN("${i[0]}"))="${i[0]}"`];case"EndsWith":return[`RIGHT(${s},LEN("${i[0]}"))="${i[0]}"`];case"IsEmpty":return[`LEN(TRIM(${s}))=0`];case"IsNotEmpty":return[`LEN(TRIM(${s}))>0`];case"Equal":case"NotEqual":case"GreaterThan":case"GreaterThanOrEqual":case"LessThan":case"LessThanOrEqual":return[i[0]];case"Between":case"NotBetween":return[i[0],i[1]]}}(e.ranges,t).map((e=>Qd`<formula>${e}</formula>`)),r={font:{color:t.style.textColor,bold:t.style.bold,italic:t.style.italic,strike:t.style.strikethrough,underline:t.style.underline}};return t.style.fillColor&&(r.fill={fgColor:t.style.fillColor}),i.push(["dxfId",Vd(r,s)]),Qd`
|
|
1243
1243
|
<conditionalFormatting sqref="${e.ranges.join(" ")}">
|
|
1244
1244
|
<cfRule ${jd(i)}>
|
|
1245
1245
|
${Kd(n)}
|
|
@@ -3072,4 +3072,4 @@
|
|
|
3072
3072
|
height: ${15}px;
|
|
3073
3073
|
vertical-align: sub;
|
|
3074
3074
|
}
|
|
3075
|
-
`;class Hf extends t.Component{constructor(e,s={}){super(e,s),this.model=new Ou(this.props.data,{notifyUser:e=>this.trigger("notify-user",{content:e}),askConfirmation:(e,t,s)=>this.trigger("ask-confirmation",{content:e,confirm:t,cancel:s}),editText:(e,t,s)=>this.trigger("edit-text",{title:e,placeholder:t,callback:s}),openSidePanel:(e,t={})=>this.openSidePanel(e,t),evalContext:{env:this.env},transportService:this.props.transportService,client:this.props.client,isReadonly:this.props.isReadonly,snapshotRequested:this.props.snapshotRequested},this.props.stateUpdateMessages),this.grid=Df("grid"),this.sidePanel=t.useState({isOpen:!1,panelProps:{}}),this.linkEditor=t.useState({isOpen:!1}),this.composer=t.useState({topBarFocus:"inactive",gridFocusMode:"inactive"}),this.clipBoardString="",this.keyDownMapping={"CTRL+H":()=>this.toggleSidePanel("FindAndReplace",{}),"CTRL+F":()=>this.toggleSidePanel("FindAndReplace",{})},$f({openSidePanel:(e,t={})=>this.openSidePanel(e,t),toggleSidePanel:(e,t={})=>this.toggleSidePanel(e,t),dispatch:this.model.dispatch,getters:this.model.getters,uuidGenerator:this.model.uuidGenerator,_t:Hf._t,clipboard:navigator.clipboard,export:this.model.exportData.bind(this.model),waitForIdle:this.model.waitForIdle.bind(this.model),exportXLSX:this.model.exportXLSX.bind(this.model),openLinkEditor:()=>this.openLinkEditor()}),Ff(window,"resize",this.render),Ff(document.body,"cut",this.copy.bind(this,!0)),Ff(document.body,"copy",this.copy.bind(this,!1)),Ff(document.body,"paste",this.paste),Ff(document.body,"keyup",this.onKeyup.bind(this)),Ff(window,"beforeunload",this.leaveCollaborativeSession.bind(this)),this.activateFirstSheet()}get focusTopBarComposer(){return"inactive"===this.model.getters.getEditionMode()?"inactive":this.composer.topBarFocus}get focusGridComposer(){return"inactive"===this.model.getters.getEditionMode()?"inactive":this.composer.gridFocusMode}mounted(){this.model.on("update",this,this.render),this.model.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.props.client&&this.model.joinSession(this.props.client)}willUnmount(){this.leaveCollaborativeSession()}async willUpdateProps(e){this.props.isReadonly!==e.isReadonly&&this.model.updateReadOnly(e.isReadonly)}leaveCollaborativeSession(){this.model.off("update",this),this.model.leaveSession()}activateFirstSheet(){const e=this.model.getters.getActiveSheetId(),[t]=this.model.getters.getSheets();t.id!==e&&this.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:e,sheetIdTo:t.id})}destroy(){this.model.destroy(),super.destroy()}openSidePanel(e,t){this.sidePanel.component=e,this.sidePanel.panelProps=t,this.sidePanel.isOpen=!0}closeSidePanel(){this.sidePanel.isOpen=!1,this.focusGrid()}openLinkEditor(){this.linkEditor.isOpen=!0}closeLinkEditor(){this.linkEditor.isOpen=!1,this.focusGrid()}toggleSidePanel(e,t){this.sidePanel.isOpen&&e===this.sidePanel.component?(this.sidePanel.isOpen=!1,this.focusGrid()):this.openSidePanel(e,t)}focusGrid(){if(!this._focusGrid)throw new Error("_focusGrid should be exposed by the grid component");this._focusGrid()}copy(e,t){if(!this.grid.el.contains(document.activeElement))return;if("inactive"!==this.model.getters.getEditionMode())return;const s=e?"CUT":"COPY",i=this.model.getters.getSelectedZones();this.model.dispatch(s,{target:i});const o=this.model.getters.getClipboardContent();this.clipBoardString=o,t.clipboardData.setData("text/plain",o),t.preventDefault()}paste(e){if(!this.grid.el.contains(document.activeElement))return;const t=e.clipboardData;if(t.types.indexOf("text/plain")>-1){const e=t.getData("text/plain"),s=this.model.getters.getSelectedZones();this.clipBoardString===e?this.model.dispatch("PASTE",{target:s,interactive:!0}):this.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:s,text:e})}}save(){this.trigger("save-content",{data:this.model.exportData()})}onKeyup(e){"Control"===e.key&&this.model.getters.getSelectionMode()!==xh.expanding&&this.model.dispatch("STOP_SELECTION")}onKeydown(e){"Control"!==e.key||e.repeat||this.model.dispatch(this.model.getters.getSelectionMode()===xh.idle?"PREPARE_SELECTION_EXPANSION":"START_SELECTION_EXPANSION");let t="";(e.ctrlKey||e.metaKey)&&(t+="CTRL+"),t+=e.key.toUpperCase();let s=this.keyDownMapping[t];if(s)return e.preventDefault(),e.stopPropagation(),void s()}onTopBarComposerFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="contentFocus",this.composer.gridFocusMode="inactive",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}onGridComposerContentFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="inactive",this.composer.gridFocusMode="contentFocus",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}onGridComposerCellFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="inactive",this.composer.gridFocusMode="cellFocus",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}setComposerContent({content:e,selection:t}){"inactive"===this.model.getters.getEditionMode()?this.model.dispatch("START_EDITION",{text:e,selection:t}):e&&this.model.dispatch("SET_CURRENT_CONTENT",{content:e,selection:t})}}Hf.template=Bf,Hf.style=Vf,Hf.components={TopBar:kf,Grid:nf,BottomBar:ep,SidePanel:df,LinkEditor:Pg},Hf._t=e=>e;const zf={},Zf={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:f,HEADER_WIDTH:m,TOPBAR_HEIGHT:v,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:E,DEFAULT_CELL_HEIGHT:S,SCROLLBAR_WIDTH:b},Gf={autofillModifiersRegistry:Ma,autofillRulesRegistry:Aa,cellMenuRegistry:hl,colMenuRegistry:dl,linkMenuRegistry:ul,functionRegistry:ar,uiPluginRegistry:ad,corePluginRegistry:rd,rowMenuRegistry:pl,sidePanelRegistry:Sh,sheetMenuRegistry:gl,topbarMenuRegistry:fl,topbarComponentRegistry:bh,otRegistry:ml,inverseCommandRegistry:Oa,cellRegistry:qr},Wf={LinkCell:sa},qf={args:_e,toBoolean:ge,toNumber:he,toString:ue,toXC:os,toZone:Fs,toCartesian:is,numberToLetters:ss,createFullMenuItem:Fa,UuidGenerator:ni,formatDecimal:re,computeTextWidth:fs,isMarkdownLink:ys,parseMarkdownLink:Ts,markdownLink:ws,createEmptyWorkbookData:fa};e.CorePlugin=va,e.DATETIME_FORMAT=A,e.DataSource=hd,e.DispatchResult=Pe,e.Model=Ou,e.Revision=Kh,e.SPREADSHEET_DIMENSIONS=Zf,e.Spreadsheet=Hf,e.UIPlugin=Ch,e.__DEBUG__=As,e.__info__=zf,e.astToFormula=kr,e.cellTypes=Wf,e.convertAstNodes=Nr,e.coreTypes=De,e.functionCache=Br,e.helpers=qf,e.invalidateEvaluationCommands=Fe,e.normalize=Gr,e.parse=Or,e.readonlyAllowedCommands=$e,e.registries=Gf,e.setTranslationMethod=function(e){o=e},Object.defineProperty(e,"__esModule",{value:!0}),zf.version="15.0.
|
|
3075
|
+
`;class Hf extends t.Component{constructor(e,s={}){super(e,s),this.model=new Ou(this.props.data,{notifyUser:e=>this.trigger("notify-user",{content:e}),askConfirmation:(e,t,s)=>this.trigger("ask-confirmation",{content:e,confirm:t,cancel:s}),editText:(e,t,s)=>this.trigger("edit-text",{title:e,placeholder:t,callback:s}),openSidePanel:(e,t={})=>this.openSidePanel(e,t),evalContext:{env:this.env},transportService:this.props.transportService,client:this.props.client,isReadonly:this.props.isReadonly,snapshotRequested:this.props.snapshotRequested},this.props.stateUpdateMessages),this.grid=Df("grid"),this.sidePanel=t.useState({isOpen:!1,panelProps:{}}),this.linkEditor=t.useState({isOpen:!1}),this.composer=t.useState({topBarFocus:"inactive",gridFocusMode:"inactive"}),this.clipBoardString="",this.keyDownMapping={"CTRL+H":()=>this.toggleSidePanel("FindAndReplace",{}),"CTRL+F":()=>this.toggleSidePanel("FindAndReplace",{})},$f({openSidePanel:(e,t={})=>this.openSidePanel(e,t),toggleSidePanel:(e,t={})=>this.toggleSidePanel(e,t),dispatch:this.model.dispatch,getters:this.model.getters,uuidGenerator:this.model.uuidGenerator,_t:Hf._t,clipboard:navigator.clipboard,export:this.model.exportData.bind(this.model),waitForIdle:this.model.waitForIdle.bind(this.model),exportXLSX:this.model.exportXLSX.bind(this.model),openLinkEditor:()=>this.openLinkEditor()}),Ff(window,"resize",this.render),Ff(document.body,"cut",this.copy.bind(this,!0)),Ff(document.body,"copy",this.copy.bind(this,!1)),Ff(document.body,"paste",this.paste),Ff(document.body,"keyup",this.onKeyup.bind(this)),Ff(window,"beforeunload",this.leaveCollaborativeSession.bind(this)),this.activateFirstSheet()}get focusTopBarComposer(){return"inactive"===this.model.getters.getEditionMode()?"inactive":this.composer.topBarFocus}get focusGridComposer(){return"inactive"===this.model.getters.getEditionMode()?"inactive":this.composer.gridFocusMode}mounted(){this.model.on("update",this,this.render),this.model.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.props.client&&this.model.joinSession(this.props.client)}willUnmount(){this.leaveCollaborativeSession()}async willUpdateProps(e){this.props.isReadonly!==e.isReadonly&&this.model.updateReadOnly(e.isReadonly)}leaveCollaborativeSession(){this.model.off("update",this),this.model.leaveSession()}activateFirstSheet(){const e=this.model.getters.getActiveSheetId(),[t]=this.model.getters.getSheets();t.id!==e&&this.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:e,sheetIdTo:t.id})}destroy(){this.model.destroy(),super.destroy()}openSidePanel(e,t){this.sidePanel.component=e,this.sidePanel.panelProps=t,this.sidePanel.isOpen=!0}closeSidePanel(){this.sidePanel.isOpen=!1,this.focusGrid()}openLinkEditor(){this.linkEditor.isOpen=!0}closeLinkEditor(){this.linkEditor.isOpen=!1,this.focusGrid()}toggleSidePanel(e,t){this.sidePanel.isOpen&&e===this.sidePanel.component?(this.sidePanel.isOpen=!1,this.focusGrid()):this.openSidePanel(e,t)}focusGrid(){if(!this._focusGrid)throw new Error("_focusGrid should be exposed by the grid component");this._focusGrid()}copy(e,t){if(!this.grid.el.contains(document.activeElement))return;if("inactive"!==this.model.getters.getEditionMode())return;const s=e?"CUT":"COPY",i=this.model.getters.getSelectedZones();this.model.dispatch(s,{target:i});const o=this.model.getters.getClipboardContent();this.clipBoardString=o,t.clipboardData.setData("text/plain",o),t.preventDefault()}paste(e){if(!this.grid.el.contains(document.activeElement))return;const t=e.clipboardData;if(t.types.indexOf("text/plain")>-1){const e=t.getData("text/plain"),s=this.model.getters.getSelectedZones();this.clipBoardString===e?this.model.dispatch("PASTE",{target:s,interactive:!0}):this.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:s,text:e})}}save(){this.trigger("save-content",{data:this.model.exportData()})}onKeyup(e){"Control"===e.key&&this.model.getters.getSelectionMode()!==xh.expanding&&this.model.dispatch("STOP_SELECTION")}onKeydown(e){"Control"!==e.key||e.repeat||this.model.dispatch(this.model.getters.getSelectionMode()===xh.idle?"PREPARE_SELECTION_EXPANSION":"START_SELECTION_EXPANSION");let t="";(e.ctrlKey||e.metaKey)&&(t+="CTRL+"),t+=e.key.toUpperCase();let s=this.keyDownMapping[t];if(s)return e.preventDefault(),e.stopPropagation(),void s()}onTopBarComposerFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="contentFocus",this.composer.gridFocusMode="inactive",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}onGridComposerContentFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="inactive",this.composer.gridFocusMode="contentFocus",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}onGridComposerCellFocused(e){this.model.getters.isReadonly()||(this.composer.topBarFocus="inactive",this.composer.gridFocusMode="cellFocus",this.setComposerContent(e.detail||{}),this.env.dispatch("UNFOCUS_SELECTION_INPUT"))}setComposerContent({content:e,selection:t}){"inactive"===this.model.getters.getEditionMode()?this.model.dispatch("START_EDITION",{text:e,selection:t}):e&&this.model.dispatch("SET_CURRENT_CONTENT",{content:e,selection:t})}}Hf.template=Bf,Hf.style=Vf,Hf.components={TopBar:kf,Grid:nf,BottomBar:ep,SidePanel:df,LinkEditor:Pg},Hf._t=e=>e;const zf={},Zf={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:f,HEADER_WIDTH:m,TOPBAR_HEIGHT:v,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:E,DEFAULT_CELL_HEIGHT:S,SCROLLBAR_WIDTH:b},Gf={autofillModifiersRegistry:Ma,autofillRulesRegistry:Aa,cellMenuRegistry:hl,colMenuRegistry:dl,linkMenuRegistry:ul,functionRegistry:ar,uiPluginRegistry:ad,corePluginRegistry:rd,rowMenuRegistry:pl,sidePanelRegistry:Sh,sheetMenuRegistry:gl,topbarMenuRegistry:fl,topbarComponentRegistry:bh,otRegistry:ml,inverseCommandRegistry:Oa,cellRegistry:qr},Wf={LinkCell:sa},qf={args:_e,toBoolean:ge,toNumber:he,toString:ue,toXC:os,toZone:Fs,toCartesian:is,numberToLetters:ss,createFullMenuItem:Fa,UuidGenerator:ni,formatDecimal:re,computeTextWidth:fs,isMarkdownLink:ys,parseMarkdownLink:Ts,markdownLink:ws,createEmptyWorkbookData:fa};e.CorePlugin=va,e.DATETIME_FORMAT=A,e.DataSource=hd,e.DispatchResult=Pe,e.Model=Ou,e.Revision=Kh,e.SPREADSHEET_DIMENSIONS=Zf,e.Spreadsheet=Hf,e.UIPlugin=Ch,e.__DEBUG__=As,e.__info__=zf,e.astToFormula=kr,e.cellTypes=Wf,e.convertAstNodes=Nr,e.coreTypes=De,e.functionCache=Br,e.helpers=qf,e.invalidateEvaluationCommands=Fe,e.normalize=Gr,e.parse=Or,e.readonlyAllowedCommands=$e,e.registries=Gf,e.setTranslationMethod=function(e){o=e},Object.defineProperty(e,"__esModule",{value:!0}),zf.version="15.0.28",zf.date="2024-09-05T09:27:39.727Z",zf.hash="0f4c167"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|