@gridsheet/preact-core 3.0.0-rc.0 → 3.0.0-rc.2

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 (98) hide show
  1. package/dist/components/ContextMenu.d.ts +1 -0
  2. package/dist/components/EditorOptions.d.ts +11 -0
  3. package/dist/components/FunctionGuide.d.ts +20 -0
  4. package/dist/components/useAutocomplete.d.ts +25 -0
  5. package/dist/constants.d.ts +1 -13
  6. package/dist/formula/evaluator.d.ts +10 -15
  7. package/dist/formula/formula-error.d.ts +10 -0
  8. package/dist/formula/functions/__async.d.ts +16 -8
  9. package/dist/formula/functions/__base.d.ts +102 -14
  10. package/dist/formula/functions/__utils.d.ts +4 -0
  11. package/dist/formula/functions/abs.d.ts +5 -8
  12. package/dist/formula/functions/add.d.ts +6 -9
  13. package/dist/formula/functions/and.d.ts +5 -15
  14. package/dist/formula/functions/arrayformula.d.ts +12 -0
  15. package/dist/formula/functions/average.d.ts +5 -15
  16. package/dist/formula/functions/concat.d.ts +5 -8
  17. package/dist/formula/functions/count.d.ts +4 -14
  18. package/dist/formula/functions/counta.d.ts +4 -14
  19. package/dist/formula/functions/divide.d.ts +5 -7
  20. package/dist/formula/functions/eq.d.ts +4 -7
  21. package/dist/formula/functions/gt.d.ts +5 -8
  22. package/dist/formula/functions/gte.d.ts +5 -8
  23. package/dist/formula/functions/if.d.ts +5 -13
  24. package/dist/formula/functions/iferror.d.ts +7 -17
  25. package/dist/formula/functions/len.d.ts +5 -8
  26. package/dist/formula/functions/lt.d.ts +5 -8
  27. package/dist/formula/functions/lte.d.ts +5 -8
  28. package/dist/formula/functions/max.d.ts +5 -15
  29. package/dist/formula/functions/min.d.ts +5 -15
  30. package/dist/formula/functions/minus.d.ts +7 -9
  31. package/dist/formula/functions/multiply.d.ts +5 -8
  32. package/dist/formula/functions/ne.d.ts +4 -7
  33. package/dist/formula/functions/not.d.ts +5 -8
  34. package/dist/formula/functions/now.d.ts +4 -4
  35. package/dist/formula/functions/or.d.ts +5 -15
  36. package/dist/formula/functions/power.d.ts +5 -8
  37. package/dist/formula/functions/sum.d.ts +5 -15
  38. package/dist/formula/functions/uminus.d.ts +5 -8
  39. package/dist/formula/mapping.d.ts +9 -1
  40. package/dist/formula/solver.d.ts +6 -4
  41. package/dist/index.d.ts +14 -14
  42. package/dist/index.js +7633 -6928
  43. package/dist/index.js.map +1 -1
  44. package/dist/lib/cell.d.ts +13 -1
  45. package/dist/lib/clipboard.d.ts +16 -1
  46. package/dist/lib/coords.d.ts +1 -1
  47. package/dist/lib/dom.d.ts +2 -0
  48. package/dist/lib/hub.d.ts +13 -25
  49. package/dist/lib/input.d.ts +9 -0
  50. package/dist/lib/operation.d.ts +0 -3
  51. package/dist/lib/spatial.d.ts +2 -0
  52. package/dist/lib/table.d.ts +77 -51
  53. package/dist/lib/time.d.ts +19 -15
  54. package/dist/policy/checkbox.d.ts +3 -0
  55. package/dist/policy/core.d.ts +136 -19
  56. package/dist/policy/thousand_separator.d.ts +4 -0
  57. package/dist/sentinels.d.ts +39 -0
  58. package/dist/store/actions.d.ts +12 -0
  59. package/dist/store/dispatchers.d.ts +2 -0
  60. package/dist/store/helpers.d.ts +4 -6
  61. package/dist/styles/minified.d.ts +2 -2
  62. package/dist/types.d.ts +26 -28
  63. package/package.json +1 -1
  64. package/dist/formula/functions/acos.d.ts +0 -12
  65. package/dist/formula/functions/asin.d.ts +0 -12
  66. package/dist/formula/functions/atan.d.ts +0 -12
  67. package/dist/formula/functions/atan2.d.ts +0 -12
  68. package/dist/formula/functions/col.d.ts +0 -13
  69. package/dist/formula/functions/concatenate.d.ts +0 -19
  70. package/dist/formula/functions/cos.d.ts +0 -12
  71. package/dist/formula/functions/countif.d.ts +0 -13
  72. package/dist/formula/functions/exp.d.ts +0 -12
  73. package/dist/formula/functions/hlookup.d.ts +0 -18
  74. package/dist/formula/functions/index.d.ts +0 -18
  75. package/dist/formula/functions/lenb.d.ts +0 -12
  76. package/dist/formula/functions/ln.d.ts +0 -12
  77. package/dist/formula/functions/log.d.ts +0 -12
  78. package/dist/formula/functions/log10.d.ts +0 -12
  79. package/dist/formula/functions/match.d.ts +0 -18
  80. package/dist/formula/functions/match.test.d.ts +0 -2
  81. package/dist/formula/functions/mod.d.ts +0 -12
  82. package/dist/formula/functions/pi.d.ts +0 -9
  83. package/dist/formula/functions/product.d.ts +0 -19
  84. package/dist/formula/functions/radians.d.ts +0 -12
  85. package/dist/formula/functions/rand.d.ts +0 -9
  86. package/dist/formula/functions/round.d.ts +0 -17
  87. package/dist/formula/functions/rounddown.d.ts +0 -17
  88. package/dist/formula/functions/roundup.d.ts +0 -17
  89. package/dist/formula/functions/row.d.ts +0 -13
  90. package/dist/formula/functions/sin.d.ts +0 -12
  91. package/dist/formula/functions/sqrt.d.ts +0 -12
  92. package/dist/formula/functions/sumif.d.ts +0 -18
  93. package/dist/formula/functions/tan.d.ts +0 -12
  94. package/dist/formula/functions/vlookup.d.ts +0 -18
  95. package/dist/parsers/core.d.ts +0 -38
  96. package/dist/renderers/checkbox.d.ts +0 -5
  97. package/dist/renderers/core.d.ts +0 -66
  98. package/dist/renderers/thousand_separator.d.ts +0 -3
