@odoo/o-spreadsheet 18.1.0-alpha.8 → 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.
|
|
6
|
-
* @date 2024-12-
|
|
7
|
-
* @hash
|
|
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';
|
|
@@ -42046,6 +42046,10 @@ css /* scss */ `
|
|
|
42046
42046
|
border: 1px solid #d8dadd;
|
|
42047
42047
|
color: #374151;
|
|
42048
42048
|
}
|
|
42049
|
+
|
|
42050
|
+
table {
|
|
42051
|
+
table-layout: fixed;
|
|
42052
|
+
}
|
|
42049
42053
|
}
|
|
42050
42054
|
`;
|
|
42051
42055
|
class CustomCurrencyPanel extends owl.Component {
|
|
@@ -74829,6 +74833,6 @@ exports.tokenColors = tokenColors;
|
|
|
74829
74833
|
exports.tokenize = tokenize;
|
|
74830
74834
|
|
|
74831
74835
|
|
|
74832
|
-
__info__.version = "18.
|
|
74833
|
-
__info__.date = "2024-12-
|
|
74834
|
-
__info__.hash = "
|
|
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.
|
|
6
|
-
* @date 2024-12-
|
|
7
|
-
* @hash
|
|
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';
|
|
@@ -42044,6 +42044,10 @@ css /* scss */ `
|
|
|
42044
42044
|
border: 1px solid #d8dadd;
|
|
42045
42045
|
color: #374151;
|
|
42046
42046
|
}
|
|
42047
|
+
|
|
42048
|
+
table {
|
|
42049
|
+
table-layout: fixed;
|
|
42050
|
+
}
|
|
42047
42051
|
}
|
|
42048
42052
|
`;
|
|
42049
42053
|
class CustomCurrencyPanel extends Component {
|
|
@@ -74783,6 +74787,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
74783
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 };
|
|
74784
74788
|
|
|
74785
74789
|
|
|
74786
|
-
__info__.version = "18.
|
|
74787
|
-
__info__.date = "2024-12-
|
|
74788
|
-
__info__.hash = "
|
|
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.
|
|
6
|
-
* @date 2024-12-
|
|
7
|
-
* @hash
|
|
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) {
|
|
@@ -42045,6 +42045,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42045
42045
|
border: 1px solid #d8dadd;
|
|
42046
42046
|
color: #374151;
|
|
42047
42047
|
}
|
|
42048
|
+
|
|
42049
|
+
table {
|
|
42050
|
+
table-layout: fixed;
|
|
42051
|
+
}
|
|
42048
42052
|
}
|
|
42049
42053
|
`;
|
|
42050
42054
|
class CustomCurrencyPanel extends owl.Component {
|
|
@@ -74828,9 +74832,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74828
74832
|
exports.tokenize = tokenize;
|
|
74829
74833
|
|
|
74830
74834
|
|
|
74831
|
-
__info__.version = "18.
|
|
74832
|
-
__info__.date = "2024-12-
|
|
74833
|
-
__info__.hash = "
|
|
74835
|
+
__info__.version = "18.2.0-alpha.0";
|
|
74836
|
+
__info__.date = "2024-12-26T08:02:39.123Z";
|
|
74837
|
+
__info__.hash = "0f45915";
|
|
74834
74838
|
|
|
74835
74839
|
|
|
74836
74840
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -1103,6 +1103,10 @@
|
|
|
1103
1103
|
border: 1px solid #d8dadd;
|
|
1104
1104
|
color: #374151;
|
|
1105
1105
|
}
|
|
1106
|
+
|
|
1107
|
+
table {
|
|
1108
|
+
table-layout: fixed;
|
|
1109
|
+
}
|
|
1106
1110
|
}
|
|
1107
1111
|
`;class sO extends t.Component{static template="o-spreadsheet-CustomCurrencyPanel";static components={Section:L_,Checkbox:DI};static props={onCloseSidePanel:Function};availableCurrencies;state;setup(){this.availableCurrencies=[],this.state=t.useState({selectedCurrencyIndex:0,currencyCode:"",currencySymbol:"",selectedFormatIndex:0,isAccountingFormat:!1}),t.onWillStart((()=>this.updateAvailableCurrencies()))}get formatProposals(){const e=this.availableCurrencies[this.state.selectedCurrencyIndex],t=e.position,o="before"===e.position?"after":"before",s=this.state.currencySymbol.trim()?this.state.currencySymbol:"",i=this.state.currencyCode.trim()?this.state.currencyCode:"",r=e.decimalPlaces;if(!s&&!i)return[];const n=[{symbol:s,position:t,decimalPlaces:0},{symbol:s,position:t,decimalPlaces:r},{symbol:s,position:t,decimalPlaces:0,code:i},{symbol:s,position:t,decimalPlaces:r,code:i},{symbol:s,position:o,decimalPlaces:0},{symbol:s,position:o,decimalPlaces:r},{symbol:s,position:o,decimalPlaces:0,code:i},{symbol:s,position:o,decimalPlaces:r,code:i}],a=new Set,l=this.env.model.getters.getLocale();return n.map((e=>{const t=dn(e);if((e.symbol||e.code)&&!a.has(t))return a.add(t),{format:t,accountingFormat:un(e),example:Xr(1e3,{format:t,locale:l})}})).filter(at)}get isSameFormat(){return!!this.selectedFormat&&this.selectedFormat===this.getCommonFormat()}async updateAvailableCurrencies(){if(0===iI.getAll().length){(await(this.env.loadCurrencies?.())||[]).forEach(((e,t)=>{iI.add(t.toString(),e)}))}const e={name:Oo(uE.Custom),code:"",symbol:"",decimalPlaces:2,position:"after"};this.availableCurrencies=[e,...iI.getAll()]}updateSelectCurrency(e){const t=e.target;this.state.selectedCurrencyIndex=parseInt(t.value,10);const o=this.availableCurrencies[this.state.selectedCurrencyIndex];this.state.currencyCode=o.code,this.state.currencySymbol=o.symbol}updateCode(e){const t=e.target;this.state.currencyCode=t.value,this.initAvailableCurrencies()}updateSymbol(e){const t=e.target;this.state.currencySymbol=t.value,this.initAvailableCurrencies()}updateSelectFormat(e){const t=e.target;this.state.selectedFormatIndex=parseInt(t.value,10)}apply(){this.env.model.dispatch("SET_FORMATTING_WITH_PIVOT",{sheetId:this.env.model.getters.getActiveSheetId(),target:this.env.model.getters.getSelectedZones(),format:this.selectedFormat})}initAvailableCurrencies(){this.state.selectedCurrencyIndex=0}getCommonFormat(){const e=this.env.model.getters.getSelectedZones(),t=this.env.model.getters.getActiveSheetId(),o=e.map((e=>this.env.model.getters.getEvaluatedCellsInZone(t,e))).flat(),s=o[0].format;return o.every((e=>e.format===s))?s:void 0}currencyDisplayName(e){return e.name+(e.code?` (${e.code})`:"")}toggleAccountingFormat(){this.state.isAccountingFormat=!this.state.isAccountingFormat}getFormatExamples(){const e=this.selectedFormat,t=this.env.model.getters.getLocale();return[{label:Oo("positive")+":",value:Xr(1234.56,{format:e,locale:t})},{label:Oo("negative")+":",value:Xr(-1234.56,{format:e,locale:t})},{label:Oo("zero")+":",value:Xr(0,{format:e,locale:t})}]}get selectedFormat(){const e=this.formatProposals[this.state.selectedFormatIndex];return this.state.isAccountingFormat?e?.accountingFormat:e?.format}}const iO=new r;iO.add("textContains",{type:"textContains",isValueValid:(e,t)=>String(e).toLowerCase().includes(t.values[0].toLowerCase()),getErrorString:e=>Oo('The value must be a text that contains "%s"',e.values[0]),isCriterionValueValid:e=>!!e,criterionValueErrorString:fE.CriterionError.notEmptyValue,numberOfValues:()=>1,name:Oo("Text contains"),getPreview:e=>Oo('Text contains "%s"',e.values[0])}),iO.add("textNotContains",{type:"textNotContains",isValueValid:(e,t)=>!String(e).toLowerCase().includes(t.values[0].toLowerCase()),getErrorString:e=>Oo('The value must be a text that does not contain "%s"',e.values[0]),isCriterionValueValid:e=>!!e,criterionValueErrorString:fE.CriterionError.notEmptyValue,numberOfValues:()=>1,name:Oo("Text does not contains"),getPreview:e=>Oo('Text does not contain "%s"',e.values[0])}),iO.add("textIs",{type:"textIs",isValueValid:(e,t)=>String(e).toLowerCase()===t.values[0].toLowerCase(),getErrorString:e=>Oo('The value must be exactly "%s"',e.values[0]),isCriterionValueValid:e=>!!e,criterionValueErrorString:fE.CriterionError.notEmptyValue,numberOfValues:()=>1,name:Oo("Text is exactly"),getPreview:e=>Oo('Text is exactly "%s"',e.values[0])});const rO=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$/;function nO(e,t){return e.values.map((e=>void 0!==e?Oa(e,t):xi.InvalidReference))}function aO(e,t){return On(e,bi).map((e=>void 0!==e?Xr(e,{locale:t,format:t.dateFormat}):xi.InvalidReference))}function lO(e){return void 0!==ks(e,bi)}function cO(e){return void 0!==Vi(e,bi)}iO.add("textIsEmail",{type:"textIsEmail",isValueValid:e=>"string"==typeof e&&rO.test(e),getErrorString:()=>Oo("The value must be a valid email address"),isCriterionValueValid:()=>!0,criterionValueErrorString:"",numberOfValues:()=>0,name:Oo("Text is valid email"),getPreview:()=>Oo("Text is valid email")}),iO.add("textIsLink",{type:"textIsLink",isValueValid:e=>void 0!==Rr(e),getErrorString:()=>Oo("The value must be a valid link"),isCriterionValueValid:()=>!0,criterionValueErrorString:"",numberOfValues:()=>0,name:Oo("Text is valid link"),getPreview:()=>Oo("Text is valid link")}),iO.add("dateIs",{type:"dateIs",isValueValid:(e,t)=>{const o=On(t,bi)[0],s=ks(e,bi);if(void 0===s||void 0===o)return!1;if(["lastWeek","lastMonth","lastYear"].includes(t.dateValue)){return Ks(s,Bs(xs.now()),o)}return i=s,r=o,Math.trunc(i)===Math.trunc(r);var i,r},getErrorString:(e,t)=>{const o=t.getLocale();return"exactDate"===e.dateValue?Oo("The value must be the date %s",aO(e,o)[0]):Oo("The value must be %s",fE.DateIs[e.dateValue])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:e=>"exactDate"===e.dateValue?1:0,name:Oo("Date is"),getPreview:(e,t)=>"exactDate"===e.dateValue?Oo("Date is %s",Mn(e.values,t.getLocale())[0]):Oo("Date is %s",fE.DateIs[e.dateValue])}),iO.add("dateIsBefore",{type:"dateIsBefore",isValueValid:(e,t)=>{const o=On(t,bi)[0],s=ks(e,bi);return void 0!==s&&void 0!==o&&function(e,t){return Math.trunc(e)<Math.trunc(t)}(s,o)},getErrorString:(e,t)=>{const o=t.getLocale();return"exactDate"===e.dateValue?Oo("The value must be a date before %s",aO(e,o)[0]):Oo("The value must be a date before %s",fE.DateIsBefore[e.dateValue])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:e=>"exactDate"===e.dateValue?1:0,name:Oo("Date is before"),getPreview:(e,t)=>"exactDate"===e.dateValue?Oo("Date is before %s",Mn(e.values,t.getLocale())[0]):Oo("Date is before %s",fE.DateIsBefore[e.dateValue])}),iO.add("dateIsOnOrBefore",{type:"dateIsOnOrBefore",isValueValid:(e,t)=>{const o=On(t,bi)[0],s=ks(e,bi);return void 0!==s&&void 0!==o&&function(e,t){return Math.trunc(e)<=Math.trunc(t)}(s,o)},getErrorString:(e,t)=>{const o=t.getLocale();return"exactDate"===e.dateValue?Oo("The value must be a date on or before %s",aO(e,o)[0]):Oo("The value must be a date on or before %s",fE.DateIsBefore[e.dateValue])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:e=>"exactDate"===e.dateValue?1:0,name:Oo("Date is on or before"),getPreview:(e,t)=>"exactDate"===e.dateValue?Oo("Date is on or before %s",Mn(e.values,t.getLocale())[0]):Oo("Date is on or before %s",fE.DateIsBefore[e.dateValue])}),iO.add("dateIsAfter",{type:"dateIsAfter",isValueValid:(e,t)=>{const o=On(t,bi)[0],s=ks(e,bi);return void 0!==s&&void 0!==o&&function(e,t){return Math.trunc(e)>Math.trunc(t)}(s,o)},getErrorString:(e,t)=>{const o=t.getLocale();return"exactDate"===e.dateValue?Oo("The value must be a date after %s",aO(e,o)[0]):Oo("The value must be a date after %s",fE.DateIsBefore[e.dateValue])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:e=>"exactDate"===e.dateValue?1:0,name:Oo("Date is after"),getPreview:(e,t)=>"exactDate"===e.dateValue?Oo("Date is after %s",Mn(e.values,t.getLocale())[0]):Oo("Date is after %s",fE.DateIsBefore[e.dateValue])}),iO.add("dateIsOnOrAfter",{type:"dateIsOnOrAfter",isValueValid:(e,t)=>{const o=On(t,bi)[0],s=ks(e,bi);return void 0!==s&&void 0!==o&&function(e,t){return Math.trunc(e)>=Math.trunc(t)}(s,o)},getErrorString:(e,t)=>{const o=t.getLocale();return"exactDate"===e.dateValue?Oo("The value must be a date on or after %s",aO(e,o)[0]):Oo("The value must be a date on or after %s",fE.DateIsBefore[e.dateValue])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:e=>"exactDate"===e.dateValue?1:0,name:Oo("Date is on or after"),getPreview:(e,t)=>"exactDate"===e.dateValue?Oo("Date is on or after %s",Mn(e.values,t.getLocale())[0]):Oo("Date is on or after %s",fE.DateIsBefore[e.dateValue])}),iO.add("dateIsBetween",{type:"dateIsBetween",isValueValid:(e,t)=>{const o=On(t,bi),s=ks(e,bi);return void 0!==s&&void 0!==o[0]&&void 0!==o[1]&&Ks(s,o[0],o[1])},getErrorString:(e,t)=>{const o=aO(e,t.getLocale());return Oo("The value must be a date between %s and %s",o[0],o[1])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:()=>2,name:Oo("Date is between"),getPreview:(e,t)=>{const o=Mn(e.values,t.getLocale());return Oo("Date is between %s and %s",o[0],o[1])}}),iO.add("dateIsNotBetween",{type:"dateIsNotBetween",isValueValid:(e,t)=>{const o=On(t,bi),s=ks(e,bi);return void 0!==s&&void 0!==o[0]&&void 0!==o[1]&&!Ks(s,o[0],o[1])},getErrorString:(e,t)=>{const o=aO(e,t.getLocale());return Oo("The value must be a date not between %s and %s",o[0],o[1])},isCriterionValueValid:e=>lO(e),criterionValueErrorString:fE.CriterionError.dateValue,numberOfValues:()=>2,name:Oo("Date is not between"),getPreview:(e,t)=>{const o=Mn(e.values,t.getLocale());return Oo("Date is not between %s and %s",o[0],o[1])}}),iO.add("dateIsValid",{type:"dateIsValid",isValueValid:e=>void 0!==ks(e,bi),getErrorString:()=>Oo("The value must be a valid date"),isCriterionValueValid:e=>lO(e),criterionValueErrorString:"",numberOfValues:()=>0,name:Oo("Is valid date"),getPreview:()=>Oo("Date is valid")}),iO.add("isEqual",{type:"isEqual",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e===o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be equal to %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is equal to"),getPreview:e=>Oo("Value is equal to %s",e.values[0])}),iO.add("isNotEqual",{type:"isNotEqual",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e!==o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must not be equal to %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is not equal to"),getPreview:e=>Oo("Value is not equal to %s",e.values[0])}),iO.add("isGreaterThan",{type:"isGreaterThan",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e>o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be greater than %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is greater than"),getPreview:e=>Oo("Value is greater than %s",e.values[0])}),iO.add("isGreaterOrEqualTo",{type:"isGreaterOrEqualTo",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e>=o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be greater or equal to %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is greater or equal to"),getPreview:e=>Oo("Value is greater or equal to %s",e.values[0])}),iO.add("isLessThan",{type:"isLessThan",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e<o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be less than %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is less than"),getPreview:e=>Oo("Value is less than %s",e.values[0])}),iO.add("isLessOrEqualTo",{type:"isLessOrEqualTo",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi)[0];return void 0!==o&&e<=o},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be less or equal to %s",o[0])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>1,name:Oo("Is less or equal to"),getPreview:e=>Oo("Value is less or equal to %s",e.values[0])}),iO.add("isBetween",{type:"isBetween",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi);return void 0!==o[0]&&void 0!==o[1]&&At(e,o[0],o[1])},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must be between %s and %s",o[0],o[1])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>2,name:Oo("Is between"),getPreview:e=>Oo("Value is between %s and %s",e.values[0],e.values[1])}),iO.add("isNotBetween",{type:"isNotBetween",isValueValid:(e,t)=>{if("number"!=typeof e)return!1;const o=Fn(t,bi);return void 0!==o[0]&&void 0!==o[1]&&!At(e,o[0],o[1])},getErrorString:(e,t)=>{const o=nO(e,t.getLocale());return Oo("The value must not be between %s and %s",o[0],o[1])},isCriterionValueValid:e=>cO(e),criterionValueErrorString:fE.CriterionError.numberValue,numberOfValues:()=>2,name:Oo("Is not between"),getPreview:e=>Oo("Value is not between %s and %s",e.values[0],e.values[1])}),iO.add("isBoolean",{type:"isBoolean",isValueValid:e=>""===e||"boolean"==typeof e,getErrorString:()=>Oo("The value must be a boolean"),isCriterionValueValid:()=>!0,criterionValueErrorString:"",numberOfValues:()=>0,name:Oo("Checkbox"),getPreview:()=>Oo("Checkbox")}),iO.add("isValueInList",{type:"isValueInList",isValueValid:(e,t)=>null!==e&&t.values.map((e=>e.toLowerCase())).includes(e.toString().toLowerCase()),getErrorString:e=>Oo("The value must be one of: %s",e.values.join(", ")),isCriterionValueValid:()=>!0,criterionValueErrorString:"",numberOfValues:()=>{},allowedValues:"onlyLiterals",name:Oo("Value in list"),getPreview:e=>Oo("Value one of: %s",e.values.join(", "))}),iO.add("isValueInRange",{type:"isValueInList",isValueValid:(e,t,o,s)=>{if(!e)return!1;const i=o.getRangeFromSheetXC(s,t.values[0]);return o.getRangeValues(i).filter(lt).map((e=>e.toString().toLowerCase())).includes(e.toString().toLowerCase())},getErrorString:e=>Oo("The value must be a value in the range %s",e.values[0]),isCriterionValueValid:e=>Ho.test(e),criterionValueErrorString:fE.CriterionError.validRange,numberOfValues:()=>1,allowedValues:"onlyLiterals",name:Oo("Value in range"),getPreview:e=>Oo("Value in range %s",e.values[0])}),iO.add("customFormula",{type:"customFormula",isValueValid:(e,t)=>{const o=In(t.values[0],bi);return("number"==typeof o||"boolean"==typeof o)&&!!o},getErrorString:()=>Oo("The value does not match the custom formula data validation rule"),isCriterionValueValid:()=>!0,criterionValueErrorString:"",numberOfValues:()=>1,allowedValues:"onlyFormulas",name:Oo("Custom formula"),getPreview:e=>Oo("Custom formula %s",e.values[0])});class hO extends t.Component{static template="o-spreadsheet-SelectMenu";static props={menuItems:Array,selectedValue:String,class:{type:String,optional:!0}};static components={Menu:oR};menuId=(new na).uuidv4();selectRef=t.useRef("select");selectRect=EI(this.selectRef);state=t.useState({isMenuOpen:!1});onClick(e){e.closedMenuId!==this.menuId&&(this.state.isMenuOpen=!this.state.isMenuOpen)}onMenuClosed(){this.state.isMenuOpen=!1}get menuPosition(){return{x:this.selectRect.x,y:this.selectRect.y+this.selectRect.height}}}class dO extends t.Component{static props={criterion:Object,onCriterionChanged:Function};setup(){const e=Sc(_c);t.onMounted((()=>{e.activeComposer.stopEdition()}))}updateCriterion(e){const t={...this.props.criterion,...e};this.props.onCriterionChanged(t)}}gy`
|
|
1108
1112
|
.o-dv-input {
|
|
@@ -3255,4 +3259,4 @@
|
|
|
3255
3259
|
<tableParts count="${e.tables.length}">
|
|
3256
3260
|
${Rw(a)}
|
|
3257
3261
|
</tableParts>
|
|
3258
|
-
`}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-alpha.8",Xk.date="2024-12-19T07:49:54.421Z",Xk.hash="87a1567"}(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);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -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.
|
|
5
|
-
@date 2024-12-
|
|
6
|
-
@hash
|
|
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">
|
|
@@ -4708,11 +4708,11 @@
|
|
|
4708
4708
|
onChange.bind="toggleAccountingFormat"
|
|
4709
4709
|
/>
|
|
4710
4710
|
<div class="o-format-examples mt-4" t-if="selectedFormat">
|
|
4711
|
-
<table>
|
|
4711
|
+
<table class="w-100">
|
|
4712
4712
|
<t t-foreach="getFormatExamples()" t-as="example" t-key="example_index">
|
|
4713
4713
|
<tr>
|
|
4714
|
-
<td class="pe-3 o-fw-bold" t-esc="example.label"/>
|
|
4715
|
-
<td t-esc="example.value"/>
|
|
4714
|
+
<td class="w-25 pe-3 o-fw-bold" t-esc="example.label"/>
|
|
4715
|
+
<td class="w-75 text-truncate" t-esc="example.value"/>
|
|
4716
4716
|
</tr>
|
|
4717
4717
|
</t>
|
|
4718
4718
|
</table>
|