@trebco/treb 37.0.0 → 37.0.1

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 (528) hide show
  1. package/build/package.json +119 -0
  2. package/build/treb-base-types/src/api_types.d.ts +11 -0
  3. package/build/treb-base-types/src/api_types.js +22 -0
  4. package/build/treb-base-types/src/api_types.js.map +1 -0
  5. package/build/treb-base-types/src/area-utils.d.ts +9 -0
  6. package/build/treb-base-types/src/area-utils.js +50 -0
  7. package/build/treb-base-types/src/area-utils.js.map +1 -0
  8. package/build/treb-base-types/src/area.d.ts +182 -0
  9. package/build/treb-base-types/src/area.js +715 -0
  10. package/build/treb-base-types/src/area.js.map +1 -0
  11. package/build/treb-base-types/src/basic_types.d.ts +20 -0
  12. package/build/treb-base-types/src/basic_types.js +22 -0
  13. package/build/treb-base-types/src/basic_types.js.map +1 -0
  14. package/build/treb-base-types/src/cell.d.ts +167 -0
  15. package/build/treb-base-types/src/cell.js +432 -0
  16. package/build/treb-base-types/src/cell.js.map +1 -0
  17. package/build/treb-base-types/src/cells.d.ts +251 -0
  18. package/build/treb-base-types/src/cells.js +1136 -0
  19. package/build/treb-base-types/src/cells.js.map +1 -0
  20. package/build/treb-base-types/src/color.d.ts +35 -0
  21. package/build/treb-base-types/src/color.js +162 -0
  22. package/build/treb-base-types/src/color.js.map +1 -0
  23. package/build/treb-base-types/src/dom-utilities.d.ts +70 -0
  24. package/build/treb-base-types/src/dom-utilities.js +144 -0
  25. package/build/treb-base-types/src/dom-utilities.js.map +1 -0
  26. package/build/treb-base-types/src/evaluate-options.d.ts +35 -0
  27. package/build/treb-base-types/src/evaluate-options.js +22 -0
  28. package/build/treb-base-types/src/evaluate-options.js.map +1 -0
  29. package/build/treb-base-types/src/font-stack.d.ts +37 -0
  30. package/build/treb-base-types/src/font-stack.js +93 -0
  31. package/build/treb-base-types/src/font-stack.js.map +1 -0
  32. package/build/treb-base-types/src/gradient.d.ts +18 -0
  33. package/build/treb-base-types/src/gradient.js +86 -0
  34. package/build/treb-base-types/src/gradient.js.map +1 -0
  35. package/build/treb-base-types/src/import.d.ts +48 -0
  36. package/build/treb-base-types/src/import.js +22 -0
  37. package/build/treb-base-types/src/import.js.map +1 -0
  38. package/build/treb-base-types/src/index-standalone.d.ts +6 -0
  39. package/build/treb-base-types/src/index-standalone.js +27 -0
  40. package/build/treb-base-types/src/index-standalone.js.map +1 -0
  41. package/build/treb-base-types/src/index.d.ts +22 -0
  42. package/build/treb-base-types/src/index.js +45 -0
  43. package/build/treb-base-types/src/index.js.map +1 -0
  44. package/build/treb-base-types/src/layout.d.ts +22 -0
  45. package/build/treb-base-types/src/layout.js +22 -0
  46. package/build/treb-base-types/src/layout.js.map +1 -0
  47. package/build/treb-base-types/src/localization.d.ts +37 -0
  48. package/build/treb-base-types/src/localization.js +157 -0
  49. package/build/treb-base-types/src/localization.js.map +1 -0
  50. package/build/treb-base-types/src/rectangle.d.ts +51 -0
  51. package/build/treb-base-types/src/rectangle.js +123 -0
  52. package/build/treb-base-types/src/rectangle.js.map +1 -0
  53. package/build/treb-base-types/src/render_text.d.ts +34 -0
  54. package/build/treb-base-types/src/render_text.js +22 -0
  55. package/build/treb-base-types/src/render_text.js.map +1 -0
  56. package/build/treb-base-types/src/style.d.ts +214 -0
  57. package/build/treb-base-types/src/style.js +373 -0
  58. package/build/treb-base-types/src/style.js.map +1 -0
  59. package/build/treb-base-types/src/table.d.ts +58 -0
  60. package/build/treb-base-types/src/table.js +27 -0
  61. package/build/treb-base-types/src/table.js.map +1 -0
  62. package/build/treb-base-types/src/text_part.d.ts +26 -0
  63. package/build/treb-base-types/src/text_part.js +47 -0
  64. package/build/treb-base-types/src/text_part.js.map +1 -0
  65. package/build/treb-base-types/src/theme.d.ts +120 -0
  66. package/build/treb-base-types/src/theme.js +460 -0
  67. package/build/treb-base-types/src/theme.js.map +1 -0
  68. package/build/treb-base-types/src/union.d.ts +73 -0
  69. package/build/treb-base-types/src/union.js +61 -0
  70. package/build/treb-base-types/src/union.js.map +1 -0
  71. package/build/treb-base-types/src/value-type.d.ts +86 -0
  72. package/build/treb-base-types/src/value-type.js +168 -0
  73. package/build/treb-base-types/src/value-type.js.map +1 -0
  74. package/build/treb-base-types/src/worker-proxy.d.ts +95 -0
  75. package/build/treb-base-types/src/worker-proxy.js +221 -0
  76. package/build/treb-base-types/src/worker-proxy.js.map +1 -0
  77. package/build/treb-calculator/src/calculator.d.ts +249 -0
  78. package/build/treb-calculator/src/calculator.js +2755 -0
  79. package/build/treb-calculator/src/calculator.js.map +1 -0
  80. package/build/treb-calculator/src/complex-math.d.ts +75 -0
  81. package/build/treb-calculator/src/complex-math.js +559 -0
  82. package/build/treb-calculator/src/complex-math.js.map +1 -0
  83. package/build/treb-calculator/src/dag/array-vertex.d.ts +71 -0
  84. package/build/treb-calculator/src/dag/array-vertex.js +156 -0
  85. package/build/treb-calculator/src/dag/array-vertex.js.map +1 -0
  86. package/build/treb-calculator/src/dag/calculation_leaf_vertex.d.ts +48 -0
  87. package/build/treb-calculator/src/dag/calculation_leaf_vertex.js +84 -0
  88. package/build/treb-calculator/src/dag/calculation_leaf_vertex.js.map +1 -0
  89. package/build/treb-calculator/src/dag/graph.d.ts +134 -0
  90. package/build/treb-calculator/src/dag/graph.js +842 -0
  91. package/build/treb-calculator/src/dag/graph.js.map +1 -0
  92. package/build/treb-calculator/src/dag/spreadsheet_vertex.d.ts +58 -0
  93. package/build/treb-calculator/src/dag/spreadsheet_vertex.js +232 -0
  94. package/build/treb-calculator/src/dag/spreadsheet_vertex.js.map +1 -0
  95. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.d.ts +20 -0
  96. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js +25 -0
  97. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js.map +1 -0
  98. package/build/treb-calculator/src/dag/state_leaf_vertex.d.ts +43 -0
  99. package/build/treb-calculator/src/dag/state_leaf_vertex.js +81 -0
  100. package/build/treb-calculator/src/dag/state_leaf_vertex.js.map +1 -0
  101. package/build/treb-calculator/src/dag/vertex.d.ts +71 -0
  102. package/build/treb-calculator/src/dag/vertex.js +274 -0
  103. package/build/treb-calculator/src/dag/vertex.js.map +1 -0
  104. package/build/treb-calculator/src/descriptors.d.ts +189 -0
  105. package/build/treb-calculator/src/descriptors.js +22 -0
  106. package/build/treb-calculator/src/descriptors.js.map +1 -0
  107. package/build/treb-calculator/src/expression-calculator.d.ts +127 -0
  108. package/build/treb-calculator/src/expression-calculator.js +1033 -0
  109. package/build/treb-calculator/src/expression-calculator.js.map +1 -0
  110. package/build/treb-calculator/src/function-error.d.ts +35 -0
  111. package/build/treb-calculator/src/function-error.js +85 -0
  112. package/build/treb-calculator/src/function-error.js.map +1 -0
  113. package/build/treb-calculator/src/function-library.d.ts +22 -0
  114. package/build/treb-calculator/src/function-library.js +96 -0
  115. package/build/treb-calculator/src/function-library.js.map +1 -0
  116. package/build/treb-calculator/src/functions/base-functions.d.ts +7 -0
  117. package/build/treb-calculator/src/functions/base-functions.js +2611 -0
  118. package/build/treb-calculator/src/functions/base-functions.js.map +1 -0
  119. package/build/treb-calculator/src/functions/beta.d.ts +17 -0
  120. package/build/treb-calculator/src/functions/beta.js +201 -0
  121. package/build/treb-calculator/src/functions/beta.js.map +1 -0
  122. package/build/treb-calculator/src/functions/checkbox.d.ts +3 -0
  123. package/build/treb-calculator/src/functions/checkbox.js +128 -0
  124. package/build/treb-calculator/src/functions/checkbox.js.map +1 -0
  125. package/build/treb-calculator/src/functions/complex-functions.d.ts +2 -0
  126. package/build/treb-calculator/src/functions/complex-functions.js +217 -0
  127. package/build/treb-calculator/src/functions/complex-functions.js.map +1 -0
  128. package/build/treb-calculator/src/functions/date-utils.d.ts +3 -0
  129. package/build/treb-calculator/src/functions/date-utils.js +59 -0
  130. package/build/treb-calculator/src/functions/date-utils.js.map +1 -0
  131. package/build/treb-calculator/src/functions/finance-functions.d.ts +2 -0
  132. package/build/treb-calculator/src/functions/finance-functions.js +547 -0
  133. package/build/treb-calculator/src/functions/finance-functions.js.map +1 -0
  134. package/build/treb-calculator/src/functions/fp.d.ts +2 -0
  135. package/build/treb-calculator/src/functions/fp.js +463 -0
  136. package/build/treb-calculator/src/functions/fp.js.map +1 -0
  137. package/build/treb-calculator/src/functions/function-utilities.d.ts +2 -0
  138. package/build/treb-calculator/src/functions/function-utilities.js +36 -0
  139. package/build/treb-calculator/src/functions/function-utilities.js.map +1 -0
  140. package/build/treb-calculator/src/functions/gamma.d.ts +20 -0
  141. package/build/treb-calculator/src/functions/gamma.js +142 -0
  142. package/build/treb-calculator/src/functions/gamma.js.map +1 -0
  143. package/build/treb-calculator/src/functions/information-functions.d.ts +2 -0
  144. package/build/treb-calculator/src/functions/information-functions.js +71 -0
  145. package/build/treb-calculator/src/functions/information-functions.js.map +1 -0
  146. package/build/treb-calculator/src/functions/lambda-functions.d.ts +2 -0
  147. package/build/treb-calculator/src/functions/lambda-functions.js +85 -0
  148. package/build/treb-calculator/src/functions/lambda-functions.js.map +1 -0
  149. package/build/treb-calculator/src/functions/matrix-functions.d.ts +2 -0
  150. package/build/treb-calculator/src/functions/matrix-functions.js +144 -0
  151. package/build/treb-calculator/src/functions/matrix-functions.js.map +1 -0
  152. package/build/treb-calculator/src/functions/normal.d.ts +2 -0
  153. package/build/treb-calculator/src/functions/normal.js +32 -0
  154. package/build/treb-calculator/src/functions/normal.js.map +1 -0
  155. package/build/treb-calculator/src/functions/regex-functions.d.ts +2 -0
  156. package/build/treb-calculator/src/functions/regex-functions.js +188 -0
  157. package/build/treb-calculator/src/functions/regex-functions.js.map +1 -0
  158. package/build/treb-calculator/src/functions/sparkline.d.ts +37 -0
  159. package/build/treb-calculator/src/functions/sparkline.js +264 -0
  160. package/build/treb-calculator/src/functions/sparkline.js.map +1 -0
  161. package/build/treb-calculator/src/functions/statistics-functions.d.ts +6 -0
  162. package/build/treb-calculator/src/functions/statistics-functions.js +989 -0
  163. package/build/treb-calculator/src/functions/statistics-functions.js.map +1 -0
  164. package/build/treb-calculator/src/functions/students-t.d.ts +3 -0
  165. package/build/treb-calculator/src/functions/students-t.js +64 -0
  166. package/build/treb-calculator/src/functions/students-t.js.map +1 -0
  167. package/build/treb-calculator/src/functions/text-functions.d.ts +3 -0
  168. package/build/treb-calculator/src/functions/text-functions.js +320 -0
  169. package/build/treb-calculator/src/functions/text-functions.js.map +1 -0
  170. package/build/treb-calculator/src/index.d.ts +2 -0
  171. package/build/treb-calculator/src/index.js +22 -0
  172. package/build/treb-calculator/src/index.js.map +1 -0
  173. package/build/treb-calculator/src/notifier-types.d.ts +26 -0
  174. package/build/treb-calculator/src/notifier-types.js +22 -0
  175. package/build/treb-calculator/src/notifier-types.js.map +1 -0
  176. package/build/treb-calculator/src/primitives.d.ts +15 -0
  177. package/build/treb-calculator/src/primitives.js +398 -0
  178. package/build/treb-calculator/src/primitives.js.map +1 -0
  179. package/build/treb-calculator/src/utilities.d.ts +68 -0
  180. package/build/treb-calculator/src/utilities.js +324 -0
  181. package/build/treb-calculator/src/utilities.js.map +1 -0
  182. package/build/treb-charts/src/chart-functions.d.ts +8 -0
  183. package/build/treb-charts/src/chart-functions.js +209 -0
  184. package/build/treb-charts/src/chart-functions.js.map +1 -0
  185. package/build/treb-charts/src/chart-types.d.ts +233 -0
  186. package/build/treb-charts/src/chart-types.js +57 -0
  187. package/build/treb-charts/src/chart-types.js.map +1 -0
  188. package/build/treb-charts/src/chart-utils.d.ts +106 -0
  189. package/build/treb-charts/src/chart-utils.js +1060 -0
  190. package/build/treb-charts/src/chart-utils.js.map +1 -0
  191. package/build/treb-charts/src/chart.d.ts +23 -0
  192. package/build/treb-charts/src/chart.js +94 -0
  193. package/build/treb-charts/src/chart.js.map +1 -0
  194. package/build/treb-charts/src/default-chart-renderer.d.ts +16 -0
  195. package/build/treb-charts/src/default-chart-renderer.js +533 -0
  196. package/build/treb-charts/src/default-chart-renderer.js.map +1 -0
  197. package/build/treb-charts/src/index.d.ts +5 -0
  198. package/build/treb-charts/src/index.js +24 -0
  199. package/build/treb-charts/src/index.js.map +1 -0
  200. package/build/treb-charts/src/main.d.ts +1 -0
  201. package/build/treb-charts/src/main.js +34 -0
  202. package/build/treb-charts/src/main.js.map +1 -0
  203. package/build/treb-charts/src/quicksort.d.ts +1 -0
  204. package/build/treb-charts/src/quicksort.js +49 -0
  205. package/build/treb-charts/src/quicksort.js.map +1 -0
  206. package/build/treb-charts/src/rectangle.d.ts +18 -0
  207. package/build/treb-charts/src/rectangle.js +41 -0
  208. package/build/treb-charts/src/rectangle.js.map +1 -0
  209. package/build/treb-charts/src/renderer-type.d.ts +24 -0
  210. package/build/treb-charts/src/renderer-type.js +22 -0
  211. package/build/treb-charts/src/renderer-type.js.map +1 -0
  212. package/build/treb-charts/src/renderer.d.ts +127 -0
  213. package/build/treb-charts/src/renderer.js +1518 -0
  214. package/build/treb-charts/src/renderer.js.map +1 -0
  215. package/build/treb-charts/src/util.d.ts +18 -0
  216. package/build/treb-charts/src/util.js +71 -0
  217. package/build/treb-charts/src/util.js.map +1 -0
  218. package/build/treb-data-model/src/annotation.d.ts +167 -0
  219. package/build/treb-data-model/src/annotation.js +120 -0
  220. package/build/treb-data-model/src/annotation.js.map +1 -0
  221. package/build/treb-data-model/src/conditional_format.d.ts +155 -0
  222. package/build/treb-data-model/src/conditional_format.js +62 -0
  223. package/build/treb-data-model/src/conditional_format.js.map +1 -0
  224. package/build/treb-data-model/src/data-validation.d.ts +28 -0
  225. package/build/treb-data-model/src/data-validation.js +22 -0
  226. package/build/treb-data-model/src/data-validation.js.map +1 -0
  227. package/build/treb-data-model/src/data_model.d.ts +173 -0
  228. package/build/treb-data-model/src/data_model.js +637 -0
  229. package/build/treb-data-model/src/data_model.js.map +1 -0
  230. package/build/treb-data-model/src/index.d.ts +13 -0
  231. package/build/treb-data-model/src/index.js +28 -0
  232. package/build/treb-data-model/src/index.js.map +1 -0
  233. package/build/treb-data-model/src/language-model.d.ts +22 -0
  234. package/build/treb-data-model/src/language-model.js +22 -0
  235. package/build/treb-data-model/src/language-model.js.map +1 -0
  236. package/build/treb-data-model/src/named.d.ts +124 -0
  237. package/build/treb-data-model/src/named.js +372 -0
  238. package/build/treb-data-model/src/named.js.map +1 -0
  239. package/build/treb-data-model/src/serialize_options.d.ts +49 -0
  240. package/build/treb-data-model/src/serialize_options.js +22 -0
  241. package/build/treb-data-model/src/serialize_options.js.map +1 -0
  242. package/build/treb-data-model/src/sheet.d.ts +499 -0
  243. package/build/treb-data-model/src/sheet.js +2904 -0
  244. package/build/treb-data-model/src/sheet.js.map +1 -0
  245. package/build/treb-data-model/src/sheet_collection.d.ts +58 -0
  246. package/build/treb-data-model/src/sheet_collection.js +112 -0
  247. package/build/treb-data-model/src/sheet_collection.js.map +1 -0
  248. package/build/treb-data-model/src/sheet_selection.d.ts +42 -0
  249. package/build/treb-data-model/src/sheet_selection.js +39 -0
  250. package/build/treb-data-model/src/sheet_selection.js.map +1 -0
  251. package/build/treb-data-model/src/sheet_types.d.ts +104 -0
  252. package/build/treb-data-model/src/sheet_types.js +22 -0
  253. package/build/treb-data-model/src/sheet_types.js.map +1 -0
  254. package/build/treb-data-model/src/types.d.ts +59 -0
  255. package/build/treb-data-model/src/types.js +22 -0
  256. package/build/treb-data-model/src/types.js.map +1 -0
  257. package/build/treb-embed/src/custom-element/spreadsheet-constructor.d.ts +75 -0
  258. package/build/treb-embed/src/custom-element/spreadsheet-constructor.js +1144 -0
  259. package/build/treb-embed/src/custom-element/spreadsheet-constructor.js.map +1 -0
  260. package/build/treb-embed/src/custom-element/treb-global.d.ts +36 -0
  261. package/build/treb-embed/src/custom-element/treb-global.js +64 -0
  262. package/build/treb-embed/src/custom-element/treb-global.js.map +1 -0
  263. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.d.ts +1 -0
  264. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js +61 -0
  265. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js.map +1 -0
  266. package/build/treb-embed/src/embedded-spreadsheet.d.ts +1358 -0
  267. package/build/treb-embed/src/embedded-spreadsheet.js +5205 -0
  268. package/build/treb-embed/src/embedded-spreadsheet.js.map +1 -0
  269. package/build/treb-embed/src/index.d.ts +12 -0
  270. package/build/treb-embed/src/index.js +34 -0
  271. package/build/treb-embed/src/index.js.map +1 -0
  272. package/build/treb-embed/src/options.d.ts +266 -0
  273. package/build/treb-embed/src/options.js +56 -0
  274. package/build/treb-embed/src/options.js.map +1 -0
  275. package/build/treb-embed/src/plugin.d.ts +9 -0
  276. package/build/treb-embed/src/plugin.js +22 -0
  277. package/build/treb-embed/src/plugin.js.map +1 -0
  278. package/build/treb-embed/src/progress-dialog.d.ts +49 -0
  279. package/build/treb-embed/src/progress-dialog.js +178 -0
  280. package/build/treb-embed/src/progress-dialog.js.map +1 -0
  281. package/build/treb-embed/src/selection-state.d.ts +15 -0
  282. package/build/treb-embed/src/selection-state.js +22 -0
  283. package/build/treb-embed/src/selection-state.js.map +1 -0
  284. package/build/treb-embed/src/spinner.d.ts +8 -0
  285. package/build/treb-embed/src/spinner.js +40 -0
  286. package/build/treb-embed/src/spinner.js.map +1 -0
  287. package/build/treb-embed/src/toolbar-message.d.ts +72 -0
  288. package/build/treb-embed/src/toolbar-message.js +22 -0
  289. package/build/treb-embed/src/toolbar-message.js.map +1 -0
  290. package/build/treb-embed/src/types.d.ts +185 -0
  291. package/build/treb-embed/src/types.js +45 -0
  292. package/build/treb-embed/src/types.js.map +1 -0
  293. package/build/treb-embed/tsconfig.tsbuildinfo +1 -0
  294. package/build/treb-export/src/address-type.d.ts +34 -0
  295. package/build/treb-export/src/address-type.js +53 -0
  296. package/build/treb-export/src/address-type.js.map +1 -0
  297. package/build/treb-export/src/base-template.d.ts +1 -0
  298. package/build/treb-export/src/base-template.js +22 -0
  299. package/build/treb-export/src/base-template.js.map +1 -0
  300. package/build/treb-export/src/column-width.d.ts +2 -0
  301. package/build/treb-export/src/column-width.js +80 -0
  302. package/build/treb-export/src/column-width.js.map +1 -0
  303. package/build/treb-export/src/drawing/bubble-chart-template.d.ts +514 -0
  304. package/build/treb-export/src/drawing/bubble-chart-template.js +544 -0
  305. package/build/treb-export/src/drawing/bubble-chart-template.js.map +1 -0
  306. package/build/treb-export/src/drawing/chart-template-components2.d.ts +365 -0
  307. package/build/treb-export/src/drawing/chart-template-components2.js +386 -0
  308. package/build/treb-export/src/drawing/chart-template-components2.js.map +1 -0
  309. package/build/treb-export/src/drawing/chart.d.ts +26 -0
  310. package/build/treb-export/src/drawing/chart.js +247 -0
  311. package/build/treb-export/src/drawing/chart.js.map +1 -0
  312. package/build/treb-export/src/drawing/column-chart-template2.d.ts +490 -0
  313. package/build/treb-export/src/drawing/column-chart-template2.js +518 -0
  314. package/build/treb-export/src/drawing/column-chart-template2.js.map +1 -0
  315. package/build/treb-export/src/drawing/donut-chart-template2.d.ts +272 -0
  316. package/build/treb-export/src/drawing/donut-chart-template2.js +293 -0
  317. package/build/treb-export/src/drawing/donut-chart-template2.js.map +1 -0
  318. package/build/treb-export/src/drawing/drawing.d.ts +49 -0
  319. package/build/treb-export/src/drawing/drawing.js +193 -0
  320. package/build/treb-export/src/drawing/drawing.js.map +1 -0
  321. package/build/treb-export/src/drawing/embedded-image.d.ts +12 -0
  322. package/build/treb-export/src/drawing/embedded-image.js +54 -0
  323. package/build/treb-export/src/drawing/embedded-image.js.map +1 -0
  324. package/build/treb-export/src/drawing/scatter-chart-template2.d.ts +520 -0
  325. package/build/treb-export/src/drawing/scatter-chart-template2.js +551 -0
  326. package/build/treb-export/src/drawing/scatter-chart-template2.js.map +1 -0
  327. package/build/treb-export/src/export.d.ts +72 -0
  328. package/build/treb-export/src/export.js +2039 -0
  329. package/build/treb-export/src/export.js.map +1 -0
  330. package/build/treb-export/src/import-export-messages.d.ts +31 -0
  331. package/build/treb-export/src/import-export-messages.js +22 -0
  332. package/build/treb-export/src/import-export-messages.js.map +1 -0
  333. package/build/treb-export/src/import.d.ts +33 -0
  334. package/build/treb-export/src/import.js +1258 -0
  335. package/build/treb-export/src/import.js.map +1 -0
  336. package/build/treb-export/src/index.worker.d.ts +1 -0
  337. package/build/treb-export/src/index.worker.js +93 -0
  338. package/build/treb-export/src/index.worker.js.map +1 -0
  339. package/build/treb-export/src/metadata.d.ts +51 -0
  340. package/build/treb-export/src/metadata.js +153 -0
  341. package/build/treb-export/src/metadata.js.map +1 -0
  342. package/build/treb-export/src/ooxml.d.ts +7 -0
  343. package/build/treb-export/src/ooxml.js +41 -0
  344. package/build/treb-export/src/ooxml.js.map +1 -0
  345. package/build/treb-export/src/relationship.d.ts +8 -0
  346. package/build/treb-export/src/relationship.js +27 -0
  347. package/build/treb-export/src/relationship.js.map +1 -0
  348. package/build/treb-export/src/shared-strings.d.ts +11 -0
  349. package/build/treb-export/src/shared-strings.js +105 -0
  350. package/build/treb-export/src/shared-strings.js.map +1 -0
  351. package/build/treb-export/src/template-2.d.ts +1 -0
  352. package/build/treb-export/src/template-2.js +22 -0
  353. package/build/treb-export/src/template-2.js.map +1 -0
  354. package/build/treb-export/src/unescape_xml.d.ts +1 -0
  355. package/build/treb-export/src/unescape_xml.js +61 -0
  356. package/build/treb-export/src/unescape_xml.js.map +1 -0
  357. package/build/treb-export/src/workbook-sheet.d.ts +75 -0
  358. package/build/treb-export/src/workbook-sheet.js +128 -0
  359. package/build/treb-export/src/workbook-sheet.js.map +1 -0
  360. package/build/treb-export/src/workbook-style.d.ts +110 -0
  361. package/build/treb-export/src/workbook-style.js +1134 -0
  362. package/build/treb-export/src/workbook-style.js.map +1 -0
  363. package/build/treb-export/src/workbook-theme.d.ts +13 -0
  364. package/build/treb-export/src/workbook-theme.js +85 -0
  365. package/build/treb-export/src/workbook-theme.js.map +1 -0
  366. package/build/treb-export/src/workbook.d.ts +123 -0
  367. package/build/treb-export/src/workbook.js +644 -0
  368. package/build/treb-export/src/workbook.js.map +1 -0
  369. package/build/treb-export/src/xml-test.d.ts +9 -0
  370. package/build/treb-export/src/xml-test.js +52 -0
  371. package/build/treb-export/src/xml-test.js.map +1 -0
  372. package/build/treb-export/src/xml-utils.d.ts +76 -0
  373. package/build/treb-export/src/xml-utils.js +223 -0
  374. package/build/treb-export/src/xml-utils.js.map +1 -0
  375. package/build/treb-export/src/zip-wrapper.d.ts +22 -0
  376. package/build/treb-export/src/zip-wrapper.js +93 -0
  377. package/build/treb-export/src/zip-wrapper.js.map +1 -0
  378. package/build/treb-format/src/format.d.ts +130 -0
  379. package/build/treb-format/src/format.js +805 -0
  380. package/build/treb-format/src/format.js.map +1 -0
  381. package/build/treb-format/src/format_cache.d.ts +55 -0
  382. package/build/treb-format/src/format_cache.js +166 -0
  383. package/build/treb-format/src/format_cache.js.map +1 -0
  384. package/build/treb-format/src/format_parser.d.ts +70 -0
  385. package/build/treb-format/src/format_parser.js +618 -0
  386. package/build/treb-format/src/format_parser.js.map +1 -0
  387. package/build/treb-format/src/index.d.ts +4 -0
  388. package/build/treb-format/src/index.js +25 -0
  389. package/build/treb-format/src/index.js.map +1 -0
  390. package/build/treb-format/src/number_format_section.d.ts +58 -0
  391. package/build/treb-format/src/number_format_section.js +78 -0
  392. package/build/treb-format/src/number_format_section.js.map +1 -0
  393. package/build/treb-format/src/value_parser.d.ts +48 -0
  394. package/build/treb-format/src/value_parser.js +244 -0
  395. package/build/treb-format/src/value_parser.js.map +1 -0
  396. package/build/treb-grid/src/editors/autocomplete.d.ts +39 -0
  397. package/build/treb-grid/src/editors/autocomplete.js +316 -0
  398. package/build/treb-grid/src/editors/autocomplete.js.map +1 -0
  399. package/build/treb-grid/src/editors/autocomplete_matcher.d.ts +74 -0
  400. package/build/treb-grid/src/editors/autocomplete_matcher.js +212 -0
  401. package/build/treb-grid/src/editors/autocomplete_matcher.js.map +1 -0
  402. package/build/treb-grid/src/editors/editor.d.ts +214 -0
  403. package/build/treb-grid/src/editors/editor.js +879 -0
  404. package/build/treb-grid/src/editors/editor.js.map +1 -0
  405. package/build/treb-grid/src/editors/external_editor.d.ts +11 -0
  406. package/build/treb-grid/src/editors/external_editor.js +118 -0
  407. package/build/treb-grid/src/editors/external_editor.js.map +1 -0
  408. package/build/treb-grid/src/editors/formula_bar.d.ts +85 -0
  409. package/build/treb-grid/src/editors/formula_bar.js +444 -0
  410. package/build/treb-grid/src/editors/formula_bar.js.map +1 -0
  411. package/build/treb-grid/src/editors/overlay_editor.d.ts +85 -0
  412. package/build/treb-grid/src/editors/overlay_editor.js +353 -0
  413. package/build/treb-grid/src/editors/overlay_editor.js.map +1 -0
  414. package/build/treb-grid/src/index.d.ts +12 -0
  415. package/build/treb-grid/src/index.js +28 -0
  416. package/build/treb-grid/src/index.js.map +1 -0
  417. package/build/treb-grid/src/layout/base_layout.d.ts +346 -0
  418. package/build/treb-grid/src/layout/base_layout.js +2050 -0
  419. package/build/treb-grid/src/layout/base_layout.js.map +1 -0
  420. package/build/treb-grid/src/layout/grid_layout.d.ts +19 -0
  421. package/build/treb-grid/src/layout/grid_layout.js +235 -0
  422. package/build/treb-grid/src/layout/grid_layout.js.map +1 -0
  423. package/build/treb-grid/src/layout/mock-layout.d.ts +10 -0
  424. package/build/treb-grid/src/layout/mock-layout.js +37 -0
  425. package/build/treb-grid/src/layout/mock-layout.js.map +1 -0
  426. package/build/treb-grid/src/render/selection-renderer.d.ts +97 -0
  427. package/build/treb-grid/src/render/selection-renderer.js +315 -0
  428. package/build/treb-grid/src/render/selection-renderer.js.map +1 -0
  429. package/build/treb-grid/src/render/svg_header_overlay.d.ts +20 -0
  430. package/build/treb-grid/src/render/svg_header_overlay.js +76 -0
  431. package/build/treb-grid/src/render/svg_header_overlay.js.map +1 -0
  432. package/build/treb-grid/src/render/svg_selection_block.d.ts +27 -0
  433. package/build/treb-grid/src/render/svg_selection_block.js +106 -0
  434. package/build/treb-grid/src/render/svg_selection_block.js.map +1 -0
  435. package/build/treb-grid/src/render/tile_renderer.d.ts +121 -0
  436. package/build/treb-grid/src/render/tile_renderer.js +1609 -0
  437. package/build/treb-grid/src/render/tile_renderer.js.map +1 -0
  438. package/build/treb-grid/src/types/border_constants.d.ts +9 -0
  439. package/build/treb-grid/src/types/border_constants.js +34 -0
  440. package/build/treb-grid/src/types/border_constants.js.map +1 -0
  441. package/build/treb-grid/src/types/clipboard_data.d.ts +11 -0
  442. package/build/treb-grid/src/types/clipboard_data.js +22 -0
  443. package/build/treb-grid/src/types/clipboard_data.js.map +1 -0
  444. package/build/treb-grid/src/types/clipboard_data2.d.ts +46 -0
  445. package/build/treb-grid/src/types/clipboard_data2.js +22 -0
  446. package/build/treb-grid/src/types/clipboard_data2.js.map +1 -0
  447. package/build/treb-grid/src/types/drag_mask.d.ts +10 -0
  448. package/build/treb-grid/src/types/drag_mask.js +78 -0
  449. package/build/treb-grid/src/types/drag_mask.js.map +1 -0
  450. package/build/treb-grid/src/types/external_editor_config.d.ts +33 -0
  451. package/build/treb-grid/src/types/external_editor_config.js +22 -0
  452. package/build/treb-grid/src/types/external_editor_config.js.map +1 -0
  453. package/build/treb-grid/src/types/grid.d.ts +806 -0
  454. package/build/treb-grid/src/types/grid.js +6410 -0
  455. package/build/treb-grid/src/types/grid.js.map +1 -0
  456. package/build/treb-grid/src/types/grid_base.d.ts +442 -0
  457. package/build/treb-grid/src/types/grid_base.js +3523 -0
  458. package/build/treb-grid/src/types/grid_base.js.map +1 -0
  459. package/build/treb-grid/src/types/grid_command.d.ts +408 -0
  460. package/build/treb-grid/src/types/grid_command.js +75 -0
  461. package/build/treb-grid/src/types/grid_command.js.map +1 -0
  462. package/build/treb-grid/src/types/grid_events.d.ts +93 -0
  463. package/build/treb-grid/src/types/grid_events.js +36 -0
  464. package/build/treb-grid/src/types/grid_events.js.map +1 -0
  465. package/build/treb-grid/src/types/grid_options.d.ts +50 -0
  466. package/build/treb-grid/src/types/grid_options.js +34 -0
  467. package/build/treb-grid/src/types/grid_options.js.map +1 -0
  468. package/build/treb-grid/src/types/scale-control.d.ts +21 -0
  469. package/build/treb-grid/src/types/scale-control.js +148 -0
  470. package/build/treb-grid/src/types/scale-control.js.map +1 -0
  471. package/build/treb-grid/src/types/set_range_options.d.ts +24 -0
  472. package/build/treb-grid/src/types/set_range_options.js +22 -0
  473. package/build/treb-grid/src/types/set_range_options.js.map +1 -0
  474. package/build/treb-grid/src/types/tab_bar.d.ts +84 -0
  475. package/build/treb-grid/src/types/tab_bar.js +426 -0
  476. package/build/treb-grid/src/types/tab_bar.js.map +1 -0
  477. package/build/treb-grid/src/types/tile.d.ts +29 -0
  478. package/build/treb-grid/src/types/tile.js +22 -0
  479. package/build/treb-grid/src/types/tile.js.map +1 -0
  480. package/build/treb-grid/src/types/update_flags.d.ts +48 -0
  481. package/build/treb-grid/src/types/update_flags.js +22 -0
  482. package/build/treb-grid/src/types/update_flags.js.map +1 -0
  483. package/build/treb-grid/src/util/fontmetrics.d.ts +21 -0
  484. package/build/treb-grid/src/util/fontmetrics.js +82 -0
  485. package/build/treb-grid/src/util/fontmetrics.js.map +1 -0
  486. package/build/treb-grid/src/util/ua.d.ts +33 -0
  487. package/build/treb-grid/src/util/ua.js +86 -0
  488. package/build/treb-grid/src/util/ua.js.map +1 -0
  489. package/build/treb-parser/src/csv-parser.d.ts +13 -0
  490. package/build/treb-parser/src/csv-parser.js +107 -0
  491. package/build/treb-parser/src/csv-parser.js.map +1 -0
  492. package/build/treb-parser/src/index.d.ts +4 -0
  493. package/build/treb-parser/src/index.js +25 -0
  494. package/build/treb-parser/src/index.js.map +1 -0
  495. package/build/treb-parser/src/md-parser.d.ts +97 -0
  496. package/build/treb-parser/src/md-parser.js +403 -0
  497. package/build/treb-parser/src/md-parser.js.map +1 -0
  498. package/build/treb-parser/src/parser-types.d.ts +345 -0
  499. package/build/treb-parser/src/parser-types.js +53 -0
  500. package/build/treb-parser/src/parser-types.js.map +1 -0
  501. package/build/treb-parser/src/parser.d.ts +422 -0
  502. package/build/treb-parser/src/parser.js +2418 -0
  503. package/build/treb-parser/src/parser.js.map +1 -0
  504. package/build/treb-utils/src/event_source.d.ts +34 -0
  505. package/build/treb-utils/src/event_source.js +110 -0
  506. package/build/treb-utils/src/event_source.js.map +1 -0
  507. package/build/treb-utils/src/ievent_source.d.ts +9 -0
  508. package/build/treb-utils/src/ievent_source.js +22 -0
  509. package/build/treb-utils/src/ievent_source.js.map +1 -0
  510. package/build/treb-utils/src/index.d.ts +6 -0
  511. package/build/treb-utils/src/index.js +30 -0
  512. package/build/treb-utils/src/index.js.map +1 -0
  513. package/build/treb-utils/src/measurement.d.ts +42 -0
  514. package/build/treb-utils/src/measurement.js +145 -0
  515. package/build/treb-utils/src/measurement.js.map +1 -0
  516. package/build/treb-utils/src/scale.d.ts +16 -0
  517. package/build/treb-utils/src/scale.js +106 -0
  518. package/build/treb-utils/src/scale.js.map +1 -0
  519. package/build/treb-utils/src/serialize_html.d.ts +5 -0
  520. package/build/treb-utils/src/serialize_html.js +128 -0
  521. package/build/treb-utils/src/serialize_html.js.map +1 -0
  522. package/build/treb-utils/src/validate_uri.d.ts +20 -0
  523. package/build/treb-utils/src/validate_uri.js +55 -0
  524. package/build/treb-utils/src/validate_uri.js.map +1 -0
  525. package/dist/{chunk-XD5PEZBZ.mjs → chunk-E35ONJUS.mjs} +1 -1
  526. package/dist/treb-export-worker.mjs +2 -2
  527. package/dist/treb-spreadsheet.mjs +4 -4
  528. package/package.json +1 -1
