@univerjs/engine-formula 0.21.0 → 0.21.1

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/index.js CHANGED
@@ -1810,24 +1810,44 @@ let DefinedNamesService = class DefinedNamesService extends _univerjs_core.Dispo
1810
1810
  registerDefinedNames(unitId, params) {
1811
1811
  this._definedNameMap[unitId] = params;
1812
1812
  this._updateCache(unitId);
1813
- this._update();
1813
+ this._update({
1814
+ type: "update",
1815
+ unitId,
1816
+ definedNames: Object.values(params)
1817
+ });
1814
1818
  }
1815
1819
  registerDefinedName(unitId, param) {
1816
1820
  if (this._definedNameMap[unitId] === void 0) this._definedNameMap[unitId] = {};
1817
1821
  this._definedNameMap[unitId][param.id] = param;
1818
1822
  this._updateCache(unitId);
1819
- this._update();
1823
+ this._update({
1824
+ type: "update",
1825
+ unitId,
1826
+ definedNames: [param]
1827
+ });
1820
1828
  }
1821
1829
  removeDefinedName(unitId, id) {
1822
1830
  var _this$_definedNameMap;
1823
- (_this$_definedNameMap = this._definedNameMap[unitId]) === null || _this$_definedNameMap === void 0 || delete _this$_definedNameMap[id];
1831
+ const definedName = (_this$_definedNameMap = this._definedNameMap[unitId]) === null || _this$_definedNameMap === void 0 ? void 0 : _this$_definedNameMap[id];
1832
+ if (!definedName) return;
1833
+ delete this._definedNameMap[unitId][id];
1824
1834
  this._updateCache(unitId);
1825
- this._update();
1835
+ this._update({
1836
+ type: "remove",
1837
+ unitId,
1838
+ definedNames: [definedName]
1839
+ });
1826
1840
  }
1827
1841
  removeUnitDefinedName(unitId) {
1842
+ const definedNames = this._definedNameMap[unitId];
1843
+ if (!definedNames) return;
1828
1844
  delete this._definedNameMap[unitId];
1829
1845
  this._updateCache(unitId);
1830
- this._update();
1846
+ this._update({
1847
+ type: "remove",
1848
+ unitId,
1849
+ definedNames: Object.values(definedNames)
1850
+ });
1831
1851
  }
1832
1852
  getDefinedNameMap(unitId) {
1833
1853
  return this._definedNameMap[unitId];
@@ -1863,8 +1883,8 @@ let DefinedNamesService = class DefinedNamesService extends _univerjs_core.Dispo
1863
1883
  if (!this._definedNameMap[unitId]) return;
1864
1884
  for (const [_, item] of Object.entries(this._definedNameMap[unitId])) if (item.formulaOrRefString === formulaOrRefString) return item;
1865
1885
  }
