You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the properties of FunctionMetadata and deprecate the old ones (#1558)
* Deprecate FunctionMetadata.arrayFunction in favor of enableArrayArithmeticForArguments
* Add unit tests for depracated function metadata
* Depracate arraySizeMethod param in favor of sizeOfResultArrayMethod
* Add changelog entry
* Tweak the docs
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
7
8
8
## [Unreleased]
9
9
10
+
### Changed
11
+
12
+
- Renamed the `arraySizeMethod` parameter in the `FunctionMetadata` interface to `sizeOfResultArrayMethod`. The `arraySizeMethod` is deprecated and will be removed in one of the next major releases. [#1401](https://github.com/handsontable/hyperformula/issues/1401)
13
+
- Renamed the `arrayFunction` parameter in the `FunctionMetadata` interface to `enableArrayArithmeticForArguments`. The `arrayFunction` is deprecated and will be removed in one of the next major releases. [#1401](https://github.com/handsontable/hyperformula/issues/1401)
14
+
10
15
### Fixed
11
16
12
17
- Fixed an issue where the `OFFSET` function was ignoring the sheet reference in the provided address. [#1477](https://github.com/handsontable/hyperformula/issues/1477)
You can change the order of rows by using the [`setRowOrder`](../api/classes/hyperformula.md#setroworder) method. You need to pass the following parameters:
You can change the order of columns by using the [`setColumnOrder`](../api/classes/hyperformula.md#setcolumnorder) method. You need to pass the following parameters:
| DATE | Returns the specified date as the number of full days since [`nullDate`](../api/interfaces/configparams.md#nulldate). | DATE(Year, Month, Day) |
67
-
| DATEDIF | Calculates distance between two dates, in selected units: "D" (days), "M" (months), "Y" (years), "MD" (days ignoring months and years), "YM" (months ignoring years), or "YD" (days ignoring years). | DATEDIF(Date1, Date2, Unit) |
68
-
| DATEVALUE | Parses a date string and returns it as the number of full days since [`nullDate`](../api/interfaces/configparams.md#nulldate).<br><br>Accepts formats set by the [`dateFormats`](../api/interfaces/configparams.md#dateformats) option. | DATEVALUE(Datestring) |
67
+
| DATEDIF | Calculates distance between two dates.<br>Supported units: "D" (days), "M" (months), "Y" (years), "MD" (days ignoring months and years), "YM" (months ignoring years), or "YD" (days ignoring years). | DATEDIF(Date1, Date2, Unit) |
68
+
| DATEVALUE | Parses a date string and returns it as the number of full days since [`nullDate`](../api/interfaces/configparams.md#nulldate).<br>Accepts formats set by the [`dateFormats`](../api/interfaces/configparams.md#dateformats) option. | DATEVALUE(Datestring) |
69
69
| DAY | Returns the day of the given date value. | DAY(Number) |
70
70
| DAYS | Calculates the difference between two date values. | DAYS(Date2, Date1) |
71
71
| DAYS360 | Calculates the difference between two date values in days, in 360-day basis. | DAYS360(Date2, Date1[, Format]) |
@@ -81,7 +81,7 @@ Total number of functions: **{{ $page.functionsCount }}**
81
81
| NOW | Returns current date + time as a number of days since [`nullDate`](../api/interfaces/configparams.md#nulldate). | NOW() |
82
82
| SECOND | Returns second component of given time. | SECOND(Time) |
83
83
| TIME | Returns the number that represents a given time as a fraction of full day. | TIME(Hour, Minute, Second) |
84
-
| TIMEVALUE | Parses a time string and returns a number that represents it as a fraction of a full day.<br><br>Accepts formats set by the [`timeFormats`](../api/interfaces/configparams.md#timeformats) option. | TIMEVALUE(Timestring) |
84
+
| TIMEVALUE | Parses a time string and returns a number that represents it as a fraction of a full day.<br>Accepts formats set by the [`timeFormats`](../api/interfaces/configparams.md#timeformats) option. | TIMEVALUE(Timestring) |
85
85
| TODAY | Returns an integer representing the current date as the number of full days since [`nullDate`](../api/interfaces/configparams.md#nulldate). | TODAY() |
86
86
| WEEKDAY | Computes a number between 1-7 representing the day of week. | WEEKDAY(Date, Type) |
87
87
| WEEKNUM | Returns a week number that corresponds to the week of year. | WEEKNUM(Date, Type) |
@@ -499,7 +499,7 @@ Total number of functions: **{{ $page.functionsCount }}**
499
499
| SPLIT | Divides the provided text using the space character as a separator and returns the substring at the zero-based position specified by the second argument.<br>`SPLIT("Lorem ipsum", 0) -> "Lorem"`<br>`SPLIT("Lorem ipsum", 1) -> "ipsum"`| SPLIT(Text, Index) |
500
500
| SUBSTITUTE | Returns string where occurrences of Old_text are replaced by New_text. Replaces only specific occurrence if last parameter is provided. | SUBSTITUTE(Text, Old_text, New_text, [Occurrence]) |
501
501
| T | Returns text if given value is text, empty string otherwise. | T(Value) |
502
-
| TEXT | Converts a number into text according to a given format.<br><br>By default, accepts the same formats that can be passed to the [`dateFormats`](../api/interfaces/configparams.md#dateformats) option, but can be further customized with the [`stringifyDateTime`](../api/interfaces/configparams.md#stringifydatetime) option. | TEXT(Number, Format) |
502
+
| TEXT | Converts a number into text according to a given format.<br>By default, accepts the same formats that can be passed to the [`dateFormats`](../api/interfaces/configparams.md#dateformats) option, but can be further customized with the [`stringifyDateTime`](../api/interfaces/configparams.md#stringifydatetime) option. | TEXT(Number, Format) |
503
503
| TRIM | Strips extra spaces from text. | TRIM("Text") |
504
504
| UNICHAR | Returns the character created by using provided code point. | UNICHAR(Number) |
505
505
| UNICODE | Returns the Unicode code point of a first character of a text. | UNICODE(Text) |
Copy file name to clipboardExpand all lines: docs/guide/compatibility-with-google-sheets.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Still, with the right configuration, you can achieve nearly full compatibility.
19
19
20
20
Google Sheets has built-in constants (keywords) for the boolean values (`TRUE` and `FALSE`).
21
21
22
-
To set up HyperFormula in the same way, define `TRUE` and `FALSE` as [named expressions](named-expressions.md), by using HyperFormula's [`TRUE`](built-in-functions.md#logical) and [`FALSE`](built-in-functions.md#logical) functions.
22
+
To set up HyperFormula in the same way, define `TRUE` and `FALSE` as [named expressions](named-expressions.md), by using HyperFormula's [`TRUE()`](built-in-functions.md#logical) and [`FALSE()`](built-in-functions.md#logical) functions.
Copy file name to clipboardExpand all lines: docs/guide/compatibility-with-microsoft-excel.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Related options:
56
56
57
57
Microsoft Excel has built-in constants (keywords) for the boolean values (`TRUE` and `FALSE`).
58
58
59
-
To set up HyperFormula in the same way, define `TRUE` and `FALSE` as [named expressions](named-expressions.md), by using HyperFormula's [`TRUE`](built-in-functions.md#logical) and [`FALSE`](built-in-functions.md#logical) functions.
59
+
To set up HyperFormula in the same way, define `TRUE` and `FALSE` as [named expressions](named-expressions.md), by using HyperFormula's [`TRUE()`](built-in-functions.md#logical) and [`FALSE()`](built-in-functions.md#logical) functions.
Copy file name to clipboardExpand all lines: docs/guide/custom-functions.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,12 +258,12 @@ export class MyCustomPlugin extends FunctionPlugin {
258
258
259
259
A function that returns an array will cause the `VALUE!` error unless you also
260
260
declare a companion method for the array size. To do that, provide the
261
-
`arraySizeMethod` that calculates the size of the result array based on the
261
+
`sizeOfResultArrayMethod` that calculates the size of the result array based on the
262
262
function arguments and returns an instance of the
263
263
[`ArraySize` class](../api/classes/arraysize.md).
264
264
265
265
::: tip
266
-
When you use your custom function in a formula, `arraySizeMethod` is triggered every time the formula changes, but not when the dependencies of the formula change.
266
+
When you use your custom function in a formula, `sizeOfResultArrayMethod` is triggered every time the formula changes, but not when the dependencies of the formula change.
267
267
This can cause unexpected behavior if the size of the result array depends on the values in the referenced cells.
268
268
:::
269
269
@@ -286,7 +286,7 @@ export class MyCustomPlugin extends FunctionPlugin {
|`method` (required) |String| Name of the method that implements the custom function logic. |
380
380
| `parameters` | Array | Specification of the arguments accepted by the function and their [validation options](#argument-validation-options). |
381
-
| `arraySizeMethod` | String | Name of the method that calculates the size of the result array. Not required for functions that never return an array. |
381
+
| `sizeOfResultArrayMethod` | String | Name of the method that calculates the size of the result array. Not required for functions that never return an array. |
382
382
| `returnNumberType` | String | If the function returns a numeric value, this option indicates how to interpret the returned number.<br/>Possible values: `NUMBER_RAW, NUMBER_DATE, NUMBER_TIME, NUMBER_DATETIME, NUMBER_CURRENCY, NUMBER_PERCENT`.<br/>Default: `NUMBER_RAW` |
383
383
| `repeatLastArgs` | Number | For functions with a variable number of arguments: sets how many last arguments can be repeated indefinitely.<br/>Default: `0` |
384
384
| `expandRanges` | Boolean | `true`: ranges in the function's arguments are inlined to (possibly multiple) scalar arguments.<br/>Default: `false` |
385
385
| `isVolatile` | Boolean | `true`: the function is [volatile](volatile-functions.md).<br/>Default: `false` |
386
386
| `isDependentOnSheetStructureChange` | Boolean | `true`: the function gets recalculated with each sheet shape change (e.g., when adding/removing rows or columns).<br/>Default: `false` |
387
387
| `doesNotNeedArgumentsToBeComputed` | Boolean | `true`: the function treats reference or range arguments as arguments that don't create dependency (other arguments are properly evaluated).<br/>Default: `false` |
388
-
| `arrayFunction` | Boolean | `true`: the function enables the [array arithmetic mode](arrays.md) in its arguments and nested expressions.<br/>Default: `false` |
388
+
| `enableArrayArithmeticForArguments` | Boolean | `true`: the function enables the [array arithmetic mode](arrays.md) in its arguments and nested expressions.<br/>Default: `false` |
389
389
| `vectorizationForbidden` | Boolean | `true`: the function will never get [vectorized](arrays.md#passing-arrays-to-scalar-functions-vectorization).<br/>Default: `false` |
390
+
| `arraySizeMethod` | String | Deprecated; Use `sizeOfResultArrayMethod` instead. |
391
+
| `arrayFunction` | Boolean | Deprecated; Use `enableArrayArithmeticForArguments` instead. |
390
392
391
393
You can set the options in the static `implementedFunctions` property of your
0 commit comments