@odoo/o-spreadsheet 16.0.54 → 16.0.55

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.
@@ -9974,6 +9974,9 @@ class ConditionalFormattingPanel extends owl.Component {
9974
9974
  }
9975
9975
  }
9976
9976
  setColorScaleColor(target, color) {
9977
+ if (!isColorValid(color)) {
9978
+ return;
9979
+ }
9977
9980
  const point = this.state.rules.colorScale[target];
9978
9981
  if (point) {
9979
9982
  point.color = Number.parseInt(color.substr(1), 16);
@@ -43459,6 +43462,6 @@ exports.setTranslationMethod = setTranslationMethod;
43459
43462
  exports.tokenize = tokenize;
43460
43463
 
43461
43464
 
43462
- __info__.version = '16.0.54';
43463
- __info__.date = '2024-11-08T12:11:01.946Z';
43464
- __info__.hash = 'fdfa7dc';
43465
+ __info__.version = '16.0.55';
43466
+ __info__.date = '2024-11-13T15:02:56.109Z';
43467
+ __info__.hash = '6984990';
@@ -4961,6 +4961,7 @@ interface ColorPickerProps {
4961
4961
  dropdownDirection?: "left" | "right" | "center";
4962
4962
  onColorPicked: (color: Color) => void;
4963
4963
  currentColor: Color;
4964
+ disableNoColor?: boolean;
4964
4965
  }
4965
4966
  declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEnv> {
4966
4967
  static template: string;
@@ -9970,6 +9970,9 @@ class ConditionalFormattingPanel extends Component {
9970
9970
  }
9971
9971
  }
9972
9972
  setColorScaleColor(target, color) {
9973
+ if (!isColorValid(color)) {
9974
+ return;
9975
+ }
9973
9976
  const point = this.state.rules.colorScale[target];
9974
9977
  if (point) {
9975
9978
  point.color = Number.parseInt(color.substr(1), 16);
@@ -43427,6 +43430,6 @@ function addFunction(functionName, functionDescription) {
43427
43430
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
43428
43431
 
43429
43432
 
43430
- __info__.version = '16.0.54';
43431
- __info__.date = '2024-11-08T12:11:01.946Z';
43432
- __info__.hash = 'fdfa7dc';
43433
+ __info__.version = '16.0.55';
43434
+ __info__.date = '2024-11-13T15:02:56.109Z';
43435
+ __info__.hash = '6984990';
@@ -9971,6 +9971,9 @@
9971
9971
  }
9972
9972
  }
9973
9973
  setColorScaleColor(target, color) {
9974
+ if (!isColorValid(color)) {
9975
+ return;
9976
+ }
9974
9977
  const point = this.state.rules.colorScale[target];
9975
9978
  if (point) {
9976
9979
  point.color = Number.parseInt(color.substr(1), 16);
@@ -43458,9 +43461,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43458
43461
  Object.defineProperty(exports, '__esModule', { value: true });
43459
43462
 
43460
43463
 
43461
- __info__.version = '16.0.54';
43462
- __info__.date = '2024-11-08T12:11:01.946Z';
43463
- __info__.hash = 'fdfa7dc';
43464
+ __info__.version = '16.0.55';
43465
+ __info__.date = '2024-11-13T15:02:56.109Z';
43466
+ __info__.hash = '6984990';
43464
43467
 
43465
43468
 
43466
43469
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -824,7 +824,7 @@
824
824
  }
825
825
  }
826
826
  }
827
- `;class Ss extends t.Component{constructor(){super(...arguments),this.icons=fs,this.cellIsOperators=Ko,this.iconSets=vs,this.getTextDecoration=wn,this.colorNumberString=gt}setup(){this.activeSheetId=this.env.model.getters.getActiveSheetId(),this.state=t.useState({mode:"list",errors:[],rules:this.getDefaultRules()});const e=this.env.model.getters.getActiveSheetId(),i=this.env.model.getters.getRulesSelection(e,this.props.selection||[]);if(1===i.length){const e=this.conditionalFormats.find((e=>e.id===i[0]));e&&this.editConditionalFormat(e)}t.onWillUpdateProps((e=>{const t=this.env.model.getters.getActiveSheetId();if(t!==this.activeSheetId)this.activeSheetId=t,this.switchToList();else if(e.selection!==this.props.selection){const t=this.env.model.getters.getActiveSheetId(),i=this.env.model.getters.getRulesSelection(t,e.selection||[]);if(1===i.length){const e=this.conditionalFormats.find((e=>e.id===i[0]));e&&this.editConditionalFormat(e)}else this.switchToList()}})),t.useExternalListener(window,"click",this.closeMenus)}get conditionalFormats(){return this.env.model.getters.getConditionalFormats(this.env.model.getters.getActiveSheetId())}get isRangeValid(){return this.state.errors.includes(24)}errorMessage(e){return Xo.Errors[e]||Xo.Errors.Unexpected}switchToList(){this.state.mode="list",this.state.currentCF=void 0,this.state.currentCFType=void 0,this.state.errors=[],this.state.rules=this.getDefaultRules()}getStyle(e){if("CellIsRule"===e.type){return`font-weight:${e.style.bold?"bold":"normal"};\n text-decoration:${wn(e.style)};\n font-style:${e.style.italic?"italic":"normal"};\n color:${e.style.textColor||"none"};\n background-color:${e.style.fillColor||"none"};`}if("ColorScaleRule"===e.type){const t=gt(e.minimum.color),i=e.midpoint?gt(e.midpoint.color):null,n=gt(e.maximum.color),o="background-image: linear-gradient(to right, ";return i?o+t+", "+i+", "+n+")":o+t+", "+n+")"}return""}getDescription(e){switch(e.rule.type){case"CellIsRule":const t=Ko[e.rule.operator];return 1===e.rule.values.length?`${t} ${e.rule.values[0]}`:2===e.rule.values.length?o("%s %s and %s",t,e.rule.values[0],e.rule.values[1]):t;case"ColorScaleRule":return Xo.ColorScale;case"IconSetRule":return Xo.IconSet;default:return""}}saveConditionalFormat(){if(this.state.currentCF){if(this.state.currentCF.ranges.some((e=>!e.match(Nt))))return void(this.state.errors=[25]);const e=this.env.model.getters.getActiveSheetId(),t=this.env.model.dispatch("ADD_CONDITIONAL_FORMAT",{cf:{rule:this.getEditorRule(),id:"edit"===this.state.mode?this.state.currentCF.id:this.env.model.uuidGenerator.uuidv4()},ranges:this.state.currentCF.ranges.map((t=>this.env.model.getters.getRangeDataFromXc(e,t))),sheetId:e});t.isSuccessful?this.switchToList():this.state.errors=t.reasons}}getEditorRule(){switch(this.state.currentCFType){case"CellIsRule":return this.state.rules.cellIs;case"ColorScaleRule":return this.state.rules.colorScale;case"IconSetRule":return this.state.rules.iconSet}throw new Error(`Invalid cf type: ${this.state.currentCFType}`)}getDefaultRules(){return{cellIs:{type:"CellIsRule",operator:"IsNotEmpty",values:[],style:{fillColor:"#b6d7a8"}},colorScale:{type:"ColorScaleRule",minimum:{type:"value",color:16777215},midpoint:void 0,maximum:{type:"value",color:6989903}},iconSet:{type:"IconSetRule",icons:{upper:"arrowGood",middle:"arrowNeutral",lower:"arrowBad"},upperInflectionPoint:{type:"percentage",value:"66",operator:"gt"},lowerInflectionPoint:{type:"percentage",value:"33",operator:"gt"}}}}addConditionalFormat(){this.state.mode="add",this.state.currentCFType="CellIsRule",this.state.currentCF={id:this.env.model.uuidGenerator.uuidv4(),ranges:this.env.model.getters.getSelectedZones().map((e=>this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(),e)))}}deleteConditionalFormat(e){this.env.model.dispatch("REMOVE_CONDITIONAL_FORMAT",{id:e.id,sheetId:this.env.model.getters.getActiveSheetId()})}editConditionalFormat(e){if("reorder"!==this.state.mode)switch(this.state.mode="edit",this.state.currentCF=e,this.state.currentCFType=e.rule.type,e.rule.type){case"CellIsRule":this.state.rules.cellIs=e.rule;break;case"ColorScaleRule":this.state.rules.colorScale=e.rule;break;case"IconSetRule":this.state.rules.iconSet=e.rule}}reorderConditionalFormats(){this.state.mode="reorder"}reorderRule(e,t){this.env.model.dispatch("MOVE_CONDITIONAL_FORMAT",{cfId:e.id,direction:t,sheetId:this.env.model.getters.getActiveSheetId()})}changeRuleType(e){this.state.currentCFType!==e&&this.state.rules&&(this.state.errors=[],this.state.currentCFType=e)}onRangesChanged(e){this.state.currentCF&&(this.state.currentCF.ranges=e)}toggleMenu(e){const t=this.state.openedMenu===e;this.closeMenus(),t||(this.state.openedMenu=e)}closeMenus(){this.state.openedMenu=void 0}get isValue1Invalid(){var e;return!!(null===(e=this.state.errors)||void 0===e?void 0:e.includes(51))}get isValue2Invalid(){var e;return!!(null===(e=this.state.errors)||void 0===e?void 0:e.includes(52))}toggleStyle(e){const t=this.state.rules.cellIs.style;t[e]=!t[e],this.closeMenus()}setColor(e,t){this.state.rules.cellIs.style[e]=t,this.closeMenus()}isValueInvalid(e){switch(e){case"minimum":return this.state.errors.includes(58)||this.state.errors.includes(50)||this.state.errors.includes(47)||this.state.errors.includes(53);case"midpoint":return this.state.errors.includes(59)||this.state.errors.includes(54)||this.state.errors.includes(49);case"maximum":return this.state.errors.includes(60)||this.state.errors.includes(55);default:return!1}}setColorScaleColor(e,t){const i=this.state.rules.colorScale[e];i&&(i.color=Number.parseInt(t.substr(1),16)),this.closeMenus()}getPreviewGradient(){var e;const t=this.state.rules.colorScale,i=gt(t.minimum.color),n=gt((null===(e=t.midpoint)||void 0===e?void 0:e.color)||x),o=gt(t.maximum.color),r="background-image: linear-gradient(to right, ";return void 0===t.midpoint?r+i+", "+o+")":r+i+", "+n+", "+o+")"}getThresholdColor(e){return gt(e?e.color:x)}onMidpointChange(e){const t=e.target.value,i=this.state.rules.colorScale;i.midpoint="none"===t?void 0:{color:x,value:"",...i.midpoint,type:t}}isInflectionPointInvalid(e){switch(e){case"lowerInflectionPoint":return this.state.errors.includes(57)||this.state.errors.includes(62)||this.state.errors.includes(48);case"upperInflectionPoint":return this.state.errors.includes(56)||this.state.errors.includes(61)||this.state.errors.includes(48);default:return!0}}reverseIcons(){const e=this.state.rules.iconSet.icons,t=e.upper;e.upper=e.lower,e.lower=t}setIconSet(e){const t=this.state.rules.iconSet.icons;t.upper=this.iconSets[e].good,t.middle=this.iconSets[e].neutral,t.lower=this.iconSets[e].bad}setIcon(e,t){this.state.rules.iconSet.icons[e]=t}}Ss.template="o-spreadsheet-ConditionalFormattingPanel",Ss.components={SelectionInput:sr,IconPicker:bs,ColorPicker:os},En`
827
+ `;class Ss extends t.Component{constructor(){super(...arguments),this.icons=fs,this.cellIsOperators=Ko,this.iconSets=vs,this.getTextDecoration=wn,this.colorNumberString=gt}setup(){this.activeSheetId=this.env.model.getters.getActiveSheetId(),this.state=t.useState({mode:"list",errors:[],rules:this.getDefaultRules()});const e=this.env.model.getters.getActiveSheetId(),i=this.env.model.getters.getRulesSelection(e,this.props.selection||[]);if(1===i.length){const e=this.conditionalFormats.find((e=>e.id===i[0]));e&&this.editConditionalFormat(e)}t.onWillUpdateProps((e=>{const t=this.env.model.getters.getActiveSheetId();if(t!==this.activeSheetId)this.activeSheetId=t,this.switchToList();else if(e.selection!==this.props.selection){const t=this.env.model.getters.getActiveSheetId(),i=this.env.model.getters.getRulesSelection(t,e.selection||[]);if(1===i.length){const e=this.conditionalFormats.find((e=>e.id===i[0]));e&&this.editConditionalFormat(e)}else this.switchToList()}})),t.useExternalListener(window,"click",this.closeMenus)}get conditionalFormats(){return this.env.model.getters.getConditionalFormats(this.env.model.getters.getActiveSheetId())}get isRangeValid(){return this.state.errors.includes(24)}errorMessage(e){return Xo.Errors[e]||Xo.Errors.Unexpected}switchToList(){this.state.mode="list",this.state.currentCF=void 0,this.state.currentCFType=void 0,this.state.errors=[],this.state.rules=this.getDefaultRules()}getStyle(e){if("CellIsRule"===e.type){return`font-weight:${e.style.bold?"bold":"normal"};\n text-decoration:${wn(e.style)};\n font-style:${e.style.italic?"italic":"normal"};\n color:${e.style.textColor||"none"};\n background-color:${e.style.fillColor||"none"};`}if("ColorScaleRule"===e.type){const t=gt(e.minimum.color),i=e.midpoint?gt(e.midpoint.color):null,n=gt(e.maximum.color),o="background-image: linear-gradient(to right, ";return i?o+t+", "+i+", "+n+")":o+t+", "+n+")"}return""}getDescription(e){switch(e.rule.type){case"CellIsRule":const t=Ko[e.rule.operator];return 1===e.rule.values.length?`${t} ${e.rule.values[0]}`:2===e.rule.values.length?o("%s %s and %s",t,e.rule.values[0],e.rule.values[1]):t;case"ColorScaleRule":return Xo.ColorScale;case"IconSetRule":return Xo.IconSet;default:return""}}saveConditionalFormat(){if(this.state.currentCF){if(this.state.currentCF.ranges.some((e=>!e.match(Nt))))return void(this.state.errors=[25]);const e=this.env.model.getters.getActiveSheetId(),t=this.env.model.dispatch("ADD_CONDITIONAL_FORMAT",{cf:{rule:this.getEditorRule(),id:"edit"===this.state.mode?this.state.currentCF.id:this.env.model.uuidGenerator.uuidv4()},ranges:this.state.currentCF.ranges.map((t=>this.env.model.getters.getRangeDataFromXc(e,t))),sheetId:e});t.isSuccessful?this.switchToList():this.state.errors=t.reasons}}getEditorRule(){switch(this.state.currentCFType){case"CellIsRule":return this.state.rules.cellIs;case"ColorScaleRule":return this.state.rules.colorScale;case"IconSetRule":return this.state.rules.iconSet}throw new Error(`Invalid cf type: ${this.state.currentCFType}`)}getDefaultRules(){return{cellIs:{type:"CellIsRule",operator:"IsNotEmpty",values:[],style:{fillColor:"#b6d7a8"}},colorScale:{type:"ColorScaleRule",minimum:{type:"value",color:16777215},midpoint:void 0,maximum:{type:"value",color:6989903}},iconSet:{type:"IconSetRule",icons:{upper:"arrowGood",middle:"arrowNeutral",lower:"arrowBad"},upperInflectionPoint:{type:"percentage",value:"66",operator:"gt"},lowerInflectionPoint:{type:"percentage",value:"33",operator:"gt"}}}}addConditionalFormat(){this.state.mode="add",this.state.currentCFType="CellIsRule",this.state.currentCF={id:this.env.model.uuidGenerator.uuidv4(),ranges:this.env.model.getters.getSelectedZones().map((e=>this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(),e)))}}deleteConditionalFormat(e){this.env.model.dispatch("REMOVE_CONDITIONAL_FORMAT",{id:e.id,sheetId:this.env.model.getters.getActiveSheetId()})}editConditionalFormat(e){if("reorder"!==this.state.mode)switch(this.state.mode="edit",this.state.currentCF=e,this.state.currentCFType=e.rule.type,e.rule.type){case"CellIsRule":this.state.rules.cellIs=e.rule;break;case"ColorScaleRule":this.state.rules.colorScale=e.rule;break;case"IconSetRule":this.state.rules.iconSet=e.rule}}reorderConditionalFormats(){this.state.mode="reorder"}reorderRule(e,t){this.env.model.dispatch("MOVE_CONDITIONAL_FORMAT",{cfId:e.id,direction:t,sheetId:this.env.model.getters.getActiveSheetId()})}changeRuleType(e){this.state.currentCFType!==e&&this.state.rules&&(this.state.errors=[],this.state.currentCFType=e)}onRangesChanged(e){this.state.currentCF&&(this.state.currentCF.ranges=e)}toggleMenu(e){const t=this.state.openedMenu===e;this.closeMenus(),t||(this.state.openedMenu=e)}closeMenus(){this.state.openedMenu=void 0}get isValue1Invalid(){var e;return!!(null===(e=this.state.errors)||void 0===e?void 0:e.includes(51))}get isValue2Invalid(){var e;return!!(null===(e=this.state.errors)||void 0===e?void 0:e.includes(52))}toggleStyle(e){const t=this.state.rules.cellIs.style;t[e]=!t[e],this.closeMenus()}setColor(e,t){this.state.rules.cellIs.style[e]=t,this.closeMenus()}isValueInvalid(e){switch(e){case"minimum":return this.state.errors.includes(58)||this.state.errors.includes(50)||this.state.errors.includes(47)||this.state.errors.includes(53);case"midpoint":return this.state.errors.includes(59)||this.state.errors.includes(54)||this.state.errors.includes(49);case"maximum":return this.state.errors.includes(60)||this.state.errors.includes(55);default:return!1}}setColorScaleColor(e,t){if(!ft(t))return;const i=this.state.rules.colorScale[e];i&&(i.color=Number.parseInt(t.substr(1),16)),this.closeMenus()}getPreviewGradient(){var e;const t=this.state.rules.colorScale,i=gt(t.minimum.color),n=gt((null===(e=t.midpoint)||void 0===e?void 0:e.color)||x),o=gt(t.maximum.color),r="background-image: linear-gradient(to right, ";return void 0===t.midpoint?r+i+", "+o+")":r+i+", "+n+", "+o+")"}getThresholdColor(e){return gt(e?e.color:x)}onMidpointChange(e){const t=e.target.value,i=this.state.rules.colorScale;i.midpoint="none"===t?void 0:{color:x,value:"",...i.midpoint,type:t}}isInflectionPointInvalid(e){switch(e){case"lowerInflectionPoint":return this.state.errors.includes(57)||this.state.errors.includes(62)||this.state.errors.includes(48);case"upperInflectionPoint":return this.state.errors.includes(56)||this.state.errors.includes(61)||this.state.errors.includes(48);default:return!0}}reverseIcons(){const e=this.state.rules.iconSet.icons,t=e.upper;e.upper=e.lower,e.lower=t}setIconSet(e){const t=this.state.rules.iconSet.icons;t.upper=this.iconSets[e].good,t.middle=this.iconSets[e].neutral,t.lower=this.iconSets[e].bad}setIcon(e,t){this.state.rules.iconSet.icons[e]=t}}Ss.template="o-spreadsheet-ConditionalFormattingPanel",Ss.components={SelectionInput:sr,IconPicker:bs,ColorPicker:os},En`
828
828
  .o-custom-currency {
829
829
  .o-format-proposals {
830
830
  color: black;
@@ -2437,4 +2437,4 @@
2437
2437
  <tableParts count="${e.filterTables.length}">
2438
2438
  ${Tf(a)}
2439
2439
  </tableParts>
2440
- `}var CS;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(CS||(CS={}));const ES={},wS={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:N,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:_,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:D},yS={autofillModifiersRegistry:sn,autofillRulesRegistry:bn,cellMenuRegistry:Go,colMenuRegistry:qo,linkMenuRegistry:Yn,functionRegistry:Wu,uiPluginRegistry:cb,corePluginRegistry:lb,rowMenuRegistry:Zo,sidePanelRegistry:ws,figureRegistry:to,sheetMenuRegistry:Yo,chartSidePanelComponentRegistry:gs,chartComponentRegistry:on,chartRegistry:nn,topbarMenuRegistry:nr,topbarComponentRegistry:ys,clickableCellRegistry:hb,otRegistry:or,inverseCommandRegistry:io,cellRegistry:Jn,cellPopoverRegistry:Qn},xS={LinkCell:_p},RS={args:$s,toBoolean:js,toJsDate:Ys,toNumber:Bs,toString:Ws,toXC:Vt,toZone:Ni,toCartesian:Ut,numberToLetters:Lt,createFullMenuItem:qn,UuidGenerator:Ai,formatValue:Qt,computeTextWidth:_e,isMarkdownLink:He,parseMarkdownLink:Ge,markdownLink:We,createEmptyWorkbookData:Jf,createEmptySheet:Qf,createEmptyExcelSheet:ev,getDefaultChartJsRuntime:Mr,chartFontColor:wr,getMenuChildren:Nn,ChartColors:Er,EvaluationError:c,CellErrorLevel:l,getFillingMode:Dr,rgbaToHex:Ct,colorToRGBA:Et,positionToZone:Ki,deepEquals:ot},IS={ChartPanel:ps,ChartFigure:As,ChartJsComponent:rn,Grid:Rp,GridOverlay:cp,ScorecardChart:Rs,LineConfigPanel:cs,LineBarPieDesignPanel:rs,BarConfigPanel:lr,LineBarPieConfigPanel:ar,GaugeChartConfigPanel:as,GaugeChartDesignPanel:ls,ScorecardChartConfigPanel:ds,ScorecardChartDesignPanel:us};e.AbstractChart=cr,e.CorePlugin=tv,e.DATETIME_FORMAT=Y,e.DispatchResult=gn,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},i={},n=[],o=new Ai,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let n=this.status;if(this.getters.isReadonly()&&(o=i,!hn.has(o.type)))return new gn(67);var o;if(!this.session.canApplyOptimisticUpdate())return new gn(64);switch(n){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:n,commands:o}=this.state.recordChanges((()=>{un(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(o,n),this.status=0,this.trigger("update");break;case 1:if(un(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(un(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return gn.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},n=this.status;this.status=2;const o=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(o,i),this.status=n,gn.Success},n=Xf(e,n);const s=jf(e,r);this.state=new kb,this.uuidGenerator=o,this.config=this.setupConfig(i),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new Mb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new _b(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.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of lb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of cb.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.isLoading=!0,this.setupSessionEvents(),this.session.loadInitialMessages(n),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this),this.isLoading=!1,this.finalize()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Ob(e,this.state.recordChanges.bind(this.state),(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-redone",this,this.finalize),this.session.on("revision-undone",this,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:r("Anonymous").toString()},i=e.transportService||new Cb;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return t.some((e=>0!==e))?new gn(t.flat()):gn.Success}finalize(){if(!this.isLoading){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}}dispatchToHandlers(e,t){t=Ae(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=Jf();for(let t of this.handlers)t instanceof tv&&t.export(e);return e.revisionId=this.session.getRevisionId()||K,e=Ae(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Jf(),sheets:[ev(Zf,"Sheet1")]};for(let t of this.handlers)t instanceof Pg&&t.exportForExcel(e);return e=Ae(e),bS(e)}},e.Registry=tn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=wS,e.Spreadsheet=Sb,e.UIPlugin=Ug,e.__info__=ES,e.addFunction=function(e,t){Wu.add(e,t)},e.astToFormula=Rg,e.cellTypes=xS,e.compile=Fg,e.components=IS,e.convertAstNodes=xg,e.coreTypes=dn,e.findCellInNewZone=Yi,e.functionCache=_g,e.helpers=RS,e.invalidateEvaluationCommands=ln,e.load=jf,e.parse=wg,e.readonlyAllowedCommands=hn,e.registries=yS,e.setTranslationMethod=function(e){i=e},e.tokenize=ju,Object.defineProperty(e,"__esModule",{value:!0}),ES.version="16.0.54",ES.date="2024-11-08T12:11:01.946Z",ES.hash="fdfa7dc"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2440
+ `}var CS;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(CS||(CS={}));const ES={},wS={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:N,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:_,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:D},yS={autofillModifiersRegistry:sn,autofillRulesRegistry:bn,cellMenuRegistry:Go,colMenuRegistry:qo,linkMenuRegistry:Yn,functionRegistry:Wu,uiPluginRegistry:cb,corePluginRegistry:lb,rowMenuRegistry:Zo,sidePanelRegistry:ws,figureRegistry:to,sheetMenuRegistry:Yo,chartSidePanelComponentRegistry:gs,chartComponentRegistry:on,chartRegistry:nn,topbarMenuRegistry:nr,topbarComponentRegistry:ys,clickableCellRegistry:hb,otRegistry:or,inverseCommandRegistry:io,cellRegistry:Jn,cellPopoverRegistry:Qn},xS={LinkCell:_p},RS={args:$s,toBoolean:js,toJsDate:Ys,toNumber:Bs,toString:Ws,toXC:Vt,toZone:Ni,toCartesian:Ut,numberToLetters:Lt,createFullMenuItem:qn,UuidGenerator:Ai,formatValue:Qt,computeTextWidth:_e,isMarkdownLink:He,parseMarkdownLink:Ge,markdownLink:We,createEmptyWorkbookData:Jf,createEmptySheet:Qf,createEmptyExcelSheet:ev,getDefaultChartJsRuntime:Mr,chartFontColor:wr,getMenuChildren:Nn,ChartColors:Er,EvaluationError:c,CellErrorLevel:l,getFillingMode:Dr,rgbaToHex:Ct,colorToRGBA:Et,positionToZone:Ki,deepEquals:ot},IS={ChartPanel:ps,ChartFigure:As,ChartJsComponent:rn,Grid:Rp,GridOverlay:cp,ScorecardChart:Rs,LineConfigPanel:cs,LineBarPieDesignPanel:rs,BarConfigPanel:lr,LineBarPieConfigPanel:ar,GaugeChartConfigPanel:as,GaugeChartDesignPanel:ls,ScorecardChartConfigPanel:ds,ScorecardChartDesignPanel:us};e.AbstractChart=cr,e.CorePlugin=tv,e.DATETIME_FORMAT=Y,e.DispatchResult=gn,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},i={},n=[],o=new Ai,r=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let n=this.status;if(this.getters.isReadonly()&&(o=i,!hn.has(o.type)))return new gn(67);var o;if(!this.session.canApplyOptimisticUpdate())return new gn(64);switch(n){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:n,commands:o}=this.state.recordChanges((()=>{un(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(o,n),this.status=0,this.trigger("update");break;case 1:if(un(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(un(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return gn.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},n=this.status;this.status=2;const o=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(o,i),this.status=n,gn.Success},n=Xf(e,n);const s=jf(e,r);this.state=new kb,this.uuidGenerator=o,this.config=this.setupConfig(i),this.session=this.setupSession(s.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new Mb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new _b(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.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of lb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of cb.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.isLoading=!0,this.setupSessionEvents(),this.session.loadInitialMessages(n),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this),this.isLoading=!1,this.finalize()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Ob(e,this.state.recordChanges.bind(this.state),(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-redone",this,this.finalize),this.session.on("revision-undone",this,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:r("Anonymous").toString()},i=e.transportService||new Cb;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return t.some((e=>0!==e))?new gn(t.flat()):gn.Success}finalize(){if(!this.isLoading){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}}dispatchToHandlers(e,t){t=Ae(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=Jf();for(let t of this.handlers)t instanceof tv&&t.export(e);return e.revisionId=this.session.getRevisionId()||K,e=Ae(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Jf(),sheets:[ev(Zf,"Sheet1")]};for(let t of this.handlers)t instanceof Pg&&t.exportForExcel(e);return e=Ae(e),bS(e)}},e.Registry=tn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=wS,e.Spreadsheet=Sb,e.UIPlugin=Ug,e.__info__=ES,e.addFunction=function(e,t){Wu.add(e,t)},e.astToFormula=Rg,e.cellTypes=xS,e.compile=Fg,e.components=IS,e.convertAstNodes=xg,e.coreTypes=dn,e.findCellInNewZone=Yi,e.functionCache=_g,e.helpers=RS,e.invalidateEvaluationCommands=ln,e.load=jf,e.parse=wg,e.readonlyAllowedCommands=hn,e.registries=yS,e.setTranslationMethod=function(e){i=e},e.tokenize=ju,Object.defineProperty(e,"__esModule",{value:!0}),ES.version="16.0.55",ES.date="2024-11-13T15:02:56.109Z",ES.hash="6984990"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
@@ -148,10 +148,12 @@
148
148
  <button class="o-add-button" t-on-click="setCustomColor">Add</button>
149
149
  </div>
150
150
  </div>
151
- <div class="o-separator"/>
152
- <div class="o-buttons">
153
- <button t-on-click="resetColor" class="o-cancel">Reset</button>
154
- </div>
151
+ <t t-if="!props.disableNoColor">
152
+ <div class="o-separator"/>
153
+ <div class="o-buttons">
154
+ <button t-on-click="resetColor" class="o-cancel">Reset</button>
155
+ </div>
156
+ </t>
155
157
  </div>
156
158
  </t>
157
159
 
@@ -2405,6 +2407,7 @@ https://fontawesome.com/license -->
2405
2407
  dropdownDirection="'left'"
2406
2408
  onColorPicked="(color) => this.setColorScaleColor(thresholdType, color)"
2407
2409
  currentColor="getThresholdColor(threshold)"
2410
+ disableNoColor="true"
2408
2411
  />
2409
2412
  </div>
2410
2413
  </div>
@@ -3239,7 +3242,7 @@ https://fontawesome.com/license -->
3239
3242
  </t>
3240
3243
  </odoo>
3241
3244
  <!--
3242
- __info__.version = '16.0.54';
3243
- __info__.date = '2024-11-08T12:11:25.156Z';
3244
- __info__.hash = 'fdfa7dc';
3245
+ __info__.version = '16.0.55';
3246
+ __info__.date = '2024-11-13T15:03:18.092Z';
3247
+ __info__.hash = '6984990';
3245
3248
  -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "16.0.54",
3
+ "version": "16.0.55",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",