@gridsheet/functions 3.0.0-rc.5 → 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 (254) hide show
  1. package/README.md +75 -0
  2. package/dist/index.d.ts +2 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +87 -88
  5. package/dist/index.js.map +1 -1
  6. package/dist/information/index.d.ts +1 -1
  7. package/dist/information/index.d.ts.map +1 -1
  8. package/dist/information/isblank.d.ts +1 -1
  9. package/dist/information/isblank.d.ts.map +1 -1
  10. package/dist/information/isdate.d.ts +1 -1
  11. package/dist/information/isdate.d.ts.map +1 -1
  12. package/dist/information/isemail.d.ts +1 -1
  13. package/dist/information/isemail.d.ts.map +1 -1
  14. package/dist/information/iserr.d.ts +2 -2
  15. package/dist/information/iserr.d.ts.map +1 -1
  16. package/dist/information/iserror.d.ts +2 -2
  17. package/dist/information/iserror.d.ts.map +1 -1
  18. package/dist/information/isformula.d.ts +1 -1
  19. package/dist/information/isformula.d.ts.map +1 -1
  20. package/dist/information/islogical.d.ts +1 -1
  21. package/dist/information/islogical.d.ts.map +1 -1
  22. package/dist/information/isna.d.ts +2 -2
  23. package/dist/information/isna.d.ts.map +1 -1
  24. package/dist/information/isnontext.d.ts +1 -1
  25. package/dist/information/isnontext.d.ts.map +1 -1
  26. package/dist/information/isref.d.ts +2 -2
  27. package/dist/information/isref.d.ts.map +1 -1
  28. package/dist/information/istext.d.ts +1 -1
  29. package/dist/information/istext.d.ts.map +1 -1
  30. package/dist/information/n.d.ts +2 -2
  31. package/dist/information/n.d.ts.map +1 -1
  32. package/dist/information/na.d.ts +1 -1
  33. package/dist/information/na.d.ts.map +1 -1
  34. package/dist/information/sheets.d.ts +1 -1
  35. package/dist/information/sheets.d.ts.map +1 -1
  36. package/dist/logical/ifna.d.ts +1 -1
  37. package/dist/logical/ifna.d.ts.map +1 -1
  38. package/dist/logical/ifs.d.ts +1 -1
  39. package/dist/logical/ifs.d.ts.map +1 -1
  40. package/dist/logical/index.d.ts +1 -1
  41. package/dist/logical/index.d.ts.map +1 -1
  42. package/dist/logical/xor.d.ts +1 -1
  43. package/dist/logical/xor.d.ts.map +1 -1
  44. package/dist/lookup/column.d.ts +1 -1
  45. package/dist/lookup/column.d.ts.map +1 -1
  46. package/dist/lookup/columns.d.ts +2 -2
  47. package/dist/lookup/columns.d.ts.map +1 -1
  48. package/dist/lookup/hlookup.d.ts +1 -1
  49. package/dist/lookup/hlookup.d.ts.map +1 -1
  50. package/dist/lookup/index.d.ts +1 -1
  51. package/dist/lookup/index.d.ts.map +1 -1
  52. package/dist/lookup/index.js +1 -1
  53. package/dist/lookup/index.js.map +1 -1
  54. package/dist/lookup/indexFn.d.ts +2 -2
  55. package/dist/lookup/indexFn.d.ts.map +1 -1
  56. package/dist/lookup/match.d.ts +1 -1
  57. package/dist/lookup/match.d.ts.map +1 -1
  58. package/dist/lookup/row.d.ts +1 -1
  59. package/dist/lookup/row.d.ts.map +1 -1
  60. package/dist/lookup/rows.d.ts +2 -2
  61. package/dist/lookup/rows.d.ts.map +1 -1
  62. package/dist/lookup/sheet.d.ts +2 -2
  63. package/dist/lookup/sheet.d.ts.map +1 -1
  64. package/dist/lookup/vlookup.d.ts +1 -1
  65. package/dist/lookup/vlookup.d.ts.map +1 -1
  66. package/dist/math/__matrix_base.d.ts +1 -1
  67. package/dist/math/__matrix_base.d.ts.map +1 -1
  68. package/dist/math/acos.d.ts +1 -1
  69. package/dist/math/acos.d.ts.map +1 -1
  70. package/dist/math/asin.d.ts +1 -1
  71. package/dist/math/asin.d.ts.map +1 -1
  72. package/dist/math/atan.d.ts +1 -1
  73. package/dist/math/atan.d.ts.map +1 -1
  74. package/dist/math/atan2.d.ts +1 -1
  75. package/dist/math/atan2.d.ts.map +1 -1
  76. package/dist/math/base.d.ts +1 -1
  77. package/dist/math/base.d.ts.map +1 -1
  78. package/dist/math/cos.d.ts +1 -1
  79. package/dist/math/cos.d.ts.map +1 -1
  80. package/dist/math/countif.d.ts +1 -1
  81. package/dist/math/countif.d.ts.map +1 -1
  82. package/dist/math/countifs.d.ts +1 -1
  83. package/dist/math/countifs.d.ts.map +1 -1
  84. package/dist/math/even.d.ts +1 -1
  85. package/dist/math/even.d.ts.map +1 -1
  86. package/dist/math/exp.d.ts +1 -1
  87. package/dist/math/exp.d.ts.map +1 -1
  88. package/dist/math/fact.d.ts +1 -1
  89. package/dist/math/fact.d.ts.map +1 -1
  90. package/dist/math/index.d.ts +1 -1
  91. package/dist/math/index.d.ts.map +1 -1
  92. package/dist/math/index.js +1 -1
  93. package/dist/math/index.js.map +1 -1
  94. package/dist/math/int.d.ts +1 -1
  95. package/dist/math/int.d.ts.map +1 -1
  96. package/dist/math/iseven.d.ts +1 -1
  97. package/dist/math/iseven.d.ts.map +1 -1
  98. package/dist/math/isodd.d.ts +1 -1
  99. package/dist/math/isodd.d.ts.map +1 -1
  100. package/dist/math/lcm.d.ts +1 -1
  101. package/dist/math/lcm.d.ts.map +1 -1
  102. package/dist/math/ln.d.ts +1 -1
  103. package/dist/math/ln.d.ts.map +1 -1
  104. package/dist/math/log.d.ts +1 -1
  105. package/dist/math/log.d.ts.map +1 -1
  106. package/dist/math/log10.d.ts +1 -1
  107. package/dist/math/log10.d.ts.map +1 -1
  108. package/dist/math/mdeterm.d.ts +1 -1
  109. package/dist/math/mdeterm.d.ts.map +1 -1
  110. package/dist/math/minverse.d.ts +1 -1
  111. package/dist/math/minverse.d.ts.map +1 -1
  112. package/dist/math/mmult.d.ts +1 -1
  113. package/dist/math/mmult.d.ts.map +1 -1
  114. package/dist/math/mod.d.ts +1 -1
  115. package/dist/math/mod.d.ts.map +1 -1
  116. package/dist/math/odd.d.ts +1 -1
  117. package/dist/math/odd.d.ts.map +1 -1
  118. package/dist/math/pi.d.ts +1 -1
  119. package/dist/math/pi.d.ts.map +1 -1
  120. package/dist/math/product.d.ts +1 -1
  121. package/dist/math/product.d.ts.map +1 -1
  122. package/dist/math/radians.d.ts +1 -1
  123. package/dist/math/radians.d.ts.map +1 -1
  124. package/dist/math/rand.d.ts +1 -1
  125. package/dist/math/rand.d.ts.map +1 -1
  126. package/dist/math/round.d.ts +1 -1
  127. package/dist/math/round.d.ts.map +1 -1
  128. package/dist/math/rounddown.d.ts +1 -1
  129. package/dist/math/rounddown.d.ts.map +1 -1
  130. package/dist/math/roundup.d.ts +1 -1
  131. package/dist/math/roundup.d.ts.map +1 -1
  132. package/dist/math/sequence.d.ts +1 -1
  133. package/dist/math/sequence.d.ts.map +1 -1
  134. package/dist/math/sign.d.ts +1 -1
  135. package/dist/math/sign.d.ts.map +1 -1
  136. package/dist/math/sin.d.ts +1 -1
  137. package/dist/math/sin.d.ts.map +1 -1
  138. package/dist/math/sqrt.d.ts +1 -1
  139. package/dist/math/sqrt.d.ts.map +1 -1
  140. package/dist/math/sumif.d.ts +1 -1
  141. package/dist/math/sumif.d.ts.map +1 -1
  142. package/dist/math/sumifs.d.ts +1 -1
  143. package/dist/math/sumifs.d.ts.map +1 -1
  144. package/dist/math/sumproduct.d.ts +1 -1
  145. package/dist/math/sumproduct.d.ts.map +1 -1
  146. package/dist/math/sumsq.d.ts +1 -1
  147. package/dist/math/sumsq.d.ts.map +1 -1
  148. package/dist/math/tan.d.ts +1 -1
  149. package/dist/math/tan.d.ts.map +1 -1
  150. package/dist/math/transpose.d.ts +1 -1
  151. package/dist/math/transpose.d.ts.map +1 -1
  152. package/dist/math/trunc.d.ts +1 -1
  153. package/dist/math/trunc.d.ts.map +1 -1
  154. package/dist/math/unaryPercent.d.ts +1 -1
  155. package/dist/math/unaryPercent.d.ts.map +1 -1
  156. package/dist/math/uplus.d.ts +1 -1
  157. package/dist/math/uplus.d.ts.map +1 -1
  158. package/dist/statistics/averageif.d.ts +1 -1
  159. package/dist/statistics/averageif.d.ts.map +1 -1
  160. package/dist/statistics/averageifs.d.ts +2 -2
  161. package/dist/statistics/averageifs.d.ts.map +1 -1
  162. package/dist/statistics/correl.d.ts +1 -1
  163. package/dist/statistics/correl.d.ts.map +1 -1
  164. package/dist/statistics/covariance_p.d.ts +1 -1
  165. package/dist/statistics/covariance_p.d.ts.map +1 -1
  166. package/dist/statistics/covariance_s.d.ts +1 -1
  167. package/dist/statistics/covariance_s.d.ts.map +1 -1
  168. package/dist/statistics/index.d.ts +1 -1
  169. package/dist/statistics/index.d.ts.map +1 -1
  170. package/dist/statistics/index.js +1 -1
  171. package/dist/statistics/index.js.map +1 -1
  172. package/dist/statistics/median.d.ts +1 -1
  173. package/dist/statistics/median.d.ts.map +1 -1
  174. package/dist/statistics/mode_sngl.d.ts +1 -1
  175. package/dist/statistics/mode_sngl.d.ts.map +1 -1
  176. package/dist/statistics/percentile_inc.d.ts +1 -1
  177. package/dist/statistics/percentile_inc.d.ts.map +1 -1
  178. package/dist/statistics/quartile_inc.d.ts +1 -1
  179. package/dist/statistics/quartile_inc.d.ts.map +1 -1
  180. package/dist/statistics/rank_eq.d.ts +1 -1
  181. package/dist/statistics/rank_eq.d.ts.map +1 -1
  182. package/dist/statistics/rsq.d.ts +1 -1
  183. package/dist/statistics/rsq.d.ts.map +1 -1
  184. package/dist/statistics/stdev_p.d.ts +1 -1
  185. package/dist/statistics/stdev_p.d.ts.map +1 -1
  186. package/dist/statistics/stdev_s.d.ts +1 -1
  187. package/dist/statistics/stdev_s.d.ts.map +1 -1
  188. package/dist/statistics/t_test.d.ts +1 -1
  189. package/dist/statistics/t_test.d.ts.map +1 -1
  190. package/dist/statistics/var_p.d.ts +1 -1
  191. package/dist/statistics/var_p.d.ts.map +1 -1
  192. package/dist/statistics/var_s.d.ts +1 -1
  193. package/dist/statistics/var_s.d.ts.map +1 -1
  194. package/dist/text/char.d.ts +1 -1
  195. package/dist/text/char.d.ts.map +1 -1
  196. package/dist/text/clean.d.ts +1 -1
  197. package/dist/text/clean.d.ts.map +1 -1
  198. package/dist/text/concatenate.d.ts +1 -1
  199. package/dist/text/concatenate.d.ts.map +1 -1
  200. package/dist/text/exact.d.ts +1 -1
  201. package/dist/text/exact.d.ts.map +1 -1
  202. package/dist/text/index.d.ts +1 -1
  203. package/dist/text/index.d.ts.map +1 -1
  204. package/dist/text/index.js +1 -1
  205. package/dist/text/index.js.map +1 -1
  206. package/dist/text/join.d.ts +1 -1
  207. package/dist/text/join.d.ts.map +1 -1
  208. package/dist/text/lenb.d.ts +1 -1
  209. package/dist/text/lenb.d.ts.map +1 -1
  210. package/dist/text/lower.d.ts +2 -2
  211. package/dist/text/lower.d.ts.map +1 -1
  212. package/dist/text/proper.d.ts +1 -1
  213. package/dist/text/proper.d.ts.map +1 -1
  214. package/dist/text/replace.d.ts +1 -1
  215. package/dist/text/replace.d.ts.map +1 -1
  216. package/dist/text/rept.d.ts +1 -1
  217. package/dist/text/rept.d.ts.map +1 -1
  218. package/dist/text/trim.d.ts +2 -2
  219. package/dist/text/trim.d.ts.map +1 -1
  220. package/dist/text/unichar.d.ts +1 -1
  221. package/dist/text/unichar.d.ts.map +1 -1
  222. package/dist/text/unicode.d.ts +1 -1
  223. package/dist/text/unicode.d.ts.map +1 -1
  224. package/dist/text/upper.d.ts +2 -2
  225. package/dist/text/upper.d.ts.map +1 -1
  226. package/dist/time/date.d.ts +1 -1
  227. package/dist/time/date.d.ts.map +1 -1
  228. package/dist/time/day.d.ts +2 -2
  229. package/dist/time/day.d.ts.map +1 -1
  230. package/dist/time/days.d.ts +1 -1
  231. package/dist/time/days.d.ts.map +1 -1
  232. package/dist/time/hour.d.ts +2 -2
  233. package/dist/time/hour.d.ts.map +1 -1
  234. package/dist/time/index.d.ts +1 -1
  235. package/dist/time/index.d.ts.map +1 -1
  236. package/dist/time/index.js +41 -53
  237. package/dist/time/index.js.map +1 -1
  238. package/dist/time/minute.d.ts +2 -2
  239. package/dist/time/minute.d.ts.map +1 -1
  240. package/dist/time/month.d.ts +2 -2
  241. package/dist/time/month.d.ts.map +1 -1
  242. package/dist/time/second.d.ts +2 -2
  243. package/dist/time/second.d.ts.map +1 -1
  244. package/dist/time/time.d.ts +2 -2
  245. package/dist/time/time.d.ts.map +1 -1
  246. package/dist/time/today.d.ts +1 -1
  247. package/dist/time/today.d.ts.map +1 -1
  248. package/dist/time/workday.d.ts +1 -1
  249. package/dist/time/workday.d.ts.map +1 -1
  250. package/dist/time/year.d.ts +2 -2
  251. package/dist/time/year.d.ts.map +1 -1
  252. package/package.json +3 -3
  253. package/dist/time/__utils.d.ts +0 -6
  254. package/dist/time/__utils.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/text/concatenate.ts","../../src/text/lenb.ts","../../src/text/exact.ts","../../src/text/unicode.ts","../../src/text/replace.ts","../../src/text/clean.ts","../../src/text/char.ts","../../src/text/unichar.ts","../../src/text/rept.ts","../../src/text/join.ts","../../src/text/lower.ts","../../src/text/upper.ts","../../src/text/proper.ts","../../src/text/trim.ts","../../src/text/index.ts"],"sourcesContent":["import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the concatenation of the values.`;\n\nexport class ConcatenateFunction extends BaseFunction {\n example = 'CONCATENATE(\"Hello\", \"World\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'Values to concatenate.',\n acceptedTypes: ['string', 'number', 'boolean'],\n variadic: true,\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(...values: any[]) {\n return values.flat().map(String).join('');\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the number of bytes in the length of the string.`;\n\nexport class LenbFunction extends BaseFunction {\n example = 'LENB(A2)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'A text to be returned the length of the bytes.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = String(text);\n return encodeURIComponent(text).replace(/%../g, 'x').length;\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Tests whether two strings are exactly the same (case-sensitive). Returns TRUE or FALSE.`;\n\nexport class ExactFunction extends BaseFunction {\n example = 'EXACT(\"山\", A3)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text1', description: 'First string to compare.', acceptedTypes: ['string', 'number', 'boolean'] },\n { name: 'text2', description: 'Second string to compare.', acceptedTypes: ['string', 'number', 'boolean'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text1: any, text2: any) {\n return String(text1) === String(text2);\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the Unicode code point (decimal) of the first character of the text.\nNumbers passed as argument are treated as strings.`;\n\nexport class UnicodeFunction extends BaseFunction {\n example = 'UNICODE(\"A\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The text whose first character Unicode value is returned.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = ensureString(text);\n if (text.length === 0) {\n throw new FormulaError('#VALUE!', 'UNICODE: text must not be empty.');\n }\n const codePoint = text.codePointAt(0);\n if (codePoint === undefined) {\n throw new FormulaError('#VALUE!', 'UNICODE: unable to determine Unicode value.');\n }\n return codePoint;\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString, ensureNumber } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Replaces part of a text string with a different text string.\nposition is 1-based.`;\n\nexport class ReplaceFunction extends BaseFunction {\n example = 'REPLACE(\"Hello World\", 7, 5, \"Excel\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text', description: 'The original text string.', acceptedTypes: ['string'] },\n { name: 'position', description: 'The 1-based position at which to start replacing.', acceptedTypes: ['number'] },\n { name: 'length', description: 'The number of characters to replace.', acceptedTypes: ['number'] },\n { name: 'new_text', description: 'The replacement text.', acceptedTypes: ['string'] },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n args = super.validate(args);\n args[0] = ensureString(args[0]);\n args[1] = ensureNumber(args[1]);\n args[2] = ensureNumber(args[2]);\n args[3] = ensureString(args[3]);\n return args;\n }\n\n protected main(text: string, position: number, length: number, newText: string) {\n // Convert to array of Unicode code points to handle surrogate pairs correctly\n const chars = [...text];\n const start = Math.max(0, position - 1);\n chars.splice(start, length, newText);\n return chars.join('');\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Removes all non-printable ASCII characters (code points 0–31) from text.`;\n\nexport class CleanFunction extends BaseFunction {\n example = 'CLEAN(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The text from which to remove non-printable characters.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = String(text);\n // Remove ASCII control characters (U+0000–U+001F)\n\n return text.replace(/[\\x00-\\x1F]/g, '');\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureNumber } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Converts a number to a character according to the current Unicode sheet.`;\n\nexport class CharFunction extends BaseFunction {\n example = 'CHAR(65)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'number', description: 'The Unicode code point to convert to a character.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(number: number) {\n const codePoint = Math.trunc(number);\n if (codePoint < 1 || codePoint > 0x10ffff) {\n throw new FormulaError('#VALUE!', `CHAR: ${number} is not a valid Unicode code point.`);\n }\n return String.fromCodePoint(codePoint);\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the Unicode character corresponding to the given numeric code point.`;\n\nexport class UnicharFunction extends BaseFunction {\n example = 'UNICHAR(127843)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'number', description: 'The Unicode code point (decimal) to convert.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(number: number) {\n const codePoint = Math.trunc(number);\n if (codePoint < 1 || codePoint > 0x10ffff) {\n throw new FormulaError('#VALUE!', `UNICHAR: ${number} is not a valid Unicode code point.`);\n }\n return String.fromCodePoint(codePoint);\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString, ensureNumber } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Repeats text a specified number of times.`;\n\nexport class ReptFunction extends BaseFunction {\n example = 'REPT(\"ha\", 3)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text', description: 'The text to repeat.', acceptedTypes: ['string'] },\n { name: 'number_of_times', description: 'The number of times to repeat the text.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n args = super.validate(args);\n if (args[1] < 0) {\n throw new FormulaError('#VALUE!', 'Number of times must be non-negative.');\n }\n return args;\n }\n\n protected main(text: string, times: number) {\n text = ensureString(text);\n times = ensureNumber(times);\n return text.repeat(Math.trunc(times));\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { stripMatrix, ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Joins the elements of one or more 1D arrays or values using a delimiter.\nIf the delimiter is omitted the result is similar to CONCATENATE.`;\n\nexport class JoinFunction extends BaseFunction {\n example = 'JOIN(\", \", A1:A5)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'delimiter', description: 'The string to place between joined values.', acceptedTypes: ['string'] },\n {\n name: 'value_or_array',\n description: 'Values or arrays to join.',\n takesMatrix: true,\n acceptedTypes: ['any', 'matrix'],\n variadic: true,\n },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n const validated = super.validate(args);\n for (let i = 1; i < validated.length; i++) {\n const matrix = this.toMatrix(validated[i]);\n if (matrix.length > 1 && matrix[0].length > 1) {\n throw new FormulaError('#VALUE!', 'JOIN requires each value_or_array argument to be a single row or column.');\n }\n }\n return validated;\n }\n\n protected main(delimiter: string, ...rest: any[]) {\n const parts: string[] = [];\n for (const arg of rest) {\n this.eachMatrix(arg, (v: any) => {\n parts.push(ensureString(stripMatrix(v, this.at)));\n });\n }\n return parts.join(delimiter);\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Converts all characters in a string to lowercase.`;\n\nexport class LowerFunction extends BaseFunction {\n example = 'LOWER(\"Hello World\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to lowercase.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.toLowerCase();\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Converts all characters in a string to uppercase.`;\n\nexport class UpperFunction extends BaseFunction {\n example = 'UPPER(\"hello world\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to uppercase.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.toUpperCase();\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Capitalizes the first letter of each word in a string.`;\n\nexport class ProperFunction extends BaseFunction {\n example = 'PROPER(\"hello world\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to title case.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = ensureString(text);\n return text.replace(/\\p{L}+/gu, (word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase());\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureString } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Removes leading and trailing spaces from a string.`;\n\nexport class TrimFunction extends BaseFunction {\n example = 'TRIM(\" Hello World \")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string from which to remove leading and trailing spaces.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.trim();\n }\n}\n","import type { FunctionMapping } from '@gridsheet/react-core';\nimport { ConcatenateFunction } from './concatenate';\nimport { LenbFunction } from './lenb';\nimport { ExactFunction } from './exact';\nimport { UnicodeFunction } from './unicode';\nimport { ReplaceFunction } from './replace';\nimport { CleanFunction } from './clean';\nimport { CharFunction } from './char';\nimport { UnicharFunction } from './unichar';\nimport { ReptFunction } from './rept';\nimport { JoinFunction } from './join';\nimport { LowerFunction } from './lower';\nimport { UpperFunction } from './upper';\nimport { ProperFunction } from './proper';\nimport { TrimFunction } from './trim';\n\nexport const textFunctions: FunctionMapping = {\n concatenate: ConcatenateFunction,\n lenb: LenbFunction,\n exact: ExactFunction,\n unicode: UnicodeFunction,\n replace: ReplaceFunction,\n clean: CleanFunction,\n char: CharFunction,\n unichar: UnicharFunction,\n rept: ReptFunction,\n join: JoinFunction,\n lower: LowerFunction,\n upper: UpperFunction,\n proper: ProperFunction,\n trim: TrimFunction,\n};\n\nexport default textFunctions;\n"],"names":["description","ConcatenateFunction","BaseFunction","values","LenbFunction","text","ExactFunction","text1","text2","UnicodeFunction","ensureString","FormulaError","codePoint","ReplaceFunction","args","ensureNumber","position","length","newText","chars","start","CleanFunction","CharFunction","number","UnicharFunction","ReptFunction","times","JoinFunction","validated","matrix","delimiter","rest","parts","arg","v","stripMatrix","LowerFunction","UpperFunction","ProperFunction","word","TrimFunction","textFunctions"],"mappings":";AAGA,MAAMA,IAAc;AAEb,MAAMC,UAA4BC,EAAa;AAAA,EAA/C,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UAAA,iCACI,KAAA,cAAAF,GACuB,KAAA,OAAA;AAAA,MACnC;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,eAAe,CAAC,UAAU,UAAU,SAAS;AAAA,QAC7C,UAAU;AAAA,MAAA;AAAA,IAEd,GAC6B,KAAA,WAAA;AAAA,EAAA;AAAA,EAEnB,QAAQG,GAAe;AAC/B,WAAOA,EAAO,OAAO,IAAI,MAAM,EAAE,KAAK,EAAE;AAAA,EAAA;AAE5C;AClBA,MAAMH,IAAc;AAEb,MAAMI,UAAqBF,EAAa;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UAAA,YACI,KAAA,cAAAF,GACuB,KAAA,OAAA;AAAA,MACn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e,CAAC,UAAU,UAAU,SAAS;AAAA,MAAA;AAAA,IAEjD,GAC6B,KAAA,WAAA;AAAA,EAAA;AAAA,EAEnB,KAAKK,GAAW;AACxB,WAAAA,IAAOK,EAAaL,CAAI,GACjBA,EAAK,QAAQ,WAAA,WAAA,IAAA,GAAY,CAACkC,MAAiBA,EAAK,OAAO,CAAC,EAAE,gBAAgBA,EAAK,MAAM,CAAC,EAAE,aAAa;AAAA,EAAA;AAEhH;AClBA,MAAMvC,IAAc;AAEb,MAAMwC,UAAqBtC,EAAa;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UAAA,2BACI,KAAA,cAAAF,GACuB,KAAA,OAAA;AAAA,MACnC;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,eAAe,CAAC,UAAU,UAAU,SAAS;AAAA,MAAA;AAAA,IAEjD,GAC6B,KAAA,WAAA;AAAA,EAAA;AAAA,EAEnB,KAAKK,GAAW;AAExB,WADUK,EAAaL,CAAI,EAClB,KAAK;AAAA,EAAA;AAElB;ACNO,MAAMoC,IAAiC;AAAA,EAC5C,aAAaxC;AAAA,EACb,MAAMG;AAAA,EACN,OAAOE;AAAA,EACP,SAASG;AAAA,EACT,SAASI;AAAA,EACT,OAAOQ;AAAA,EACP,MAAMC;AAAA,EACN,SAASE;AAAA,EACT,MAAMC;AAAA,EACN,MAAME;AAAA,EACN,OAAOS;AAAA,EACP,OAAOC;AAAA,EACP,QAAQC;AAAA,EACR,MAAME;AACR;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/text/concatenate.ts","../../src/text/lenb.ts","../../src/text/exact.ts","../../src/text/unicode.ts","../../src/text/replace.ts","../../src/text/clean.ts","../../src/text/char.ts","../../src/text/unichar.ts","../../src/text/rept.ts","../../src/text/join.ts","../../src/text/lower.ts","../../src/text/upper.ts","../../src/text/proper.ts","../../src/text/trim.ts","../../src/text/index.ts"],"sourcesContent":["import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the concatenation of the values.`;\n\nexport class ConcatenateFunction extends BaseFunction {\n example = 'CONCATENATE(\"Hello\", \"World\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'Values to concatenate.',\n acceptedTypes: ['string', 'number', 'boolean'],\n variadic: true,\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(...values: any[]) {\n return values.flat().map(String).join('');\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the number of bytes in the length of the string.`;\n\nexport class LenbFunction extends BaseFunction {\n example = 'LENB(A2)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'A text to be returned the length of the bytes.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = String(text);\n return encodeURIComponent(text).replace(/%../g, 'x').length;\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Tests whether two strings are exactly the same (case-sensitive). Returns TRUE or FALSE.`;\n\nexport class ExactFunction extends BaseFunction {\n example = 'EXACT(\"山\", A3)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text1', description: 'First string to compare.', acceptedTypes: ['string', 'number', 'boolean'] },\n { name: 'text2', description: 'Second string to compare.', acceptedTypes: ['string', 'number', 'boolean'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text1: any, text2: any) {\n return String(text1) === String(text2);\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the Unicode code point (decimal) of the first character of the text.\nNumbers passed as argument are treated as strings.`;\n\nexport class UnicodeFunction extends BaseFunction {\n example = 'UNICODE(\"A\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The text whose first character Unicode value is returned.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = ensureString(text);\n if (text.length === 0) {\n throw new FormulaError('#VALUE!', 'UNICODE: text must not be empty.');\n }\n const codePoint = text.codePointAt(0);\n if (codePoint === undefined) {\n throw new FormulaError('#VALUE!', 'UNICODE: unable to determine Unicode value.');\n }\n return codePoint;\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString, ensureNumber } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Replaces part of a text string with a different text string.\nposition is 1-based.`;\n\nexport class ReplaceFunction extends BaseFunction {\n example = 'REPLACE(\"Hello World\", 7, 5, \"Excel\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text', description: 'The original text string.', acceptedTypes: ['string'] },\n { name: 'position', description: 'The 1-based position at which to start replacing.', acceptedTypes: ['number'] },\n { name: 'length', description: 'The number of characters to replace.', acceptedTypes: ['number'] },\n { name: 'new_text', description: 'The replacement text.', acceptedTypes: ['string'] },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n args = super.validate(args);\n args[0] = ensureString(args[0]);\n args[1] = ensureNumber(args[1]);\n args[2] = ensureNumber(args[2]);\n args[3] = ensureString(args[3]);\n return args;\n }\n\n protected main(text: string, position: number, length: number, newText: string) {\n // Convert to array of Unicode code points to handle surrogate pairs correctly\n const chars = [...text];\n const start = Math.max(0, position - 1);\n chars.splice(start, length, newText);\n return chars.join('');\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Removes all non-printable ASCII characters (code points 0–31) from text.`;\n\nexport class CleanFunction extends BaseFunction {\n example = 'CLEAN(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The text from which to remove non-printable characters.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = String(text);\n // Remove ASCII control characters (U+0000–U+001F)\n\n return text.replace(/[\\x00-\\x1F]/g, '');\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureNumber } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Converts a number to a character according to the current Unicode sheet.`;\n\nexport class CharFunction extends BaseFunction {\n example = 'CHAR(65)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'number', description: 'The Unicode code point to convert to a character.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(number: number) {\n const codePoint = Math.trunc(number);\n if (codePoint < 1 || codePoint > 0x10ffff) {\n throw new FormulaError('#VALUE!', `CHAR: ${number} is not a valid Unicode code point.`);\n }\n return String.fromCodePoint(codePoint);\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the Unicode character corresponding to the given numeric code point.`;\n\nexport class UnicharFunction extends BaseFunction {\n example = 'UNICHAR(127843)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'number', description: 'The Unicode code point (decimal) to convert.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected main(number: number) {\n const codePoint = Math.trunc(number);\n if (codePoint < 1 || codePoint > 0x10ffff) {\n throw new FormulaError('#VALUE!', `UNICHAR: ${number} is not a valid Unicode code point.`);\n }\n return String.fromCodePoint(codePoint);\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString, ensureNumber } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Repeats text a specified number of times.`;\n\nexport class ReptFunction extends BaseFunction {\n example = 'REPT(\"ha\", 3)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'text', description: 'The text to repeat.', acceptedTypes: ['string'] },\n { name: 'number_of_times', description: 'The number of times to repeat the text.', acceptedTypes: ['number'] },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n args = super.validate(args);\n if (args[1] < 0) {\n throw new FormulaError('#VALUE!', 'Number of times must be non-negative.');\n }\n return args;\n }\n\n protected main(text: string, times: number) {\n text = ensureString(text);\n times = ensureNumber(times);\n return text.repeat(Math.trunc(times));\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { stripMatrix, ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Joins the elements of one or more 1D arrays or values using a delimiter.\nIf the delimiter is omitted the result is similar to CONCATENATE.`;\n\nexport class JoinFunction extends BaseFunction {\n example = 'JOIN(\", \", A1:A5)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'delimiter', description: 'The string to place between joined values.', acceptedTypes: ['string'] },\n {\n name: 'value_or_array',\n description: 'Values or arrays to join.',\n takesMatrix: true,\n acceptedTypes: ['any', 'matrix'],\n variadic: true,\n },\n ];\n category: FunctionCategory = 'text';\n\n protected validate(args: any[]): any[] {\n const validated = super.validate(args);\n for (let i = 1; i < validated.length; i++) {\n const matrix = this.toMatrix(validated[i]);\n if (matrix.length > 1 && matrix[0].length > 1) {\n throw new FormulaError('#VALUE!', 'JOIN requires each value_or_array argument to be a single row or column.');\n }\n }\n return validated;\n }\n\n protected main(delimiter: string, ...rest: any[]) {\n const parts: string[] = [];\n for (const arg of rest) {\n this.eachMatrix(arg, (v: any) => {\n parts.push(ensureString(stripMatrix(v, this.at)));\n });\n }\n return parts.join(delimiter);\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Converts all characters in a string to lowercase.`;\n\nexport class LowerFunction extends BaseFunction {\n example = 'LOWER(\"Hello World\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to lowercase.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.toLowerCase();\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Converts all characters in a string to uppercase.`;\n\nexport class UpperFunction extends BaseFunction {\n example = 'UPPER(\"hello world\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to uppercase.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.toUpperCase();\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Capitalizes the first letter of each word in a string.`;\n\nexport class ProperFunction extends BaseFunction {\n example = 'PROPER(\"hello world\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string to convert to title case.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n text = ensureString(text);\n return text.replace(/\\p{L}+/gu, (word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase());\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureString } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Removes leading and trailing spaces from a string.`;\n\nexport class TrimFunction extends BaseFunction {\n example = 'TRIM(\" Hello World \")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'text',\n description: 'The string from which to remove leading and trailing spaces.',\n acceptedTypes: ['string', 'number', 'boolean'],\n },\n ];\n category: FunctionCategory = 'text';\n\n protected main(text: any) {\n const t = ensureString(text);\n return t.trim();\n }\n}\n","import type { FunctionMapping } from '@gridsheet/core';\nimport { ConcatenateFunction } from './concatenate';\nimport { LenbFunction } from './lenb';\nimport { ExactFunction } from './exact';\nimport { UnicodeFunction } from './unicode';\nimport { ReplaceFunction } from './replace';\nimport { CleanFunction } from './clean';\nimport { CharFunction } from './char';\nimport { UnicharFunction } from './unichar';\nimport { ReptFunction } from './rept';\nimport { JoinFunction } from './join';\nimport { LowerFunction } from './lower';\nimport { UpperFunction } from './upper';\nimport { ProperFunction } from './proper';\nimport { TrimFunction } from './trim';\n\nexport const textFunctions: FunctionMapping = {\n concatenate: ConcatenateFunction,\n lenb: LenbFunction,\n exact: ExactFunction,\n unicode: UnicodeFunction,\n replace: ReplaceFunction,\n clean: CleanFunction,\n char: CharFunction,\n unichar: UnicharFunction,\n rept: ReptFunction,\n join: JoinFunction,\n lower: LowerFunction,\n upper: UpperFunction,\n proper: ProperFunction,\n trim: TrimFunction,\n};\n\nexport default textFunctions;\n"],"names":["description","ConcatenateFunction","BaseFunction","values","LenbFunction","text","ExactFunction","text1","text2","UnicodeFunction","ensureString","FormulaError","codePoint","ReplaceFunction","args","ensureNumber","position","length","newText","chars","start","CleanFunction","CharFunction","number","UnicharFunction","ReptFunction","times","JoinFunction","validated","matrix","delimiter","rest","parts","arg","v","stripMatrix","LowerFunction","UpperFunction","ProperFunction","word","TrimFunction","textFunctions"],"mappings":";AAGA,MAAMA,IAAc;AAEb,MAAMC,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AAA,EACb,MAAMG;AAAA,EACN,OAAOE;AAAA,EACP,SAASG;AAAA,EACT,SAASI;AAAA,EACT,OAAOQ;AAAA,EACP,MAAMC;AAAA,EACN,SAASE;AAAA,EACT,MAAMC;AAAA,EACN,MAAME;AAAA,EACN,OAAOS;AAAA,EACP,OAAOC;AAAA,EACP,QAAQC;AAAA,EACR,MAAME;AACR;"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class JoinFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../src/text/join.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAuB;IAC9B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAShC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAWtC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CASjD"}
1
+ {"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../src/text/join.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAuB;IAC9B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAShC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAWtC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CASjD"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class LenbFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"lenb.d.ts","sourceRoot":"","sources":["../../src/text/lenb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAc;IACrB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
1
+ {"version":3,"file":"lenb.d.ts","sourceRoot":"","sources":["../../src/text/lenb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAc;IACrB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class LowerFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(text: any): string;
7
+ protected main(text: any): any;
8
8
  }
9
9
  //# sourceMappingURL=lower.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lower.d.ts","sourceRoot":"","sources":["../../src/text/lower.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAA0B;IACjC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
1
+ {"version":3,"file":"lower.d.ts","sourceRoot":"","sources":["../../src/text/lower.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAA0B;IACjC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class ProperFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"proper.d.ts","sourceRoot":"","sources":["../../src/text/proper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,cAAe,SAAQ,YAAY;IAC9C,OAAO,SAA2B;IAClC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
1
+ {"version":3,"file":"proper.d.ts","sourceRoot":"","sources":["../../src/text/proper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,cAAe,SAAQ,YAAY;IAC9C,OAAO,SAA2B;IAClC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class ReplaceFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/text/replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAA2C;IAClD,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAKhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAStC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAO/E"}
1
+ {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/text/replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAA2C;IAClD,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAKhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAStC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAO/E"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class ReptFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"rept.d.ts","sourceRoot":"","sources":["../../src/text/rept.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAmB;IAC1B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAGhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAQtC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3C"}
1
+ {"version":3,"file":"rept.d.ts","sourceRoot":"","sources":["../../src/text/rept.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAmB;IAC1B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAGhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAQtC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3C"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class TrimFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(text: any): string;
7
+ protected main(text: any): any;
8
8
  }
9
9
  //# sourceMappingURL=trim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/text/trim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAA6B;IACpC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
1
+ {"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/text/trim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAA6B;IACpC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class UnicharFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"unichar.d.ts","sourceRoot":"","sources":["../../src/text/unichar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAqB;IAC5B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAEhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM;CAO9B"}
1
+ {"version":3,"file":"unichar.d.ts","sourceRoot":"","sources":["../../src/text/unichar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAqB;IAC5B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAEhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM;CAO9B"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class UnicodeFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"unicode.d.ts","sourceRoot":"","sources":["../../src/text/unicode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAkB;IACzB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAWzB"}
1
+ {"version":3,"file":"unicode.d.ts","sourceRoot":"","sources":["../../src/text/unicode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAkB;IACzB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAWzB"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class UpperFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(text: any): string;
7
+ protected main(text: any): any;
8
8
  }
9
9
  //# sourceMappingURL=upper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upper.d.ts","sourceRoot":"","sources":["../../src/text/upper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAA0B;IACjC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
1
+ {"version":3,"file":"upper.d.ts","sourceRoot":"","sources":["../../src/text/upper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAA0B;IACjC,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAIzB"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class DateFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/time/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAuB;IAC9B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAQhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAIxD"}
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/time/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAuB;IAC9B,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAQhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAIxD"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class DayFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(date: any): number;
7
+ protected main(date: any): any;
8
8
  }
9
9
  //# sourceMappingURL=day.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"day.d.ts","sourceRoot":"","sources":["../../src/time/day.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAa;IACpB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAEhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAGzB"}
1
+ {"version":3,"file":"day.d.ts","sourceRoot":"","sources":["../../src/time/day.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAa;IACpB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAEhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAGzB"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class DaysFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"days.d.ts","sourceRoot":"","sources":["../../src/time/days.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAkB;IACzB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAGhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;CAK5C"}
1
+ {"version":3,"file":"days.d.ts","sourceRoot":"","sources":["../../src/time/days.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAkB;IACzB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAGhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;CAK5C"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class HourFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(time: any): number;
7
+ protected main(time: any): any;
8
8
  }
9
9
  //# sourceMappingURL=hour.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hour.d.ts","sourceRoot":"","sources":["../../src/time/hour.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAc;IACrB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAGzB"}
1
+ {"version":3,"file":"hour.d.ts","sourceRoot":"","sources":["../../src/time/hour.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAc;IACrB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAMhC;IACF,QAAQ,EAAE,gBAAgB,CAAU;IAEpC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG;CAGzB"}
@@ -1,4 +1,4 @@
1
- import { FunctionMapping } from '@gridsheet/react-core';
1
+ import { FunctionMapping } from '@gridsheet/core';
2
2
  export declare const timeFunctions: FunctionMapping;
3
3
  export default timeFunctions;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/time/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAa7D,eAAO,MAAM,aAAa,EAAE,eAY3B,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/time/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAavD,eAAO,MAAM,aAAa,EAAE,eAY3B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,8 +1,8 @@
1
- import { BaseFunction as n, Time as p, FormulaError as g } from "@gridsheet/react-core";
2
- const y = "Returns the current date as a Date value.";
3
- class f extends n {
1
+ import { BaseFunction as n, Time as p, ensureDate as s } from "@gridsheet/core";
2
+ const g = "Returns the current date as a Date value.";
3
+ class y extends n {
4
4
  constructor() {
5
- super(...arguments), this.example = "TODAY()", this.description = y, this.defs = [], this.category = "time";
5
+ super(...arguments), this.example = "TODAY()", this.description = g, this.defs = [], this.category = "time";
6
6
  }
7
7
  main() {
8
8
  const e = /* @__PURE__ */ new Date();
@@ -26,10 +26,10 @@ class T extends n {
26
26
  return new Date(e, a - 1, i);
27
27
  }
28
28
  }
29
- const x = "Returns a Date value representing the specified hour, minute, and second (on the base date 1899-12-30).";
30
- class D extends n {
29
+ const f = "Returns a Date value representing the specified hour, minute, and second (on the base date 1899-12-30).";
30
+ class x extends n {
31
31
  constructor() {
32
- super(...arguments), this.example = "TIME(13, 30, 0)", this.description = x, this.defs = [
32
+ super(...arguments), this.example = "TIME(13, 30, 0)", this.description = f, this.defs = [
33
33
  { name: "hour", description: "The hour component (0–23).", acceptedTypes: ["number"] },
34
34
  { name: "minute", description: "The minute component (0–59).", acceptedTypes: ["number"] },
35
35
  { name: "second", description: "The second component (0–59).", acceptedTypes: ["number"] }
@@ -39,35 +39,23 @@ class D extends n {
39
39
  return p.create(e, a, i);
40
40
  }
41
41
  }
42
- function s(t) {
43
- if (t instanceof Date)
44
- return t;
45
- if (typeof t == "number")
46
- return new Date(t);
47
- if (typeof t == "string") {
48
- const e = new Date(t);
49
- if (!isNaN(e.getTime()))
50
- return e;
51
- }
52
- throw new g("#VALUE!", `${t} cannot be converted to a date`);
53
- }
54
- const w = 24 * 60 * 60 * 1e3, b = "Returns the number of days between two dates.";
55
- class F extends n {
42
+ const D = 24 * 60 * 60 * 1e3, w = "Returns the number of days between two dates.";
43
+ class b extends n {
56
44
  constructor() {
57
- super(...arguments), this.example = "DAYS(A2, A1)", this.description = b, this.defs = [
45
+ super(...arguments), this.example = "DAYS(A2, A1)", this.description = w, this.defs = [
58
46
  { name: "end_date", description: "The end date.", acceptedTypes: ["date", "string"] },
59
47
  { name: "start_date", description: "The start date.", acceptedTypes: ["date", "string"] }
60
48
  ], this.category = "time";
61
49
  }
62
50
  main(e, a) {
63
51
  const i = s(e), o = s(a);
64
- return Math.trunc((i.getTime() - o.getTime()) / w);
52
+ return Math.trunc((i.getTime() - o.getTime()) / D);
65
53
  }
66
54
  }
67
- const A = "Returns the day of the month for a given date (1–31).";
68
- class M extends n {
55
+ const F = "Returns the day of the month for a given date (1–31).";
56
+ class v extends n {
69
57
  constructor() {
70
- super(...arguments), this.example = "DAY(A1)", this.description = A, this.defs = [
58
+ super(...arguments), this.example = "DAY(A1)", this.description = F, this.defs = [
71
59
  { name: "date", description: "The date from which to extract the day.", acceptedTypes: ["date", "string"] }
72
60
  ], this.category = "time";
73
61
  }
@@ -75,10 +63,10 @@ class M extends n {
75
63
  return s(e).getDate();
76
64
  }
77
65
  }
78
- const R = "Returns the month of a given date as a number (1=January, 12=December).";
79
- class $ extends n {
66
+ const A = "Returns the month of a given date as a number (1=January, 12=December).";
67
+ class M extends n {
80
68
  constructor() {
81
- super(...arguments), this.example = "MONTH(A1)", this.description = R, this.defs = [
69
+ super(...arguments), this.example = "MONTH(A1)", this.description = A, this.defs = [
82
70
  { name: "date", description: "The date from which to extract the month.", acceptedTypes: ["date", "string"] }
83
71
  ], this.category = "time";
84
72
  }
@@ -86,10 +74,10 @@ class $ extends n {
86
74
  return s(e).getMonth() + 1;
87
75
  }
88
76
  }
89
- const v = "Returns the year of a given date.";
90
- class S extends n {
77
+ const R = "Returns the year of a given date.";
78
+ class $ extends n {
91
79
  constructor() {
92
- super(...arguments), this.example = "YEAR(A1)", this.description = v, this.defs = [
80
+ super(...arguments), this.example = "YEAR(A1)", this.description = R, this.defs = [
93
81
  { name: "date", description: "The date from which to extract the year.", acceptedTypes: ["date", "string"] }
94
82
  ], this.category = "time";
95
83
  }
@@ -97,10 +85,10 @@ class S extends n {
97
85
  return s(e).getFullYear();
98
86
  }
99
87
  }
100
- const Y = "Returns the hour component of a given time/date value (0–23).";
101
- class E extends n {
88
+ const S = "Returns the hour component of a given time/date value (0–23).";
89
+ class Y extends n {
102
90
  constructor() {
103
- super(...arguments), this.example = "HOUR(A1)", this.description = Y, this.defs = [
91
+ super(...arguments), this.example = "HOUR(A1)", this.description = S, this.defs = [
104
92
  {
105
93
  name: "time",
106
94
  description: "The time or date-time value from which to extract the hour.",
@@ -113,7 +101,7 @@ class E extends n {
113
101
  }
114
102
  }
115
103
  const k = "Returns the minute component of a given time/date value (0–59).";
116
- class O extends n {
104
+ class E extends n {
117
105
  constructor() {
118
106
  super(...arguments), this.example = "MINUTE(A1)", this.description = k, this.defs = [
119
107
  {
@@ -127,10 +115,10 @@ class O extends n {
127
115
  return s(e).getMinutes();
128
116
  }
129
117
  }
130
- const N = "Returns the second component of a given time/date value (0–59).";
118
+ const O = "Returns the second component of a given time/date value (0–59).";
131
119
  class _ extends n {
132
120
  constructor() {
133
- super(...arguments), this.example = "SECOND(A1)", this.description = N, this.defs = [
121
+ super(...arguments), this.example = "SECOND(A1)", this.description = O, this.defs = [
134
122
  {
135
123
  name: "time",
136
124
  description: "The time or date-time value from which to extract the second.",
@@ -142,18 +130,18 @@ class _ extends n {
142
130
  return s(e).getSeconds();
143
131
  }
144
132
  }
145
- function u(t) {
133
+ function m(t) {
146
134
  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
147
135
  }
148
136
  function H(t) {
149
137
  const e = t.getDay();
150
138
  return e === 0 || e === 6;
151
139
  }
152
- const U = `Returns the date that is a given number of working days (Mon–Fri) before or after a start date.
140
+ const N = `Returns the date that is a given number of working days (Mon–Fri) before or after a start date.
153
141
  Optionally excludes a list of holiday dates.`;
154
142
  class W extends n {
155
143
  constructor() {
156
- super(...arguments), this.example = "WORKDAY(A1, 5)", this.description = U, this.defs = [
144
+ super(...arguments), this.example = "WORKDAY(A1, 5)", this.description = N, this.defs = [
157
145
  { name: "start_date", description: "The starting date.", acceptedTypes: ["date"] },
158
146
  {
159
147
  name: "days",
@@ -171,10 +159,10 @@ class W extends n {
171
159
  }
172
160
  main(e, a, i) {
173
161
  const o = s(e), c = /* @__PURE__ */ new Set();
174
- i != null && this.eachMatrix(i, (m) => {
175
- if (m)
162
+ i != null && this.eachMatrix(i, (u) => {
163
+ if (u)
176
164
  try {
177
- c.add(u(s(m)));
165
+ c.add(m(s(u)));
178
166
  } catch {
179
167
  }
180
168
  });
@@ -182,20 +170,20 @@ class W extends n {
182
170
  let d = Math.abs(Math.trunc(a));
183
171
  const r = new Date(o.getTime());
184
172
  for (; d > 0; )
185
- r.setDate(r.getDate() + h), !H(r) && !c.has(u(r)) && d--;
173
+ r.setDate(r.getDate() + h), !H(r) && !c.has(m(r)) && d--;
186
174
  return new Date(r.getFullYear(), r.getMonth(), r.getDate());
187
175
  }
188
176
  }
189
177
  const J = {
190
- today: f,
178
+ today: y,
191
179
  date: T,
192
- time: D,
193
- days: F,
194
- day: M,
195
- month: $,
196
- year: S,
197
- hour: E,
198
- minute: O,
180
+ time: x,
181
+ days: b,
182
+ day: v,
183
+ month: M,
184
+ year: $,
185
+ hour: Y,
186
+ minute: E,
199
187
  second: _,
200
188
  workday: W
201
189
  };