@gridsheet/react-core 0.12.3 → 0.12.4-alpha.0

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 (307) hide show
  1. package/dist/components/Cell.d.ts.map +1 -1
  2. package/dist/components/Emitter.d.ts.map +1 -1
  3. package/dist/components/GridSheet.d.ts.map +1 -1
  4. package/dist/components/HeaderLeftCell.d.ts.map +1 -1
  5. package/dist/components/HeaderTopCell.d.ts.map +1 -1
  6. package/dist/components/Resizer.d.ts.map +1 -1
  7. package/dist/components/SearchBox.d.ts.map +1 -1
  8. package/dist/components/Tabular.d.ts.map +1 -1
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/formula/evaluator.d.ts.map +1 -1
  11. package/dist/formula/functions/__base.d.ts.map +1 -1
  12. package/dist/formula/solver.d.ts.map +1 -1
  13. package/dist/index.d.ts +1824 -1
  14. package/dist/index.js +5205 -11
  15. package/dist/lib/structs.d.ts.map +1 -1
  16. package/dist/lib/table.d.ts.map +1 -1
  17. package/dist/lib/time.d.ts.map +1 -1
  18. package/dist/lib/virtualization.d.ts.map +1 -1
  19. package/dist/parsers/core.d.ts.map +1 -1
  20. package/dist/renderers/core.d.ts.map +1 -1
  21. package/dist/store/actions.d.ts.map +1 -1
  22. package/dist/store/index.d.ts.map +1 -1
  23. package/dist/types.d.ts.map +1 -1
  24. package/package.json +13 -3
  25. package/dist/components/Cell.d.ts +0 -8
  26. package/dist/components/Cell.js +0 -199
  27. package/dist/components/Cell.js.map +0 -1
  28. package/dist/components/ContextMenu.d.ts +0 -3
  29. package/dist/components/ContextMenu.js +0 -207
  30. package/dist/components/ContextMenu.js.map +0 -1
  31. package/dist/components/Editor.d.ts +0 -3
  32. package/dist/components/Editor.js +0 -304
  33. package/dist/components/Editor.js.map +0 -1
  34. package/dist/components/Emitter.d.ts +0 -9
  35. package/dist/components/Emitter.js +0 -26
  36. package/dist/components/Emitter.js.map +0 -1
  37. package/dist/components/GridSheet.d.ts +0 -4
  38. package/dist/components/GridSheet.js +0 -110
  39. package/dist/components/GridSheet.js.map +0 -1
  40. package/dist/components/HeaderLeftCell.d.ts +0 -7
  41. package/dist/components/HeaderLeftCell.js +0 -67
  42. package/dist/components/HeaderLeftCell.js.map +0 -1
  43. package/dist/components/HeaderTopCell.d.ts +0 -7
  44. package/dist/components/HeaderTopCell.js +0 -68
  45. package/dist/components/HeaderTopCell.js.map +0 -1
  46. package/dist/components/Resizer.d.ts +0 -3
  47. package/dist/components/Resizer.js +0 -83
  48. package/dist/components/Resizer.js.map +0 -1
  49. package/dist/components/SearchBox.d.ts +0 -3
  50. package/dist/components/SearchBox.js +0 -52
  51. package/dist/components/SearchBox.js.map +0 -1
  52. package/dist/components/StoreInitializer.d.ts +0 -4
  53. package/dist/components/StoreInitializer.js +0 -68
  54. package/dist/components/StoreInitializer.js.map +0 -1
  55. package/dist/components/Tabular.d.ts +0 -9
  56. package/dist/components/Tabular.js +0 -84
  57. package/dist/components/Tabular.js.map +0 -1
  58. package/dist/constants.d.ts +0 -18
  59. package/dist/constants.js +0 -21
  60. package/dist/constants.js.map +0 -1
  61. package/dist/formula/evaluator.d.ts +0 -91
  62. package/dist/formula/evaluator.js +0 -541
  63. package/dist/formula/evaluator.js.map +0 -1
  64. package/dist/formula/functions/__base.d.ts +0 -23
  65. package/dist/formula/functions/__base.js +0 -16
  66. package/dist/formula/functions/__base.js.map +0 -1
  67. package/dist/formula/functions/__utils.d.ts +0 -6
  68. package/dist/formula/functions/__utils.js +0 -102
  69. package/dist/formula/functions/__utils.js.map +0 -1
  70. package/dist/formula/functions/abs.d.ts +0 -12
  71. package/dist/formula/functions/abs.js +0 -21
  72. package/dist/formula/functions/abs.js.map +0 -1
  73. package/dist/formula/functions/abs.spec.d.ts +0 -2
  74. package/dist/formula/functions/abs.spec.js +0 -29
  75. package/dist/formula/functions/abs.spec.js.map +0 -1
  76. package/dist/formula/functions/acos.d.ts +0 -12
  77. package/dist/formula/functions/acos.js +0 -29
  78. package/dist/formula/functions/acos.js.map +0 -1
  79. package/dist/formula/functions/add.d.ts +0 -13
  80. package/dist/formula/functions/add.js +0 -50
  81. package/dist/formula/functions/add.js.map +0 -1
  82. package/dist/formula/functions/and.d.ts +0 -19
  83. package/dist/formula/functions/and.js +0 -28
  84. package/dist/formula/functions/and.js.map +0 -1
  85. package/dist/formula/functions/asin.d.ts +0 -12
  86. package/dist/formula/functions/asin.js +0 -29
  87. package/dist/formula/functions/asin.js.map +0 -1
  88. package/dist/formula/functions/atan.d.ts +0 -12
  89. package/dist/formula/functions/atan.js +0 -26
  90. package/dist/formula/functions/atan.js.map +0 -1
  91. package/dist/formula/functions/atan2.d.ts +0 -12
  92. package/dist/formula/functions/atan2.js +0 -32
  93. package/dist/formula/functions/atan2.js.map +0 -1
  94. package/dist/formula/functions/average.d.ts +0 -19
  95. package/dist/formula/functions/average.js +0 -41
  96. package/dist/formula/functions/average.js.map +0 -1
  97. package/dist/formula/functions/col.d.ts +0 -14
  98. package/dist/formula/functions/col.js +0 -30
  99. package/dist/formula/functions/col.js.map +0 -1
  100. package/dist/formula/functions/concat.d.ts +0 -12
  101. package/dist/formula/functions/concat.js +0 -27
  102. package/dist/formula/functions/concat.js.map +0 -1
  103. package/dist/formula/functions/concatenate.d.ts +0 -19
  104. package/dist/formula/functions/concatenate.js +0 -25
  105. package/dist/formula/functions/concatenate.js.map +0 -1
  106. package/dist/formula/functions/cos.d.ts +0 -12
  107. package/dist/formula/functions/cos.js +0 -26
  108. package/dist/formula/functions/cos.js.map +0 -1
  109. package/dist/formula/functions/count.d.ts +0 -19
  110. package/dist/formula/functions/count.js +0 -35
  111. package/dist/formula/functions/count.js.map +0 -1
  112. package/dist/formula/functions/counta.d.ts +0 -19
  113. package/dist/formula/functions/counta.js +0 -35
  114. package/dist/formula/functions/counta.js.map +0 -1
  115. package/dist/formula/functions/countif.d.ts +0 -13
  116. package/dist/formula/functions/countif.js +0 -30
  117. package/dist/formula/functions/countif.js.map +0 -1
  118. package/dist/formula/functions/divide.d.ts +0 -12
  119. package/dist/formula/functions/divide.js +0 -33
  120. package/dist/formula/functions/divide.js.map +0 -1
  121. package/dist/formula/functions/eq.d.ts +0 -12
  122. package/dist/formula/functions/eq.js +0 -25
  123. package/dist/formula/functions/eq.js.map +0 -1
  124. package/dist/formula/functions/exp.d.ts +0 -12
  125. package/dist/formula/functions/exp.js +0 -28
  126. package/dist/formula/functions/exp.js.map +0 -1
  127. package/dist/formula/functions/gt.d.ts +0 -12
  128. package/dist/formula/functions/gt.js +0 -27
  129. package/dist/formula/functions/gt.js.map +0 -1
  130. package/dist/formula/functions/gte.d.ts +0 -12
  131. package/dist/formula/functions/gte.js +0 -27
  132. package/dist/formula/functions/gte.js.map +0 -1
  133. package/dist/formula/functions/hlookup.d.ts +0 -18
  134. package/dist/formula/functions/hlookup.js +0 -74
  135. package/dist/formula/functions/hlookup.js.map +0 -1
  136. package/dist/formula/functions/if.d.ts +0 -17
  137. package/dist/formula/functions/if.js +0 -36
  138. package/dist/formula/functions/if.js.map +0 -1
  139. package/dist/formula/functions/iferror.d.ts +0 -20
  140. package/dist/formula/functions/iferror.js +0 -41
  141. package/dist/formula/functions/iferror.js.map +0 -1
  142. package/dist/formula/functions/iferror.spec.d.ts +0 -2
  143. package/dist/formula/functions/iferror.spec.js +0 -61
  144. package/dist/formula/functions/iferror.spec.js.map +0 -1
  145. package/dist/formula/functions/len.d.ts +0 -12
  146. package/dist/formula/functions/len.js +0 -26
  147. package/dist/formula/functions/len.js.map +0 -1
  148. package/dist/formula/functions/lenb.d.ts +0 -12
  149. package/dist/formula/functions/lenb.js +0 -26
  150. package/dist/formula/functions/lenb.js.map +0 -1
  151. package/dist/formula/functions/ln.d.ts +0 -12
  152. package/dist/formula/functions/ln.js +0 -29
  153. package/dist/formula/functions/ln.js.map +0 -1
  154. package/dist/formula/functions/log.d.ts +0 -12
  155. package/dist/formula/functions/log.js +0 -35
  156. package/dist/formula/functions/log.js.map +0 -1
  157. package/dist/formula/functions/log10.d.ts +0 -12
  158. package/dist/formula/functions/log10.js +0 -29
  159. package/dist/formula/functions/log10.js.map +0 -1
  160. package/dist/formula/functions/lt.d.ts +0 -12
  161. package/dist/formula/functions/lt.js +0 -27
  162. package/dist/formula/functions/lt.js.map +0 -1
  163. package/dist/formula/functions/lte.d.ts +0 -12
  164. package/dist/formula/functions/lte.js +0 -27
  165. package/dist/formula/functions/lte.js.map +0 -1
  166. package/dist/formula/functions/max.d.ts +0 -19
  167. package/dist/formula/functions/max.js +0 -44
  168. package/dist/formula/functions/max.js.map +0 -1
  169. package/dist/formula/functions/min.d.ts +0 -19
  170. package/dist/formula/functions/min.js +0 -44
  171. package/dist/formula/functions/min.js.map +0 -1
  172. package/dist/formula/functions/minus.d.ts +0 -13
  173. package/dist/formula/functions/minus.js +0 -50
  174. package/dist/formula/functions/minus.js.map +0 -1
  175. package/dist/formula/functions/mod.d.ts +0 -12
  176. package/dist/formula/functions/mod.js +0 -31
  177. package/dist/formula/functions/mod.js.map +0 -1
  178. package/dist/formula/functions/mod.spec.d.ts +0 -2
  179. package/dist/formula/functions/mod.spec.js +0 -52
  180. package/dist/formula/functions/mod.spec.js.map +0 -1
  181. package/dist/formula/functions/multiply.d.ts +0 -12
  182. package/dist/formula/functions/multiply.js +0 -27
  183. package/dist/formula/functions/multiply.js.map +0 -1
  184. package/dist/formula/functions/ne.d.ts +0 -12
  185. package/dist/formula/functions/ne.js +0 -25
  186. package/dist/formula/functions/ne.js.map +0 -1
  187. package/dist/formula/functions/not.d.ts +0 -12
  188. package/dist/formula/functions/not.js +0 -30
  189. package/dist/formula/functions/not.js.map +0 -1
  190. package/dist/formula/functions/now.d.ts +0 -9
  191. package/dist/formula/functions/now.js +0 -21
  192. package/dist/formula/functions/now.js.map +0 -1
  193. package/dist/formula/functions/or.d.ts +0 -19
  194. package/dist/formula/functions/or.js +0 -28
  195. package/dist/formula/functions/or.js.map +0 -1
  196. package/dist/formula/functions/pi.d.ts +0 -9
  197. package/dist/formula/functions/pi.js +0 -19
  198. package/dist/formula/functions/pi.js.map +0 -1
  199. package/dist/formula/functions/power.d.ts +0 -12
  200. package/dist/formula/functions/power.js +0 -24
  201. package/dist/formula/functions/power.js.map +0 -1
  202. package/dist/formula/functions/product.d.ts +0 -19
  203. package/dist/formula/functions/product.js +0 -37
  204. package/dist/formula/functions/product.js.map +0 -1
  205. package/dist/formula/functions/radians.d.ts +0 -12
  206. package/dist/formula/functions/radians.js +0 -26
  207. package/dist/formula/functions/radians.js.map +0 -1
  208. package/dist/formula/functions/rand.d.ts +0 -9
  209. package/dist/formula/functions/rand.js +0 -19
  210. package/dist/formula/functions/rand.js.map +0 -1
  211. package/dist/formula/functions/round.d.ts +0 -17
  212. package/dist/formula/functions/round.js +0 -34
  213. package/dist/formula/functions/round.js.map +0 -1
  214. package/dist/formula/functions/rounddown.d.ts +0 -17
  215. package/dist/formula/functions/rounddown.js +0 -34
  216. package/dist/formula/functions/rounddown.js.map +0 -1
  217. package/dist/formula/functions/roundup.d.ts +0 -17
  218. package/dist/formula/functions/roundup.js +0 -34
  219. package/dist/formula/functions/roundup.js.map +0 -1
  220. package/dist/formula/functions/row.d.ts +0 -14
  221. package/dist/formula/functions/row.js +0 -30
  222. package/dist/formula/functions/row.js.map +0 -1
  223. package/dist/formula/functions/sin.d.ts +0 -12
  224. package/dist/formula/functions/sin.js +0 -26
  225. package/dist/formula/functions/sin.js.map +0 -1
  226. package/dist/formula/functions/sqrt.d.ts +0 -12
  227. package/dist/formula/functions/sqrt.js +0 -29
  228. package/dist/formula/functions/sqrt.js.map +0 -1
  229. package/dist/formula/functions/sum.d.ts +0 -19
  230. package/dist/formula/functions/sum.js +0 -44
  231. package/dist/formula/functions/sum.js.map +0 -1
  232. package/dist/formula/functions/sum.spec.d.ts +0 -2
  233. package/dist/formula/functions/sum.spec.js +0 -40
  234. package/dist/formula/functions/sum.spec.js.map +0 -1
  235. package/dist/formula/functions/sumif.d.ts +0 -18
  236. package/dist/formula/functions/sumif.js +0 -59
  237. package/dist/formula/functions/sumif.js.map +0 -1
  238. package/dist/formula/functions/tan.d.ts +0 -12
  239. package/dist/formula/functions/tan.js +0 -26
  240. package/dist/formula/functions/tan.js.map +0 -1
  241. package/dist/formula/functions/uminus.d.ts +0 -12
  242. package/dist/formula/functions/uminus.js +0 -23
  243. package/dist/formula/functions/uminus.js.map +0 -1
  244. package/dist/formula/functions/vlookup.d.ts +0 -18
  245. package/dist/formula/functions/vlookup.js +0 -74
  246. package/dist/formula/functions/vlookup.js.map +0 -1
  247. package/dist/formula/mapping.d.ts +0 -114
  248. package/dist/formula/mapping.js +0 -114
  249. package/dist/formula/mapping.js.map +0 -1
  250. package/dist/formula/solver.d.ts +0 -12
  251. package/dist/formula/solver.js +0 -64
  252. package/dist/formula/solver.js.map +0 -1
  253. package/dist/index.js.map +0 -1
  254. package/dist/lib/autofill.d.ts +0 -17
  255. package/dist/lib/autofill.js +0 -389
  256. package/dist/lib/autofill.js.map +0 -1
  257. package/dist/lib/clipboard.d.ts +0 -3
  258. package/dist/lib/clipboard.js +0 -45
  259. package/dist/lib/clipboard.js.map +0 -1
  260. package/dist/lib/converters.d.ts +0 -10
  261. package/dist/lib/converters.js +0 -127
  262. package/dist/lib/converters.js.map +0 -1
  263. package/dist/lib/structs.d.ts +0 -60
  264. package/dist/lib/structs.js +0 -251
  265. package/dist/lib/structs.js.map +0 -1
  266. package/dist/lib/table.d.ts +0 -299
  267. package/dist/lib/table.js +0 -989
  268. package/dist/lib/table.js.map +0 -1
  269. package/dist/lib/time.d.ts +0 -14
  270. package/dist/lib/time.js +0 -60
  271. package/dist/lib/time.js.map +0 -1
  272. package/dist/lib/virtualization.d.ts +0 -30
  273. package/dist/lib/virtualization.js +0 -114
  274. package/dist/lib/virtualization.js.map +0 -1
  275. package/dist/parsers/core.d.ts +0 -36
  276. package/dist/parsers/core.js +0 -123
  277. package/dist/parsers/core.js.map +0 -1
  278. package/dist/renderers/checkbox.d.ts +0 -5
  279. package/dist/renderers/checkbox.js +0 -10
  280. package/dist/renderers/checkbox.js.map +0 -1
  281. package/dist/renderers/core.d.ts +0 -48
  282. package/dist/renderers/core.js +0 -143
  283. package/dist/renderers/core.js.map +0 -1
  284. package/dist/renderers/thousand_separator.d.ts +0 -5
  285. package/dist/renderers/thousand_separator.js +0 -14
  286. package/dist/renderers/thousand_separator.js.map +0 -1
  287. package/dist/store/actions.d.ts +0 -198
  288. package/dist/store/actions.js +0 -519
  289. package/dist/store/actions.js.map +0 -1
  290. package/dist/store/helpers.d.ts +0 -28
  291. package/dist/store/helpers.js +0 -78
  292. package/dist/store/helpers.js.map +0 -1
  293. package/dist/store/index.d.ts +0 -11
  294. package/dist/store/index.js +0 -3
  295. package/dist/store/index.js.map +0 -1
  296. package/dist/styles/embedder.d.ts +0 -2
  297. package/dist/styles/embedder.js +0 -16
  298. package/dist/styles/embedder.js.map +0 -1
  299. package/dist/styles/minified.d.ts +0 -3
  300. package/dist/styles/minified.js +0 -4
  301. package/dist/styles/minified.js.map +0 -1
  302. package/dist/types.d.ts +0 -213
  303. package/dist/types.js +0 -2
  304. package/dist/types.js.map +0 -1
  305. package/dist/utils.d.ts +0 -2
  306. package/dist/utils.js +0 -7
  307. package/dist/utils.js.map +0 -1