1866
- _update() {
1867
- this._update$.next(null);
1886
+ _update(event) {
1887
+ this._update$.next(event);
1868
1888
  }
1869
1889
  _updateCache(unitId) {
1870
1890
  const nameMap = this._definedNameMap[unitId];
@@ -1883,14 +1903,13 @@ const IDefinedNamesService = (0, _univerjs_core.createIdentifier)("univer.formul
1883
1903
  //#region src/commands/mutations/set-defined-name.mutation.ts
1884
1904
  /**
1885
1905
  * Generate undo mutation of a `SetDefinedNameMutation`
1886
- * @param accessor
1887
- * @param params
1888
- * @returns
1889
1906
  */
1890
1907
  const SetDefinedNameMutationFactory = (accessor, params) => {
1891
1908
  const { unitId, id } = params;
1909
+ const definedName = accessor.get(IDefinedNamesService).getValueById(unitId, id);
1910
+ if (!definedName) return null;
1892
1911
  return {
1893
- ...accessor.get(IDefinedNamesService).getValueById(unitId, id),
1912
+ ...definedName,
1894
1913
  unitId
1895
1914
  };
1896
1915
  };
@@ -9738,6 +9757,9 @@ var FunctionService = class extends _univerjs_core.Disposable {
9738
9757
  this._functionDescriptions.delete(functionToken);
9739
9758
  }
9740
9759
  }
9760
+ clearDescriptions() {
9761
+ this._functionDescriptions.clear();
9762
+ }
9741
9763
  deleteFormulaAstCacheKey(...functionToken) {
9742
9764
  FORMULA_AST_CACHE.forEach((_, key) => {
9743
9765
  functionToken.forEach((token) => {
@@ -33766,152 +33788,6 @@ const functionMeta = [
33766
33788
  [Cube, FUNCTION_NAMES_META.CUBE]
33767
33789
  ];
33768
33790
 
33769
- //#endregion
33770
- //#region src/functions/new-excel-functions.ts
33771
- const NEW_EXCEL_FUNCTIONS = new Set([
33772
- FUNCTION_NAMES_MATH.ACOT,
33773
- FUNCTION_NAMES_MATH.ACOTH,
33774
- FUNCTION_NAMES_MATH.ARABIC,
33775
- FUNCTION_NAMES_MATH.BASE,
33776
- FUNCTION_NAMES_MATH.CEILING_MATH,
33777
- FUNCTION_NAMES_MATH.CEILING_PRECISE,
33778
- FUNCTION_NAMES_MATH.COMBINA,
33779
- FUNCTION_NAMES_MATH.COT,
33780
- FUNCTION_NAMES_MATH.COTH,
33781
- FUNCTION_NAMES_MATH.CSC,
33782
- FUNCTION_NAMES_MATH.CSCH,
33783
- FUNCTION_NAMES_MATH.DECIMAL,
33784
- FUNCTION_NAMES_MATH.FLOOR_MATH,
33785
- FUNCTION_NAMES_MATH.FLOOR_PRECISE,
33786
- FUNCTION_NAMES_MATH.MUNIT,
33787
- FUNCTION_NAMES_MATH.RANDARRAY,
33788
- FUNCTION_NAMES_MATH.SEC,
33789
- FUNCTION_NAMES_MATH.SECH,
33790
- FUNCTION_NAMES_MATH.SEQUENCE,
33791
- FUNCTION_NAMES_LOOKUP.CHOOSECOLS,
33792
- FUNCTION_NAMES_LOOKUP.CHOOSEROWS,
33793
- FUNCTION_NAMES_LOOKUP.DROP,
33794
- FUNCTION_NAMES_LOOKUP.EXPAND,
33795
- FUNCTION_NAMES_LOOKUP.FILTER,
33796
- FUNCTION_NAMES_LOOKUP.FORMULATEXT,
33797
- FUNCTION_NAMES_LOOKUP.HSTACK,
33798
- FUNCTION_NAMES_LOOKUP.SORT,
33799
- FUNCTION_NAMES_LOOKUP.SORTBY,
33800
- FUNCTION_NAMES_LOOKUP.TAKE,
33801
- FUNCTION_NAMES_LOOKUP.TOCOL,
33802
- FUNCTION_NAMES_LOOKUP.TOROW,
33803
- FUNCTION_NAMES_LOOKUP.UNIQUE,
33804
- FUNCTION_NAMES_LOOKUP.VSTACK,
33805
- FUNCTION_NAMES_LOOKUP.WRAPCOLS,
33806
- FUNCTION_NAMES_LOOKUP.WRAPROWS,
33807
- FUNCTION_NAMES_LOOKUP.XLOOKUP,
33808
- FUNCTION_NAMES_LOOKUP.XMATCH,
33809
- FUNCTION_NAMES_ENGINEERING.BITAND,
33810
- FUNCTION_NAMES_ENGINEERING.BITLSHIFT,
33811
- FUNCTION_NAMES_ENGINEERING.BITOR,
33812
- FUNCTION_NAMES_ENGINEERING.BITRSHIFT,
33813
- FUNCTION_NAMES_ENGINEERING.BITXOR,
33814
- FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,
33815
- FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,
33816
- FUNCTION_NAMES_ENGINEERING.IMCOSH,
33817
- FUNCTION_NAMES_ENGINEERING.IMCOT,
33818
- FUNCTION_NAMES_ENGINEERING.IMCSC,
33819
- FUNCTION_NAMES_ENGINEERING.IMCSCH,
33820
- FUNCTION_NAMES_ENGINEERING.IMSEC,
33821
- FUNCTION_NAMES_ENGINEERING.IMSECH,
33822
- FUNCTION_NAMES_ENGINEERING.IMSINH,
33823
- FUNCTION_NAMES_ENGINEERING.IMTAN,
33824
- FUNCTION_NAMES_INFORMATION.ISFORMULA,
33825
- FUNCTION_NAMES_INFORMATION.SHEET,
33826
- FUNCTION_NAMES_INFORMATION.SHEETS,
33827
- FUNCTION_NAMES_LOGICAL.IFNA,
33828
- FUNCTION_NAMES_LOGICAL.IFS,
33829
- FUNCTION_NAMES_LOGICAL.SWITCH,
33830
- FUNCTION_NAMES_LOGICAL.XOR,
33831
- FUNCTION_NAMES_STATISTICAL.BETA_DIST,
33832
- FUNCTION_NAMES_STATISTICAL.BETA_INV,
33833
- FUNCTION_NAMES_STATISTICAL.BINOM_DIST,
33834
- FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,
33835
- FUNCTION_NAMES_STATISTICAL.BINOM_INV,
33836
- FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,
33837
- FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,
33838
- FUNCTION_NAMES_STATISTICAL.CHISQ_INV,
33839
- FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,
33840
- FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,
33841
- FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,
33842
- FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,
33843
- FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,
33844
- FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,
33845
- FUNCTION_NAMES_STATISTICAL.EXPON_DIST,
33846
- FUNCTION_NAMES_STATISTICAL.F_DIST,
33847
- FUNCTION_NAMES_STATISTICAL.F_DIST_RT,
33848
- FUNCTION_NAMES_STATISTICAL.F_INV,
33849
- FUNCTION_NAMES_STATISTICAL.F_INV_RT,
33850
- FUNCTION_NAMES_STATISTICAL.F_TEST,
33851
- FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,
33852
- FUNCTION_NAMES_STATISTICAL.GAMMA,
33853
- FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,
33854
- FUNCTION_NAMES_STATISTICAL.GAMMA_INV,
33855
- FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,
33856
- FUNCTION_NAMES_STATISTICAL.GAUSS,
33857
- FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,
33858
- FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,
33859
- FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,
33860
- FUNCTION_NAMES_STATISTICAL.MAXIFS,
33861
- FUNCTION_NAMES_STATISTICAL.MINIFS,
33862
- FUNCTION_NAMES_STATISTICAL.MODE_MULT,
33863
- FUNCTION_NAMES_STATISTICAL.MODE_SNGL,
33864
- FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,
33865
- FUNCTION_NAMES_STATISTICAL.NORM_DIST,
33866
- FUNCTION_NAMES_STATISTICAL.NORM_INV,
33867
- FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,
33868
- FUNCTION_NAMES_STATISTICAL.NORM_S_INV,
33869
- FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,
33870
- FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,
33871
- FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,
33872
- FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,
33873
- FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,
33874
- FUNCTION_NAMES_STATISTICAL.PHI,
33875
- FUNCTION_NAMES_STATISTICAL.POISSON_DIST,
33876
- FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,
33877
- FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,
33878
- FUNCTION_NAMES_STATISTICAL.RANK_AVG,
33879
- FUNCTION_NAMES_STATISTICAL.RANK_EQ,
33880
- FUNCTION_NAMES_STATISTICAL.SKEW_P,
33881
- FUNCTION_NAMES_STATISTICAL.STDEV_P,
33882
- FUNCTION_NAMES_STATISTICAL.STDEV_S,
33883
- FUNCTION_NAMES_STATISTICAL.T_DIST,
33884
- FUNCTION_NAMES_STATISTICAL.T_DIST_2T,
33885
- FUNCTION_NAMES_STATISTICAL.T_DIST_RT,
33886
- FUNCTION_NAMES_STATISTICAL.T_INV,
33887
- FUNCTION_NAMES_STATISTICAL.T_INV_2T,
33888
- FUNCTION_NAMES_STATISTICAL.T_TEST,
33889
- FUNCTION_NAMES_STATISTICAL.VAR_P,
33890
- FUNCTION_NAMES_STATISTICAL.VAR_S,
33891
- FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,
33892
- FUNCTION_NAMES_STATISTICAL.Z_TEST,
33893
- FUNCTION_NAMES_TEXT.ARRAYTOTEXT,
33894
- FUNCTION_NAMES_WEB.ENCODEURL,
33895
- FUNCTION_NAMES_TEXT.NUMBERVALUE,
33896
- FUNCTION_NAMES_TEXT.TEXTAFTER,
33897
- FUNCTION_NAMES_TEXT.TEXTBEFORE,
33898
- FUNCTION_NAMES_TEXT.TEXTJOIN,
33899
- FUNCTION_NAMES_TEXT.TEXTSPLIT,
33900
- FUNCTION_NAMES_TEXT.UNICHAR,
33901
- FUNCTION_NAMES_TEXT.UNICODE,
33902
- FUNCTION_NAMES_TEXT.VALUETOTEXT,
33903
- FUNCTION_NAMES_DATE.DAYS,
33904
- FUNCTION_NAMES_DATE.ISOWEEKNUM,
33905
- FUNCTION_NAMES_FINANCIAL.PDURATION,
33906
- FUNCTION_NAMES_FINANCIAL.RRI,
33907
- FUNCTION_NAMES_LOGICAL.BYCOL,
33908
- FUNCTION_NAMES_LOGICAL.BYROW,
33909
- FUNCTION_NAMES_LOGICAL.MAKEARRAY,
33910
- FUNCTION_NAMES_LOGICAL.MAP,
33911
- FUNCTION_NAMES_LOGICAL.REDUCE,
33912
- FUNCTION_NAMES_LOGICAL.SCAN
33913
- ]);
33914
-
33915
33791
  //#endregion
33916
33792
  //#region src/functions/statistical/avedev/index.ts
33917
33793
  var Avedev = class extends BaseFunction {
@@ -40283,49 +40159,6 @@ const functionText = [
40283
40159
  */
40284
40160
  const functionUniver = [];
40285
40161
 
40286
- //#endregion
40287
- //#region src/functions/univer/function-names.ts
40288
- /**
40289
- * Copyright 2023-present DreamNum Co., Ltd.
40290
- *
40291
- * Licensed under the Apache License, Version 2.0 (the "License");
40292
- * you may not use this file except in compliance with the License.
40293
- * You may obtain a copy of the License at
40294
- *
40295
- * http://www.apache.org/licenses/LICENSE-2.0
40296
- *
40297
- * Unless required by applicable law or agreed to in writing, software
40298
- * distributed under the License is distributed on an "AS IS" BASIS,
40299
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40300
- * See the License for the specific language governing permissions and
40301
- * limitations under the License.
40302
- */
40303
- let FUNCTION_NAMES_UNIVER = /* @__PURE__ */ function(FUNCTION_NAMES_UNIVER) {
40304
- return FUNCTION_NAMES_UNIVER;
40305
- }({});
40306
-
40307
- //#endregion
40308
- //#region src/functions/util.ts
40309
- function stripArrayValue(array) {
40310
- return array.map((row) => row.map((cell) => {
40311
- if (typeof cell === "number") return stripErrorMargin(cell);
40312
- return cell;
40313
- }));
40314
- }
40315
- function getObjectValue(result, isUseStrip = false) {
40316
- if (result.isReferenceObject()) {
40317
- const arrayValue = result.toArrayValueObject().toValue();
40318
- return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40319
- } else if (result.isArray()) {
40320
- const arrayValue = result.toValue();
40321
- return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40322
- } else if (result.isNumber()) {
40323
- const value = result.getValue();
40324
- return isUseStrip ? stripErrorMargin(value) : value;
40325
- }
40326
- return result.getValue();
40327
- }
40328
-
40329
40162
  //#endregion
40330
40163
  //#region src/functions/web/encodeurl/index.ts
40331
40164
  var Encodeurl = class extends BaseFunction {
@@ -40369,10 +40202,221 @@ var Encodeurl = class extends BaseFunction {
40369
40202
  */
40370
40203
  const functionWeb = [[Encodeurl, FUNCTION_NAMES_WEB.ENCODEURL]];
40371
40204
 
40205
+ //#endregion
40206
+ //#region src/functions/index.ts
40207
+ const ALL_IMPLEMENTED_FUNCTIONS = [
40208
+ ...functionArray,
40209
+ ...functionCompatibility,
40210
+ ...functionCube,
40211
+ ...functionDatabase,
40212
+ ...functionDate,
40213
+ ...functionEngineering,
40214
+ ...functionFinancial,
40215
+ ...functionInformation,
40216
+ ...functionLogical,
40217
+ ...functionLookup,
40218
+ ...functionMath,
40219
+ ...functionMeta,
40220
+ ...functionStatistical,
40221
+ ...functionText,
40222
+ ...functionUniver,
40223
+ ...functionWeb
40224
+ ];
40225
+ const ALL_IMPLEMENTED_FUNCTIONS_SET = new Set(ALL_IMPLEMENTED_FUNCTIONS.map(([_, name]) => name));
40226
+
40227
+ //#endregion
40228
+ //#region src/functions/new-excel-functions.ts
40229
+ const NEW_EXCEL_FUNCTIONS = new Set([
40230
+ FUNCTION_NAMES_MATH.ACOT,
40231
+ FUNCTION_NAMES_MATH.ACOTH,
40232
+ FUNCTION_NAMES_MATH.ARABIC,
40233
+ FUNCTION_NAMES_MATH.BASE,
40234
+ FUNCTION_NAMES_MATH.CEILING_MATH,
40235
+ FUNCTION_NAMES_MATH.CEILING_PRECISE,
40236
+ FUNCTION_NAMES_MATH.COMBINA,
40237
+ FUNCTION_NAMES_MATH.COT,
40238
+ FUNCTION_NAMES_MATH.COTH,
40239
+ FUNCTION_NAMES_MATH.CSC,
40240
+ FUNCTION_NAMES_MATH.CSCH,
40241
+ FUNCTION_NAMES_MATH.DECIMAL,
40242
+ FUNCTION_NAMES_MATH.FLOOR_MATH,
40243
+ FUNCTION_NAMES_MATH.FLOOR_PRECISE,
40244
+ FUNCTION_NAMES_MATH.MUNIT,
40245
+ FUNCTION_NAMES_MATH.RANDARRAY,
40246
+ FUNCTION_NAMES_MATH.SEC,
40247
+ FUNCTION_NAMES_MATH.SECH,
40248
+ FUNCTION_NAMES_MATH.SEQUENCE,
40249
+ FUNCTION_NAMES_LOOKUP.CHOOSECOLS,
40250
+ FUNCTION_NAMES_LOOKUP.CHOOSEROWS,
40251
+ FUNCTION_NAMES_LOOKUP.DROP,
40252
+ FUNCTION_NAMES_LOOKUP.EXPAND,
40253
+ FUNCTION_NAMES_LOOKUP.FILTER,
40254
+ FUNCTION_NAMES_LOOKUP.FORMULATEXT,
40255
+ FUNCTION_NAMES_LOOKUP.HSTACK,
40256
+ FUNCTION_NAMES_LOOKUP.SORT,
40257
+ FUNCTION_NAMES_LOOKUP.SORTBY,
40258
+ FUNCTION_NAMES_LOOKUP.TAKE,
40259
+ FUNCTION_NAMES_LOOKUP.TOCOL,
40260
+ FUNCTION_NAMES_LOOKUP.TOROW,
40261
+ FUNCTION_NAMES_LOOKUP.UNIQUE,
40262
+ FUNCTION_NAMES_LOOKUP.VSTACK,
40263
+ FUNCTION_NAMES_LOOKUP.WRAPCOLS,
40264
+ FUNCTION_NAMES_LOOKUP.WRAPROWS,
40265
+ FUNCTION_NAMES_LOOKUP.XLOOKUP,
40266
+ FUNCTION_NAMES_LOOKUP.XMATCH,
40267
+ FUNCTION_NAMES_ENGINEERING.BITAND,
40268
+ FUNCTION_NAMES_ENGINEERING.BITLSHIFT,
40269
+ FUNCTION_NAMES_ENGINEERING.BITOR,
40270
+ FUNCTION_NAMES_ENGINEERING.BITRSHIFT,
40271
+ FUNCTION_NAMES_ENGINEERING.BITXOR,
40272
+ FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,
40273
+ FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,
40274
+ FUNCTION_NAMES_ENGINEERING.IMCOSH,
40275
+ FUNCTION_NAMES_ENGINEERING.IMCOT,
40276
+ FUNCTION_NAMES_ENGINEERING.IMCSC,
40277
+ FUNCTION_NAMES_ENGINEERING.IMCSCH,
40278
+ FUNCTION_NAMES_ENGINEERING.IMSEC,
40279
+ FUNCTION_NAMES_ENGINEERING.IMSECH,
40280
+ FUNCTION_NAMES_ENGINEERING.IMSINH,
40281
+ FUNCTION_NAMES_ENGINEERING.IMTAN,
40282
+ FUNCTION_NAMES_INFORMATION.ISFORMULA,
40283
+ FUNCTION_NAMES_INFORMATION.SHEET,
40284
+ FUNCTION_NAMES_INFORMATION.SHEETS,
40285
+ FUNCTION_NAMES_LOGICAL.IFNA,
40286
+ FUNCTION_NAMES_LOGICAL.IFS,
40287
+ FUNCTION_NAMES_LOGICAL.SWITCH,
40288
+ FUNCTION_NAMES_LOGICAL.XOR,
40289
+ FUNCTION_NAMES_STATISTICAL.BETA_DIST,
40290
+ FUNCTION_NAMES_STATISTICAL.BETA_INV,
40291
+ FUNCTION_NAMES_STATISTICAL.BINOM_DIST,
40292
+ FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,
40293
+ FUNCTION_NAMES_STATISTICAL.BINOM_INV,
40294
+ FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,
40295
+ FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,
40296
+ FUNCTION_NAMES_STATISTICAL.CHISQ_INV,
40297
+ FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,
40298
+ FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,
40299
+ FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,
40300
+ FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,
40301
+ FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,
40302
+ FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,
40303
+ FUNCTION_NAMES_STATISTICAL.EXPON_DIST,
40304
+ FUNCTION_NAMES_STATISTICAL.F_DIST,
40305
+ FUNCTION_NAMES_STATISTICAL.F_DIST_RT,
40306
+ FUNCTION_NAMES_STATISTICAL.F_INV,
40307
+ FUNCTION_NAMES_STATISTICAL.F_INV_RT,
40308
+ FUNCTION_NAMES_STATISTICAL.F_TEST,
40309
+ FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,
40310
+ FUNCTION_NAMES_STATISTICAL.GAMMA,
40311
+ FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,
40312
+ FUNCTION_NAMES_STATISTICAL.GAMMA_INV,
40313
+ FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,
40314
+ FUNCTION_NAMES_STATISTICAL.GAUSS,
40315
+ FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,
40316
+ FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,
40317
+ FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,
40318
+ FUNCTION_NAMES_STATISTICAL.MAXIFS,
40319
+ FUNCTION_NAMES_STATISTICAL.MINIFS,
40320
+ FUNCTION_NAMES_STATISTICAL.MODE_MULT,
40321
+ FUNCTION_NAMES_STATISTICAL.MODE_SNGL,
40322
+ FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,
40323
+ FUNCTION_NAMES_STATISTICAL.NORM_DIST,
40324
+ FUNCTION_NAMES_STATISTICAL.NORM_INV,
40325
+ FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,
40326
+ FUNCTION_NAMES_STATISTICAL.NORM_S_INV,
40327
+ FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,
40328
+ FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,
40329
+ FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,
40330
+ FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,
40331
+ FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,
40332
+ FUNCTION_NAMES_STATISTICAL.PHI,
40333
+ FUNCTION_NAMES_STATISTICAL.POISSON_DIST,
40334
+ FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,
40335
+ FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,
40336
+ FUNCTION_NAMES_STATISTICAL.RANK_AVG,
40337
+ FUNCTION_NAMES_STATISTICAL.RANK_EQ,
40338
+ FUNCTION_NAMES_STATISTICAL.SKEW_P,
40339
+ FUNCTION_NAMES_STATISTICAL.STDEV_P,
40340
+ FUNCTION_NAMES_STATISTICAL.STDEV_S,
40341
+ FUNCTION_NAMES_STATISTICAL.T_DIST,
40342
+ FUNCTION_NAMES_STATISTICAL.T_DIST_2T,
40343
+ FUNCTION_NAMES_STATISTICAL.T_DIST_RT,
40344
+ FUNCTION_NAMES_STATISTICAL.T_INV,
40345
+ FUNCTION_NAMES_STATISTICAL.T_INV_2T,
40346
+ FUNCTION_NAMES_STATISTICAL.T_TEST,
40347
+ FUNCTION_NAMES_STATISTICAL.VAR_P,
40348
+ FUNCTION_NAMES_STATISTICAL.VAR_S,
40349
+ FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,
40350
+ FUNCTION_NAMES_STATISTICAL.Z_TEST,
40351
+ FUNCTION_NAMES_TEXT.ARRAYTOTEXT,
40352
+ FUNCTION_NAMES_WEB.ENCODEURL,
40353
+ FUNCTION_NAMES_TEXT.NUMBERVALUE,
40354
+ FUNCTION_NAMES_TEXT.TEXTAFTER,
40355
+ FUNCTION_NAMES_TEXT.TEXTBEFORE,
40356
+ FUNCTION_NAMES_TEXT.TEXTJOIN,
40357
+ FUNCTION_NAMES_TEXT.TEXTSPLIT,
40358
+ FUNCTION_NAMES_TEXT.UNICHAR,
40359
+ FUNCTION_NAMES_TEXT.UNICODE,
40360
+ FUNCTION_NAMES_TEXT.VALUETOTEXT,
40361
+ FUNCTION_NAMES_DATE.DAYS,
40362
+ FUNCTION_NAMES_DATE.ISOWEEKNUM,
40363
+ FUNCTION_NAMES_FINANCIAL.PDURATION,
40364
+ FUNCTION_NAMES_FINANCIAL.RRI,
40365
+ FUNCTION_NAMES_LOGICAL.BYCOL,
40366
+ FUNCTION_NAMES_LOGICAL.BYROW,
40367
+ FUNCTION_NAMES_LOGICAL.MAKEARRAY,
40368
+ FUNCTION_NAMES_LOGICAL.MAP,
40369
+ FUNCTION_NAMES_LOGICAL.REDUCE,
40370
+ FUNCTION_NAMES_LOGICAL.SCAN
40371
+ ]);
40372
+
40373
+ //#endregion
40374
+ //#region src/functions/univer/function-names.ts
40375
+ /**
40376
+ * Copyright 2023-present DreamNum Co., Ltd.
40377
+ *
40378
+ * Licensed under the Apache License, Version 2.0 (the "License");
40379
+ * you may not use this file except in compliance with the License.
40380
+ * You may obtain a copy of the License at
40381
+ *
40382
+ * http://www.apache.org/licenses/LICENSE-2.0
40383
+ *
40384
+ * Unless required by applicable law or agreed to in writing, software
40385
+ * distributed under the License is distributed on an "AS IS" BASIS,
40386
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40387
+ * See the License for the specific language governing permissions and
40388
+ * limitations under the License.
40389
+ */
40390
+ let FUNCTION_NAMES_UNIVER = /* @__PURE__ */ function(FUNCTION_NAMES_UNIVER) {
40391
+ return FUNCTION_NAMES_UNIVER;
40392
+ }({});
40393
+
40394
+ //#endregion
40395
+ //#region src/functions/util.ts
40396
+ function stripArrayValue(array) {
40397
+ return array.map((row) => row.map((cell) => {
40398
+ if (typeof cell === "number") return stripErrorMargin(cell);
40399
+ return cell;
40400
+ }));
40401
+ }
40402
+ function getObjectValue(result, isUseStrip = false) {
40403
+ if (result.isReferenceObject()) {
40404
+ const arrayValue = result.toArrayValueObject().toValue();
40405
+ return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40406
+ } else if (result.isArray()) {
40407
+ const arrayValue = result.toValue();
40408
+ return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40409
+ } else if (result.isNumber()) {
40410
+ const value = result.getValue();
40411
+ return isUseStrip ? stripErrorMargin(value) : value;
40412
+ }
40413
+ return result.getValue();
40414
+ }
40415
+
40372
40416
  //#endregion
40373
40417
  //#region package.json
40374
40418
  var name = "@univerjs/engine-formula";
40375
- var version = "0.21.0";
40419
+ var version = "0.21.1";
40376
40420
 
40377
40421
  //#endregion
40378
40422
  //#region src/services/global-computing-status.service.ts
@@ -40495,24 +40539,7 @@ let FormulaController = class FormulaController extends _univerjs_core.Disposabl
40495
40539
  _registerFunctions() {
40496
40540
  var _config$function;
40497
40541
  const config = this._configService.getConfig(ENGINE_FORMULA_PLUGIN_CONFIG_KEY);
40498
- const functions = [
40499
- ...functionArray,
40500
- ...functionCompatibility,
40501
- ...functionCube,
40502
- ...functionDatabase,
40503
- ...functionDate,
40504
- ...functionEngineering,
40505
- ...functionFinancial,
40506
- ...functionInformation,
40507
- ...functionLogical,
40508
- ...functionLookup,
40509
- ...functionMath,
40510
- ...functionMeta,
40511
- ...functionStatistical,
40512
- ...functionText,
40513
- ...functionUniver,
40514
- ...functionWeb
40515
- ].concat((_config$function = config === null || config === void 0 ? void 0 : config.function) !== null && _config$function !== void 0 ? _config$function : []).map((registerObject) => {
40542
+ const functions = ALL_IMPLEMENTED_FUNCTIONS.concat((_config$function = config === null || config === void 0 ? void 0 : config.function) !== null && _config$function !== void 0 ? _config$function : []).map((registerObject) => {
40516
40543
  const Func = registerObject[0];
40517
40544
  const name = registerObject[1];
40518
40545
  return new Func(name);
@@ -40956,6 +40983,8 @@ _defineProperty(UniverFormulaEnginePlugin, "version", version);
40956
40983
  UniverFormulaEnginePlugin = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(2, _univerjs_core.IConfigService)], UniverFormulaEnginePlugin);
40957
40984
 
40958
40985
  //#endregion
40986
+ exports.ALL_IMPLEMENTED_FUNCTIONS = ALL_IMPLEMENTED_FUNCTIONS;
40987
+ exports.ALL_IMPLEMENTED_FUNCTIONS_SET = ALL_IMPLEMENTED_FUNCTIONS_SET;
40959
40988
  exports.ActiveDirtyManagerService = ActiveDirtyManagerService;
40960
40989
  exports.ArrayValueObject = ArrayValueObject;
40961
40990
  exports.AstRootNodeFactory = AstRootNodeFactory;