@univerjs/engine-formula 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830

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.
Files changed (101) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +2 -2
  3. package/lib/es/facade.js +40 -20
  4. package/lib/es/index.js +3100 -3032
  5. package/lib/types/basics/cache-lru.d.ts +1 -1
  6. package/lib/types/basics/complex.d.ts +1 -1
  7. package/lib/types/basics/engineering.d.ts +1 -1
  8. package/lib/types/basics/error-type.d.ts +1 -1
  9. package/lib/types/basics/math.d.ts +1 -1
  10. package/lib/types/basics/object-class-type.d.ts +1 -1
  11. package/lib/types/basics/regex.d.ts +1 -1
  12. package/lib/types/basics/token-type.d.ts +1 -1
  13. package/lib/types/basics/token.d.ts +1 -1
  14. package/lib/types/controller/computing-status.controller.d.ts +14 -0
  15. package/lib/types/engine/ast-node/index.d.ts +1 -1
  16. package/lib/types/engine/ast-node/node-type.d.ts +1 -1
  17. package/lib/types/engine/dependency/range-block-util.d.ts +1 -1
  18. package/lib/types/engine/reference-object/base-reference-object.d.ts +1 -1
  19. package/lib/types/engine/utils/char-kit.d.ts +1 -1
  20. package/lib/types/engine/utils/math-kit.d.ts +1 -1
  21. package/lib/types/engine/utils/regexp-check.d.ts +1 -1
  22. package/lib/types/facade/f-formula.d.ts +13 -0
  23. package/lib/types/facade/index.d.ts +1 -1
  24. package/lib/types/functions/array/function-names.d.ts +1 -1
  25. package/lib/types/functions/compatibility/function-names.d.ts +1 -1
  26. package/lib/types/functions/cube/function-map.d.ts +1 -1
  27. package/lib/types/functions/cube/function-names.d.ts +1 -1
  28. package/lib/types/functions/database/function-names.d.ts +1 -1
  29. package/lib/types/functions/date/function-names.d.ts +1 -1
  30. package/lib/types/functions/engineering/function-names.d.ts +1 -1
  31. package/lib/types/functions/financial/function-names.d.ts +1 -1
  32. package/lib/types/functions/information/function-names.d.ts +1 -1
  33. package/lib/types/functions/logical/bycol/__test__/index.spec.d.ts +1 -1
  34. package/lib/types/functions/logical/byrow/__test__/index.spec.d.ts +1 -1
  35. package/lib/types/functions/logical/function-names.d.ts +1 -1
  36. package/lib/types/functions/logical/makearray/__test__/index.spec.d.ts +1 -1
  37. package/lib/types/functions/logical/map/__test__/index.spec.d.ts +1 -1
  38. package/lib/types/functions/logical/reduce/__test__/index.spec.d.ts +1 -1
  39. package/lib/types/functions/logical/scan/__test__/index.spec.d.ts +1 -1
  40. package/lib/types/functions/lookup/function-names.d.ts +1 -1
  41. package/lib/types/functions/lookup/index/__test__/index.spec.d.ts +1 -1
  42. package/lib/types/functions/lookup/indirect/__test__/index.spec.d.ts +1 -1
  43. package/lib/types/functions/math/function-names.d.ts +1 -1
  44. package/lib/types/functions/meta/function-names.d.ts +1 -1
  45. package/lib/types/functions/statistical/function-names.d.ts +1 -1
  46. package/lib/types/functions/text/arraytotext/__test__/index.spec.d.ts +1 -1
  47. package/lib/types/functions/text/asc/__test__/index.spec.d.ts +1 -1
  48. package/lib/types/functions/text/bahttext/__test__/index.spec.d.ts +1 -1
  49. package/lib/types/functions/text/char/__test__/index.spec.d.ts +1 -1
  50. package/lib/types/functions/text/clean/__test__/index.spec.d.ts +1 -1
  51. package/lib/types/functions/text/code/__test__/index.spec.d.ts +1 -1
  52. package/lib/types/functions/text/dbcs/__test__/index.spec.d.ts +1 -1
  53. package/lib/types/functions/text/dollar/__test__/index.spec.d.ts +1 -1
  54. package/lib/types/functions/text/exact/__test__/index.spec.d.ts +1 -1
  55. package/lib/types/functions/text/find/__test__/index.spec.d.ts +1 -1
  56. package/lib/types/functions/text/findb/__test__/index.spec.d.ts +1 -1
  57. package/lib/types/functions/text/fixed/__test__/index.spec.d.ts +1 -1
  58. package/lib/types/functions/text/function-names.d.ts +1 -1
  59. package/lib/types/functions/text/left/__test__/index.spec.d.ts +1 -1
  60. package/lib/types/functions/text/leftb/__test__/index.spec.d.ts +1 -1
  61. package/lib/types/functions/text/len/__test__/index.spec.d.ts +1 -1
  62. package/lib/types/functions/text/lenb/__test__/index.spec.d.ts +1 -1
  63. package/lib/types/functions/text/lower/__test__/index.spec.d.ts +1 -1
  64. package/lib/types/functions/text/mid/__test__/index.spec.d.ts +1 -1
  65. package/lib/types/functions/text/midb/__test__/index.spec.d.ts +1 -1
  66. package/lib/types/functions/text/numbervalue/__test__/index.spec.d.ts +1 -1
  67. package/lib/types/functions/text/proper/__test__/index.spec.d.ts +1 -1
  68. package/lib/types/functions/text/regexextract/__test__/index.spec.d.ts +1 -1
  69. package/lib/types/functions/text/regexmatch/__test__/index.spec.d.ts +1 -1
  70. package/lib/types/functions/text/regexreplace/__test__/index.spec.d.ts +1 -1
  71. package/lib/types/functions/text/replace/__test__/index.spec.d.ts +1 -1
  72. package/lib/types/functions/text/replaceb/__test__/index.spec.d.ts +1 -1
  73. package/lib/types/functions/text/rept/__test__/index.spec.d.ts +1 -1
  74. package/lib/types/functions/text/right/__test__/index.spec.d.ts +1 -1
  75. package/lib/types/functions/text/rightb/__test__/index.spec.d.ts +1 -1
  76. package/lib/types/functions/text/search/__test__/index.spec.d.ts +1 -1
  77. package/lib/types/functions/text/searchb/__test__/index.spec.d.ts +1 -1
  78. package/lib/types/functions/text/substitute/__test__/index.spec.d.ts +1 -1
  79. package/lib/types/functions/text/t/__test__/index.spec.d.ts +1 -1
  80. package/lib/types/functions/text/text/__test__/index.spec.d.ts +1 -1
  81. package/lib/types/functions/text/textafter/__test__/index.spec.d.ts +1 -1
  82. package/lib/types/functions/text/textbefore/__test__/index.spec.d.ts +1 -1
  83. package/lib/types/functions/text/textjoin/__test__/index.spec.d.ts +1 -1
  84. package/lib/types/functions/text/textsplit/__test__/index.spec.d.ts +1 -1
  85. package/lib/types/functions/text/trim/__test__/index.spec.d.ts +1 -1
  86. package/lib/types/functions/text/unichar/__test__/index.spec.d.ts +1 -1
  87. package/lib/types/functions/text/unicode/__test__/index.spec.d.ts +1 -1
  88. package/lib/types/functions/text/upper/__test__/index.spec.d.ts +1 -1
  89. package/lib/types/functions/text/value/__test__/index.spec.d.ts +1 -1
  90. package/lib/types/functions/text/valuetotext/__test__/index.spec.d.ts +1 -1
  91. package/lib/types/functions/univer/function-map.d.ts +1 -1
  92. package/lib/types/functions/univer/function-names.d.ts +1 -1
  93. package/lib/types/functions/web/function-names.d.ts +1 -1
  94. package/lib/types/index.d.ts +2 -1
  95. package/lib/types/services/global-computing-status.service.d.ts +13 -0
  96. package/lib/types/services/runtime.service.d.ts +2 -7
  97. package/lib/umd/facade.js +1 -1
  98. package/lib/umd/index.js +2 -2
  99. package/package.json +6 -5
  100. package/LICENSE +0 -176
  101. /package/lib/types/engine/utils/{prefixHandler.d.ts → prefix-handler.d.ts} +0 -0