@@ -1,20 +1,10 @@
1
- import { FunctionProps } from './__base';
2
- export declare class IfErrorFunction {
1
+ import { FunctionArgumentDefinition, BaseFunction, FunctionCategory } from './__base';
2
+ export declare class IfErrorFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: ({
6
- name: string;
7
- description: string;
8
- optional?: undefined;
9
- } | {
10
- name: string;
11
- description: string;
12
- optional: boolean;
13
- })[];
14
- private args;
15
- private table;
16
- constructor({ args, table }: FunctionProps);
17
- protected validate(): void;
18
- call(): any;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected broadcastDisabled: boolean;
8
+ protected main(value: any, valueIfError?: any): any;
19
9
  }
20
10
  //# sourceMappingURL=iferror.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class LenFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(text: string): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(text: any): number;
11
8
  }
12
9
  //# sourceMappingURL=len.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class LtFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(v1: number, v2: number): boolean;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any, v2: any): boolean;
11
8
  }
12
9
  //# sourceMappingURL=lt.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class LteFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(v1: number, v2: number): boolean;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any, v2: any): boolean;
11
8
  }
12
9
  //# sourceMappingURL=lte.d.ts.map
@@ -1,19 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class MaxFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: ({
6
- name: string;
7
- description: string;
8
- optional?: undefined;
9
- iterable?: undefined;
10
- } | {
11
- name: string;
12
- description: string;
13
- optional: boolean;
14
- iterable: boolean;
15
- })[];
16
- protected validate(): void;
17
- protected main(...values: number[]): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(...values: any[]): number;
18
8
  }
19
9
  //# sourceMappingURL=max.d.ts.map
@@ -1,19 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class MinFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: ({
6
- name: string;
7
- description: string;
8
- optional?: undefined;
9
- iterable?: undefined;
10
- } | {
11
- name: string;
12
- description: string;
13
- optional: boolean;
14
- iterable: boolean;
15
- })[];
16
- protected validate(): void;
17
- protected main(...values: number[]): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(...values: any[]): number;
18
8
  }
