@gridsheet/core 3.0.0-rc.8

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 (250) hide show
  1. package/README.md +17 -0
  2. package/dist/constants.d.ts +21 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +28 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/formula/evaluator.d.ts +134 -0
  7. package/dist/formula/evaluator.d.ts.map +1 -0
  8. package/dist/formula/evaluator.js +585 -0
  9. package/dist/formula/evaluator.js.map +1 -0
  10. package/dist/formula/formula-error.d.ts +10 -0
  11. package/dist/formula/formula-error.d.ts.map +1 -0
  12. package/dist/formula/formula-error.js +15 -0
  13. package/dist/formula/formula-error.js.map +1 -0
  14. package/dist/formula/functions/__async.d.ts +67 -0
  15. package/dist/formula/functions/__async.d.ts.map +1 -0
  16. package/dist/formula/functions/__async.js +70 -0
  17. package/dist/formula/functions/__async.js.map +1 -0
  18. package/dist/formula/functions/__base.d.ts +112 -0
  19. package/dist/formula/functions/__base.d.ts.map +1 -0
  20. package/dist/formula/functions/__base.js +265 -0
  21. package/dist/formula/functions/__base.js.map +1 -0
  22. package/dist/formula/functions/__utils.d.ts +28 -0
  23. package/dist/formula/functions/__utils.d.ts.map +1 -0
  24. package/dist/formula/functions/__utils.js +179 -0
  25. package/dist/formula/functions/__utils.js.map +1 -0
  26. package/dist/formula/functions/abs.d.ts +9 -0
  27. package/dist/formula/functions/abs.d.ts.map +1 -0
  28. package/dist/formula/functions/abs.js +15 -0
  29. package/dist/formula/functions/abs.js.map +1 -0
  30. package/dist/formula/functions/add.d.ts +10 -0
  31. package/dist/formula/functions/add.d.ts.map +1 -0
  32. package/dist/formula/functions/add.js +37 -0
  33. package/dist/formula/functions/add.js.map +1 -0
  34. package/dist/formula/functions/and.d.ts +9 -0
  35. package/dist/formula/functions/and.d.ts.map +1 -0
  36. package/dist/formula/functions/and.js +23 -0
  37. package/dist/formula/functions/and.js.map +1 -0
  38. package/dist/formula/functions/arrayformula.d.ts +12 -0
  39. package/dist/formula/functions/arrayformula.d.ts.map +1 -0
  40. package/dist/formula/functions/arrayformula.js +24 -0
  41. package/dist/formula/functions/arrayformula.js.map +1 -0
  42. package/dist/formula/functions/average.d.ts +9 -0
  43. package/dist/formula/functions/average.d.ts.map +1 -0
  44. package/dist/formula/functions/average.js +40 -0
  45. package/dist/formula/functions/average.js.map +1 -0
  46. package/dist/formula/functions/concat.d.ts +9 -0
  47. package/dist/formula/functions/concat.d.ts.map +1 -0
  48. package/dist/formula/functions/concat.js +27 -0
  49. package/dist/formula/functions/concat.js.map +1 -0
  50. package/dist/formula/functions/count.d.ts +9 -0
  51. package/dist/formula/functions/count.d.ts.map +1 -0
  52. package/dist/formula/functions/count.js +32 -0
  53. package/dist/formula/functions/count.js.map +1 -0
  54. package/dist/formula/functions/counta.d.ts +9 -0
  55. package/dist/formula/functions/counta.d.ts.map +1 -0
  56. package/dist/formula/functions/counta.js +32 -0
  57. package/dist/formula/functions/counta.js.map +1 -0
  58. package/dist/formula/functions/divide.d.ts +10 -0
  59. package/dist/formula/functions/divide.d.ts.map +1 -0
  60. package/dist/formula/functions/divide.js +34 -0
  61. package/dist/formula/functions/divide.js.map +1 -0
  62. package/dist/formula/functions/eq.d.ts +9 -0
  63. package/dist/formula/functions/eq.d.ts.map +1 -0
  64. package/dist/formula/functions/eq.js +19 -0
  65. package/dist/formula/functions/eq.js.map +1 -0
  66. package/dist/formula/functions/gt.d.ts +9 -0
  67. package/dist/formula/functions/gt.d.ts.map +1 -0
  68. package/dist/formula/functions/gt.js +19 -0
  69. package/dist/formula/functions/gt.js.map +1 -0
  70. package/dist/formula/functions/gte.d.ts +9 -0
  71. package/dist/formula/functions/gte.d.ts.map +1 -0
  72. package/dist/formula/functions/gte.js +19 -0
  73. package/dist/formula/functions/gte.js.map +1 -0
  74. package/dist/formula/functions/if.d.ts +9 -0
  75. package/dist/formula/functions/if.d.ts.map +1 -0
  76. package/dist/formula/functions/if.js +29 -0
  77. package/dist/formula/functions/if.js.map +1 -0
  78. package/dist/formula/functions/iferror.d.ts +10 -0
  79. package/dist/formula/functions/iferror.d.ts.map +1 -0
  80. package/dist/formula/functions/iferror.js +28 -0
  81. package/dist/formula/functions/iferror.js.map +1 -0
  82. package/dist/formula/functions/len.d.ts +9 -0
  83. package/dist/formula/functions/len.d.ts.map +1 -0
  84. package/dist/formula/functions/len.js +21 -0
  85. package/dist/formula/functions/len.js.map +1 -0
  86. package/dist/formula/functions/lt.d.ts +9 -0
  87. package/dist/formula/functions/lt.d.ts.map +1 -0
  88. package/dist/formula/functions/lt.js +19 -0
  89. package/dist/formula/functions/lt.js.map +1 -0
  90. package/dist/formula/functions/lte.d.ts +9 -0
  91. package/dist/formula/functions/lte.d.ts.map +1 -0
  92. package/dist/formula/functions/lte.js +19 -0
  93. package/dist/formula/functions/lte.js.map +1 -0
  94. package/dist/formula/functions/max.d.ts +9 -0
  95. package/dist/formula/functions/max.d.ts.map +1 -0
  96. package/dist/formula/functions/max.js +37 -0
  97. package/dist/formula/functions/max.js.map +1 -0
  98. package/dist/formula/functions/min.d.ts +9 -0
  99. package/dist/formula/functions/min.d.ts.map +1 -0
  100. package/dist/formula/functions/min.js +37 -0
  101. package/dist/formula/functions/min.js.map +1 -0
  102. package/dist/formula/functions/minus.d.ts +10 -0
  103. package/dist/formula/functions/minus.d.ts.map +1 -0
  104. package/dist/formula/functions/minus.js +41 -0
  105. package/dist/formula/functions/minus.js.map +1 -0
  106. package/dist/formula/functions/multiply.d.ts +9 -0
  107. package/dist/formula/functions/multiply.d.ts.map +1 -0
  108. package/dist/formula/functions/multiply.js +19 -0
  109. package/dist/formula/functions/multiply.js.map +1 -0
  110. package/dist/formula/functions/ne.d.ts +9 -0
  111. package/dist/formula/functions/ne.d.ts.map +1 -0
  112. package/dist/formula/functions/ne.js +19 -0
  113. package/dist/formula/functions/ne.js.map +1 -0
  114. package/dist/formula/functions/not.d.ts +9 -0
  115. package/dist/formula/functions/not.d.ts.map +1 -0
  116. package/dist/formula/functions/not.js +22 -0
  117. package/dist/formula/functions/not.js.map +1 -0
  118. package/dist/formula/functions/now.d.ts +9 -0
  119. package/dist/formula/functions/now.d.ts.map +1 -0
  120. package/dist/formula/functions/now.js +14 -0
  121. package/dist/formula/functions/now.js.map +1 -0
  122. package/dist/formula/functions/or.d.ts +9 -0
  123. package/dist/formula/functions/or.d.ts.map +1 -0
  124. package/dist/formula/functions/or.js +23 -0
  125. package/dist/formula/functions/or.js.map +1 -0
  126. package/dist/formula/functions/power.d.ts +9 -0
  127. package/dist/formula/functions/power.d.ts.map +1 -0
  128. package/dist/formula/functions/power.js +18 -0
  129. package/dist/formula/functions/power.js.map +1 -0
  130. package/dist/formula/functions/sum.d.ts +9 -0
  131. package/dist/formula/functions/sum.d.ts.map +1 -0
  132. package/dist/formula/functions/sum.js +34 -0
  133. package/dist/formula/functions/sum.js.map +1 -0
  134. package/dist/formula/functions/uminus.d.ts +9 -0
  135. package/dist/formula/functions/uminus.d.ts.map +1 -0
  136. package/dist/formula/functions/uminus.js +17 -0
  137. package/dist/formula/functions/uminus.js.map +1 -0
  138. package/dist/formula/mapping.d.ts +11 -0
  139. package/dist/formula/mapping.d.ts.map +1 -0
  140. package/dist/formula/mapping.js +82 -0
  141. package/dist/formula/mapping.js.map +1 -0
  142. package/dist/formula/solver.d.ts +39 -0
  143. package/dist/formula/solver.d.ts.map +1 -0
  144. package/dist/formula/solver.js +71 -0
  145. package/dist/formula/solver.js.map +1 -0
  146. package/dist/index.d.ts +22 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +74 -0
  149. package/dist/index.js.map +1 -0
  150. package/dist/lib/autofill.d.ts +22 -0
  151. package/dist/lib/autofill.d.ts.map +1 -0
  152. package/dist/lib/autofill.js +276 -0
  153. package/dist/lib/autofill.js.map +1 -0
  154. package/dist/lib/book.d.ts +131 -0
  155. package/dist/lib/book.d.ts.map +1 -0
  156. package/dist/lib/book.js +53 -0
  157. package/dist/lib/book.js.map +1 -0
  158. package/dist/lib/cell.d.ts +17 -0
  159. package/dist/lib/cell.d.ts.map +1 -0
  160. package/dist/lib/cell.js +17 -0
  161. package/dist/lib/cell.js.map +1 -0
  162. package/dist/lib/coords.d.ts +22 -0
  163. package/dist/lib/coords.d.ts.map +1 -0
  164. package/dist/lib/coords.js +73 -0
  165. package/dist/lib/coords.js.map +1 -0
  166. package/dist/lib/date.d.ts +2 -0
  167. package/dist/lib/date.d.ts.map +1 -0
  168. package/dist/lib/date.js +91 -0
  169. package/dist/lib/date.js.map +1 -0
  170. package/dist/lib/dom.d.ts +7 -0
  171. package/dist/lib/dom.d.ts.map +1 -0
  172. package/dist/lib/dom.js +28 -0
  173. package/dist/lib/dom.js.map +1 -0
  174. package/dist/lib/filter.d.ts +7 -0
  175. package/dist/lib/filter.d.ts.map +1 -0
  176. package/dist/lib/filter.js +122 -0
  177. package/dist/lib/filter.js.map +1 -0
  178. package/dist/lib/input.d.ts +28 -0
  179. package/dist/lib/input.d.ts.map +1 -0
  180. package/dist/lib/input.js +73 -0
  181. package/dist/lib/input.js.map +1 -0
  182. package/dist/lib/label.d.ts +4 -0
  183. package/dist/lib/label.d.ts.map +1 -0
  184. package/dist/lib/label.js +10 -0
  185. package/dist/lib/label.js.map +1 -0
  186. package/dist/lib/operation.d.ts +31 -0
  187. package/dist/lib/operation.d.ts.map +1 -0
  188. package/dist/lib/operation.js +36 -0
  189. package/dist/lib/operation.js.map +1 -0
  190. package/dist/lib/palette.d.ts +2 -0
  191. package/dist/lib/palette.d.ts.map +1 -0
  192. package/dist/lib/palette.js +26 -0
  193. package/dist/lib/palette.js.map +1 -0
  194. package/dist/lib/popup.d.ts +24 -0
  195. package/dist/lib/popup.d.ts.map +1 -0
  196. package/dist/lib/popup.js +21 -0
  197. package/dist/lib/popup.js.map +1 -0
  198. package/dist/lib/reference.d.ts +19 -0
  199. package/dist/lib/reference.d.ts.map +1 -0
  200. package/dist/lib/reference.js +40 -0
  201. package/dist/lib/reference.js.map +1 -0
  202. package/dist/lib/sheet.d.ts +512 -0
  203. package/dist/lib/sheet.d.ts.map +1 -0
  204. package/dist/lib/sheet.js +1530 -0
  205. package/dist/lib/sheet.js.map +1 -0
  206. package/dist/lib/sheet_utils.d.ts +55 -0
  207. package/dist/lib/sheet_utils.d.ts.map +1 -0
  208. package/dist/lib/sheet_utils.js +125 -0
  209. package/dist/lib/sheet_utils.js.map +1 -0
  210. package/dist/lib/spatial.d.ts +79 -0
  211. package/dist/lib/spatial.d.ts.map +1 -0
  212. package/dist/lib/spatial.js +227 -0
  213. package/dist/lib/spatial.js.map +1 -0
  214. package/dist/lib/time.d.ts +29 -0
  215. package/dist/lib/time.d.ts.map +1 -0
  216. package/dist/lib/time.js +113 -0
  217. package/dist/lib/time.js.map +1 -0
  218. package/dist/lib/virtualization.d.ts +22 -0
  219. package/dist/lib/virtualization.d.ts.map +1 -0
  220. package/dist/lib/virtualization.js +91 -0
  221. package/dist/lib/virtualization.js.map +1 -0
  222. package/dist/policy/core.d.ts +161 -0
  223. package/dist/policy/core.d.ts.map +1 -0
  224. package/dist/policy/core.js +248 -0
  225. package/dist/policy/core.js.map +1 -0
  226. package/dist/policy/thousand_separator.d.ts +4 -0
  227. package/dist/policy/thousand_separator.d.ts.map +1 -0
  228. package/dist/policy/thousand_separator.js +13 -0
  229. package/dist/policy/thousand_separator.js.map +1 -0
  230. package/dist/sentinels.d.ts +40 -0
  231. package/dist/sentinels.d.ts.map +1 -0
  232. package/dist/sentinels.js +41 -0
  233. package/dist/sentinels.js.map +1 -0
  234. package/dist/styles/embedder.d.ts +2 -0
  235. package/dist/styles/embedder.d.ts.map +1 -0
  236. package/dist/styles/embedder.js +11 -0
  237. package/dist/styles/embedder.js.map +1 -0
  238. package/dist/styles/minified.d.ts +3 -0
  239. package/dist/styles/minified.d.ts.map +1 -0
  240. package/dist/styles/minified.js +6 -0
  241. package/dist/styles/minified.js.map +1 -0
  242. package/dist/types.d.ts +310 -0
  243. package/dist/types.d.ts.map +1 -0
  244. package/dist/types.js +2 -0
  245. package/dist/types.js.map +1 -0
  246. package/dist/utils.d.ts +2 -0
  247. package/dist/utils.d.ts.map +1 -0
  248. package/dist/utils.js +5 -0
  249. package/dist/utils.js.map +1 -0
  250. package/package.json +59 -0
