@univerjs/sheets-formula 0.16.1 → 0.17.0-insiders.20260318-5bef180
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.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -170
- package/lib/es/index.js +1 -16506
- package/lib/es/locale/ca-ES.js +1 -14
- package/lib/es/locale/en-US.js +1 -14
- package/lib/es/locale/es-ES.js +1 -14
- package/lib/es/locale/fa-IR.js +1 -14
- package/lib/es/locale/fr-FR.js +1 -14
- package/lib/es/locale/ja-JP.js +1 -14
- package/lib/es/locale/ko-KR.js +1 -14
- package/lib/es/locale/ru-RU.js +1 -14
- package/lib/es/locale/sk-SK.js +1 -14
- package/lib/es/locale/vi-VN.js +1 -14
- package/lib/es/locale/zh-CN.js +1 -14
- package/lib/es/locale/zh-TW.js +1 -14
- package/lib/facade.js +1 -170
- package/lib/index.js +1 -16506
- package/lib/locale/ca-ES.js +1 -14
- package/lib/locale/en-US.js +1 -14
- package/lib/locale/es-ES.js +1 -14
- package/lib/locale/fa-IR.js +1 -14
- package/lib/locale/fr-FR.js +1 -14
- package/lib/locale/ja-JP.js +1 -14
- package/lib/locale/ko-KR.js +1 -14
- package/lib/locale/ru-RU.js +1 -14
- package/lib/locale/sk-SK.js +1 -14
- package/lib/locale/vi-VN.js +1 -14
- package/lib/locale/zh-CN.js +1 -14
- package/lib/locale/zh-TW.js +1 -14
- package/lib/types/commands/commands/insert-function.command.d.ts +16 -1
- package/lib/types/commands/commands/quick-sum.command.d.ts +16 -1
- package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +17 -2
- package/lib/types/controllers/active-dirty.controller.d.ts +15 -0
- package/lib/types/controllers/array-formula-cell-interceptor.controller.d.ts +15 -0
- package/lib/types/controllers/defined-name.controller.d.ts +15 -0
- package/lib/types/{services/__test__/formula-ref.spec.d.ts → controllers/formula-auto-fill.controller.d.ts} +10 -1
- package/lib/types/controllers/formula.controller.d.ts +15 -0
- package/lib/types/controllers/image-formula-cell-interceptor.controller.d.ts +15 -0
- package/lib/types/controllers/super-table.controller.d.ts +15 -0
- package/lib/types/controllers/trigger-calculation.controller.d.ts +16 -1
- package/lib/types/controllers/update-defined-name.controller.d.ts +15 -0
- package/lib/types/controllers/update-formula.controller.d.ts +15 -0
- package/lib/types/controllers/utils/offset-formula-data.d.ts +17 -2
- package/lib/types/controllers/utils/ref-range-formula.d.ts +17 -2
- package/lib/types/controllers/utils/ref-range-move.d.ts +17 -2
- package/lib/types/controllers/utils/ref-range-param.d.ts +17 -2
- package/lib/types/facade/f-enum.d.ts +15 -0
- package/lib/types/facade/f-formula.d.ts +18 -3
- package/lib/types/facade/f-range.d.ts +16 -1
- package/lib/types/facade/f-univer.d.ts +17 -2
- package/lib/types/facade/f-workbook.d.ts +16 -1
- package/lib/types/index.d.ts +3 -2
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/plugin.d.ts +20 -1
- package/lib/types/services/description.service.d.ts +20 -3
- package/lib/types/services/formula-ref-range.service.d.ts +19 -2
- package/lib/types/services/function-list/array.d.ts +16 -1
- package/lib/types/services/function-list/compatibility.d.ts +16 -1
- package/lib/types/services/function-list/cube.d.ts +16 -1
- package/lib/types/services/function-list/database.d.ts +16 -1
- package/lib/types/services/function-list/date.d.ts +16 -1
- package/lib/types/services/function-list/engineering.d.ts +16 -1
- package/lib/types/services/function-list/financial.d.ts +16 -1
- package/lib/types/services/function-list/function-list.d.ts +16 -1
- package/lib/types/services/function-list/information.d.ts +16 -1
- package/lib/types/services/function-list/logical.d.ts +16 -1
- package/lib/types/services/function-list/lookup.d.ts +16 -1
- package/lib/types/services/function-list/math.d.ts +16 -1
- package/lib/types/services/function-list/statistical.d.ts +16 -1
- package/lib/types/services/function-list/text.d.ts +16 -1
- package/lib/types/services/function-list/univer.d.ts +16 -1
- package/lib/types/services/function-list/web.d.ts +16 -1
- package/lib/types/services/register-function.service.d.ts +20 -3
- package/lib/types/services/remote/remote-register-function.service.d.ts +16 -1
- package/lib/types/services/utils.d.ts +17 -2
- package/lib/types/util/calculate.d.ts +17 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -11
- package/LICENSE +0 -176
- package/lib/types/services/__test__/util.d.ts +0 -7
package/lib/cjs/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let e=require(`@univerjs/core`),t=require(`@univerjs/core/facade`),n=require(`@univerjs/engine-formula`),r=require(`@univerjs/sheets-formula`),i=require(`@univerjs/engine-formula/facade`),a=require(`@univerjs/sheets`),o=require(`@univerjs/sheets/facade`);var s=class extends t.FUniver{_initialize(){this._debouncedFormulaCalculation=(0,e.debounce)(()=>{this._commandService.executeCommand(n.SetTriggerFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(e){let t=this._injector.get(r.IRegisterFunctionService);t||(this._injector.add([r.IRegisterFunctionService,{useClass:r.RegisterFunctionService}]),t=this._injector.get(r.IRegisterFunctionService));let n=t.registerFunctions(e);return this._debouncedFormulaCalculation(),n}};t.FUniver.extend(s);var c=class extends i.FFormula{_initialize(){this._debouncedFormulaCalculation=(0,e.debounce)(()=>{this._commandService.executeCommand(n.SetTriggerFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(t){let n=this._injector.get(e.LifecycleService).stage,i=this._injector.get(e.ILogService),a=this._injector.get(e.IConfigService);n>e.LifecycleStages.Starting&&i.warn(`[FFormula]`,`CalculationMode is called after the Starting lifecycle and will take effect the next time the Univer Sheet is constructed. If you want it to take effect when the Univer Sheet is initialized this time, consider calling it before the Ready lifecycle or using configuration.`);let o=a.getConfig(r.PLUGIN_CONFIG_KEY_BASE);if(!o){a.setConfig(r.PLUGIN_CONFIG_KEY_BASE,{initialFormulaComputing:t});return}o.initialFormulaComputing=t}registerFunction(e,t,n){var i;let a=this._injector.get(r.IRegisterFunctionService);a||(this._injector.add([r.IRegisterFunctionService,{useClass:r.RegisterFunctionService}]),a=this._injector.get(r.IRegisterFunctionService));let o={name:e,func:t,description:typeof n==`string`?n:(i=n==null?void 0:n.description)==null?``:i,locales:typeof n==`object`?n.locales:void 0},s=a.registerFunction(o);return this._debouncedFormulaCalculation(),s}registerAsyncFunction(e,t,n){var i;let a=this._injector.get(r.IRegisterFunctionService);a||(this._injector.add([r.IRegisterFunctionService,{useClass:r.RegisterFunctionService}]),a=this._injector.get(r.IRegisterFunctionService));let o={name:e,func:t,description:typeof n==`string`?n:(i=n==null?void 0:n.description)==null?``:i,locales:typeof n==`object`?n.locales:void 0},s=a.registerAsyncFunction(o);return this._debouncedFormulaCalculation(),s}calculationResultApplied(e){let t=!1,r=!1,i=null;return this._commandService.onCommandExecuted((o,s)=>{o.id!==n.SetFormulaCalculationResultMutation.id&&o.id!==a.SetRangeValuesMutation.id||(o.id===n.SetFormulaCalculationResultMutation.id&&(t=!0,i=o.params),o.id===a.SetRangeValuesMutation.id&&s!=null&&s.applyFormulaCalculationResult&&(r=!0),!(!t||!r)&&requestIdleCallback(()=>{e(i)}))})}onCalculationResultApplied(){return new Promise((e,t)=>{let r=!1,i=!1,a=setTimeout(()=>{l(),t(Error(`Calculation end timeout`))},6e4),o=setTimeout(()=>{r||(l(),e())},500),s=this.calculationProcessing(t=>{let{stage:i,totalArrayFormulasToCalculate:a,totalFormulasToCalculate:s}=t;if(i===n.FormulaExecuteStageType.START_CALCULATION&&a+s===0){l(),e();return}r||(r=!0,clearTimeout(o))}),c=this.calculationResultApplied(()=>{i||(i=!0,l(),e())});function l(){clearTimeout(a),clearTimeout(o),s.dispose(),c.dispose()}})}};i.FFormula.extend(c);var l=class{get CalculationMode(){return r.CalculationMode}};t.FEnum.extend(l);var u=class extends o.FWorkbook{getAllFormulaError(){let e=[],t=this._workbook,r=t.getUnitId(),i=t.getSheets(),a=this._injector.get(n.FormulaDataModel).getArrayFormulaCellData();return i.forEach(t=>{var i;let o=t.getName(),s=t.getSheetId(),c=t.getCellMatrix(),l=(a==null||(i=a[r])==null?void 0:i[s])||{};c.forValue((t,r,i)=>{var a;if(!i)return;let s=(0,n.extractFormulaError)(i,!!(!(l==null||(a=l[t])==null)&&a[r]));s&&e.push({sheetName:o,row:t,column:r,formula:i.f||``,errorType:s})})}),e}};o.FWorkbook.extend(u);var d=class extends o.FRange{getFormulaError(){var e;let t=[],r=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),a=this._worksheet.getName(),o=this._workbook.getSheetBySheetId(i);if(!o)return t;let s=this._injector.get(n.FormulaDataModel).getArrayFormulaCellData(),c=(s==null||(e=s[r])==null?void 0:e[i])||{},l=o.getCellMatrix(),{startRow:u,endRow:d,startColumn:f,endColumn:p}=this._range;for(let e=u;e<=d;e++)for(let r=f;r<=p;r++){var m;let i=l.getValue(e,r);if(!i)continue;let o=(0,n.extractFormulaError)(i,!!(!(c==null||(m=c[e])==null)&&m[r]));o&&t.push({sheetName:a,row:e,column:r,formula:i.f||``,errorType:o})}return t}};o.FRange.extend(d);
|