@@ -1,59 +0,0 @@
1
- import { FormulaError } from "../evaluator";
2
- import { solveTable } from "../solver";
3
- import { Table } from "../../lib/table";
4
- import { BaseFunction } from "./__base";
5
- import { check } from "./__utils";
6
- export class SumifFunction extends BaseFunction {
7
- constructor() {
8
- super(...arguments);
9
- this.example = 'SUMIF(A1:A10,">20")';
10
- this.helpText = ["Returns the sum of a series of cells."];
11
- this.helpArgs = [
12
- { name: "range1", description: "A condition range." },
13
- {
14
- name: "condition",
15
- description: "A condition for summarization.",
16
- },
17
- {
18
- name: "range2",
19
- description: "A range to be summarized.",
20
- optional: true,
21
- },
22
- ];
23
- }
24
- validate() {
25
- if (this.bareArgs.length !== 2 && this.bareArgs.length !== 3) {
26
- throw new FormulaError("#N/A", "Number of arguments for SUMIF is incorrect.");
27
- }
28
- if (this.bareArgs[2] != undefined && this.bareArgs[2] instanceof Table) {
29
- throw new FormulaError("#N/A", "3rd argument must be range.");
30
- }
31
- }
32
- main(range, condition, sumRange) {
33
- if (!(range instanceof Table)) {
34
- return check(range, condition) ? range : 0;
35
- }
36
- const conditionMatrix = solveTable({ table: range });
37
- let sumMatrix = conditionMatrix;
38
- if (sumRange) {
39
- const [top, left] = [sumRange.top, sumRange.left];
40
- const area = {
41
- top,
42
- left,
43
- bottom: top + sumRange.getNumRows(),
44
- right: left + sumRange.getNumCols(),
45
- };
46
- sumMatrix = solveTable({ table: this.table.trim(area) });
47
- }
48
- let total = 0;
49
- conditionMatrix.forEach((row, y) => row.forEach((c, x) => {
50
- var _a;
51
- const s = ((_a = sumMatrix[y]) === null || _a === void 0 ? void 0 : _a[x]) || 0;
52
- if (typeof s === "number" && check(c, condition)) {
53
- total += s;
54
- }
55
- }));
56
- return total;
57
- }
58
- }
59
- //# sourceMappingURL=sumif.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sumif.js","sourceRoot":"","sources":["../../../src/formula/functions/sumif.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAA/C;;QACE,YAAO,GAAG,qBAAqB,CAAC;QAChC,aAAQ,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;YACrD;gBACE,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,gCAAgC;a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AC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1D;QACD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,eAAe,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACjC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;;YACnB,MAAM,CAAC,GAAG,CAAA,MAAA,SAAS,CAAC,CAAC,CAAC,0CAAG,CAAC,CAAC,KAAI,CAAC,CAAC;YACjC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE;gBAChD,KAAK,IAAI,CAAC,CAAC;aACZ;QACH,CAAC,CAAC,CACH,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- import { BaseFunction } from "./__base";
2
- export declare class TanFunction extends BaseFunction {
3
- example: string;
4
- helpText: string[];
5
- helpArgs: {
6
- name: string;
7
- description: string;
8
- }[];
9
- protected validate(): void;
10
- protected main(angle: number): number;
11
- }
12
- //# sourceMappingURL=tan.d.ts.map
@@ -1,26 +0,0 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class TanFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "TAN(1)";
8
- this.helpText = ["Returns the tan of the angle specified in radians."];
9
- this.helpArgs = [
10
- {
11
- name: "angle",
12
- description: "An angle in radians, at which you want the tan.",
13
- },
14
- ];
15
- }
16
- validate() {
17
- if (this.bareArgs.length !== 1) {
18
- throw new FormulaError("#N/A", "Number of arguments for TAN is incorrect.");
19
- }
20
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
21
- }
22
- main(angle) {
23
- return Math.tan(angle);
24
- }
25
- }
26
- //# sourceMappingURL=tan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tan.js","sourceRoot":"","sources":["../../../src/formula/functions/tan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,QAAQ,CAAC;QACnB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,iDAAiD;aAC/D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- import { BaseFunction } from "./__base";
2
- export declare class UminusFunction extends BaseFunction {
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;
11
- }
12
- //# sourceMappingURL=uminus.d.ts.map
@@ -1,23 +0,0 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class UminusFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "UMINUS(4)";
8
- this.helpText = ["Returns a number with positive and negative values reversed."];
9
- this.helpArgs = [
10
- { name: "value1", description: "A number that will be subtracted." },
11
- ];
12
- }
13
- validate() {
14
- if (this.bareArgs.length !== 1) {
15
- throw new FormulaError("#N/A", "A single numerical value is only required.");
16
- }
17
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
18
- }
19
- main(v1) {
20
- return -v1;
21
- }
22
- }
23
- //# sourceMappingURL=uminus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uminus.js","sourceRoot":"","sources":["../../../src/formula/functions/uminus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,cAAe,SAAQ,YAAY;IAAhD;;QACE,YAAO,GAAG,WAAW,CAAC;QACtB,aAAQ,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;SACrE,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,EAAU;QACvB,OAAO,CAAC,EAAE,CAAC;IACb,CAAC;CACF"}
@@ -1,18 +0,0 @@
1
- import { Table } from "../../lib/table";
2
- import { BaseFunction } from "./__base";
3
- export declare class VlookupFunction extends BaseFunction {
4
- example: string;
5
- helpText: string[];
6
- helpArgs: ({
7
- name: string;
8
- description: string;
9
- option?: undefined;
10
- } | {
11
- name: string;
12
- description: string;
13
- option: boolean;
14
- })[];
15
- protected validate(): void;
16
- protected main(key: any, range: Table, index: number, isSorted: boolean): any;
17
- }
18
- //# sourceMappingURL=vlookup.d.ts.map
@@ -1,74 +0,0 @@
1
- import { FormulaError } from "../evaluator";
2
- import { solveTable } from "../solver";
3
- import { Table } from "../../lib/table";
4
- import { BaseFunction } from "./__base";
5
- import { ensureBoolean, ensureNumber, stripTable } from "./__utils";
6
- export class VlookupFunction extends BaseFunction {
7
- constructor() {
8
- super(...arguments);
9
- this.example = "VLOOKUP(10003, A2:B26, 2, FALSE)";
10
- this.helpText = [
11
- "Searches vertically for the specified key in the first column of the range and returns the value of the specified cell in the same row.",
12
- ];
13
- this.helpArgs = [
14
- { name: "key", description: "Search key." },
15
- {
16
- name: "range",
17
- description: "A range for search",
18
- },
19
- {
20
- name: "index",
21
- description: "The index of the column in the range.",
22
- },
23
- {
24
- name: "is_sorted",
25
- description: "FALSE: Exact match. This is recommended. TRUE: Approximate match. Before you use an approximate match, sort your search key in ascending order. Otherwise, you may likely get a wrong return value.",
26
- option: true,
27
- },
28
- ];
29
- }
30
- validate() {
31
- if (this.bareArgs.length !== 3 && this.bareArgs.length !== 4) {
32
- throw new FormulaError("#N/A", "Number of arguments for VLOOKUP is incorrect.");
33
- }
34
- if (this.bareArgs[0] instanceof Table) {
35
- this.bareArgs[0] = stripTable(this.bareArgs[0]);
36
- }
37
- if (!(this.bareArgs[1] instanceof Table)) {
38
- throw new FormulaError("#REF!", "2nd argument must be range");
39
- }
40
- this.bareArgs[2] = ensureNumber(this.bareArgs[2]);
41
- this.bareArgs[3] = ensureBoolean(this.bareArgs[3], true);
42
- }
43
- main(key, range, index, isSorted) {
44
- var _a, _b, _c, _d;
45
- const matrix = solveTable({ table: range });
46
- if (isSorted) {
47
- let last = -1;
48
- for (let y = 0; y <= range.getNumRows(); y++) {
49
- const v = (_a = matrix[y]) === null || _a === void 0 ? void 0 : _a[0];
50
- if (v == null) {
51
- continue;
52
- }
53
- if (v <= key) {
54
- last = y;
55
- }
56
- else {
57
- break;
58
- }
59
- }
60
- if (last !== -1) {
61
- return (_b = matrix[last]) === null || _b === void 0 ? void 0 : _b[index - 1];
62
- }
63
- }
64
- else {
65
- for (let y = 0; y <= range.getNumRows(); y++) {
66
- if (((_c = matrix[y]) === null || _c === void 0 ? void 0 : _c[0]) === key) {
67
- return (_d = matrix[y]) === null || _d === void 0 ? void 0 : _d[index - 1];
68
- }
69
- }
70
- }
71
- throw new FormulaError("#N/A", `No values found for '${key}'.`);
72
- }
73
- }
74
- //# sourceMappingURL=vlookup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vlookup.js","sourceRoot":"","sources":["../../../src/formula/functions/vlookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,kCAAkC,CAAC;QAC7C,aAAQ,GAAG;YACT,yIAAyI;SAC1I,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE;YAC3C;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,oBAAoB;aAClC;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,uCAAuC;aACrD;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,WAAW,EACT,qMAAqM;gBACvM,MAAM,EAAE,IAAI;aACb;SACF,CAAC;IA8CJ,CAAC;IA5CW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,Q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aACF;YACD,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE;gBACf,OAAO,MAAA,MAAM,CAAC,IAAI,CAAC,0CAAG,KAAK,GAAG,CAAC,CAAC,CAAC;aAClC;SACF;aAAM;YACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC5C,IAAI,CAAA,MAAA,MAAM,CAAC,CAAC,CAAC,0CAAG,CAAC,CAAC,MAAK,GAAG,EAAE;oBAC1B,OAAO,MAAA,MAAM,CAAC,CAAC,CAAC,0CAAG,KAAK,GAAG,CAAC,CAAC,CAAC;iBAC/B;aACF;SACF;QACD,MAAM,IAAI,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAClE,CAAC;CACF"}
@@ -1,114 +0,0 @@
1
- import { AddFunction } from "./functions/add";
2
- import { MinusFunction } from "./functions/minus";
3
- import { MultiplyFunction } from "./functions/multiply";
4
- import { DivideFunction } from "./functions/divide";
5
- import { ModFunction } from "./functions/mod";
6
- import { SumFunction } from "./functions/sum";
7
- import { ConcatFunction } from "./functions/concat";
8
- import { ConcatenateFunction } from "./functions/concatenate";
9
- import { EqFunction } from "./functions/eq";
10
- import { NeFunction } from "./functions/ne";
11
- import { GtFunction } from "./functions/gt";
12
- import { GteFunction } from "./functions/gte";
13
- import { LtFunction } from "./functions/lt";
14
- import { LteFunction } from "./functions/lte";
15
- import { NowFunction } from "./functions/now";
16
- import { AndFunction } from "./functions/and";
17
- import { OrFunction } from "./functions/or";
18
- import { IfFunction } from "./functions/if";
19
- import { IfErrorFunction } from "./functions/iferror";
20
- import { NotFunction } from "./functions/not";
21
- import { CountFunction } from "./functions/count";
22
- import { CountifFunction } from "./functions/countif";
23
- import { SumifFunction } from "./functions/sumif";
24
- import { VlookupFunction } from "./functions/vlookup";
25
- import { HlookupFunction } from "./functions/hlookup";
26
- import { LogFunction } from "./functions/log";
27
- import { Log10Function } from "./functions/log10";
28
- import { LnFunction } from "./functions/ln";
29
- import { AbsFunction } from "./functions/abs";
30
- import { ProductFunction } from "./functions/product";
31
- import { RandFunction } from "./functions/rand";
32
- import { PiFunction } from "./functions/pi";
33
- import { ExpFunction } from "./functions/exp";
34
- import { RadiansFunction } from "./functions/radians";
35
- import { PowerFunction } from "./functions/power";
36
- import { SqrtFunction } from "./functions/sqrt";
37
- import { RoundFunction } from "./functions/round";
38
- import { RoundupFunction } from "./functions/roundup";
39
- import { RounddownFunction } from "./functions/rounddown";
40
- import { SinFunction } from "./functions/sin";
41
- import { CosFunction } from "./functions/cos";
42
- import { TanFunction } from "./functions/tan";
43
- import { AsinFunction } from "./functions/asin";
44
- import { AcosFunction } from "./functions/acos";
45
- import { AtanFunction } from "./functions/atan";
46
- import { Atan2Function } from "./functions/atan2";
47
- import { CountaFunction } from "./functions/counta";
48
- import { AverageFunction } from "./functions/average";
49
- import { MaxFunction } from "./functions/max";
50
- import { MinFunction } from "./functions/min";
51
- import { LenFunction } from "./functions/len";
52
- import { LenbFunction } from "./functions/lenb";
53
- import { UminusFunction } from "./functions/uminus";
54
- import { RowFunction } from "./functions/row";
55
- import { ColFunction } from "./functions/col";
56
- export declare const functions: {
57
- abs: typeof AbsFunction;
58
- add: typeof AddFunction;
59
- divide: typeof DivideFunction;
60
- mod: typeof ModFunction;
61
- minus: typeof MinusFunction;
62
- uminus: typeof UminusFunction;
63
- multiply: typeof MultiplyFunction;
64
- pow: typeof PowerFunction;
65
- power: typeof PowerFunction;
66
- sqrt: typeof SqrtFunction;
67
- sum: typeof SumFunction;
68
- sumif: typeof SumifFunction;
69
- max: typeof MaxFunction;
70
- min: typeof MinFunction;
71
- average: typeof AverageFunction;
72
- count: typeof CountFunction;
73
- counta: typeof CountaFunction;
74
- countif: typeof CountifFunction;
75
- product: typeof ProductFunction;
76
- concat: typeof ConcatFunction;
77
- concatenate: typeof ConcatenateFunction;
78
- eq: typeof EqFunction;
79
- ne: typeof NeFunction;
80
- gt: typeof GtFunction;
81
- gte: typeof GteFunction;
82
- lt: typeof LtFunction;
83
- lte: typeof LteFunction;
84
- and: typeof AndFunction;
85
- or: typeof OrFunction;
86
- round: typeof RoundFunction;
87
- rounddown: typeof RounddownFunction;
88
- roundup: typeof RoundupFunction;
89
- if: typeof IfFunction;
90
- iferror: typeof IfErrorFunction;
91
- not: typeof NotFunction;
92
- vlookup: typeof VlookupFunction;
93
- hlookup: typeof HlookupFunction;
94
- row: typeof RowFunction;
95
- col: typeof ColFunction;
96
- now: typeof NowFunction;
97
- rand: typeof RandFunction;
98
- log: typeof LogFunction;
99
- log10: typeof Log10Function;
100
- ln: typeof LnFunction;
101
- exp: typeof ExpFunction;
102
- pi: typeof PiFunction;
103
- radians: typeof RadiansFunction;
104
- sin: typeof SinFunction;
105
- cos: typeof CosFunction;
106
- tan: typeof TanFunction;
107
- asin: typeof AsinFunction;
108
- acos: typeof AcosFunction;
109
- atan: typeof AtanFunction;
110
- atan2: typeof Atan2Function;
111
- len: typeof LenFunction;
112
- lenb: typeof LenbFunction;
113
- };
114
- //# sourceMappingURL=mapping.d.ts.map
@@ -1,114 +0,0 @@
1
- import { AddFunction } from "./functions/add";
2
- import { MinusFunction } from "./functions/minus";
3
- import { MultiplyFunction } from "./functions/multiply";
4
- import { DivideFunction } from "./functions/divide";
5
- import { ModFunction } from "./functions/mod";
6
- import { SumFunction } from "./functions/sum";
7
- import { ConcatFunction } from "./functions/concat";
8
- import { ConcatenateFunction } from "./functions/concatenate";
9
- import { EqFunction } from "./functions/eq";
10
- import { NeFunction } from "./functions/ne";
11
- import { GtFunction } from "./functions/gt";
12
- import { GteFunction } from "./functions/gte";
13
- import { LtFunction } from "./functions/lt";
14
- import { LteFunction } from "./functions/lte";
15
- import { NowFunction } from "./functions/now";
16
- import { AndFunction } from "./functions/and";
17
- import { OrFunction } from "./functions/or";
18
- import { IfFunction } from "./functions/if";
19
- import { IfErrorFunction } from "./functions/iferror";
20
- import { NotFunction } from "./functions/not";
21
- import { CountFunction } from "./functions/count";
22
- import { CountifFunction } from "./functions/countif";
23
- import { SumifFunction } from "./functions/sumif";
24
- import { VlookupFunction } from "./functions/vlookup";
25
- import { HlookupFunction } from "./functions/hlookup";
26
- import { LogFunction } from "./functions/log";
27
- import { Log10Function } from "./functions/log10";
28
- import { LnFunction } from "./functions/ln";
29
- import { AbsFunction } from "./functions/abs";
30
- import { ProductFunction } from "./functions/product";
31
- import { RandFunction } from "./functions/rand";
32
- import { PiFunction } from "./functions/pi";
33
- import { ExpFunction } from "./functions/exp";
34
- import { RadiansFunction } from "./functions/radians";
35
- import { PowerFunction } from "./functions/power";
36
- import { SqrtFunction } from "./functions/sqrt";
37
- import { RoundFunction } from "./functions/round";
38
- import { RoundupFunction } from "./functions/roundup";
39
- import { RounddownFunction } from "./functions/rounddown";
40
- import { SinFunction } from "./functions/sin";
41
- import { CosFunction } from "./functions/cos";
42
- import { TanFunction } from "./functions/tan";
43
- import { AsinFunction } from "./functions/asin";
44
- import { AcosFunction } from "./functions/acos";
45
- import { AtanFunction } from "./functions/atan";
46
- import { Atan2Function } from "./functions/atan2";
47
- import { CountaFunction } from "./functions/counta";
48
- import { AverageFunction } from "./functions/average";
49
- import { MaxFunction } from "./functions/max";
50
- import { MinFunction } from "./functions/min";
51
- import { LenFunction } from "./functions/len";
52
- import { LenbFunction } from "./functions/lenb";
53
- import { UminusFunction } from "./functions/uminus";
54
- import { RowFunction } from "./functions/row";
55
- import { ColFunction } from "./functions/col";
56
- export const functions = {
57
- abs: AbsFunction,
58
- add: AddFunction,
59
- divide: DivideFunction,
60
- mod: ModFunction,
61
- minus: MinusFunction,
62
- uminus: UminusFunction,
63
- multiply: MultiplyFunction,
64
- pow: PowerFunction,
65
- power: PowerFunction,
66
- sqrt: SqrtFunction,
67
- sum: SumFunction,
68
- sumif: SumifFunction,
69
- max: MaxFunction,
70
- min: MinFunction,
71
- average: AverageFunction,
72
- count: CountFunction,
73
- counta: CountaFunction,
74
- countif: CountifFunction,
75
- product: ProductFunction,
76
- concat: ConcatFunction,
77
- concatenate: ConcatenateFunction,
78
- eq: EqFunction,
79
- ne: NeFunction,
80
- gt: GtFunction,
81
- gte: GteFunction,
82
- lt: LtFunction,
83
- lte: LteFunction,
84
- and: AndFunction,
85
- or: OrFunction,
86
- round: RoundFunction,
87
- rounddown: RounddownFunction,
88
- roundup: RoundupFunction,
89
- if: IfFunction,
90
- iferror: IfErrorFunction,
91
- not: NotFunction,
92
- vlookup: VlookupFunction,
93
- hlookup: HlookupFunction,
94
- row: RowFunction,
95
- col: ColFunction,
96
- now: NowFunction,
97
- rand: RandFunction,
98
- log: LogFunction,
99
- log10: Log10Function,
100
- ln: LnFunction,
101
- exp: ExpFunction,
102
- pi: PiFunction,
103
- radians: RadiansFunction,
104
- sin: SinFunction,
105
- cos: CosFunction,
106
- tan: TanFunction,
107
- asin: AsinFunction,
108
- acos: AcosFunction,
109
- atan: AtanFunction,
110
- atan2: Atan2Function,
111
- len: LenFunction,
112
- lenb: LenbFunction,
113
- };
114
- //# sourceMappingURL=mapping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../src/formula/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,E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,WAAW;IAChB,IAAI,EAAE,YAAY;CACnB,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Table } from "../lib/table";
2
- import { MatrixType } from "../types";
3
- export declare const solveFormula: ({ value, table, raise, }: {
4
- value: any;
5
- table: Table;
6
- raise?: boolean | undefined;
7
- }) => any;
8
- export declare const solveTable: ({ table, raise, }: {
9
- table: Table;
10
- raise?: boolean | undefined;
11
- }) => MatrixType<any>;
12
- //# sourceMappingURL=solver.d.ts.map
@@ -1,64 +0,0 @@
1
- import { Special } from "../constants";
2
- import { Table } from "../lib/table";
3
- import { FormulaError, Lexer, Parser } from "./evaluator";
4
- import { p2a } from "../lib/converters";
5
- const SOLVING = new Special("solving");
6
- export const solveFormula = ({ value, table, raise = true, }) => {
7
- var _a;
8
- let solved = value;
9
- if (typeof value === "string") {
10
- if (value.charAt(0) === "=") {
11
- try {
12
- const lexer = new Lexer(value.substring(1));
13
- lexer.tokenize();
14
- const parser = new Parser(lexer.tokens);
15
- const expr = parser.build();
16
- solved = (_a = expr === null || expr === void 0 ? void 0 : expr.evaluate) === null || _a === void 0 ? void 0 : _a.call(expr, { table });
17
- }
18
- catch (e) {
19
- if (raise) {
20
- throw e;
21
- }
22
- return null;
23
- }
24
- }
25
- }
26
- if (solved instanceof Table) {
27
- solved = solveTable({ table: solved, raise })[0][0];
28
- }
29
- return solved;
30
- };
31
- export const solveTable = ({ table, raise = true, }) => {
32
- const area = table.getArea();
33
- return table.getMatrixFlatten({ area, evaluates: false }).map((row, i) => {
34
- const y = area.top + i;
35
- return row.map((value, j) => {
36
- const x = area.left + j;
37
- const address = p2a({ y, x });
38
- const cache = table.getSolvedCache(address);
39
- try {
40
- if (cache === SOLVING) {
41
- throw new FormulaError("#RFF!", "References are circulating.", new Error(value));
42
- }
43
- else if (cache instanceof FormulaError) {
44
- throw cache;
45
- }
46
- else if (cache != null) {
47
- return cache;
48
- }
49
- table.setSolvedCache(address, SOLVING);
50
- const solved = solveFormula({ value, table, raise });
51
- table.setSolvedCache(address, solved);
52
- return solved;
53
- }
54
- catch (e) {
55
- table.setSolvedCache(address, e);
56
- if (raise) {
57
- throw e;
58
- }
59
- return null;
60
- }
61
- });
62
- });
63
- };
64
- //# sourceMappingURL=solver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"solver.js","sourceRoot":"","sources":["../../src/formula/solver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;AAEvC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,GAAG,IAAI,GAKb,EAAE,EAAE;;IACH,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAC3B,IAAI;gBACF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5C,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACjB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACxC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;gBAC5B,MAAM,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,qDAAG,EAAE,KAAK,EAAE,CAAC,CAAC;aACtC;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,KAAK,EAAE;oBACT,MAAM,CAAC,CAAC;iBAC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,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;gBACrD,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACtC,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,CAAC,EAAE;gBACV,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBACjC,IAAI,KAAK,EAAE;oBACT,MAAM,CAAC,CAAC;iBACT;gBACD,OAAO,IAAI,CAAC;aACb;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAqB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAmB,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAUhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { AreaType, PointType, StoreType } from "../types";
3
- import { Table } from "../lib/table";
4
- export declare class Autofill {
5
- private readonly src;
6
- private readonly dst;
7
- private readonly direction;
8
- private readonly table;
9
- constructor(store: StoreType, draggingTo: PointType);
10
- get applied(): Table;
11
- get wholeArea(): AreaType;
12
- getCellStyle(target: PointType): React.CSSProperties;
13
- private getDestinationArea;
14
- private suggestDirection;
15
- private getChangePatterns;
16
- }
17
- //# sourceMappingURL=autofill.d.ts.map