package/lib/cjs/facade.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@univerjs/core"),a=require("@univerjs/engine-formula");var s=Object.defineProperty,m=Object.getOwnPropertyDescriptor,d=(o,e,t,r)=>{for(var i=r>1?void 0:r?m(e,t):e,c=o.length-1,l;c>=0;c--)(l=o[c])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&s(e,t,i),i},u=(o,e)=>(t,r)=>e(t,r,o);exports.FFormula=class extends n.FBase{constructor(e,t,r,i){super(),this._commandService=e,this._injector=t,this._lexerTreeBuilder=r,this._configService=i,this._initialize()}_initialize(){}get lexerTreeBuilder(){return this._lexerTreeBuilder}moveFormulaRefOffset(e,t,r,i){return this._lexerTreeBuilder.moveFormulaRefOffset(e,t,r,i)}sequenceNodesBuilder(e){return this._lexerTreeBuilder.sequenceNodesBuilder(e)||[]}executeCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStopMutation.id,{})}calculationStart(e){return this._commandService.onCommandExecuted(t=>{if(t.id===a.SetFormulaCalculationStartMutation.id){const r=t.params;e(r.forceCalculation)}})}calculationEnd(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.functionsExecutedState!==void 0&&e(r.functionsExecutedState)})}onCalculationEnd(){return new Promise((e,t)=>{const r=setTimeout(()=>{t(new Error("Calculation end timeout"))},3e4),i=this.calculationEnd(()=>{clearTimeout(r),i.dispose(),e()})})}calculationProcessing(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.stageInfo!==void 0&&e(r.stageInfo)})}setMaxIteration(e){this._configService.setConfig(a.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,e)}};exports.FFormula=d([u(0,n.Inject(n.ICommandService)),u(1,n.Inject(n.Injector)),u(2,n.Inject(a.LexerTreeBuilder)),u(3,n.IConfigService)],exports.FFormula);class f extends n.FUniver{getFormula(){return this._injector.createInstance(exports.FFormula)}}n.FUniver.extend(f);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@univerjs/core"),a=require("@univerjs/engine-formula"),u=require("rxjs");var m=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(o,e,t,r)=>{for(var i=r>1?void 0:r?d(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&m(e,t,i),i},c=(o,e)=>(t,r)=>e(t,r,o);exports.FFormula=class extends n.FBase{constructor(e,t,r,i){super(),this._commandService=e,this._injector=t,this._lexerTreeBuilder=r,this._configService=i,this._initialize()}_initialize(){}get lexerTreeBuilder(){return this._lexerTreeBuilder}moveFormulaRefOffset(e,t,r,i){return this._lexerTreeBuilder.moveFormulaRefOffset(e,t,r,i)}sequenceNodesBuilder(e){return this._lexerTreeBuilder.sequenceNodesBuilder(e)||[]}executeCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStopMutation.id,{})}calculationStart(e){return this._commandService.onCommandExecuted(t=>{if(t.id===a.SetFormulaCalculationStartMutation.id){const r=t.params;e(r.forceCalculation)}})}calculationEnd(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.functionsExecutedState!==void 0&&e(r.functionsExecutedState)})}whenComputingCompleteAsync(e){const t=this._injector.get(a.GlobalComputingStatusService);return t.computingStatus?Promise.resolve(!0):u.firstValueFrom(u.race(t.computingStatus$.pipe(u.filter(r=>r)),u.timer(e!=null?e:3e4).pipe(u.map(()=>!1))))}onCalculationEnd(){return new Promise((e,t)=>{const r=setTimeout(()=>{t(new Error("Calculation end timeout"))},3e4),i=this.calculationEnd(()=>{clearTimeout(r),i.dispose(),e()})})}calculationProcessing(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.stageInfo!==void 0&&e(r.stageInfo)})}setMaxIteration(e){this._configService.setConfig(a.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,e)}};exports.FFormula=f([c(0,n.Inject(n.ICommandService)),c(1,n.Inject(n.Injector)),c(2,n.Inject(a.LexerTreeBuilder)),c(3,n.IConfigService)],exports.FFormula);class _ extends n.FUniver{getFormula(){return this._injector.createInstance(exports.FFormula)}}n.FUniver.extend(_);