@@ -0,0 +1,9 @@
1
+ import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';
2
+ export declare class UminusFunction extends BaseFunction {
3
+ example: string;
4
+ description: string;
5
+ defs: FunctionArgumentDefinition[];
6
+ category: FunctionCategory;
7
+ protected main(v1: any): number;
8
+ }
9
+ //# sourceMappingURL=uminus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uminus.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/uminus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAKtF,qBAAa,cAAe,SAAQ,YAAY;IAC9C,OAAO,SAAe;IACtB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAEhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG;CAGvB"}
@@ -0,0 +1,17 @@
1
+ import { BaseFunction as t } from "./__base.js";
2
+ import { ensureNumber as r } from "./__utils.js";
3
+ const s = "Returns a number with positive and negative values reversed.";
4
+ class u extends t {
5
+ constructor() {
6
+ super(...arguments), this.example = "UMINUS(4)", this.description = s, this.defs = [
7
+ { name: "value1", description: "A number that will be subtracted.", acceptedTypes: ["number"] }
8
+ ], this.category = "math";
9
+ }
10
+ main(e) {
11
+ return -r(e);
12
+ }
13
+ }
14
+ export {
15
+ u as UminusFunction
16
+ };
17
+ //# sourceMappingURL=uminus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uminus.js","sources":["../../../src/formula/functions/uminus.ts"],"sourcesContent":["import { BaseFunction, FunctionCategory, FunctionArgumentDefinition } from './__base';\nimport { ensureNumber } from './__utils';\n\nconst description = `Returns a number with positive and negative values reversed.`;\n\nexport class UminusFunction extends BaseFunction {\n example = 'UMINUS(4)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'value1', description: 'A number that will be subtracted.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'math';\n\n protected main(v1: any) {\n return -ensureNumber(v1);\n }\n}\n"],"names":["description","UminusFunction","BaseFunction","v1","ensureNumber"],"mappings":";;AAGA,MAAMA,IAAc;AAEb,MAAMC,UAAuBC,EAAa;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UAAA,aACI,KAAA,cAAAF,GACuB,KAAA,OAAA;AAAA,MACnC,EAAE,MAAM,UAAU,aAAa,qCAAqC,eAAe,CAAC,QAAQ,EAAE;AAAA,IAChG,GAC6B,KAAA,WAAA;AAAA,EAAA;AAAA,EAEnB,KAAKG,GAAS;AACf,WAAA,CAACC,EAAaD,CAAE;AAAA,EAAA;AAE3B;"}
@@ -0,0 +1,11 @@
1
+ import { FunctionCategory, FunctionMapping, FunctionArgumentDefinition } from './functions/__base';
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[];
11
+ //# sourceMappingURL=mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/formula/mapping.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAExG,eAAO,MAAM,SAAS,EAAE,eAyCvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,0BAA0B,EAAE,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,gBAAgB,GAAI,kBAAiB,eAA2B,KAAG,YAAY,EAiB3F,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { AddFunction as p } from "./functions/add.js";
2
+ import { MinusFunction as c } from "./functions/minus.js";
3
+ import { MultiplyFunction as u } from "./functions/multiply.js";
4
+ import { DivideFunction as f } from "./functions/divide.js";
5
+ import { SumFunction as a } from "./functions/sum.js";
6
+ import { ConcatFunction as F } from "./functions/concat.js";
7
+ import { EqFunction as s } from "./functions/eq.js";
8
+ import { NeFunction as l } from "./functions/ne.js";
9
+ import { GtFunction as d } from "./functions/gt.js";
10
+ import { GteFunction as g } from "./functions/gte.js";
11
+ import { LtFunction as w } from "./functions/lt.js";
12
+ import { LteFunction as y } from "./functions/lte.js";
13
+ import { NowFunction as x } from "./functions/now.js";
14
+ import { AndFunction as A } from "./functions/and.js";
15
+ import { OrFunction as M } from "./functions/or.js";
16
+ import { IfFunction as v } from "./functions/if.js";
17
+ import { IfErrorFunction as C } from "./functions/iferror.js";
18
+ import { NotFunction as b } from "./functions/not.js";
19
+ import { CountFunction as h } from "./functions/count.js";
20
+ import { AbsFunction as L } from "./functions/abs.js";
21
+ import { PowerFunction as m } from "./functions/power.js";
22
+ import { CountaFunction as N } from "./functions/counta.js";
23
+ import { AverageFunction as U } from "./functions/average.js";
24
+ import { MaxFunction as _ } from "./functions/max.js";
25
+ import { MinFunction as k } from "./functions/min.js";
26
+ import { LenFunction as q } from "./functions/len.js";
27
+ import { UminusFunction as E } from "./functions/uminus.js";
28
+ import { ArrayformulaFunction as G } from "./functions/arrayformula.js";
29
+ const H = {
30
+ // Arithmetic & Comparison
31
+ add: p,
32
+ minus: c,
33
+ uminus: E,
34
+ multiply: u,
35
+ divide: f,
36
+ pow: m,
37
+ power: m,
38
+ concat: F,
39
+ eq: s,
40
+ ne: l,
41
+ gt: d,
42
+ gte: g,
43
+ lt: w,
44
+ lte: y,
45
+ // Logical
46
+ if: v,
47
+ iferror: C,
48
+ and: A,
49
+ or: M,
50
+ not: b,
51
+ arrayformula: G,
52
+ // Statistics & Aggregation
53
+ sum: a,
54
+ max: _,
55
+ min: k,
56
+ average: U,
57
+ count: h,
58
+ counta: N,
59
+ // Text
60
+ len: q,
61
+ // Math
62
+ abs: L,
63
+ // Time
64
+ now: x
65
+ }, e = /* @__PURE__ */ new Map(), uo = (o = H) => {
66
+ let n = e.get(o);
67
+ return n || (n = Object.keys(o).map((i) => {
68
+ const t = o[i], r = new t({ args: [], sheet: {} });
69
+ return {
70
+ name: i.toUpperCase(),
71
+ category: r.category,
72
+ example: r.example ?? (t == null ? void 0 : t.__name) ?? "Unknown",
73
+ description: r.description ?? "",
74
+ defs: r.defs || []
75
+ };
76
+ }), e.set(o, n)), n;
77
+ };
78
+ export {
79
+ H as functions,
80
+ uo as getFunctionHelps
81
+ };
82
+ //# sourceMappingURL=mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapping.js","sources":["../../src/formula/mapping.ts"],"sourcesContent":["import { AddFunction } from './functions/add';\nimport { MinusFunction } from './functions/minus';\nimport { MultiplyFunction } from './functions/multiply';\nimport { DivideFunction } from './functions/divide';\nimport { SumFunction } from './functions/sum';\nimport { ConcatFunction } from './functions/concat';\nimport { EqFunction } from './functions/eq';\nimport { NeFunction } from './functions/ne';\nimport { GtFunction } from './functions/gt';\nimport { GteFunction } from './functions/gte';\nimport { LtFunction } from './functions/lt';\nimport { LteFunction } from './functions/lte';\nimport { NowFunction } from './functions/now';\nimport { AndFunction } from './functions/and';\nimport { OrFunction } from './functions/or';\nimport { IfFunction } from './functions/if';\nimport { IfErrorFunction } from './functions/iferror';\nimport { NotFunction } from './functions/not';\nimport { CountFunction } from './functions/count';\nimport { AbsFunction } from './functions/abs';\nimport { PowerFunction } from './functions/power';\nimport { CountaFunction } from './functions/counta';\nimport { AverageFunction } from './functions/average';\nimport { MaxFunction } from './functions/max';\nimport { MinFunction } from './functions/min';\nimport { LenFunction } from './functions/len';\nimport { UminusFunction } from './functions/uminus';\nimport { ArrayformulaFunction } from './functions/arrayformula';\nimport type { FunctionCategory, FunctionMapping, FunctionArgumentDefinition } from './functions/__base';\n\nexport const functions: FunctionMapping = {\n // Arithmetic & Comparison\n add: AddFunction,\n minus: MinusFunction,\n uminus: UminusFunction,\n multiply: MultiplyFunction,\n divide: DivideFunction,\n pow: PowerFunction,\n power: PowerFunction,\n concat: ConcatFunction,\n eq: EqFunction,\n ne: NeFunction,\n gt: GtFunction,\n gte: GteFunction,\n lt: LtFunction,\n lte: LteFunction,\n\n // Logical\n if: IfFunction,\n iferror: IfErrorFunction,\n and: AndFunction,\n or: OrFunction,\n not: NotFunction,\n arrayformula: ArrayformulaFunction,\n\n // Statistics & Aggregation\n sum: SumFunction,\n max: MaxFunction,\n min: MinFunction,\n average: AverageFunction,\n count: CountFunction,\n counta: CountaFunction,\n\n // Text\n len: LenFunction,\n\n // Math\n abs: AbsFunction,\n\n // Time\n now: NowFunction,\n};\n\nexport type FunctionHelp = {\n name: string;\n category: FunctionCategory;\n example: string;\n description: string;\n defs: FunctionArgumentDefinition[];\n};\n\nconst _functionHelpsCache = new Map<FunctionMapping, FunctionHelp[]>();\n\nexport const getFunctionHelps = (customFunctions: FunctionMapping = functions): FunctionHelp[] => {\n let helps = _functionHelpsCache.get(customFunctions);\n if (!helps) {\n helps = Object.keys(customFunctions).map((name) => {\n const FnClass = customFunctions[name];\n const instance = new FnClass({ args: [], sheet: {} as any });\n return {\n name: name.toUpperCase(),\n category: instance.category,\n example: instance.example ?? FnClass?.__name ?? 'Unknown',\n description: instance.description ?? '',\n defs: instance.defs || [],\n };\n });\n _functionHelpsCache.set(customFunctions, helps);\n }\n return helps;\n};\n"],"names":["functions","AddFunction","MinusFunction","UminusFunction","MultiplyFunction","DivideFunction","PowerFunction","ConcatFunction","EqFunction","NeFunction","GtFunction","GteFunction","LtFunction","LteFunction","IfFunction","IfErrorFunction","AndFunction","OrFunction","NotFunction","ArrayformulaFunction","SumFunction","MaxFunction","MinFunction","AverageFunction","CountFunction","CountaFunction","LenFunction","AbsFunction","NowFunction","_functionHelpsCache","getFunctionHelps","customFunctions","helps","name","FnClass","instance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA6B;AAAA;AAAA,EAExC,KAAKC;AAAA,EACL,OAAOC;AAAA,EACP,QAAQC;AAAA,EACR,UAAUC;AAAA,EACV,QAAQC;AAAA,EACR,KAAKC;AAAA,EACL,OAAOA;AAAA,EACP,QAAQC;AAAA,EACR,IAAIC;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AAAA,EACJ,KAAKC;AAAA,EACL,IAAIC;AAAA,EACJ,KAAKC;AAAA;AAAA,EAGL,IAAIC;AAAA,EACJ,SAASC;AAAA,EACT,KAAKC;AAAA,EACL,IAAIC;AAAA,EACJ,KAAKC;AAAA,EACL,cAAcC;AAAA;AAAA,EAGd,KAAKC;AAAA,EACL,KAAKC;AAAA,EACL,KAAKC;AAAA,EACL,SAASC;AAAA,EACT,OAAOC;AAAA,EACP,QAAQC;AAAA;AAAA,EAGR,KAAKC;AAAA;AAAA,EAGL,KAAKC;AAAA;AAAA,EAGL,KAAKC;AACP,GAUMC,wBAA0B,IAAqC,GAExDC,KAAmB,CAACC,IAAmC/B,MAA8B;AAC5F,MAAAgC,IAAQH,EAAoB,IAAIE,CAAe;AACnD,SAAKC,MACHA,IAAQ,OAAO,KAAKD,CAAe,EAAE,IAAI,CAACE,MAAS;AAC3C,UAAAC,IAAUH,EAAgBE,CAAI,GAC9BE,IAAW,IAAID,EAAQ,EAAE,MAAM,IAAI,OAAO,CAAA,GAAW;AACpD,WAAA;AAAA,MACL,MAAMD,EAAK,YAAY;AAAA,MACvB,UAAUE,EAAS;AAAA,MACnB,SAASA,EAAS,YAAWD,KAAA,gBAAAA,EAAS,WAAU;AAAA,MAChD,aAAaC,EAAS,eAAe;AAAA,MACrC,MAAMA,EAAS,QAAQ,CAAA;AAAA,IACzB;AAAA,EAAA,CACD,GACmBN,EAAA,IAAIE,GAAiBC,CAAK,IAEzCA;AACT;"}
@@ -0,0 +1,39 @@
1
+ import { Sheet } from '../lib/sheet';
2
+ import { Id, MatrixType, PointType, Resolution } from '../types';
3
+ export type SolveOptions = {
4
+ raise?: boolean;
5
+ resolution?: Resolution;
6
+ };
7
+ type SolveFormulaProps = {
8
+ value: any;
9
+ sheet: Sheet;
10
+ point: PointType;
11
+ raise?: boolean;
12
+ resolution?: Resolution;
13
+ at?: Id;
14
+ };
15
+ /**
16
+ * Evaluates a single cell value (formula or literal) within the context of a sheet.
17
+ * Handles caching, circular reference detection, spilling, and async pending states.
18
+ * Returns the resolved scalar value (or error) for the given cell.
19
+ */
20
+ export declare const solveFormula: ({ value, sheet, point, raise, resolution, at }: SolveFormulaProps) => any;
21
+ export type SolveSheetProps = {
22
+ sheet: Sheet;
23
+ raise?: boolean;
24
+ at?: Id;
25
+ };
26
+ /**
27
+ * Evaluates all cells in a Sheet and returns the results as a 2D array (MatrixType).
28
+ * Each cell formula is resolved in order, with caching to avoid redundant computation.
29
+ * Use this when you need the full evaluated contents of a range.
30
+ */
31
+ export declare const solveSheet: ({ sheet, raise, at }: SolveSheetProps) => MatrixType;
32
+ export type StripSheetProps = {
33
+ value: any;
34
+ at?: Id;
35
+ raise?: boolean;
36
+ };
37
+ export declare const stripSheet: ({ value, at, raise }: StripSheetProps) => any;
38
+ export {};
39
+ //# sourceMappingURL=solver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solver.d.ts","sourceRoot":"","sources":["../../src/formula/solver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItE,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,gDAAoE,iBAAiB,QA+DjH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,sBAA6B,eAAe,KAAG,UAgCzE,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,GAAG,CAAC;IACX,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,sBAA6B,eAAe,KAAG,GAKzE,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { SOLVING as u, Spilling as R, Pending as g } from "../sentinels.js";
2
+ import { Sheet as w } from "../lib/sheet.js";
3
+ import { Lexer as d, Parser as x } from "./evaluator.js";
4
+ import { FormulaError as E } from "./formula-error.js";
5
+ const y = ({ value: r, sheet: n, point: o, raise: s = !0, resolution: l = "RESOLVED", at: S }) => {
6
+ var a, m;
7
+ const [h, c] = n.getSolvedCache(o);
8
+ if (h && r == null && !u.is(c))
9
+ return c;
10
+ if (typeof r != "string" || l === "SYSTEM")
11
+ return r;
12
+ if (r.charAt(0) === "'")
13
+ return l === "RAW" ? r : r.substring(1);
14
+ if (r.charAt(0) !== "=")
15
+ return r;
16
+ if (l === "RAW") {
17
+ const e = new d(r.substring(1), { at: S });
18
+ return e.tokenize(), "=" + e.display({ sheet: n });
19
+ }
20
+ let t = r;
21
+ if (h && !u.is(c))
22
+ t = c;
23
+ else
24
+ try {
25
+ const e = new d(r.substring(1), { at: S });
26
+ e.tokenize();
27
+ const i = new x(e.tokens).build();
28
+ t = (a = i == null ? void 0 : i.evaluate) == null ? void 0 : a.call(i, { sheet: n });
29
+ } catch (e) {
30
+ if (s)
31
+ throw n.finishSolvedCache(o, e), e;
32
+ return e;
33
+ }
34
+ return l === "RESOLVED" && t instanceof w && (t = (m = p({ sheet: t, raise: s, at: S })[0]) == null ? void 0 : m[0]), R.is(t) ? t = n.spill(o, t.matrix) : n.finishSolvedCache(o, t), g.is(t) && n.finishSolvedCache(o, t), t;
35
+ }, p = ({ sheet: r, raise: n = !0, at: o }) => {
36
+ const s = r.area;
37
+ return r._toValueMatrix({ area: s, at: o, resolution: "SYSTEM" }).map((S, h) => {
38
+ const c = s.top + h;
39
+ return S.map((t, a) => {
40
+ const m = s.left + a, e = { y: c, x: m }, [C, i] = r.getSolvedCache(e);
41
+ try {
42
+ if (u.is(i))
43
+ throw new E("#REF!", "References are circulating.", new Error(t));
44
+ if (g.is(i))
45
+ return i;
46
+ if (E.is(i))
47
+ throw i;
48
+ if (i != null)
49
+ return i;
50
+ r.setSolvingCache(e);
51
+ const f = y({ value: t, sheet: r, point: e, raise: n, at: o, resolution: "RESOLVED" });
52
+ return r.finishSolvedCache(e, f), f;
53
+ } catch (f) {
54
+ if (r.finishSolvedCache(e, f), n)
55
+ throw f;
56
+ return f;
57
+ }
58
+ });
59
+ });
60
+ }, O = ({ value: r, at: n, raise: o = !0 }) => {
61
+ var s;
62
+ for (; r instanceof w; )
63
+ r = (s = p({ sheet: r, raise: o, at: n })[0]) == null ? void 0 : s[0];
64
+ return r;
65
+ };
66
+ export {
67
+ y as solveFormula,
68
+ p as solveSheet,
69
+ O as stripSheet
70
+ };
71
+ //# sourceMappingURL=solver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solver.js","sources":["../../src/formula/solver.ts"],"sourcesContent":["import { Pending, SOLVING, Spilling } from '../sentinels';\nimport { Sheet } from '../lib/sheet';\nimport type { Id, MatrixType, PointType, Resolution } from '../types';\nimport { Lexer, Parser } from './evaluator';\nimport { FormulaError } from './formula-error';\n\nexport type SolveOptions = {\n raise?: boolean;\n resolution?: Resolution;\n};\n\ntype SolveFormulaProps = {\n value: any;\n sheet: Sheet;\n point: PointType;\n raise?: boolean;\n resolution?: Resolution;\n at?: Id;\n};\n\n/**\n * Evaluates a single cell value (formula or literal) within the context of a sheet.\n * Handles caching, circular reference detection, spilling, and async pending states.\n * Returns the resolved scalar value (or error) for the given cell.\n */\nexport const solveFormula = ({ value, sheet, point, raise = true, resolution = 'RESOLVED', at }: SolveFormulaProps) => {\n const [hit, cache] = sheet.getSolvedCache(point);\n if (hit && value == null && !SOLVING.is(cache)) {\n // spilled value\n return cache;\n }\n\n if (typeof value !== 'string') {\n return value;\n }\n if (resolution === 'SYSTEM') {\n return value;\n }\n if (value.charAt(0) === \"'\") {\n return resolution === 'RAW' ? value : value.substring(1);\n }\n if (value.charAt(0) !== '=') {\n return value;\n }\n if (resolution === 'RAW') {\n const lexer = new Lexer(value.substring(1), { at });\n lexer.tokenize();\n return '=' + lexer.display({ sheet });\n }\n\n let solved: any = value;\n if (hit && !SOLVING.is(cache)) {\n solved = cache;\n } else {\n try {\n const lexer = new Lexer(value.substring(1), { at });\n lexer.tokenize();\n const parser = new Parser(lexer.tokens);\n const expr = parser.build();\n solved = expr?.evaluate?.({ sheet });\n } catch (e) {\n if (raise) {\n sheet.finishSolvedCache(point, e);\n throw e;\n }\n return e;\n }\n }\n\n if (resolution === 'RESOLVED' && solved instanceof Sheet) {\n // Unwrap to scalar (top-left cell of the sheet's area).\n // NOTE: We intentionally call solveSheet directly here instead of stripSheet,\n // to avoid a three-way cycle: solveFormula → stripSheet → solveSheet → solveFormula.\n // The mutual recursion between solveFormula and solveSheet is unavoidable by design,\n // but routing through stripSheet would make the call graph harder to follow and reason about.\n solved = solveSheet({ sheet: solved, raise, at })[0]?.[0];\n }\n // 'EVALUATED' resolution: keep Sheet objects intact (range formulas return Sheet, not scalar).\n\n if (Spilling.is(solved)) {\n solved = sheet.spill(point, solved.matrix);\n } else {\n sheet.finishSolvedCache(point, solved);\n }\n if (Pending.is(solved)) {\n sheet.finishSolvedCache(point, solved);\n }\n return solved;\n};\n\nexport type SolveSheetProps = {\n sheet: Sheet;\n raise?: boolean;\n at?: Id;\n};\n\n/**\n * Evaluates all cells in a Sheet and returns the results as a 2D array (MatrixType).\n * Each cell formula is resolved in order, with caching to avoid redundant computation.\n * Use this when you need the full evaluated contents of a range.\n */\nexport const solveSheet = ({ sheet, raise = true, at }: SolveSheetProps): MatrixType => {\n const area = sheet.area;\n const matrix = sheet._toValueMatrix({ area, at, resolution: 'SYSTEM' });\n return matrix.map((row, i) => {\n const y = area.top + i;\n return row.map((value, j) => {\n const x = area.left + j;\n const point = { y, x };\n const [hit, cache] = sheet.getSolvedCache(point);\n try {\n if (SOLVING.is(cache)) {\n throw new FormulaError('#REF!', 'References are circulating.', new Error(value as string));\n } else if (Pending.is(cache)) {\n return cache;\n } else if (FormulaError.is(cache)) {\n throw cache;\n } else if (cache != null) {\n return cache;\n }\n sheet.setSolvingCache(point);\n const solved = solveFormula({ value, sheet, point, raise, at, resolution: 'RESOLVED' });\n sheet.finishSolvedCache(point, solved);\n return solved;\n } catch (e) {\n sheet.finishSolvedCache(point, e);\n if (raise) {\n throw e;\n }\n return e;\n }\n });\n });\n};\n\nexport type StripSheetProps = {\n value: any;\n at?: Id;\n raise?: boolean;\n};\n\nexport const stripSheet = ({ value, at, raise = true }: StripSheetProps): any => {\n while (value instanceof Sheet) {\n value = solveSheet({ sheet: value, raise, at })[0]?.[0];\n }\n return value;\n};\n"],"names":["solveFormula","value","sheet","point","raise","resolution","at","hit","cache","SOLVING","lexer","Lexer","solved","expr","Parser","_a","Sheet","_b","solveSheet","Spilling","Pending","area","row","i","y","j","x","FormulaError","e","stripSheet"],"mappings":"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"}
@@ -0,0 +1,22 @@
1
+ export { oa2aa, aa2oa, buildInitialCells, buildInitialCellsFromOrigin, zoneToArea, areaToZone, areaToRange, matrixShape, addressesToAreas, addressesToCols, addressesToRows, } from './lib/spatial';
2
+ export { Time } from './lib/time';
3
+ export { x2c, c2x, y2r, r2y, p2a, a2p, rh, ch } from './lib/coords';
4
+ export type { CSSPropertiesLike, RefLike, Resolution, Y, X, Height, Width, ShapeType, RectType, MatrixType, CursorStateType, FeedbackType, ModeType, HeadersType, AsyncCache, System, FilterConditionMethod, FilterCondition, FilterConfig, CellType, RawCellType, CellPatchType, CellFilter, CellsByAddressType, CellsByIdType, SystemsByIdType, RangeType, PointType, ExtraPointType, PositionType, ZoneType, AreaType, WriterType, Id, Ids, IdMatrix, Address, MatricesByAddress, StorePatchType, HistoryUpdateType, MoveRelation, MoveRelations, HistoryMoveType, HistoryInsertRowsType, HistoryRemoveRowsType, HistoryInsertColsType, HistoryRemoveColsType, HistorySortRowsType, HistoryType, Virtualization, OperatorType, OperationType, Dispatcher, StoreDispatchType, ContextsBySheetId, SheetIdsByName, RefPaletteType, EditorEvent, } from './types';
5
+ export type { BookType, BookProps, RegistryProps, TransmitProps } from './lib/book';
6
+ export { Registry, createBook, createRegistry, createBinding } from './lib/book';
7
+ export { Sheet, type UserSheet, type SheetLimits } from './lib/sheet';
8
+ export { toValueMatrix, toValueObject, toValueRows, toValueCols, toCellMatrix, toCellObject, toCellRows, toCellCols, type ToValueMatrixProps, type ToValueObjectProps, type ToValueRowsProps, type ToValueColsProps, type ToCellMatrixProps, type ToCellObjectProps, type ToCellRowsProps, type ToCellColsProps, } from './lib/sheet_utils';
9
+ export { BaseFunction, BaseFunctionAsync } from './formula/functions/__base';
10
+ export type { FunctionProps, FunctionArgumentDefinition, FunctionCategory, FunctionMapping, } from './formula/functions/__base';
11
+ export { Lexer, FormulaParser, RefEntity, ValueEntity, RangeEntity } from './formula/evaluator';
12
+ export { FormulaError } from './formula/formula-error';
13
+ export { ensureString, ensureNumber, ensureBoolean, ensureDate, check, eachMatrix, createBooleanMask, } from './formula/functions/__utils';
14
+ export type { EnsureNumberOptions, EnsureBooleanOptions } from './formula/functions/__utils';
15
+ export { conditionArg, stripMatrix } from './formula/functions/__base';
16
+ export { Policy } from './policy/core';
17
+ export type { PolicyType, AutocompleteOption, PolicyMixinType, RenderProps, SerializeProps, SelectProps, SelectFallbackProps, SerializeForClipboardProps, } from './policy/core';
18
+ export { ThousandSeparatorPolicyMixin } from './policy/thousand_separator';
19
+ export * as operations from './lib/operation';
20
+ export { DEFAULT_HISTORY_LIMIT } from './constants';
21
+ export { Pending, Spilling } from './sentinels';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
package/dist/index.js ADDED
@@ -0,0 +1,74 @@
1
+ import { aa2oa as t, addressesToAreas as a, addressesToCols as i, addressesToRows as s, areaToRange as l, areaToZone as n, buildInitialCells as p, buildInitialCellsFromOrigin as x, matrixShape as m, oa2aa as c, zoneToArea as u } from "./lib/spatial.js";
2
+ import { Time as d } from "./lib/time.js";
3
+ import { a2p as g, c2x as y, ch as C, p2a as R, r2y as h, rh as M, x2c as b, y2r as B } from "./lib/coords.js";
4
+ import { Registry as S, createBinding as A, createBook as E, createRegistry as I } from "./lib/book.js";
5
+ import { Sheet as O } from "./lib/sheet.js";
6
+ import { toCellCols as k, toCellMatrix as w, toCellObject as L, toCellRows as _, toValueCols as j, toValueMatrix as D, toValueObject as z, toValueRows as H } from "./lib/sheet_utils.js";
7
+ import { BaseFunction as U, BaseFunctionAsync as Y, conditionArg as Z, stripMatrix as q } from "./formula/functions/__base.js";
8
+ import { FormulaParser as G, Lexer as J, RangeEntity as K, RefEntity as Q, ValueEntity as W } from "./formula/evaluator.js";
9
+ import { FormulaError as $ } from "./formula/formula-error.js";
10
+ import { check as oe, createBooleanMask as re, eachMatrix as te, ensureBoolean as ae, ensureDate as ie, ensureNumber as se, ensureString as le } from "./formula/functions/__utils.js";
11
+ import { Policy as pe } from "./policy/core.js";
12
+ import { ThousandSeparatorPolicyMixin as me } from "./policy/thousand_separator.js";
13
+ import * as e from "./lib/operation.js";
14
+ import { DEFAULT_HISTORY_LIMIT as ue } from "./constants.js";
15
+ import { Pending as de, Spilling as Te } from "./sentinels.js";
16
+ export {
17
+ U as BaseFunction,
18
+ Y as BaseFunctionAsync,
19
+ ue as DEFAULT_HISTORY_LIMIT,
20
+ $ as FormulaError,
21
+ G as FormulaParser,
22
+ J as Lexer,
23
+ de as Pending,
24
+ pe as Policy,
25
+ K as RangeEntity,
26
+ Q as RefEntity,
27
+ S as Registry,
28
+ O as Sheet,
29
+ Te as Spilling,
30
+ me as ThousandSeparatorPolicyMixin,
31
+ d as Time,
32
+ W as ValueEntity,
33
+ g as a2p,
34
+ t as aa2oa,
35
+ a as addressesToAreas,
36
+ i as addressesToCols,
37
+ s as addressesToRows,
38
+ l as areaToRange,
39
+ n as areaToZone,
40
+ p as buildInitialCells,
41
+ x as buildInitialCellsFromOrigin,
42
+ y as c2x,
43
+ C as ch,
44
+ oe as check,
45
+ Z as conditionArg,
46
+ A as createBinding,
47
+ E as createBook,
48
+ re as createBooleanMask,
49
+ I as createRegistry,
50
+ te as eachMatrix,
51
+ ae as ensureBoolean,
52
+ ie as ensureDate,
53
+ se as ensureNumber,
54
+ le as ensureString,
55
+ m as matrixShape,
56
+ c as oa2aa,
57
+ e as operations,
58
+ R as p2a,
59
+ h as r2y,
60
+ M as rh,
61
+ q as stripMatrix,
62
+ k as toCellCols,
63
+ w as toCellMatrix,
64
+ L as toCellObject,
65
+ _ as toCellRows,
66
+ j as toValueCols,
67
+ D as toValueMatrix,
68
+ z as toValueObject,
69
+ H as toValueRows,
70
+ b as x2c,
71
+ B as y2r,
72
+ u as zoneToArea
73
+ };
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { AreaType, CSSPropertiesLike, PointType, RefLike, ZoneType } from '../types';
2
+ import { Sheet } from './sheet';
3
+ type AutofillStore = {
4
+ sheetReactive: RefLike<Sheet>;
5
+ choosing: PointType;
6
+ selectingZone: ZoneType;
7
+ };
8
+ export declare class Autofill {
9
+ private readonly src;
10
+ private readonly dst;
11
+ private readonly direction;
12
+ private readonly sheet;
13
+ constructor(store: AutofillStore, draggingTo: PointType);
14
+ get applied(): Sheet;
15
+ get wholeArea(): AreaType;
16
+ getCellStyle(target: PointType): CSSPropertiesLike;
17
+ private getDestinationArea;
18
+ private suggestDirection;
19
+ private getChangePatterns;
20
+ }
21
+ export {};
22
+ //# sourceMappingURL=autofill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autofill.d.ts","sourceRoot":"","sources":["../../src/lib/autofill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAgC,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACxH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,KAAK,aAAa,GAAG;IACnB,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,QAAQ,CAAC;CACzB,CAAC;AAgBF,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAClB,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS;IAYvD,IAAW,OAAO,IAAI,KAAK,CAiE1B;IAED,IAAW,SAAS,aAEnB;IAEM,YAAY,CAAC,MAAM,EAAE,SAAS;IAmErC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,iBAAiB;CA4F1B"}