@@ -0,0 +1,426 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2026 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+ import { EventSource } from 'treb-utils';
22
+ import { MouseDrag } from './drag_mask';
23
+ import { ScaleControl } from './scale-control';
24
+ import { DOMContext, ResolveThemeColor } from 'treb-base-types';
25
+ /**
26
+ * tabs for multiple sheets. at the bottom, atm (FIXME: options?)
27
+ *
28
+ * rename tabs (sheets) by double-clicking. this triggers a global
29
+ * rename over all cells and annotations.
30
+ *
31
+ * reorder tabs by dragging. reorders the array, but order is not
32
+ * material to any other module, so it's basically just housekeeping.
33
+ *
34
+ * add a new tab with a special (+) tab (last).
35
+ *
36
+ * FIXME: delete tabs... add an (x) to each tab? don't really want to
37
+ * do that. right-click is out. ??? [A: toolbar menu]
38
+ *
39
+ */
40
+ export class TabBar extends EventSource {
41
+ layout;
42
+ model;
43
+ view;
44
+ options;
45
+ theme;
46
+ // private container?: HTMLElement;
47
+ tab_container;
48
+ scale_control;
49
+ stats_panel;
50
+ dragging = false;
51
+ double_click_data = {};
52
+ tab_color_cache = new Map();
53
+ // tslint:disable-next-line: variable-name
54
+ _visible = false;
55
+ get visible() {
56
+ return this._visible;
57
+ }
58
+ set stats_data(value) {
59
+ if (this.stats_panel) {
60
+ this.stats_panel.innerText = ''; // clear
61
+ for (const entry of value) {
62
+ this.DOM.Create('span', 'treb-stats-label', this.stats_panel, {
63
+ text: entry.label
64
+ });
65
+ this.DOM.Create('span', 'treb-stats-value', this.stats_panel, {
66
+ text: entry.value,
67
+ });
68
+ }
69
+ }
70
+ }
71
+ container;
72
+ DOM;
73
+ constructor(layout, model, view, options, theme,
74
+ // private container: HTMLElement,
75
+ view_node) {
76
+ super();
77
+ this.layout = layout;
78
+ this.model = model;
79
+ this.view = view;
80
+ this.options = options;
81
+ this.theme = theme;
82
+ this.DOM = DOMContext.GetInstance(view_node.ownerDocument);
83
+ this.container = view_node.querySelector('.treb-spreadsheet-footer');
84
+ if (!this.container) {
85
+ throw new Error('missing container for tab bar');
86
+ }
87
+ // if we're here, we have a tab bar. show unless we're on auto
88
+ if (options.tab_bar !== 'auto') {
89
+ this.container.removeAttribute('hidden');
90
+ }
91
+ this.tab_container = this.container.querySelector('.treb-spreadsheet-tabs');
92
+ this.container.addEventListener('click', event => {
93
+ const command = event.target?.dataset.command;
94
+ if (command) {
95
+ event.stopPropagation();
96
+ event.preventDefault();
97
+ switch (command) {
98
+ case 'add-tab':
99
+ this.Publish({ type: 'add-sheet' });
100
+ break;
101
+ case 'delete-tab':
102
+ this.Publish({ type: 'delete-sheet' });
103
+ break;
104
+ default:
105
+ console.info('unhandled command', command);
106
+ }
107
+ }
108
+ });
109
+ if (this.options.stats) {
110
+ this.stats_panel = this.container.querySelector('.treb-stats-panel');
111
+ }
112
+ if (this.options.scale_control) {
113
+ const div = this.container.querySelector('.treb-scale-control');
114
+ this.scale_control = new ScaleControl(div);
115
+ this.scale_control.Subscribe((event) => {
116
+ this.Publish(event);
117
+ });
118
+ this.UpdateScale(this.options.initial_scale || 1); // so we only have to write the scaling routine once
119
+ }
120
+ }
121
+ IsDoubleClick(index, timeout = 300) {
122
+ if (this.double_click_data.index === index) {
123
+ clearTimeout(this.double_click_data.timeout);
124
+ this.double_click_data.index = undefined;
125
+ this.double_click_data.timeout = undefined;
126
+ return true;
127
+ }
128
+ if (this.double_click_data.timeout) {
129
+ clearTimeout(this.double_click_data.timeout);
130
+ }
131
+ this.double_click_data.index = index;
132
+ // I don't think the window instance matters for this,
133
+ // but perhaps it's worth using DOM just for consistency
134
+ this.double_click_data.timeout = window.setTimeout(() => {
135
+ this.double_click_data.index = undefined;
136
+ this.double_click_data.timeout = undefined;
137
+ }, timeout);
138
+ return false;
139
+ }
140
+ Hide() {
141
+ this.Show(false);
142
+ }
143
+ Show(show = true) {
144
+ if (!this.container) {
145
+ return;
146
+ }
147
+ this._visible = show;
148
+ if (show) {
149
+ this.container.removeAttribute('hidden');
150
+ }
151
+ else {
152
+ this.container.setAttribute('hidden', '');
153
+ }
154
+ }
155
+ SetActive(tab, active, user = false) {
156
+ if (active) {
157
+ // tab.classList.add('treb-selected');
158
+ tab.setAttribute('selected', '');
159
+ if (tab.dataset.background_color) {
160
+ tab.style.backgroundColor = `color-mix(in srgb, ${tab.dataset.background_color} 20%, var(--treb-tab-bar-active-tab-background, #fff))`;
161
+ tab.style.color = '';
162
+ }
163
+ // this is forcing the page to scroll if the sheet is below
164
+ // the fold. this is not useful behavior. at the same time,
165
+ // we do need this to work... we probably have to do it manually
166
+ // instead of using scrollIntoView. would be nice if we could
167
+ // toggle this on manual/auto, so user clicks would still be
168
+ // smooth. call that a TODO
169
+ requestAnimationFrame(() => {
170
+ if (user) {
171
+ tab.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
172
+ }
173
+ else {
174
+ if (tab.parentElement) {
175
+ const left = tab.offsetLeft;
176
+ const width = tab.offsetWidth;
177
+ const container_width = tab.parentElement.clientWidth || 0;
178
+ const scroll_left = tab.parentElement.scrollLeft || 0;
179
+ if (left > container_width) {
180
+ tab.parentElement.scrollLeft = left - width;
181
+ }
182
+ else if (scroll_left > left) {
183
+ tab.parentElement.scrollLeft = left;
184
+ }
185
+ }
186
+ }
187
+ });
188
+ }
189
+ else {
190
+ // tab.classList.remove('treb-selected');
191
+ tab.removeAttribute('selected');
192
+ if (tab.dataset.background_color) {
193
+ tab.style.backgroundColor = tab.dataset.background_color;
194
+ }
195
+ if (tab.dataset.foreground_color) {
196
+ tab.style.color = tab.dataset.foreground_color;
197
+ }
198
+ }
199
+ }
200
+ /** change scale if we have a scale label */
201
+ UpdateScale(scale) {
202
+ this.scale_control?.UpdateScale(scale * 100);
203
+ }
204
+ DoubleClickTab(event, tab, sheet) {
205
+ tab.contentEditable = 'true';
206
+ if (this.DOM.doc) {
207
+ const selection = this.DOM.GetSelection();
208
+ if (selection) {
209
+ selection.removeAllRanges();
210
+ const range = this.DOM.doc.createRange();
211
+ range.selectNodeContents(tab);
212
+ selection.addRange(range);
213
+ }
214
+ }
215
+ tab.addEventListener('keydown', (inner_event) => {
216
+ switch (inner_event.key) {
217
+ case 'Enter':
218
+ // const name = tab.innerText.trim();
219
+ this.Publish({
220
+ type: 'rename-sheet',
221
+ name: tab.innerText.trim(),
222
+ sheet,
223
+ });
224
+ break;
225
+ case 'Escape':
226
+ tab.innerText = sheet.name;
227
+ this.Publish({ type: 'cancel' });
228
+ this.Update(true);
229
+ break;
230
+ default:
231
+ return;
232
+ }
233
+ inner_event.stopPropagation();
234
+ inner_event.preventDefault();
235
+ });
236
+ tab.addEventListener('focusout', () => {
237
+ const name = tab.innerText.trim();
238
+ if (name !== sheet.name) {
239
+ this.Publish({ type: 'rename-sheet', name, sheet });
240
+ }
241
+ else {
242
+ this.Update(true);
243
+ }
244
+ });
245
+ tab.focus();
246
+ }
247
+ MouseDownTab(event, tab, sheet, index, tabs) {
248
+ event.stopPropagation();
249
+ event.preventDefault();
250
+ if (this.IsDoubleClick(index)) {
251
+ return; // seems to allow us to process double clicks normally...
252
+ }
253
+ this.Publish({ type: 'activate-sheet', sheet });
254
+ let rectangles = tabs.map((element) => element.getBoundingClientRect());
255
+ let order = index * 2 - 1;
256
+ // orginal
257
+ const left = rectangles[0].left;
258
+ const right = rectangles[rectangles.length - 1].right;
259
+ const top = rectangles[0].top;
260
+ const bottom = rectangles[0].bottom;
261
+ const min = -1;
262
+ const max = (rectangles.length - 1) * 2 + 1;
263
+ // see above re: dragging and activation. if the tabs aren't rebuilt,
264
+ // then the classes won't change.
265
+ for (const candidate of tabs) {
266
+ this.SetActive(candidate, candidate === tab, true);
267
+ }
268
+ this.dragging = true;
269
+ // ghost is a good idea but we need to delay it, because
270
+ // it starts to flicker if you just click a tab to select
271
+ // it (or double click to rename)
272
+ /*
273
+ const ghost = document.createElement('div');
274
+ ghost.classList.add('ghost-tab');
275
+ ghost.appendChild(tab.cloneNode(true));
276
+ ghost.style.top = '-1000px';
277
+ this.layout.mask.appendChild(ghost);
278
+ */
279
+ MouseDrag(this.layout.mask, [], (move_event) => {
280
+ const [x, y] = [move_event.clientX, move_event.clientY];
281
+ /*
282
+ ghost.style.top = `${y}px`;
283
+ ghost.style.left = `${x}px`;
284
+ */
285
+ if (y > top && y < bottom) {
286
+ let new_order = order;
287
+ if (x < left) {
288
+ new_order = min;
289
+ }
290
+ else if (x > right) {
291
+ new_order = max;
292
+ }
293
+ else {
294
+ for (let i = 0; i < rectangles.length; i++) {
295
+ const rectangle = rectangles[i];
296
+ if (x >= rectangle.left && x <= rectangle.right) {
297
+ if (i !== index) {
298
+ if (x >= rectangle.left + rectangle.width / 2) {
299
+ new_order = (i * 2) + 1;
300
+ }
301
+ else {
302
+ new_order = (i * 2) - 1;
303
+ }
304
+ }
305
+ break;
306
+ }
307
+ }
308
+ }
309
+ if (new_order !== order) {
310
+ order = new_order;
311
+ tab.style.order = order.toString();
312
+ rectangles = tabs.map((element) => element.getBoundingClientRect());
313
+ }
314
+ }
315
+ }, () => {
316
+ let current = index;
317
+ let move_before = (order + 1) / 2;
318
+ /*
319
+ this.layout.mask.removeChild(ghost);
320
+ */
321
+ // console.info('set false')
322
+ this.dragging = false;
323
+ // the indexes we have are visible tabs only, so we may need
324
+ // to adjust if there are hidden tabs in between.
325
+ for (let i = 0; i < this.model.sheets.length; i++) {
326
+ if (!this.model.sheets.list[i].visible) {
327
+ if (current >= i) {
328
+ current++;
329
+ }
330
+ if (move_before >= i) {
331
+ move_before++;
332
+ }
333
+ }
334
+ }
335
+ if ((current === move_before) ||
336
+ (current === 0 && move_before <= 0) ||
337
+ (current === tabs.length - 1 && move_before >= tabs.length - 1)) {
338
+ // didn't change
339
+ }
340
+ else {
341
+ this.Publish({ type: 'reorder-sheet', index: current, move_before });
342
+ }
343
+ });
344
+ }
345
+ UpdateTheme() {
346
+ this.tab_color_cache.clear();
347
+ this.Update();
348
+ }
349
+ /**
350
+ * update tabs from model.
351
+ *
352
+ * @param user - this is a user action, so use smooth scrolling
353
+ * when activating the tab. otherwise it's automatic so jump.
354
+ */
355
+ Update(user = false) {
356
+ this.tab_color_cache.clear(); // we're setting tab color but it's not getting updated otherwise
357
+ // this is a hack to normalize behavior if you try to re-order
358
+ // a tab that's not the active tab. what ordinarily happens is
359
+ // we start the drag, but then Update is called again which rebuilds
360
+ // tabs and throws out the old set.
361
+ // at the same time we want to activate on mousedown, not mouseup.
362
+ // so for the time being we just block the rebuild if we are dragging.
363
+ // longer term it's a FIXME.
364
+ if (this.dragging) {
365
+ return;
366
+ }
367
+ if (this.options.tab_bar === 'auto') {
368
+ const visible_count = this.model.sheets.list.reduce((count, test) => test.visible ? count + 1 : count, 0);
369
+ if (visible_count <= 1) {
370
+ this.Show(false);
371
+ return;
372
+ }
373
+ this.Show(true);
374
+ }
375
+ if (!this.tab_container) {
376
+ return;
377
+ }
378
+ // clear
379
+ this.tab_container.innerText = '';
380
+ // we need to pass the full array to the drag function, so collect them
381
+ const tabs = [];
382
+ for (const sheet of this.model.sheets.list) {
383
+ if (!sheet.visible) {
384
+ continue;
385
+ }
386
+ const index = tabs.length;
387
+ const tab = this.DOM.Create('li');
388
+ tab.setAttribute('tabindex', '0');
389
+ if (sheet.tab_color) {
390
+ const id = sheet.id;
391
+ if (!this.tab_color_cache.has(id)) {
392
+ const background = ResolveThemeColor(this.theme, sheet.tab_color);
393
+ const foreground = ResolveThemeColor(this.theme, { offset: sheet.tab_color });
394
+ if (background && foreground) {
395
+ this.tab_color_cache.set(id, { background, foreground });
396
+ }
397
+ }
398
+ const color = this.tab_color_cache.get(id);
399
+ if (color) {
400
+ tab.style.backgroundColor = color.background;
401
+ tab.style.color = color.foreground;
402
+ tab.dataset.background_color = color.background;
403
+ tab.dataset.foreground_color = color.foreground;
404
+ }
405
+ }
406
+ // tab.classList.add('tab');
407
+ tab.style.order = (index * 2).toString();
408
+ tab.role = 'tab';
409
+ this.SetActive(tab, sheet === this.view.active_sheet, user);
410
+ const mousedown = (event) => this.MouseDownTab(event, tab, sheet, index, tabs);
411
+ const doubleclick = (event) => {
412
+ tab.removeEventListener('mousedown', mousedown);
413
+ tab.removeEventListener('dblclick', doubleclick);
414
+ this.DoubleClickTab(event, tab, sheet);
415
+ };
416
+ // you need the inner span for ellipsis, if we want that
417
+ tab.textContent = sheet.name;
418
+ // tab.innerHTML = `<span>${sheet.name}</span>`;
419
+ tab.addEventListener('dblclick', doubleclick);
420
+ tab.addEventListener('mousedown', mousedown);
421
+ this.tab_container.appendChild(tab);
422
+ tabs.push(tab);
423
+ }
424
+ }
425
+ }
426
+ //# sourceMappingURL=tab_bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab_bar.js","sourceRoot":"","sources":["../../../../treb-grid/src/types/tab_bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAmB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AA8C5E;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAqB;IA6CnC;IACA;IACA;IACA;IACA;IA/CZ,mCAAmC;IAC3B,aAAa,CAAe;IAC5B,aAAa,CAAgB;IAC7B,WAAW,CAAkB;IAE7B,QAAQ,GAAG,KAAK,CAAC;IAEjB,iBAAiB,GAGrB,EAAE,CAAC;IAEC,eAAe,GAA4D,IAAI,GAAG,EAAE,CAAC;IAE7F,0CAA0C;IAClC,QAAQ,GAAG,KAAK,CAAC;IAEzB,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAW,UAAU,CAAC,KAAmB;QACvC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,WAAW,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC,QAAQ;YACzC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;gBAE1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MA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AAE,SAAS,CAAC,CAAC;gBAChD,GAAG,CAAC,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBACjD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACzC,CAAC,CAAC;YAEF,wDAAwD;YAExD,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC;YAC7B,gDAAgD;YAEhD,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YAC9C,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAE7C,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEjB,CAAC;IAEH,CAAC;CAEF"}
@@ -0,0 +1,29 @@
1
+ import type { Point, Size, Position } from 'treb-base-types';
2
+ /**
3
+ * tile adds some metadata to canvas
4
+ *
5
+ * FIXME: there might be some performance cost with this, versus a wrapper
6
+ * or container class/interface that just holds the canvas.
7
+ */
8
+ export interface Tile extends HTMLCanvasElement {
9
+ /** contents have changed, needs repainting */
10
+ dirty: boolean;
11
+ /** never painted or layout has changed: repaint everything */
12
+ needs_full_repaint: boolean;
13
+ /** position in the grid, in grid rows/columns */
14
+ tile_position: Position;
15
+ /** first cell in the tile */
16
+ first_cell: Position;
17
+ /** last cell in the tile, more useful than extent */
18
+ last_cell: Position;
19
+ /** position in the grid, in pixels */
20
+ pixel_start: Point;
21
+ /** position in the grid, in pixels */
22
+ pixel_end: Point;
23
+ /**
24
+ * tile size in pixels, matching css height/width. this is
25
+ * different than the _canvas_ height/width, which is scaled
26
+ * to dpr for high-dpi displays.
27
+ */
28
+ logical_size: Size;
29
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2026 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=tile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile.js","sourceRoot":"","sources":["../../../../treb-grid/src/types/tile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -0,0 +1,48 @@
1
+ import type { Area } from 'treb-base-types';
2
+ /**
3
+ * trying to split data management from the grid, we are updating the
4
+ * command queue so that (some/most) methods return hints as to what
5
+ * needs to update: a nonvisible grid can just ignore this, but the
6
+ * visible grid can use it to trigger layout/repaint/etc.
7
+ */
8
+ export interface UpdateFlags {
9
+ /** sheet names or order have changed, update the tab bar */
10
+ sheets?: boolean;
11
+ /**
12
+ * structure refers to rows/columns/sheets -- something has been
13
+ * added, removed, or resized
14
+ */
15
+ structure?: boolean;
16
+ /**
17
+ * on sheet change, hide hover info -- hyperlink, note, &c
18
+ */
19
+ active_sheet?: boolean;
20
+ /**
21
+ * formula -- we might need to update the formula bar
22
+ */
23
+ formula?: boolean;
24
+ /**
25
+ * layout is changing. use this as a proxy for the old "queue layout update"
26
+ */
27
+ layout?: boolean;
28
+ /** non-active sheets updated. we set flags to update layout on activate */
29
+ pending?: number[];
30
+ /**
31
+ * this is only used by the setheaders command, which needs to come
32
+ * out. so this should also come out.
33
+ */
34
+ repaint?: boolean;
35
+ data_event?: boolean;
36
+ style_event?: boolean;
37
+ conditional_formatting_event?: boolean;
38
+ structure_event?: boolean;
39
+ structure_rebuild_required?: boolean;
40
+ /**
41
+ * new, an indication to split views that we might need to update/reinflate
42
+ * annotations.
43
+ */
44
+ annotation_event?: boolean;
45
+ render_area?: Area;
46
+ data_area?: Area;
47
+ style_area?: Area;
48
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2026 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=update_flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_flags.js","sourceRoot":"","sources":["../../../../treb-grid/src/types/update_flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -0,0 +1,21 @@
1
+ export interface FontMetrics {
2
+ /** from textmetrics, this is the font ascent (max, essentially) */
3
+ ascent: number;
4
+ /** from textmetrics, this is the font descent (max) */
5
+ descent: number;
6
+ /** total height for the font (line height). just ascent + descent. should we +1 for baseline? */
7
+ height: number;
8
+ /** width of one paren */
9
+ paren: number;
10
+ /** width of one hash (#) character */
11
+ hash: number;
12
+ }
13
+ /**
14
+ * get font metrics for the given font, which includes a size.
15
+ * precompute the size, we're not doing that anymore.
16
+ */
17
+ export declare const Get: (font: string, variants?: string) => FontMetrics;
18
+ /**
19
+ * flush cache. this should be called when you update the theme
20
+ */
21
+ export declare const Flush: () => void;