19
9
  //# sourceMappingURL=min.d.ts.map
@@ -1,13 +1,11 @@
1
- import { TimeDelta } from '../../lib/time';
2
- import { BaseFunction } from './__base';
1
+ import { Time } from '../../lib/time';
2
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
3
3
  export declare class MinusFunction extends BaseFunction {
4
4
  example: string;
5
- helpText: string[];
6
- helpArgs: {
7
- name: string;
8
- description: string;
9
- }[];
10
- protected validate(): void;
11
- protected main(v1: number | Date | TimeDelta, v2: number | Date | TimeDelta): number | Date | TimeDelta;
5
+ description: string;
6
+ defs: FunctionArgumentDefinition[];
7
+ category: FunctionCategory;
8
+ protected validate(args: any[]): any[];
9
+ protected main(v1: number | Date | Time, v2: number | Date | Time): number | Date | Time;
12
10
  }
13
11
  //# sourceMappingURL=minus.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class MultiplyFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(v1: number, v2: number): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any, v2: any): number;
11
8
  }
12
9
  //# sourceMappingURL=multiply.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class NeFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
10
7
  protected main(v1: number, v2: number): boolean;
11
8
  }
12
9
  //# sourceMappingURL=ne.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class NotFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(v1: boolean): boolean;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any): boolean;
11
8
  }
12
9
  //# sourceMappingURL=not.d.ts.map
@@ -1,9 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class NowFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: never[];
6
- protected validate(): void;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
7
  protected main(): Date;
8
8
  }
9
9
  //# sourceMappingURL=now.d.ts.map
@@ -1,19 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class OrFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: ({
6
- name: string;
7
- description: string;
8
- optional?: undefined;
9
- iterable?: undefined;
10
- } | {
11
- name: string;
12
- description: string;
13
- optional: boolean;
14
- iterable: boolean;
15
- })[];
16
- protected validate(): void;
17
- protected main(...values: boolean[]): boolean;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(...values: any[]): boolean;
18
8
  }
19
9
  //# sourceMappingURL=or.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class PowerFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(base: number, exponent: number): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(base: any, exponent: any): number;
11
8
  }
12
9
  //# sourceMappingURL=power.d.ts.map
@@ -1,19 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class SumFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: ({
6
- name: string;
7
- description: string;
8
- optional?: undefined;
9
- iterable?: undefined;
10
- } | {
11
- name: string;
12
- description: string;
13
- optional: boolean;
14
- iterable: boolean;
15
- })[];
16
- protected validate(): void;
17
- protected main(...values: number[]): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(...values: any[]): number;
18
8
  }
19
9
  //# sourceMappingURL=sum.d.ts.map
@@ -1,12 +1,9 @@
1
- import { BaseFunction } from './__base';
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
2
  export declare class UminusFunction extends BaseFunction {
3
3
  example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(v1: number): number;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any): number;
11
8
  }
12
9
  //# sourceMappingURL=uminus.d.ts.map
@@ -1,3 +1,11 @@
1
- import { FunctionMapping } from './functions/__base';
1
+ import { FunctionCategory, FunctionMapping, FunctionArgumentDefinition } from './functions/__base';
2
2
  export declare const functions: FunctionMapping;
3
+ export type FunctionHelp = {
4
+ name: string;
5
+ category: FunctionCategory;
6
+ example: string;
7
+ description: string;
8
+ defs: FunctionArgumentDefinition[];
9
+ };
10
+ export declare const getFunctionHelps: (customFunctions?: FunctionMapping) => FunctionHelp[];
3
11
  //# sourceMappingURL=mapping.d.ts.map
@@ -3,17 +3,19 @@ import { Id, MatrixType, PointType, RefEvaluation } from '../types';
3
3
  type SolveFormulaProps = {
4
4
  value: any;
5
5
  table: Table;
6
+ point: PointType;
6
7
  raise?: boolean;
7
8
  refEvaluation?: RefEvaluation;
8
- origin: PointType;
9
+ at?: Id;
9
10
  };
10
- export declare const solveFormula: ({ value, table, raise, refEvaluation, origin }: SolveFormulaProps) => any;
11
- type SolveTableProps = {
11
+ export declare const solveFormula: ({ value, table, point, raise, refEvaluation, at }: SolveFormulaProps) => any;
12
+ export type SolveTableProps = {
12
13
  table: Table;
13
14
  raise?: boolean;
15
+ at?: Id;
14
16
  refEvaluation?: RefEvaluation;
15
17
  };
16
- export declare const solveTable: ({ table, raise }: SolveTableProps) => MatrixType;
18
+ export declare const solveTable: ({ table, raise, at, refEvaluation }: SolveTableProps) => MatrixType;
17
19
  export type StripTableProps = {
18
20
  value: any;
19
21
  y?: number;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  export { GridSheet, createConnector, useConnector } from './components/GridSheet';
2
- export { Renderer } from './renderers/core';
3
- export type { RendererMixinType, RendererCallProps, RenderProps } from './renderers/core';
4
- export { Parser } from './parsers/core';
5
- export type { ParserMixinType } from './parsers/core';
6
2
  export { oa2aa, aa2oa, buildInitialCells, buildInitialCellsFromOrigin, zoneToArea, areaToZone, areaToRange, addressesToAreas, addressesToCols, addressesToRows, } from './lib/spatial';
7
- export { TimeDelta } from './lib/time';
3
+ export { Time } from './lib/time';
8
4
  export { x2c, c2x, y2r, r2y, p2a, a2p } from './lib/coords';
9
5
  export { updateTable } from './store/actions';
10
6
  export { PluginBase, useInitialPluginContext, usePluginContext } from './components/PluginBase';
@@ -12,22 +8,26 @@ export type { MatrixType, CellType, Address, AsyncCache, FilterCondition, Filter
12
8
  export type { HubType, HubProps, WireProps, TransmitProps } from './lib/hub';
13
9
  export { Wire, useHub, createHub } from './lib/hub';
14
10
  export type { Dispatcher } from './store';
15
- export { ThousandSeparatorRendererMixin } from './renderers/thousand_separator';
16
- export { CheckboxRendererMixin } from './renderers/checkbox';
17
- export { BaseFunction } from './formula/functions/__base';
18
- export { FormulaError } from './formula/evaluator';
11
+ export { ThousandSeparatorPolicyMixin } from './policy/thousand_separator';
12
+ export { CheckboxPolicyMixin } from './policy/checkbox';
13
+ export { BaseFunction, BaseFunctionSync, BaseFunctionAsync } from './formula/functions/__base';
14
+ export type { FunctionProps, FunctionArgumentDefinition as FunctionArgumentDefinition, FunctionCategory, FunctionMapping, } from './formula/functions/__base';
15
+ export { Lexer, FormulaParser, RefEntity, ValueEntity, RangeEntity } from './formula/evaluator';
16
+ export { FormulaError } from './formula/formula-error';
19
17
  export { Table, type UserTable } from './lib/table';
20
18
  export { Policy } from './policy/core';
21
- export type { PolicyType, PolicyOption, PolicyMixinType } from './policy/core';
19
+ export type { PolicyType, AutocompleteOption, PolicyMixinType, RenderProps, SerializeProps, SelectProps, SelectFallbackProps, SerializeForClipboardProps, } from './policy/core';
22
20
  export * as operations from './lib/operation';
23
- export { DEFAULT_HISTORY_LIMIT, Pending } from './constants';
21
+ export { DEFAULT_HISTORY_LIMIT } from './constants';
22
+ export { Pending, Spilling } from './sentinels';
24
23
  export { userActions } from './store/actions';
25
- export { clip } from './lib/clipboard';
24
+ export { clip, table2csv } from './lib/clipboard';
26
25
  export { makeBorder } from './styles/utils';
27
26
  export { syncers } from './store/dispatchers';
28
- export { ensureString, ensureNumber, ensureBoolean } from './formula/functions/__utils';
27
+ export { ensureString, ensureNumber, ensureBoolean, check, eachMatrix, createBooleanMask, } from './formula/functions/__utils';
29
28
  export type { EnsureNumberOptions, EnsureBooleanOptions } from './formula/functions/__utils';
30
- export { solveTable } from './formula/solver';
29
+ export { conditionArg } from './formula/functions/__base';
30
+ export { solveTable, stripTable } from './formula/solver';
31
31
  //# sourceMappingURL=index.d.ts.map
32
32
  export { h, render } from "preact";
33
33
  export {