@visactor/vtable 0.9.0-alpha.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1210) hide show
  1. package/README.md +152 -0
  2. package/cjs/ListTable.d.ts +38 -0
  3. package/cjs/ListTable.js +258 -0
  4. package/cjs/ListTable.js.map +1 -0
  5. package/cjs/PivotTable.d.ts +50 -0
  6. package/cjs/PivotTable.js +275 -0
  7. package/cjs/PivotTable.js.map +1 -0
  8. package/cjs/body-helper/body-helper.d.ts +14 -0
  9. package/cjs/body-helper/body-helper.js +99 -0
  10. package/cjs/body-helper/body-helper.js.map +1 -0
  11. package/cjs/body-helper/style/ImageStyle.d.ts +7 -0
  12. package/cjs/body-helper/style/ImageStyle.js +24 -0
  13. package/cjs/body-helper/style/ImageStyle.js.map +1 -0
  14. package/cjs/body-helper/style/MultilineTextStyle.d.ts +13 -0
  15. package/cjs/body-helper/style/MultilineTextStyle.js +38 -0
  16. package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -0
  17. package/cjs/body-helper/style/NumberStyle.d.ts +7 -0
  18. package/cjs/body-helper/style/NumberStyle.js +24 -0
  19. package/cjs/body-helper/style/NumberStyle.js.map +1 -0
  20. package/cjs/body-helper/style/ProgressBarStyle.d.ts +52 -0
  21. package/cjs/body-helper/style/ProgressBarStyle.js +126 -0
  22. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -0
  23. package/cjs/body-helper/style/Style.d.ts +85 -0
  24. package/cjs/body-helper/style/Style.js +200 -0
  25. package/cjs/body-helper/style/Style.js.map +1 -0
  26. package/cjs/body-helper/style.d.ts +10 -0
  27. package/cjs/body-helper/style.js +52 -0
  28. package/cjs/body-helper/style.js.map +1 -0
  29. package/cjs/chartType.d.ts +3 -0
  30. package/cjs/chartType.js +14 -0
  31. package/cjs/chartType.js.map +1 -0
  32. package/cjs/core/BaseTable.d.ts +287 -0
  33. package/cjs/core/BaseTable.js +1272 -0
  34. package/cjs/core/BaseTable.js.map +1 -0
  35. package/cjs/core/FouseInput.d.ts +11 -0
  36. package/cjs/core/FouseInput.js +38 -0
  37. package/cjs/core/FouseInput.js.map +1 -0
  38. package/cjs/core/TABLE_EVENT_TYPE.d.ts +30 -0
  39. package/cjs/core/TABLE_EVENT_TYPE.js +34 -0
  40. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -0
  41. package/cjs/core/tableHelper.d.ts +28 -0
  42. package/cjs/core/tableHelper.js +141 -0
  43. package/cjs/core/tableHelper.js.map +1 -0
  44. package/cjs/core.d.ts +3 -0
  45. package/cjs/core.js +24 -0
  46. package/cjs/core.js.map +1 -0
  47. package/cjs/data/CachedDataSource.d.ts +16 -0
  48. package/cjs/data/CachedDataSource.js +54 -0
  49. package/cjs/data/CachedDataSource.js.map +1 -0
  50. package/cjs/data/DataSource.d.ts +64 -0
  51. package/cjs/data/DataSource.js +294 -0
  52. package/cjs/data/DataSource.js.map +1 -0
  53. package/cjs/data/FilterDataSource.d.ts +1 -0
  54. package/cjs/data/FilterDataSource.js +1 -0
  55. package/cjs/data/FilterDataSource.js.map +1 -0
  56. package/cjs/data.d.ts +4 -0
  57. package/cjs/data.js +24 -0
  58. package/cjs/data.js.map +1 -0
  59. package/cjs/dataset/DataStatistics.d.ts +10 -0
  60. package/cjs/dataset/DataStatistics.js +81 -0
  61. package/cjs/dataset/DataStatistics.js.map +1 -0
  62. package/cjs/dataset/dataset.d.ts +72 -0
  63. package/cjs/dataset/dataset.js +490 -0
  64. package/cjs/dataset/dataset.js.map +1 -0
  65. package/cjs/dataset/flatDataToObject.d.ts +31 -0
  66. package/cjs/dataset/flatDataToObject.js +71 -0
  67. package/cjs/dataset/flatDataToObject.js.map +1 -0
  68. package/cjs/event/EventHandler.d.ts +45 -0
  69. package/cjs/event/EventHandler.js +120 -0
  70. package/cjs/event/EventHandler.js.map +1 -0
  71. package/cjs/event/EventTarget.d.ts +11 -0
  72. package/cjs/event/EventTarget.js +59 -0
  73. package/cjs/event/EventTarget.js.map +1 -0
  74. package/cjs/event/chart.d.ts +2 -0
  75. package/cjs/event/chart.js +24 -0
  76. package/cjs/event/chart.js.map +1 -0
  77. package/cjs/event/drill.d.ts +3 -0
  78. package/cjs/event/drill.js +23 -0
  79. package/cjs/event/drill.js.map +1 -0
  80. package/cjs/event/event.d.ts +35 -0
  81. package/cjs/event/event.js +426 -0
  82. package/cjs/event/event.js.map +1 -0
  83. package/cjs/event/media-click.d.ts +2 -0
  84. package/cjs/event/media-click.js +58 -0
  85. package/cjs/event/media-click.js.map +1 -0
  86. package/cjs/event/scroll.d.ts +2 -0
  87. package/cjs/event/scroll.js +23 -0
  88. package/cjs/event/scroll.js.map +1 -0
  89. package/cjs/header-helper/header-helper.d.ts +26 -0
  90. package/cjs/header-helper/header-helper.js +214 -0
  91. package/cjs/header-helper/header-helper.js.map +1 -0
  92. package/cjs/header-helper/style/ImageStyle.d.ts +7 -0
  93. package/cjs/header-helper/style/ImageStyle.js +25 -0
  94. package/cjs/header-helper/style/ImageStyle.js.map +1 -0
  95. package/cjs/header-helper/style/MultilineTextHeaderStyle.d.ts +13 -0
  96. package/cjs/header-helper/style/MultilineTextHeaderStyle.js +38 -0
  97. package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -0
  98. package/cjs/header-helper/style/SortHeaderStyle.d.ts +1 -0
  99. package/cjs/header-helper/style/SortHeaderStyle.js +3 -0
  100. package/cjs/header-helper/style/SortHeaderStyle.js.map +1 -0
  101. package/cjs/header-helper/style/Style.d.ts +88 -0
  102. package/cjs/header-helper/style/Style.js +208 -0
  103. package/cjs/header-helper/style/Style.js.map +1 -0
  104. package/cjs/header-helper/style.d.ts +5 -0
  105. package/cjs/header-helper/style.js +30 -0
  106. package/cjs/header-helper/style.js.map +1 -0
  107. package/cjs/icons.d.ts +4 -0
  108. package/cjs/icons.js +241 -0
  109. package/cjs/icons.js.map +1 -0
  110. package/cjs/index.d.ts +17 -0
  111. package/cjs/index.js +95 -0
  112. package/cjs/index.js.map +1 -0
  113. package/cjs/layout/index.d.ts +1 -0
  114. package/cjs/layout/index.js +15 -0
  115. package/cjs/layout/index.js.map +1 -0
  116. package/cjs/layout/pivot-header-layout.d.ts +155 -0
  117. package/cjs/layout/pivot-header-layout.js +897 -0
  118. package/cjs/layout/pivot-header-layout.js.map +1 -0
  119. package/cjs/layout/pivot-layout.d.ts +86 -0
  120. package/cjs/layout/pivot-layout.js +422 -0
  121. package/cjs/layout/pivot-layout.js.map +1 -0
  122. package/cjs/layout/simple-header-layout.d.ts +67 -0
  123. package/cjs/layout/simple-header-layout.js +413 -0
  124. package/cjs/layout/simple-header-layout.js.map +1 -0
  125. package/cjs/menu/dom/BaseMenu.d.ts +15 -0
  126. package/cjs/menu/dom/BaseMenu.js +30 -0
  127. package/cjs/menu/dom/BaseMenu.js.map +1 -0
  128. package/cjs/menu/dom/Menu.d.ts +9 -0
  129. package/cjs/menu/dom/Menu.js +24 -0
  130. package/cjs/menu/dom/Menu.js.map +1 -0
  131. package/cjs/menu/dom/MenuHandler.d.ts +20 -0
  132. package/cjs/menu/dom/MenuHandler.js +134 -0
  133. package/cjs/menu/dom/MenuHandler.js.map +1 -0
  134. package/cjs/menu/dom/logic/MenuContainer.d.ts +22 -0
  135. package/cjs/menu/dom/logic/MenuContainer.js +110 -0
  136. package/cjs/menu/dom/logic/MenuContainer.js.map +1 -0
  137. package/cjs/menu/dom/logic/MenuElement.css +86 -0
  138. package/cjs/menu/dom/logic/MenuElement.d.ts +27 -0
  139. package/cjs/menu/dom/logic/MenuElement.js +278 -0
  140. package/cjs/menu/dom/logic/MenuElement.js.map +1 -0
  141. package/cjs/plugins/chartTypes.d.ts +3 -0
  142. package/cjs/plugins/chartTypes.js +6 -0
  143. package/cjs/plugins/chartTypes.js.map +1 -0
  144. package/cjs/plugins/icons.d.ts +12 -0
  145. package/cjs/plugins/icons.js +26 -0
  146. package/cjs/plugins/icons.js.map +1 -0
  147. package/cjs/plugins/themes.d.ts +4 -0
  148. package/cjs/plugins/themes.js +6 -0
  149. package/cjs/plugins/themes.js.map +1 -0
  150. package/cjs/register.d.ts +5 -0
  151. package/cjs/register.js +35 -0
  152. package/cjs/register.js.map +1 -0
  153. package/cjs/render/layout/arc.d.ts +23 -0
  154. package/cjs/render/layout/arc.js +20 -0
  155. package/cjs/render/layout/arc.js.map +1 -0
  156. package/cjs/render/layout/circle.d.ts +19 -0
  157. package/cjs/render/layout/circle.js +19 -0
  158. package/cjs/render/layout/circle.js.map +1 -0
  159. package/cjs/render/layout/container.d.ts +52 -0
  160. package/cjs/render/layout/container.js +99 -0
  161. package/cjs/render/layout/container.js.map +1 -0
  162. package/cjs/render/layout/direction.d.ts +22 -0
  163. package/cjs/render/layout/direction.js +35 -0
  164. package/cjs/render/layout/direction.js.map +1 -0
  165. package/cjs/render/layout/element.d.ts +47 -0
  166. package/cjs/render/layout/element.js +27 -0
  167. package/cjs/render/layout/element.js.map +1 -0
  168. package/cjs/render/layout/group-element.d.ts +25 -0
  169. package/cjs/render/layout/group-element.js +52 -0
  170. package/cjs/render/layout/group-element.js.map +1 -0
  171. package/cjs/render/layout/icon.d.ts +21 -0
  172. package/cjs/render/layout/icon.js +48 -0
  173. package/cjs/render/layout/icon.js.map +1 -0
  174. package/cjs/render/layout/image.d.ts +21 -0
  175. package/cjs/render/layout/image.js +20 -0
  176. package/cjs/render/layout/image.js.map +1 -0
  177. package/cjs/render/layout/index.d.ts +9 -0
  178. package/cjs/render/layout/index.js +25 -0
  179. package/cjs/render/layout/index.js.map +1 -0
  180. package/cjs/render/layout/line.d.ts +32 -0
  181. package/cjs/render/layout/line.js +88 -0
  182. package/cjs/render/layout/line.js.map +1 -0
  183. package/cjs/render/layout/percent-calc.d.ts +8 -0
  184. package/cjs/render/layout/percent-calc.js +13 -0
  185. package/cjs/render/layout/percent-calc.js.map +1 -0
  186. package/cjs/render/layout/rect.d.ts +22 -0
  187. package/cjs/render/layout/rect.js +19 -0
  188. package/cjs/render/layout/rect.js.map +1 -0
  189. package/cjs/render/layout/text.d.ts +22 -0
  190. package/cjs/render/layout/text.js +26 -0
  191. package/cjs/render/layout/text.js.map +1 -0
  192. package/cjs/scenegraph/component/cell-content.d.ts +36 -0
  193. package/cjs/scenegraph/component/cell-content.js +100 -0
  194. package/cjs/scenegraph/component/cell-content.js.map +1 -0
  195. package/cjs/scenegraph/component/cell-mover.d.ts +15 -0
  196. package/cjs/scenegraph/component/cell-mover.js +107 -0
  197. package/cjs/scenegraph/component/cell-mover.js.map +1 -0
  198. package/cjs/scenegraph/component/custom.d.ts +7 -0
  199. package/cjs/scenegraph/component/custom.js +212 -0
  200. package/cjs/scenegraph/component/custom.js.map +1 -0
  201. package/cjs/scenegraph/component/drill-icon.d.ts +9 -0
  202. package/cjs/scenegraph/component/drill-icon.js +70 -0
  203. package/cjs/scenegraph/component/drill-icon.js.map +1 -0
  204. package/cjs/scenegraph/component/menu.d.ts +41 -0
  205. package/cjs/scenegraph/component/menu.js +214 -0
  206. package/cjs/scenegraph/component/menu.js.map +1 -0
  207. package/cjs/scenegraph/component/table-component.d.ts +37 -0
  208. package/cjs/scenegraph/component/table-component.js +302 -0
  209. package/cjs/scenegraph/component/table-component.js.map +1 -0
  210. package/cjs/scenegraph/component/util.d.ts +2 -0
  211. package/cjs/scenegraph/component/util.js +11 -0
  212. package/cjs/scenegraph/component/util.js.map +1 -0
  213. package/cjs/scenegraph/debug-tool/debug-tool.d.ts +36 -0
  214. package/cjs/scenegraph/debug-tool/debug-tool.js +138 -0
  215. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -0
  216. package/cjs/scenegraph/debug-tool/index.d.ts +4 -0
  217. package/cjs/scenegraph/debug-tool/index.js +14 -0
  218. package/cjs/scenegraph/debug-tool/index.js.map +1 -0
  219. package/cjs/scenegraph/graphic/chart.d.ts +30 -0
  220. package/cjs/scenegraph/graphic/chart.js +66 -0
  221. package/cjs/scenegraph/graphic/chart.js.map +1 -0
  222. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +10 -0
  223. package/cjs/scenegraph/graphic/contributions/chart-render.js +46 -0
  224. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -0
  225. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +70 -0
  226. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +195 -0
  227. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -0
  228. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +20 -0
  229. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +46 -0
  230. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -0
  231. package/cjs/scenegraph/graphic/contributions/index.d.ts +3 -0
  232. package/cjs/scenegraph/graphic/contributions/index.js +36 -0
  233. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -0
  234. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +17 -0
  235. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +47 -0
  236. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -0
  237. package/cjs/scenegraph/graphic/group.d.ts +23 -0
  238. package/cjs/scenegraph/graphic/group.js +94 -0
  239. package/cjs/scenegraph/graphic/group.js.map +1 -0
  240. package/cjs/scenegraph/graphic/icon.d.ts +24 -0
  241. package/cjs/scenegraph/graphic/icon.js +25 -0
  242. package/cjs/scenegraph/graphic/icon.js.map +1 -0
  243. package/cjs/scenegraph/graphic/text.d.ts +16 -0
  244. package/cjs/scenegraph/graphic/text.js +146 -0
  245. package/cjs/scenegraph/graphic/text.js.map +1 -0
  246. package/cjs/scenegraph/group-creater/cell-helper.d.ts +7 -0
  247. package/cjs/scenegraph/group-creater/cell-helper.js +84 -0
  248. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -0
  249. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +3 -0
  250. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +78 -0
  251. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -0
  252. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +7 -0
  253. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +123 -0
  254. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -0
  255. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +9 -0
  256. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +342 -0
  257. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -0
  258. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +3 -0
  259. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +163 -0
  260. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -0
  261. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +5 -0
  262. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +64 -0
  263. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -0
  264. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +4 -0
  265. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +100 -0
  266. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -0
  267. package/cjs/scenegraph/group-creater/column-helper.d.ts +24 -0
  268. package/cjs/scenegraph/group-creater/column-helper.js +136 -0
  269. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -0
  270. package/cjs/scenegraph/group-creater/column.d.ts +14 -0
  271. package/cjs/scenegraph/group-creater/column.js +57 -0
  272. package/cjs/scenegraph/group-creater/column.js.map +1 -0
  273. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +45 -0
  274. package/cjs/scenegraph/group-creater/progress/proxy.js +267 -0
  275. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -0
  276. package/cjs/scenegraph/header-icon/layout.d.ts +3 -0
  277. package/cjs/scenegraph/header-icon/layout.js +75 -0
  278. package/cjs/scenegraph/header-icon/layout.js.map +1 -0
  279. package/cjs/scenegraph/hover-state.d.ts +14 -0
  280. package/cjs/scenegraph/hover-state.js +27 -0
  281. package/cjs/scenegraph/hover-state.js.map +1 -0
  282. package/cjs/scenegraph/layout/auto-height.d.ts +2 -0
  283. package/cjs/scenegraph/layout/auto-height.js +50 -0
  284. package/cjs/scenegraph/layout/auto-height.js.map +1 -0
  285. package/cjs/scenegraph/layout/auto-width.d.ts +2 -0
  286. package/cjs/scenegraph/layout/auto-width.js +85 -0
  287. package/cjs/scenegraph/layout/auto-width.js.map +1 -0
  288. package/cjs/scenegraph/layout/compute-col-width.d.ts +3 -0
  289. package/cjs/scenegraph/layout/compute-col-width.js +194 -0
  290. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -0
  291. package/cjs/scenegraph/layout/move-cell.d.ts +2 -0
  292. package/cjs/scenegraph/layout/move-cell.js +61 -0
  293. package/cjs/scenegraph/layout/move-cell.js.map +1 -0
  294. package/cjs/scenegraph/layout/update-cell.d.ts +3 -0
  295. package/cjs/scenegraph/layout/update-cell.js +55 -0
  296. package/cjs/scenegraph/layout/update-cell.js.map +1 -0
  297. package/cjs/scenegraph/layout/update-height.d.ts +6 -0
  298. package/cjs/scenegraph/layout/update-height.js +90 -0
  299. package/cjs/scenegraph/layout/update-height.js.map +1 -0
  300. package/cjs/scenegraph/layout/update-width.d.ts +2 -0
  301. package/cjs/scenegraph/layout/update-width.js +103 -0
  302. package/cjs/scenegraph/layout/update-width.js.map +1 -0
  303. package/cjs/scenegraph/scenegraph.d.ts +109 -0
  304. package/cjs/scenegraph/scenegraph.js +798 -0
  305. package/cjs/scenegraph/scenegraph.js.map +1 -0
  306. package/cjs/scenegraph/style/frame-border.d.ts +3 -0
  307. package/cjs/scenegraph/style/frame-border.js +43 -0
  308. package/cjs/scenegraph/style/frame-border.js.map +1 -0
  309. package/cjs/scenegraph/utils/border-line.d.ts +8 -0
  310. package/cjs/scenegraph/utils/border-line.js +51 -0
  311. package/cjs/scenegraph/utils/border-line.js.map +1 -0
  312. package/cjs/scenegraph/utils/break-string.d.ts +1 -0
  313. package/cjs/scenegraph/utils/break-string.js +37 -0
  314. package/cjs/scenegraph/utils/break-string.js.map +1 -0
  315. package/cjs/scenegraph/utils/cell-pos.d.ts +4 -0
  316. package/cjs/scenegraph/utils/cell-pos.js +18 -0
  317. package/cjs/scenegraph/utils/cell-pos.js.map +1 -0
  318. package/cjs/scenegraph/utils/font.d.ts +1 -0
  319. package/cjs/scenegraph/utils/font.js +20 -0
  320. package/cjs/scenegraph/utils/font.js.map +1 -0
  321. package/cjs/scenegraph/utils/get-cell-merge.d.ts +3 -0
  322. package/cjs/scenegraph/utils/get-cell-merge.js +11 -0
  323. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -0
  324. package/cjs/scenegraph/utils/get-prop.d.ts +4 -0
  325. package/cjs/scenegraph/utils/get-prop.js +44 -0
  326. package/cjs/scenegraph/utils/get-prop.js.map +1 -0
  327. package/cjs/scenegraph/utils/icon.d.ts +12 -0
  328. package/cjs/scenegraph/utils/icon.js +35 -0
  329. package/cjs/scenegraph/utils/icon.js.map +1 -0
  330. package/cjs/scenegraph/utils/keep-aspect-ratio.d.ts +4 -0
  331. package/cjs/scenegraph/utils/keep-aspect-ratio.js +16 -0
  332. package/cjs/scenegraph/utils/keep-aspect-ratio.js.map +1 -0
  333. package/cjs/scenegraph/utils/measure-text.d.ts +20 -0
  334. package/cjs/scenegraph/utils/measure-text.js +111 -0
  335. package/cjs/scenegraph/utils/measure-text.js.map +1 -0
  336. package/cjs/scenegraph/utils/padding.d.ts +1 -0
  337. package/cjs/scenegraph/utils/padding.js +16 -0
  338. package/cjs/scenegraph/utils/padding.js.map +1 -0
  339. package/cjs/scenegraph/utils/text-icon-layout.d.ts +9 -0
  340. package/cjs/scenegraph/utils/text-icon-layout.js +237 -0
  341. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -0
  342. package/cjs/scenegraph/utils/text-pos.d.ts +8 -0
  343. package/cjs/scenegraph/utils/text-pos.js +27 -0
  344. package/cjs/scenegraph/utils/text-pos.js.map +1 -0
  345. package/cjs/state/cell-move/adjust-header.d.ts +3 -0
  346. package/cjs/state/cell-move/adjust-header.js +20 -0
  347. package/cjs/state/cell-move/adjust-header.js.map +1 -0
  348. package/cjs/state/cell-move/index.d.ts +4 -0
  349. package/cjs/state/cell-move/index.js +60 -0
  350. package/cjs/state/cell-move/index.js.map +1 -0
  351. package/cjs/state/common/check-in-select.d.ts +8 -0
  352. package/cjs/state/common/check-in-select.js +63 -0
  353. package/cjs/state/common/check-in-select.js.map +1 -0
  354. package/cjs/state/drill/index.d.ts +2 -0
  355. package/cjs/state/drill/index.js +15 -0
  356. package/cjs/state/drill/index.js.map +1 -0
  357. package/cjs/state/hover/col.d.ts +5 -0
  358. package/cjs/state/hover/col.js +24 -0
  359. package/cjs/state/hover/col.js.map +1 -0
  360. package/cjs/state/hover/is-cell-hover.d.ts +5 -0
  361. package/cjs/state/hover/is-cell-hover.js +36 -0
  362. package/cjs/state/hover/is-cell-hover.js.map +1 -0
  363. package/cjs/state/hover/row.d.ts +5 -0
  364. package/cjs/state/hover/row.js +22 -0
  365. package/cjs/state/hover/row.js.map +1 -0
  366. package/cjs/state/hover/single.d.ts +5 -0
  367. package/cjs/state/hover/single.js +18 -0
  368. package/cjs/state/hover/single.js.map +1 -0
  369. package/cjs/state/hover/update-cell.d.ts +2 -0
  370. package/cjs/state/hover/update-cell.js +13 -0
  371. package/cjs/state/hover/update-cell.js.map +1 -0
  372. package/cjs/state/hover/update-position.d.ts +2 -0
  373. package/cjs/state/hover/update-position.js +44 -0
  374. package/cjs/state/hover/update-position.js.map +1 -0
  375. package/cjs/state/pin/index.d.ts +2 -0
  376. package/cjs/state/pin/index.js +10 -0
  377. package/cjs/state/pin/index.js.map +1 -0
  378. package/cjs/state/select/update-position.d.ts +4 -0
  379. package/cjs/state/select/update-position.js +111 -0
  380. package/cjs/state/select/update-position.js.map +1 -0
  381. package/cjs/state/sort/index.d.ts +2 -0
  382. package/cjs/state/sort/index.js +41 -0
  383. package/cjs/state/sort/index.js.map +1 -0
  384. package/cjs/state/spark-line/index.d.ts +3 -0
  385. package/cjs/state/spark-line/index.js +98 -0
  386. package/cjs/state/spark-line/index.js.map +1 -0
  387. package/cjs/state/state.d.ts +155 -0
  388. package/cjs/state/state.js +431 -0
  389. package/cjs/state/state.js.map +1 -0
  390. package/cjs/themes/ARCO.d.ts +3 -0
  391. package/cjs/themes/ARCO.js +114 -0
  392. package/cjs/themes/ARCO.js.map +1 -0
  393. package/cjs/themes/BRIGHT.d.ts +3 -0
  394. package/cjs/themes/BRIGHT.js +71 -0
  395. package/cjs/themes/BRIGHT.js.map +1 -0
  396. package/cjs/themes/DARK.d.ts +3 -0
  397. package/cjs/themes/DARK.js +90 -0
  398. package/cjs/themes/DARK.js.map +1 -0
  399. package/cjs/themes/DEFAULT.d.ts +3 -0
  400. package/cjs/themes/DEFAULT.js +89 -0
  401. package/cjs/themes/DEFAULT.js.map +1 -0
  402. package/cjs/themes/SIMPLIFY.d.ts +3 -0
  403. package/cjs/themes/SIMPLIFY.js +46 -0
  404. package/cjs/themes/SIMPLIFY.js.map +1 -0
  405. package/cjs/themes/theme.d.ts +34 -0
  406. package/cjs/themes/theme.js +520 -0
  407. package/cjs/themes/theme.js.map +1 -0
  408. package/cjs/themes.d.ts +28 -0
  409. package/cjs/themes.js +52 -0
  410. package/cjs/themes.js.map +1 -0
  411. package/cjs/tools/LimitPromiseQueue.d.ts +8 -0
  412. package/cjs/tools/LimitPromiseQueue.js +29 -0
  413. package/cjs/tools/LimitPromiseQueue.js.map +1 -0
  414. package/cjs/tools/NumberMap.d.ts +16 -0
  415. package/cjs/tools/NumberMap.js +76 -0
  416. package/cjs/tools/NumberMap.js.map +1 -0
  417. package/cjs/tools/Rect.d.ts +24 -0
  418. package/cjs/tools/Rect.js +69 -0
  419. package/cjs/tools/Rect.js.map +1 -0
  420. package/cjs/tools/calc.d.ts +5 -0
  421. package/cjs/tools/calc.js +197 -0
  422. package/cjs/tools/calc.js.map +1 -0
  423. package/cjs/tools/debounce.d.ts +1 -0
  424. package/cjs/tools/debounce.js +51 -0
  425. package/cjs/tools/debounce.js.map +1 -0
  426. package/cjs/tools/dom.d.ts +1 -0
  427. package/cjs/tools/dom.js +11 -0
  428. package/cjs/tools/dom.js.map +1 -0
  429. package/cjs/tools/env.d.ts +19 -0
  430. package/cjs/tools/env.js +48 -0
  431. package/cjs/tools/env.js.map +1 -0
  432. package/cjs/tools/global.d.ts +13 -0
  433. package/cjs/tools/global.js +12 -0
  434. package/cjs/tools/global.js.map +1 -0
  435. package/cjs/tools/helper.d.ts +60 -0
  436. package/cjs/tools/helper.js +216 -0
  437. package/cjs/tools/helper.js.map +1 -0
  438. package/cjs/tools/icons.d.ts +4 -0
  439. package/cjs/tools/icons.js +10 -0
  440. package/cjs/tools/icons.js.map +1 -0
  441. package/cjs/tools/isx.d.ts +16 -0
  442. package/cjs/tools/isx.js +117 -0
  443. package/cjs/tools/isx.js.map +1 -0
  444. package/cjs/tools/sort.d.ts +1 -0
  445. package/cjs/tools/sort.js +18 -0
  446. package/cjs/tools/sort.js.map +1 -0
  447. package/cjs/tools/style.css +60 -0
  448. package/cjs/tools/style.d.ts +2 -0
  449. package/cjs/tools/style.js +11 -0
  450. package/cjs/tools/style.js.map +1 -0
  451. package/cjs/tools/text-width.d.ts +1 -0
  452. package/cjs/tools/text-width.js +17 -0
  453. package/cjs/tools/text-width.js.map +1 -0
  454. package/cjs/tools/util.d.ts +45 -0
  455. package/cjs/tools/util.js +299 -0
  456. package/cjs/tools/util.js.map +1 -0
  457. package/cjs/tooltip/BaseTooltip.d.ts +22 -0
  458. package/cjs/tooltip/BaseTooltip.js +35 -0
  459. package/cjs/tooltip/BaseTooltip.js.map +1 -0
  460. package/cjs/tooltip/Tooltip.d.ts +5 -0
  461. package/cjs/tooltip/Tooltip.js +16 -0
  462. package/cjs/tooltip/Tooltip.js.map +1 -0
  463. package/cjs/tooltip/TooltipHandler.d.ts +27 -0
  464. package/cjs/tooltip/TooltipHandler.js +129 -0
  465. package/cjs/tooltip/TooltipHandler.js.map +1 -0
  466. package/cjs/tooltip/logic/BubbleTooltipElement.css +63 -0
  467. package/cjs/tooltip/logic/BubbleTooltipElement.d.ts +33 -0
  468. package/cjs/tooltip/logic/BubbleTooltipElement.js +152 -0
  469. package/cjs/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  470. package/cjs/ts-types/base-table.d.ts +313 -0
  471. package/cjs/ts-types/base-table.js +6 -0
  472. package/cjs/ts-types/base-table.js.map +1 -0
  473. package/cjs/ts-types/chartType.d.ts +53 -0
  474. package/cjs/ts-types/chartType.js +6 -0
  475. package/cjs/ts-types/chartType.js.map +1 -0
  476. package/cjs/ts-types/column/index.d.ts +2 -0
  477. package/cjs/ts-types/column/index.js +21 -0
  478. package/cjs/ts-types/column/index.js.map +1 -0
  479. package/cjs/ts-types/column/style.d.ts +78 -0
  480. package/cjs/ts-types/column/style.js +6 -0
  481. package/cjs/ts-types/column/style.js.map +1 -0
  482. package/cjs/ts-types/column/type.d.ts +2 -0
  483. package/cjs/ts-types/column/type.js +6 -0
  484. package/cjs/ts-types/column/type.js.map +1 -0
  485. package/cjs/ts-types/common.d.ts +72 -0
  486. package/cjs/ts-types/common.js +6 -0
  487. package/cjs/ts-types/common.js.map +1 -0
  488. package/cjs/ts-types/customElement.d.ts +111 -0
  489. package/cjs/ts-types/customElement.js +6 -0
  490. package/cjs/ts-types/customElement.js.map +1 -0
  491. package/cjs/ts-types/customLayout.d.ts +8 -0
  492. package/cjs/ts-types/customLayout.js +6 -0
  493. package/cjs/ts-types/customLayout.js.map +1 -0
  494. package/cjs/ts-types/events.d.ts +182 -0
  495. package/cjs/ts-types/events.js +6 -0
  496. package/cjs/ts-types/events.js.map +1 -0
  497. package/cjs/ts-types/icon.d.ts +86 -0
  498. package/cjs/ts-types/icon.js +26 -0
  499. package/cjs/ts-types/icon.js.map +1 -0
  500. package/cjs/ts-types/index.d.ts +15 -0
  501. package/cjs/ts-types/index.js +28 -0
  502. package/cjs/ts-types/index.js.map +1 -0
  503. package/cjs/ts-types/list-table/define/basic-define.d.ts +36 -0
  504. package/cjs/ts-types/list-table/define/basic-define.js +6 -0
  505. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -0
  506. package/cjs/ts-types/list-table/define/chart-define.d.ts +10 -0
  507. package/cjs/ts-types/list-table/define/chart-define.js +6 -0
  508. package/cjs/ts-types/list-table/define/chart-define.js.map +1 -0
  509. package/cjs/ts-types/list-table/define/image-define.d.ts +15 -0
  510. package/cjs/ts-types/list-table/define/image-define.js +6 -0
  511. package/cjs/ts-types/list-table/define/image-define.js.map +1 -0
  512. package/cjs/ts-types/list-table/define/index.d.ts +21 -0
  513. package/cjs/ts-types/list-table/define/index.js +6 -0
  514. package/cjs/ts-types/list-table/define/index.js.map +1 -0
  515. package/cjs/ts-types/list-table/define/link-define.d.ts +17 -0
  516. package/cjs/ts-types/list-table/define/link-define.js +6 -0
  517. package/cjs/ts-types/list-table/define/link-define.js.map +1 -0
  518. package/cjs/ts-types/list-table/define/multilinetext-define.d.ts +12 -0
  519. package/cjs/ts-types/list-table/define/multilinetext-define.js +6 -0
  520. package/cjs/ts-types/list-table/define/multilinetext-define.js.map +1 -0
  521. package/cjs/ts-types/list-table/define/progressbar-define.d.ts +11 -0
  522. package/cjs/ts-types/list-table/define/progressbar-define.js +6 -0
  523. package/cjs/ts-types/list-table/define/progressbar-define.js.map +1 -0
  524. package/cjs/ts-types/list-table/define/sparkline-define.d.ts +10 -0
  525. package/cjs/ts-types/list-table/define/sparkline-define.js +6 -0
  526. package/cjs/ts-types/list-table/define/sparkline-define.js.map +1 -0
  527. package/cjs/ts-types/list-table/index.d.ts +2 -0
  528. package/cjs/ts-types/list-table/index.js +21 -0
  529. package/cjs/ts-types/list-table/index.js.map +1 -0
  530. package/cjs/ts-types/list-table/layout-map/api.d.ts +92 -0
  531. package/cjs/ts-types/list-table/layout-map/api.js +6 -0
  532. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -0
  533. package/cjs/ts-types/list-table/layout-map/index.d.ts +1 -0
  534. package/cjs/ts-types/list-table/layout-map/index.js +6 -0
  535. package/cjs/ts-types/list-table/layout-map/index.js.map +1 -0
  536. package/cjs/ts-types/menu.d.ts +73 -0
  537. package/cjs/ts-types/menu.js +6 -0
  538. package/cjs/ts-types/menu.js.map +1 -0
  539. package/cjs/ts-types/new-data-set.d.ts +95 -0
  540. package/cjs/ts-types/new-data-set.js +14 -0
  541. package/cjs/ts-types/new-data-set.js.map +1 -0
  542. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +6 -0
  543. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +13 -0
  544. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -0
  545. package/cjs/ts-types/pivot-table/corner.d.ts +19 -0
  546. package/cjs/ts-types/pivot-table/corner.js +6 -0
  547. package/cjs/ts-types/pivot-table/corner.js.map +1 -0
  548. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +25 -0
  549. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js +6 -0
  550. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -0
  551. package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +9 -0
  552. package/cjs/ts-types/pivot-table/dimension/image-dimension.js +6 -0
  553. package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -0
  554. package/cjs/ts-types/pivot-table/dimension/index.d.ts +4 -0
  555. package/cjs/ts-types/pivot-table/dimension/index.js +6 -0
  556. package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -0
  557. package/cjs/ts-types/pivot-table/dimension/link-dimension.d.ts +10 -0
  558. package/cjs/ts-types/pivot-table/dimension/link-dimension.js +6 -0
  559. package/cjs/ts-types/pivot-table/dimension/link-dimension.js.map +1 -0
  560. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.d.ts +7 -0
  561. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.js +6 -0
  562. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.js.map +1 -0
  563. package/cjs/ts-types/pivot-table/index.d.ts +4 -0
  564. package/cjs/ts-types/pivot-table/index.js +22 -0
  565. package/cjs/ts-types/pivot-table/index.js.map +1 -0
  566. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +26 -0
  567. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js +6 -0
  568. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -0
  569. package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +10 -0
  570. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js +6 -0
  571. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -0
  572. package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +15 -0
  573. package/cjs/ts-types/pivot-table/indicator/image-indicator.js +6 -0
  574. package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -0
  575. package/cjs/ts-types/pivot-table/indicator/index.d.ts +10 -0
  576. package/cjs/ts-types/pivot-table/indicator/index.js +6 -0
  577. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -0
  578. package/cjs/ts-types/pivot-table/indicator/link-indicator.d.ts +17 -0
  579. package/cjs/ts-types/pivot-table/indicator/link-indicator.js +6 -0
  580. package/cjs/ts-types/pivot-table/indicator/link-indicator.js.map +1 -0
  581. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.d.ts +11 -0
  582. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.js +6 -0
  583. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.js.map +1 -0
  584. package/cjs/ts-types/pivot-table/indicator/progress-indicator.d.ts +11 -0
  585. package/cjs/ts-types/pivot-table/indicator/progress-indicator.js +6 -0
  586. package/cjs/ts-types/pivot-table/indicator/progress-indicator.js.map +1 -0
  587. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.d.ts +10 -0
  588. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.js +6 -0
  589. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.js.map +1 -0
  590. package/cjs/ts-types/pivot-table/title.d.ts +18 -0
  591. package/cjs/ts-types/pivot-table/title.js +6 -0
  592. package/cjs/ts-types/pivot-table/title.js.map +1 -0
  593. package/cjs/ts-types/style-define.d.ts +60 -0
  594. package/cjs/ts-types/style-define.js +6 -0
  595. package/cjs/ts-types/style-define.js.map +1 -0
  596. package/cjs/ts-types/table-engine.d.ts +169 -0
  597. package/cjs/ts-types/table-engine.js +12 -0
  598. package/cjs/ts-types/table-engine.js.map +1 -0
  599. package/cjs/ts-types/theme.d.ts +88 -0
  600. package/cjs/ts-types/theme.js +6 -0
  601. package/cjs/ts-types/theme.js.map +1 -0
  602. package/cjs/ts-types/tooltip.d.ts +22 -0
  603. package/cjs/ts-types/tooltip.js +6 -0
  604. package/cjs/ts-types/tooltip.js.map +1 -0
  605. package/dist/vtable.js +72964 -0
  606. package/dist/vtable.min.js +17 -0
  607. package/es/ListTable.d.ts +38 -0
  608. package/es/ListTable.js +256 -0
  609. package/es/ListTable.js.map +1 -0
  610. package/es/PivotTable.d.ts +50 -0
  611. package/es/PivotTable.js +282 -0
  612. package/es/PivotTable.js.map +1 -0
  613. package/es/body-helper/body-helper.d.ts +14 -0
  614. package/es/body-helper/body-helper.js +80 -0
  615. package/es/body-helper/body-helper.js.map +1 -0
  616. package/es/body-helper/style/ImageStyle.d.ts +7 -0
  617. package/es/body-helper/style/ImageStyle.js +16 -0
  618. package/es/body-helper/style/ImageStyle.js.map +1 -0
  619. package/es/body-helper/style/MultilineTextStyle.d.ts +13 -0
  620. package/es/body-helper/style/MultilineTextStyle.js +30 -0
  621. package/es/body-helper/style/MultilineTextStyle.js.map +1 -0
  622. package/es/body-helper/style/NumberStyle.d.ts +7 -0
  623. package/es/body-helper/style/NumberStyle.js +16 -0
  624. package/es/body-helper/style/NumberStyle.js.map +1 -0
  625. package/es/body-helper/style/ProgressBarStyle.d.ts +52 -0
  626. package/es/body-helper/style/ProgressBarStyle.js +118 -0
  627. package/es/body-helper/style/ProgressBarStyle.js.map +1 -0
  628. package/es/body-helper/style/Style.d.ts +85 -0
  629. package/es/body-helper/style/Style.js +194 -0
  630. package/es/body-helper/style/Style.js.map +1 -0
  631. package/es/body-helper/style.d.ts +10 -0
  632. package/es/body-helper/style.js +20 -0
  633. package/es/body-helper/style.js.map +1 -0
  634. package/es/chartType.d.ts +3 -0
  635. package/es/chartType.js +10 -0
  636. package/es/chartType.js.map +1 -0
  637. package/es/core/BaseTable.d.ts +287 -0
  638. package/es/core/BaseTable.js +1281 -0
  639. package/es/core/BaseTable.js.map +1 -0
  640. package/es/core/FouseInput.d.ts +11 -0
  641. package/es/core/FouseInput.js +30 -0
  642. package/es/core/FouseInput.js.map +1 -0
  643. package/es/core/TABLE_EVENT_TYPE.d.ts +30 -0
  644. package/es/core/TABLE_EVENT_TYPE.js +30 -0
  645. package/es/core/TABLE_EVENT_TYPE.js.map +1 -0
  646. package/es/core/tableHelper.d.ts +28 -0
  647. package/es/core/tableHelper.js +107 -0
  648. package/es/core/tableHelper.js.map +1 -0
  649. package/es/core.d.ts +3 -0
  650. package/es/core.js +6 -0
  651. package/es/core.js.map +1 -0
  652. package/es/data/CachedDataSource.d.ts +16 -0
  653. package/es/data/CachedDataSource.js +48 -0
  654. package/es/data/CachedDataSource.js.map +1 -0
  655. package/es/data/DataSource.d.ts +64 -0
  656. package/es/data/DataSource.js +267 -0
  657. package/es/data/DataSource.js.map +1 -0
  658. package/es/data/FilterDataSource.d.ts +1 -0
  659. package/es/data/FilterDataSource.js +1 -0
  660. package/es/data/FilterDataSource.js.map +1 -0
  661. package/es/data.d.ts +4 -0
  662. package/es/data.js +6 -0
  663. package/es/data.js.map +1 -0
  664. package/es/dataset/DataStatistics.d.ts +10 -0
  665. package/es/dataset/DataStatistics.js +74 -0
  666. package/es/dataset/DataStatistics.js.map +1 -0
  667. package/es/dataset/dataset.d.ts +72 -0
  668. package/es/dataset/dataset.js +482 -0
  669. package/es/dataset/dataset.js.map +1 -0
  670. package/es/dataset/flatDataToObject.d.ts +31 -0
  671. package/es/dataset/flatDataToObject.js +63 -0
  672. package/es/dataset/flatDataToObject.js.map +1 -0
  673. package/es/event/EventHandler.d.ts +45 -0
  674. package/es/event/EventHandler.js +111 -0
  675. package/es/event/EventHandler.js.map +1 -0
  676. package/es/event/EventTarget.d.ts +11 -0
  677. package/es/event/EventTarget.js +50 -0
  678. package/es/event/EventTarget.js.map +1 -0
  679. package/es/event/chart.d.ts +2 -0
  680. package/es/event/chart.js +16 -0
  681. package/es/event/chart.js.map +1 -0
  682. package/es/event/drill.d.ts +3 -0
  683. package/es/event/drill.js +17 -0
  684. package/es/event/drill.js.map +1 -0
  685. package/es/event/event.d.ts +35 -0
  686. package/es/event/event.js +438 -0
  687. package/es/event/event.js.map +1 -0
  688. package/es/event/media-click.d.ts +2 -0
  689. package/es/event/media-click.js +54 -0
  690. package/es/event/media-click.js.map +1 -0
  691. package/es/event/scroll.d.ts +2 -0
  692. package/es/event/scroll.js +17 -0
  693. package/es/event/scroll.js.map +1 -0
  694. package/es/header-helper/header-helper.d.ts +26 -0
  695. package/es/header-helper/header-helper.js +189 -0
  696. package/es/header-helper/header-helper.js.map +1 -0
  697. package/es/header-helper/style/ImageStyle.d.ts +7 -0
  698. package/es/header-helper/style/ImageStyle.js +17 -0
  699. package/es/header-helper/style/ImageStyle.js.map +1 -0
  700. package/es/header-helper/style/MultilineTextHeaderStyle.d.ts +13 -0
  701. package/es/header-helper/style/MultilineTextHeaderStyle.js +30 -0
  702. package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -0
  703. package/es/header-helper/style/SortHeaderStyle.d.ts +1 -0
  704. package/es/header-helper/style/SortHeaderStyle.js +3 -0
  705. package/es/header-helper/style/SortHeaderStyle.js.map +1 -0
  706. package/es/header-helper/style/Style.d.ts +88 -0
  707. package/es/header-helper/style/Style.js +202 -0
  708. package/es/header-helper/style/Style.js.map +1 -0
  709. package/es/header-helper/style.d.ts +5 -0
  710. package/es/header-helper/style.js +14 -0
  711. package/es/header-helper/style.js.map +1 -0
  712. package/es/icons.d.ts +4 -0
  713. package/es/icons.js +241 -0
  714. package/es/icons.js.map +1 -0
  715. package/es/index.d.ts +17 -0
  716. package/es/index.js +34 -0
  717. package/es/index.js.map +1 -0
  718. package/es/layout/index.d.ts +1 -0
  719. package/es/layout/index.js +2 -0
  720. package/es/layout/index.js.map +1 -0
  721. package/es/layout/pivot-header-layout.d.ts +155 -0
  722. package/es/layout/pivot-header-layout.js +888 -0
  723. package/es/layout/pivot-header-layout.js.map +1 -0
  724. package/es/layout/pivot-layout.d.ts +86 -0
  725. package/es/layout/pivot-layout.js +416 -0
  726. package/es/layout/pivot-layout.js.map +1 -0
  727. package/es/layout/simple-header-layout.d.ts +67 -0
  728. package/es/layout/simple-header-layout.js +405 -0
  729. package/es/layout/simple-header-layout.js.map +1 -0
  730. package/es/menu/dom/BaseMenu.d.ts +15 -0
  731. package/es/menu/dom/BaseMenu.js +22 -0
  732. package/es/menu/dom/BaseMenu.js.map +1 -0
  733. package/es/menu/dom/Menu.d.ts +9 -0
  734. package/es/menu/dom/Menu.js +18 -0
  735. package/es/menu/dom/Menu.js.map +1 -0
  736. package/es/menu/dom/MenuHandler.d.ts +20 -0
  737. package/es/menu/dom/MenuHandler.js +132 -0
  738. package/es/menu/dom/MenuHandler.js.map +1 -0
  739. package/es/menu/dom/logic/MenuContainer.d.ts +22 -0
  740. package/es/menu/dom/logic/MenuContainer.js +105 -0
  741. package/es/menu/dom/logic/MenuContainer.js.map +1 -0
  742. package/es/menu/dom/logic/MenuElement.css +86 -0
  743. package/es/menu/dom/logic/MenuElement.d.ts +27 -0
  744. package/es/menu/dom/logic/MenuElement.js +277 -0
  745. package/es/menu/dom/logic/MenuElement.js.map +1 -0
  746. package/es/plugins/chartTypes.d.ts +3 -0
  747. package/es/plugins/chartTypes.js +2 -0
  748. package/es/plugins/chartTypes.js.map +1 -0
  749. package/es/plugins/icons.d.ts +12 -0
  750. package/es/plugins/icons.js +22 -0
  751. package/es/plugins/icons.js.map +1 -0
  752. package/es/plugins/themes.d.ts +4 -0
  753. package/es/plugins/themes.js +2 -0
  754. package/es/plugins/themes.js.map +1 -0
  755. package/es/register.d.ts +5 -0
  756. package/es/register.js +31 -0
  757. package/es/register.js.map +1 -0
  758. package/es/render/layout/arc.d.ts +23 -0
  759. package/es/render/layout/arc.js +12 -0
  760. package/es/render/layout/arc.js.map +1 -0
  761. package/es/render/layout/circle.d.ts +19 -0
  762. package/es/render/layout/circle.js +11 -0
  763. package/es/render/layout/circle.js.map +1 -0
  764. package/es/render/layout/container.d.ts +52 -0
  765. package/es/render/layout/container.js +99 -0
  766. package/es/render/layout/container.js.map +1 -0
  767. package/es/render/layout/direction.d.ts +22 -0
  768. package/es/render/layout/direction.js +31 -0
  769. package/es/render/layout/direction.js.map +1 -0
  770. package/es/render/layout/element.d.ts +47 -0
  771. package/es/render/layout/element.js +19 -0
  772. package/es/render/layout/element.js.map +1 -0
  773. package/es/render/layout/group-element.d.ts +25 -0
  774. package/es/render/layout/group-element.js +46 -0
  775. package/es/render/layout/group-element.js.map +1 -0
  776. package/es/render/layout/icon.d.ts +21 -0
  777. package/es/render/layout/icon.js +19 -0
  778. package/es/render/layout/icon.js.map +1 -0
  779. package/es/render/layout/image.d.ts +21 -0
  780. package/es/render/layout/image.js +12 -0
  781. package/es/render/layout/image.js.map +1 -0
  782. package/es/render/layout/index.d.ts +9 -0
  783. package/es/render/layout/index.js +18 -0
  784. package/es/render/layout/index.js.map +1 -0
  785. package/es/render/layout/line.d.ts +32 -0
  786. package/es/render/layout/line.js +80 -0
  787. package/es/render/layout/line.js.map +1 -0
  788. package/es/render/layout/percent-calc.d.ts +8 -0
  789. package/es/render/layout/percent-calc.js +7 -0
  790. package/es/render/layout/percent-calc.js.map +1 -0
  791. package/es/render/layout/rect.d.ts +22 -0
  792. package/es/render/layout/rect.js +11 -0
  793. package/es/render/layout/rect.js.map +1 -0
  794. package/es/render/layout/text.d.ts +22 -0
  795. package/es/render/layout/text.js +18 -0
  796. package/es/render/layout/text.js.map +1 -0
  797. package/es/scenegraph/component/cell-content.d.ts +36 -0
  798. package/es/scenegraph/component/cell-content.js +98 -0
  799. package/es/scenegraph/component/cell-content.js.map +1 -0
  800. package/es/scenegraph/component/cell-mover.d.ts +15 -0
  801. package/es/scenegraph/component/cell-mover.js +101 -0
  802. package/es/scenegraph/component/cell-mover.js.map +1 -0
  803. package/es/scenegraph/component/custom.d.ts +7 -0
  804. package/es/scenegraph/component/custom.js +211 -0
  805. package/es/scenegraph/component/custom.js.map +1 -0
  806. package/es/scenegraph/component/drill-icon.d.ts +9 -0
  807. package/es/scenegraph/component/drill-icon.js +41 -0
  808. package/es/scenegraph/component/drill-icon.js.map +1 -0
  809. package/es/scenegraph/component/menu.d.ts +41 -0
  810. package/es/scenegraph/component/menu.js +212 -0
  811. package/es/scenegraph/component/menu.js.map +1 -0
  812. package/es/scenegraph/component/table-component.d.ts +37 -0
  813. package/es/scenegraph/component/table-component.js +304 -0
  814. package/es/scenegraph/component/table-component.js.map +1 -0
  815. package/es/scenegraph/component/util.d.ts +2 -0
  816. package/es/scenegraph/component/util.js +5 -0
  817. package/es/scenegraph/component/util.js.map +1 -0
  818. package/es/scenegraph/debug-tool/debug-tool.d.ts +36 -0
  819. package/es/scenegraph/debug-tool/debug-tool.js +126 -0
  820. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -0
  821. package/es/scenegraph/debug-tool/index.d.ts +4 -0
  822. package/es/scenegraph/debug-tool/index.js +6 -0
  823. package/es/scenegraph/debug-tool/index.js.map +1 -0
  824. package/es/scenegraph/graphic/chart.d.ts +30 -0
  825. package/es/scenegraph/graphic/chart.js +59 -0
  826. package/es/scenegraph/graphic/chart.js.map +1 -0
  827. package/es/scenegraph/graphic/contributions/chart-render.d.ts +10 -0
  828. package/es/scenegraph/graphic/contributions/chart-render.js +47 -0
  829. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -0
  830. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +70 -0
  831. package/es/scenegraph/graphic/contributions/group-contribution-render.js +192 -0
  832. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -0
  833. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +20 -0
  834. package/es/scenegraph/graphic/contributions/image-contribution-render.js +42 -0
  835. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -0
  836. package/es/scenegraph/graphic/contributions/index.d.ts +3 -0
  837. package/es/scenegraph/graphic/contributions/index.js +29 -0
  838. package/es/scenegraph/graphic/contributions/index.js.map +1 -0
  839. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +17 -0
  840. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +45 -0
  841. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -0
  842. package/es/scenegraph/graphic/group.d.ts +23 -0
  843. package/es/scenegraph/graphic/group.js +86 -0
  844. package/es/scenegraph/graphic/group.js.map +1 -0
  845. package/es/scenegraph/graphic/icon.d.ts +24 -0
  846. package/es/scenegraph/graphic/icon.js +17 -0
  847. package/es/scenegraph/graphic/icon.js.map +1 -0
  848. package/es/scenegraph/graphic/text.d.ts +16 -0
  849. package/es/scenegraph/graphic/text.js +142 -0
  850. package/es/scenegraph/graphic/text.js.map +1 -0
  851. package/es/scenegraph/group-creater/cell-helper.d.ts +7 -0
  852. package/es/scenegraph/group-creater/cell-helper.js +93 -0
  853. package/es/scenegraph/group-creater/cell-helper.js.map +1 -0
  854. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +3 -0
  855. package/es/scenegraph/group-creater/cell-type/chart-cell.js +54 -0
  856. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -0
  857. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +7 -0
  858. package/es/scenegraph/group-creater/cell-type/image-cell.js +102 -0
  859. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -0
  860. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +9 -0
  861. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +337 -0
  862. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -0
  863. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +3 -0
  864. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +165 -0
  865. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -0
  866. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +5 -0
  867. package/es/scenegraph/group-creater/cell-type/text-cell.js +66 -0
  868. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -0
  869. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +4 -0
  870. package/es/scenegraph/group-creater/cell-type/video-cell.js +86 -0
  871. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -0
  872. package/es/scenegraph/group-creater/column-helper.d.ts +24 -0
  873. package/es/scenegraph/group-creater/column-helper.js +135 -0
  874. package/es/scenegraph/group-creater/column-helper.js.map +1 -0
  875. package/es/scenegraph/group-creater/column.d.ts +14 -0
  876. package/es/scenegraph/group-creater/column.js +49 -0
  877. package/es/scenegraph/group-creater/column.js.map +1 -0
  878. package/es/scenegraph/group-creater/progress/proxy.d.ts +45 -0
  879. package/es/scenegraph/group-creater/progress/proxy.js +268 -0
  880. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -0
  881. package/es/scenegraph/header-icon/layout.d.ts +3 -0
  882. package/es/scenegraph/header-icon/layout.js +69 -0
  883. package/es/scenegraph/header-icon/layout.js.map +1 -0
  884. package/es/scenegraph/hover-state.d.ts +14 -0
  885. package/es/scenegraph/hover-state.js +19 -0
  886. package/es/scenegraph/hover-state.js.map +1 -0
  887. package/es/scenegraph/layout/auto-height.d.ts +2 -0
  888. package/es/scenegraph/layout/auto-height.js +44 -0
  889. package/es/scenegraph/layout/auto-height.js.map +1 -0
  890. package/es/scenegraph/layout/auto-width.d.ts +2 -0
  891. package/es/scenegraph/layout/auto-width.js +82 -0
  892. package/es/scenegraph/layout/auto-width.js.map +1 -0
  893. package/es/scenegraph/layout/compute-col-width.d.ts +3 -0
  894. package/es/scenegraph/layout/compute-col-width.js +167 -0
  895. package/es/scenegraph/layout/compute-col-width.js.map +1 -0
  896. package/es/scenegraph/layout/move-cell.d.ts +2 -0
  897. package/es/scenegraph/layout/move-cell.js +55 -0
  898. package/es/scenegraph/layout/move-cell.js.map +1 -0
  899. package/es/scenegraph/layout/update-cell.d.ts +3 -0
  900. package/es/scenegraph/layout/update-cell.js +55 -0
  901. package/es/scenegraph/layout/update-cell.js.map +1 -0
  902. package/es/scenegraph/layout/update-height.d.ts +6 -0
  903. package/es/scenegraph/layout/update-height.js +91 -0
  904. package/es/scenegraph/layout/update-height.js.map +1 -0
  905. package/es/scenegraph/layout/update-width.d.ts +2 -0
  906. package/es/scenegraph/layout/update-width.js +105 -0
  907. package/es/scenegraph/layout/update-width.js.map +1 -0
  908. package/es/scenegraph/scenegraph.d.ts +109 -0
  909. package/es/scenegraph/scenegraph.js +818 -0
  910. package/es/scenegraph/scenegraph.js.map +1 -0
  911. package/es/scenegraph/style/frame-border.d.ts +3 -0
  912. package/es/scenegraph/style/frame-border.js +35 -0
  913. package/es/scenegraph/style/frame-border.js.map +1 -0
  914. package/es/scenegraph/utils/border-line.d.ts +8 -0
  915. package/es/scenegraph/utils/border-line.js +45 -0
  916. package/es/scenegraph/utils/border-line.js.map +1 -0
  917. package/es/scenegraph/utils/break-string.d.ts +1 -0
  918. package/es/scenegraph/utils/break-string.js +31 -0
  919. package/es/scenegraph/utils/break-string.js.map +1 -0
  920. package/es/scenegraph/utils/cell-pos.d.ts +4 -0
  921. package/es/scenegraph/utils/cell-pos.js +12 -0
  922. package/es/scenegraph/utils/cell-pos.js.map +1 -0
  923. package/es/scenegraph/utils/font.d.ts +1 -0
  924. package/es/scenegraph/utils/font.js +6 -0
  925. package/es/scenegraph/utils/font.js.map +1 -0
  926. package/es/scenegraph/utils/get-cell-merge.d.ts +3 -0
  927. package/es/scenegraph/utils/get-cell-merge.js +5 -0
  928. package/es/scenegraph/utils/get-cell-merge.js.map +1 -0
  929. package/es/scenegraph/utils/get-prop.d.ts +4 -0
  930. package/es/scenegraph/utils/get-prop.js +36 -0
  931. package/es/scenegraph/utils/get-prop.js.map +1 -0
  932. package/es/scenegraph/utils/icon.d.ts +12 -0
  933. package/es/scenegraph/utils/icon.js +29 -0
  934. package/es/scenegraph/utils/icon.js.map +1 -0
  935. package/es/scenegraph/utils/keep-aspect-ratio.d.ts +4 -0
  936. package/es/scenegraph/utils/keep-aspect-ratio.js +10 -0
  937. package/es/scenegraph/utils/keep-aspect-ratio.js.map +1 -0
  938. package/es/scenegraph/utils/measure-text.d.ts +20 -0
  939. package/es/scenegraph/utils/measure-text.js +114 -0
  940. package/es/scenegraph/utils/measure-text.js.map +1 -0
  941. package/es/scenegraph/utils/padding.d.ts +1 -0
  942. package/es/scenegraph/utils/padding.js +8 -0
  943. package/es/scenegraph/utils/padding.js.map +1 -0
  944. package/es/scenegraph/utils/text-icon-layout.d.ts +9 -0
  945. package/es/scenegraph/utils/text-icon-layout.js +239 -0
  946. package/es/scenegraph/utils/text-icon-layout.js.map +1 -0
  947. package/es/scenegraph/utils/text-pos.d.ts +8 -0
  948. package/es/scenegraph/utils/text-pos.js +20 -0
  949. package/es/scenegraph/utils/text-pos.js.map +1 -0
  950. package/es/state/cell-move/adjust-header.d.ts +3 -0
  951. package/es/state/cell-move/adjust-header.js +14 -0
  952. package/es/state/cell-move/adjust-header.js.map +1 -0
  953. package/es/state/cell-move/index.d.ts +4 -0
  954. package/es/state/cell-move/index.js +52 -0
  955. package/es/state/cell-move/index.js.map +1 -0
  956. package/es/state/common/check-in-select.d.ts +8 -0
  957. package/es/state/common/check-in-select.js +53 -0
  958. package/es/state/common/check-in-select.js.map +1 -0
  959. package/es/state/drill/index.d.ts +2 -0
  960. package/es/state/drill/index.js +9 -0
  961. package/es/state/drill/index.js.map +1 -0
  962. package/es/state/hover/col.d.ts +5 -0
  963. package/es/state/hover/col.js +16 -0
  964. package/es/state/hover/col.js.map +1 -0
  965. package/es/state/hover/is-cell-hover.d.ts +5 -0
  966. package/es/state/hover/is-cell-hover.js +30 -0
  967. package/es/state/hover/is-cell-hover.js.map +1 -0
  968. package/es/state/hover/row.d.ts +5 -0
  969. package/es/state/hover/row.js +14 -0
  970. package/es/state/hover/row.js.map +1 -0
  971. package/es/state/hover/single.d.ts +5 -0
  972. package/es/state/hover/single.js +10 -0
  973. package/es/state/hover/single.js.map +1 -0
  974. package/es/state/hover/update-cell.d.ts +2 -0
  975. package/es/state/hover/update-cell.js +7 -0
  976. package/es/state/hover/update-cell.js.map +1 -0
  977. package/es/state/hover/update-position.d.ts +2 -0
  978. package/es/state/hover/update-position.js +36 -0
  979. package/es/state/hover/update-position.js.map +1 -0
  980. package/es/state/pin/index.d.ts +2 -0
  981. package/es/state/pin/index.js +4 -0
  982. package/es/state/pin/index.js.map +1 -0
  983. package/es/state/select/update-position.d.ts +4 -0
  984. package/es/state/select/update-position.js +103 -0
  985. package/es/state/select/update-position.js.map +1 -0
  986. package/es/state/sort/index.d.ts +2 -0
  987. package/es/state/sort/index.js +35 -0
  988. package/es/state/sort/index.js.map +1 -0
  989. package/es/state/spark-line/index.d.ts +3 -0
  990. package/es/state/spark-line/index.js +92 -0
  991. package/es/state/spark-line/index.js.map +1 -0
  992. package/es/state/state.d.ts +155 -0
  993. package/es/state/state.js +458 -0
  994. package/es/state/state.js.map +1 -0
  995. package/es/themes/ARCO.d.ts +3 -0
  996. package/es/themes/ARCO.js +110 -0
  997. package/es/themes/ARCO.js.map +1 -0
  998. package/es/themes/BRIGHT.d.ts +3 -0
  999. package/es/themes/BRIGHT.js +67 -0
  1000. package/es/themes/BRIGHT.js.map +1 -0
  1001. package/es/themes/DARK.d.ts +3 -0
  1002. package/es/themes/DARK.js +86 -0
  1003. package/es/themes/DARK.js.map +1 -0
  1004. package/es/themes/DEFAULT.d.ts +3 -0
  1005. package/es/themes/DEFAULT.js +85 -0
  1006. package/es/themes/DEFAULT.js.map +1 -0
  1007. package/es/themes/SIMPLIFY.d.ts +3 -0
  1008. package/es/themes/SIMPLIFY.js +42 -0
  1009. package/es/themes/SIMPLIFY.js.map +1 -0
  1010. package/es/themes/theme.d.ts +34 -0
  1011. package/es/themes/theme.js +505 -0
  1012. package/es/themes/theme.js.map +1 -0
  1013. package/es/themes.d.ts +28 -0
  1014. package/es/themes.js +62 -0
  1015. package/es/themes.js.map +1 -0
  1016. package/es/tools/LimitPromiseQueue.d.ts +8 -0
  1017. package/es/tools/LimitPromiseQueue.js +21 -0
  1018. package/es/tools/LimitPromiseQueue.js.map +1 -0
  1019. package/es/tools/NumberMap.d.ts +16 -0
  1020. package/es/tools/NumberMap.js +70 -0
  1021. package/es/tools/NumberMap.js.map +1 -0
  1022. package/es/tools/Rect.d.ts +24 -0
  1023. package/es/tools/Rect.js +61 -0
  1024. package/es/tools/Rect.js.map +1 -0
  1025. package/es/tools/calc.d.ts +5 -0
  1026. package/es/tools/calc.js +191 -0
  1027. package/es/tools/calc.js.map +1 -0
  1028. package/es/tools/debounce.d.ts +1 -0
  1029. package/es/tools/debounce.js +43 -0
  1030. package/es/tools/debounce.js.map +1 -0
  1031. package/es/tools/dom.d.ts +1 -0
  1032. package/es/tools/dom.js +5 -0
  1033. package/es/tools/dom.js.map +1 -0
  1034. package/es/tools/env.d.ts +19 -0
  1035. package/es/tools/env.js +42 -0
  1036. package/es/tools/env.js.map +1 -0
  1037. package/es/tools/global.d.ts +13 -0
  1038. package/es/tools/global.js +26 -0
  1039. package/es/tools/global.js.map +1 -0
  1040. package/es/tools/helper.d.ts +60 -0
  1041. package/es/tools/helper.js +216 -0
  1042. package/es/tools/helper.js.map +1 -0
  1043. package/es/tools/icons.d.ts +4 -0
  1044. package/es/tools/icons.js +4 -0
  1045. package/es/tools/icons.js.map +1 -0
  1046. package/es/tools/isx.d.ts +16 -0
  1047. package/es/tools/isx.js +79 -0
  1048. package/es/tools/isx.js.map +1 -0
  1049. package/es/tools/sort.d.ts +1 -0
  1050. package/es/tools/sort.js +12 -0
  1051. package/es/tools/sort.js.map +1 -0
  1052. package/es/tools/style.css +60 -0
  1053. package/es/tools/style.d.ts +2 -0
  1054. package/es/tools/style.js +5 -0
  1055. package/es/tools/style.js.map +1 -0
  1056. package/es/tools/text-width.d.ts +1 -0
  1057. package/es/tools/text-width.js +9 -0
  1058. package/es/tools/text-width.js.map +1 -0
  1059. package/es/tools/util.d.ts +45 -0
  1060. package/es/tools/util.js +250 -0
  1061. package/es/tools/util.js.map +1 -0
  1062. package/es/tooltip/BaseTooltip.d.ts +22 -0
  1063. package/es/tooltip/BaseTooltip.js +27 -0
  1064. package/es/tooltip/BaseTooltip.js.map +1 -0
  1065. package/es/tooltip/Tooltip.d.ts +5 -0
  1066. package/es/tooltip/Tooltip.js +10 -0
  1067. package/es/tooltip/Tooltip.js.map +1 -0
  1068. package/es/tooltip/TooltipHandler.d.ts +27 -0
  1069. package/es/tooltip/TooltipHandler.js +131 -0
  1070. package/es/tooltip/TooltipHandler.js.map +1 -0
  1071. package/es/tooltip/logic/BubbleTooltipElement.css +63 -0
  1072. package/es/tooltip/logic/BubbleTooltipElement.d.ts +33 -0
  1073. package/es/tooltip/logic/BubbleTooltipElement.js +149 -0
  1074. package/es/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  1075. package/es/ts-types/base-table.d.ts +313 -0
  1076. package/es/ts-types/base-table.js +2 -0
  1077. package/es/ts-types/base-table.js.map +1 -0
  1078. package/es/ts-types/chartType.d.ts +53 -0
  1079. package/es/ts-types/chartType.js +2 -0
  1080. package/es/ts-types/chartType.js.map +1 -0
  1081. package/es/ts-types/column/index.d.ts +2 -0
  1082. package/es/ts-types/column/index.js +4 -0
  1083. package/es/ts-types/column/index.js.map +1 -0
  1084. package/es/ts-types/column/style.d.ts +78 -0
  1085. package/es/ts-types/column/style.js +2 -0
  1086. package/es/ts-types/column/style.js.map +1 -0
  1087. package/es/ts-types/column/type.d.ts +2 -0
  1088. package/es/ts-types/column/type.js +2 -0
  1089. package/es/ts-types/column/type.js.map +1 -0
  1090. package/es/ts-types/common.d.ts +72 -0
  1091. package/es/ts-types/common.js +2 -0
  1092. package/es/ts-types/common.js.map +1 -0
  1093. package/es/ts-types/customElement.d.ts +111 -0
  1094. package/es/ts-types/customElement.js +2 -0
  1095. package/es/ts-types/customElement.js.map +1 -0
  1096. package/es/ts-types/customLayout.d.ts +8 -0
  1097. package/es/ts-types/customLayout.js +2 -0
  1098. package/es/ts-types/customLayout.js.map +1 -0
  1099. package/es/ts-types/events.d.ts +182 -0
  1100. package/es/ts-types/events.js +2 -0
  1101. package/es/ts-types/events.js.map +1 -0
  1102. package/es/ts-types/icon.d.ts +86 -0
  1103. package/es/ts-types/icon.js +28 -0
  1104. package/es/ts-types/icon.js.map +1 -0
  1105. package/es/ts-types/index.d.ts +15 -0
  1106. package/es/ts-types/index.js +30 -0
  1107. package/es/ts-types/index.js.map +1 -0
  1108. package/es/ts-types/list-table/define/basic-define.d.ts +36 -0
  1109. package/es/ts-types/list-table/define/basic-define.js +2 -0
  1110. package/es/ts-types/list-table/define/basic-define.js.map +1 -0
  1111. package/es/ts-types/list-table/define/chart-define.d.ts +10 -0
  1112. package/es/ts-types/list-table/define/chart-define.js +2 -0
  1113. package/es/ts-types/list-table/define/chart-define.js.map +1 -0
  1114. package/es/ts-types/list-table/define/image-define.d.ts +15 -0
  1115. package/es/ts-types/list-table/define/image-define.js +2 -0
  1116. package/es/ts-types/list-table/define/image-define.js.map +1 -0
  1117. package/es/ts-types/list-table/define/index.d.ts +21 -0
  1118. package/es/ts-types/list-table/define/index.js +2 -0
  1119. package/es/ts-types/list-table/define/index.js.map +1 -0
  1120. package/es/ts-types/list-table/define/link-define.d.ts +17 -0
  1121. package/es/ts-types/list-table/define/link-define.js +2 -0
  1122. package/es/ts-types/list-table/define/link-define.js.map +1 -0
  1123. package/es/ts-types/list-table/define/multilinetext-define.d.ts +12 -0
  1124. package/es/ts-types/list-table/define/multilinetext-define.js +2 -0
  1125. package/es/ts-types/list-table/define/multilinetext-define.js.map +1 -0
  1126. package/es/ts-types/list-table/define/progressbar-define.d.ts +11 -0
  1127. package/es/ts-types/list-table/define/progressbar-define.js +2 -0
  1128. package/es/ts-types/list-table/define/progressbar-define.js.map +1 -0
  1129. package/es/ts-types/list-table/define/sparkline-define.d.ts +10 -0
  1130. package/es/ts-types/list-table/define/sparkline-define.js +2 -0
  1131. package/es/ts-types/list-table/define/sparkline-define.js.map +1 -0
  1132. package/es/ts-types/list-table/index.d.ts +2 -0
  1133. package/es/ts-types/list-table/index.js +4 -0
  1134. package/es/ts-types/list-table/index.js.map +1 -0
  1135. package/es/ts-types/list-table/layout-map/api.d.ts +92 -0
  1136. package/es/ts-types/list-table/layout-map/api.js +2 -0
  1137. package/es/ts-types/list-table/layout-map/api.js.map +1 -0
  1138. package/es/ts-types/list-table/layout-map/index.d.ts +1 -0
  1139. package/es/ts-types/list-table/layout-map/index.js +2 -0
  1140. package/es/ts-types/list-table/layout-map/index.js.map +1 -0
  1141. package/es/ts-types/menu.d.ts +73 -0
  1142. package/es/ts-types/menu.js +2 -0
  1143. package/es/ts-types/menu.js.map +1 -0
  1144. package/es/ts-types/new-data-set.d.ts +95 -0
  1145. package/es/ts-types/new-data-set.js +13 -0
  1146. package/es/ts-types/new-data-set.js.map +1 -0
  1147. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +6 -0
  1148. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +9 -0
  1149. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -0
  1150. package/es/ts-types/pivot-table/corner.d.ts +19 -0
  1151. package/es/ts-types/pivot-table/corner.js +2 -0
  1152. package/es/ts-types/pivot-table/corner.js.map +1 -0
  1153. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +25 -0
  1154. package/es/ts-types/pivot-table/dimension/basic-dimension.js +2 -0
  1155. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -0
  1156. package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +9 -0
  1157. package/es/ts-types/pivot-table/dimension/image-dimension.js +2 -0
  1158. package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -0
  1159. package/es/ts-types/pivot-table/dimension/index.d.ts +4 -0
  1160. package/es/ts-types/pivot-table/dimension/index.js +2 -0
  1161. package/es/ts-types/pivot-table/dimension/index.js.map +1 -0
  1162. package/es/ts-types/pivot-table/dimension/link-dimension.d.ts +10 -0
  1163. package/es/ts-types/pivot-table/dimension/link-dimension.js +2 -0
  1164. package/es/ts-types/pivot-table/dimension/link-dimension.js.map +1 -0
  1165. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.d.ts +7 -0
  1166. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.js +2 -0
  1167. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.js.map +1 -0
  1168. package/es/ts-types/pivot-table/index.d.ts +4 -0
  1169. package/es/ts-types/pivot-table/index.js +8 -0
  1170. package/es/ts-types/pivot-table/index.js.map +1 -0
  1171. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +26 -0
  1172. package/es/ts-types/pivot-table/indicator/basic-indicator.js +2 -0
  1173. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -0
  1174. package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +10 -0
  1175. package/es/ts-types/pivot-table/indicator/chart-indicator.js +2 -0
  1176. package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -0
  1177. package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +15 -0
  1178. package/es/ts-types/pivot-table/indicator/image-indicator.js +2 -0
  1179. package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -0
  1180. package/es/ts-types/pivot-table/indicator/index.d.ts +10 -0
  1181. package/es/ts-types/pivot-table/indicator/index.js +2 -0
  1182. package/es/ts-types/pivot-table/indicator/index.js.map +1 -0
  1183. package/es/ts-types/pivot-table/indicator/link-indicator.d.ts +17 -0
  1184. package/es/ts-types/pivot-table/indicator/link-indicator.js +2 -0
  1185. package/es/ts-types/pivot-table/indicator/link-indicator.js.map +1 -0
  1186. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.d.ts +11 -0
  1187. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.js +2 -0
  1188. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.js.map +1 -0
  1189. package/es/ts-types/pivot-table/indicator/progress-indicator.d.ts +11 -0
  1190. package/es/ts-types/pivot-table/indicator/progress-indicator.js +2 -0
  1191. package/es/ts-types/pivot-table/indicator/progress-indicator.js.map +1 -0
  1192. package/es/ts-types/pivot-table/indicator/sparkline-indicator.d.ts +10 -0
  1193. package/es/ts-types/pivot-table/indicator/sparkline-indicator.js +2 -0
  1194. package/es/ts-types/pivot-table/indicator/sparkline-indicator.js.map +1 -0
  1195. package/es/ts-types/pivot-table/title.d.ts +18 -0
  1196. package/es/ts-types/pivot-table/title.js +2 -0
  1197. package/es/ts-types/pivot-table/title.js.map +1 -0
  1198. package/es/ts-types/style-define.d.ts +60 -0
  1199. package/es/ts-types/style-define.js +2 -0
  1200. package/es/ts-types/style-define.js.map +1 -0
  1201. package/es/ts-types/table-engine.d.ts +169 -0
  1202. package/es/ts-types/table-engine.js +12 -0
  1203. package/es/ts-types/table-engine.js.map +1 -0
  1204. package/es/ts-types/theme.d.ts +88 -0
  1205. package/es/ts-types/theme.js +2 -0
  1206. package/es/ts-types/theme.js.map +1 -0
  1207. package/es/ts-types/tooltip.d.ts +22 -0
  1208. package/es/ts-types/tooltip.js +2 -0
  1209. package/es/ts-types/tooltip.js.map +1 -0
  1210. package/package.json +95 -0
package/cjs/themes.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var __importDefault = this && this.__importDefault || function(mod) {
4
+ return mod && mod.__esModule ? mod : {
5
+ default: mod
6
+ };
7
+ };
8
+
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: !0
11
+ }), exports.get = exports.of = exports.theme = exports.SIMPLIFY = exports.DEFAULT = exports.ARCO = exports.BRIGHT = exports.DARK = void 0;
12
+
13
+ const helper_1 = require("./tools/helper"), DARK_1 = __importDefault(require("./themes/DARK")), BRIGHT_1 = __importDefault(require("./themes/BRIGHT")), ARCO_1 = __importDefault(require("./themes/ARCO")), DEFAULT_1 = __importDefault(require("./themes/DEFAULT")), SIMPLIFY_1 = __importDefault(require("./themes/SIMPLIFY")), themes_1 = require("./plugins/themes"), theme_1 = require("./themes/theme");
14
+
15
+ exports.DARK = new theme_1.TableTheme(DARK_1.default, DARK_1.default), exports.BRIGHT = new theme_1.TableTheme(BRIGHT_1.default, BRIGHT_1.default),
16
+ exports.ARCO = new theme_1.TableTheme(ARCO_1.default, ARCO_1.default), exports.DEFAULT = new theme_1.TableTheme(DEFAULT_1.default, DEFAULT_1.default),
17
+ exports.SIMPLIFY = new theme_1.TableTheme(SIMPLIFY_1.default, SIMPLIFY_1.default);
18
+
19
+ const builtin = {
20
+ DEFAULT: exports.DEFAULT,
21
+ SIMPLIFY: exports.SIMPLIFY,
22
+ ARCO: exports.ARCO,
23
+ DARK: exports.DARK,
24
+ BRIGHT: exports.BRIGHT
25
+ };
26
+
27
+ function of(value) {
28
+ if (!value) return null;
29
+ if ("string" == typeof value) {
30
+ const t = (0, helper_1.getIgnoreCase)(get(), value);
31
+ return t ? t instanceof theme_1.TableTheme ? t : new theme_1.TableTheme(t, t) : null;
32
+ }
33
+ return value instanceof theme_1.TableTheme ? value : new theme_1.TableTheme(value, value);
34
+ }
35
+
36
+ function get() {
37
+ return (0, helper_1.extend)(builtin, themes_1.themes);
38
+ }
39
+
40
+ exports.theme = {
41
+ TableTheme: theme_1.TableTheme
42
+ }, exports.of = of, exports.get = get, exports.default = {
43
+ DARK: exports.DARK,
44
+ BRIGHT: exports.BRIGHT,
45
+ ARCO: exports.ARCO,
46
+ DEFAULT: exports.DEFAULT,
47
+ SIMPLIFY: exports.SIMPLIFY,
48
+ theme: exports.theme,
49
+ of: of,
50
+ get: get
51
+ };
52
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["themes.ts"],"names":[],"mappings":";;;;;;AACA,2CAAuD;AACvD,yDAAsC;AACtC,6DAA0C;AAC1C,yDAAsC;AACtC,+DAA4C;AAC5C,iEAAoD;AACpD,6CAAqD;AACrD,0CAA4C;AAE/B,QAAA,IAAI,GAAG,IAAI,kBAAU,CAAC,cAAS,EAAE,cAAS,CAAC,CAAC;AAC5C,QAAA,MAAM,GAAG,IAAI,kBAAU,CAAC,gBAAW,EAAE,gBAAW,CAAC,CAAC;AAClD,QAAA,IAAI,GAAG,IAAI,kBAAU,CAAC,cAAS,EAAE,cAAS,CAAC,CAAC;AAC5C,QAAA,OAAO,GAAG,IAAI,kBAAU,CAAC,iBAAY,EAAE,iBAAY,CAAC,CAAC;AACrD,QAAA,QAAQ,GAAG,IAAI,kBAAU,CAAC,kBAAmB,EAAE,kBAAmB,CAAC,CAAC;AAEjF,MAAM,OAAO,GAAkC;IAC7C,OAAO,EAAP,eAAO;IACP,QAAQ,EAAR,gBAAQ;IACR,IAAI,EAAJ,YAAI;IACJ,IAAI,EAAJ,YAAI;IACJ,MAAM,EAAN,cAAM;CACP,CAAC;AAEW,QAAA,KAAK,GAAG,EAAE,UAAU,EAAV,kBAAU,EAAE,CAAC;AACpC,SAAgB,EAAE,CAAC,KAAoD;IACrE,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,CAAC,GAAG,IAAA,sBAAa,EAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,YAAY,kBAAU,EAAE;gBAC3B,OAAO,CAAC,CAAC;aACV;YACD,OAAO,IAAI,kBAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,KAAK,YAAY,kBAAU,EAAE;QAC/B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,kBAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC;AAlBD,gBAkBC;AAED,SAAgB,GAAG;IACjB,OAAO,IAAA,eAAM,EAAC,OAAO,EAAE,eAAO,CAAC,CAAC;AAClC,CAAC;AAFD,kBAEC;AAED,kBAAe;IACb,IAAI,EAAJ,YAAI;IACJ,MAAM,EAAN,cAAM;IACN,IAAI,EAAJ,YAAI;IACJ,OAAO,EAAP,eAAO;IACP,QAAQ,EAAR,gBAAQ;IACR,KAAK,EAAL,aAAK;IACL,EAAE;IACF,GAAG;CACJ,CAAC","file":"themes.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { extend, getIgnoreCase } from './tools/helper';\nimport darkTheme from './themes/DARK';\nimport brightTheme from './themes/BRIGHT';\nimport arcoTheme from './themes/ARCO';\nimport defaultTheme from './themes/DEFAULT';\nimport materialDesignTheme from './themes/SIMPLIFY';\nimport { themes as plugins } from './plugins/themes';\nimport { TableTheme } from './themes/theme';\nimport type { ITableThemeDefine } from './ts-types';\nexport const DARK = new TableTheme(darkTheme, darkTheme);\nexport const BRIGHT = new TableTheme(brightTheme, brightTheme);\nexport const ARCO = new TableTheme(arcoTheme, arcoTheme);\nexport const DEFAULT = new TableTheme(defaultTheme, defaultTheme);\nexport const SIMPLIFY = new TableTheme(materialDesignTheme, materialDesignTheme);\n\nconst builtin: { [key: string]: TableTheme } = {\n DEFAULT,\n SIMPLIFY,\n ARCO,\n DARK,\n BRIGHT\n};\n// let defTheme = DEFAULT;\nexport const theme = { TableTheme };\nexport function of(value: ITableThemeDefine | string | undefined | null): TableTheme | null {\n if (!value) {\n return null;\n }\n if (typeof value === 'string') {\n const t = getIgnoreCase(get(), value);\n if (t) {\n if (t instanceof TableTheme) {\n return t;\n }\n return new TableTheme(t, t);\n }\n return null;\n }\n if (value instanceof TableTheme) {\n return value;\n }\n return new TableTheme(value, value);\n}\n\nexport function get(): { [key: string]: TableTheme } {\n return extend(builtin, plugins);\n}\nexport { ITableThemeDefine };\nexport default {\n DARK,\n BRIGHT,\n ARCO,\n DEFAULT,\n SIMPLIFY,\n theme,\n of,\n get\n};\n"]}
@@ -0,0 +1,8 @@
1
+ export declare class LimitPromiseQueue {
2
+ max: number;
3
+ _count: number;
4
+ _pendingTaskQueue: Function[];
5
+ constructor(max: number);
6
+ call(caller: any, ...arg: any[]): Promise<unknown>;
7
+ _createTask(caller: Function, arg: any[], resolve: any, reject: any): () => void;
8
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.LimitPromiseQueue = void 0;
6
+
7
+ class LimitPromiseQueue {
8
+ constructor(max) {
9
+ this.max = max, this._count = 0, this._pendingTaskQueue = [];
10
+ }
11
+ call(caller, ...arg) {
12
+ return new Promise(((resolve, reject) => {
13
+ const task = this._createTask(caller, arg, resolve, reject);
14
+ this._count >= this.max ? this._pendingTaskQueue.push(task) : task();
15
+ }));
16
+ }
17
+ _createTask(caller, arg, resolve, reject) {
18
+ return () => {
19
+ this._count++, caller(...arg).then(resolve).catch(reject).finally((() => {
20
+ if (console.log("finally"), this._count--, this._pendingTaskQueue.length) {
21
+ this._pendingTaskQueue.shift()();
22
+ }
23
+ }));
24
+ };
25
+ }
26
+ }
27
+
28
+ exports.LimitPromiseQueue = LimitPromiseQueue;
29
+ //# sourceMappingURL=LimitPromiseQueue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tools/LimitPromiseQueue.ts"],"names":[],"mappings":";;;AAAA,MAAa,iBAAiB;IAI5B,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAC9B,CAAC;IAOD,IAAI,CAAC,MAAW,EAAE,GAAG,GAAU;QAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAC5D,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;gBAC3B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACnC;iBAAM;gBACL,IAAI,EAAE,CAAC;aACR;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAWD,WAAW,CAAC,MAAgB,EAAE,GAAU,EAAE,OAAY,EAAE,MAAW;QACjE,OAAO,GAAG,EAAE;YAEV,IAAI,CAAC,MAAM,EAAE,CAAC;YAEd,MAAM,CAAC,GAAG,GAAG,CAAC;iBACX,IAAI,CAAC,OAAO,CAAC;iBACb,KAAK,CAAC,MAAM,CAAC;iBACb,OAAO,CAAC,GAAG,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBAEvB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE;oBACjC,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;oBAC5C,IAAI,EAAE,CAAC;iBACR;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;CACF;AAtDD,8CAsDC","file":"LimitPromiseQueue.js","sourcesContent":["export class LimitPromiseQueue {\n max: number;\n _count: number;\n _pendingTaskQueue: Function[];\n constructor(max: number) {\n this.max = max;\n this._count = 0;\n this._pendingTaskQueue = [];\n }\n /**\n * 调用器,将异步任务函数和它的参数传入\n * @param caller 异步任务函数,返回Promise的函数\n * @param args 异步任务函数的参数列表\n * @returns {Promise} 返回一个新的Promise\n */\n call(caller: any, ...arg: any[]) {\n return new Promise((resolve, reject) => {\n const task = this._createTask(caller, arg, resolve, reject);\n if (this._count >= this.max) {\n this._pendingTaskQueue.push(task);\n } else {\n task();\n }\n });\n }\n\n /**\n * 创建一个任务\n * @param caller 实际执行的函数\n * @param args 执行函数的参数\n * @param resolve\n * @param reject\n * @returns {Function} 返回一个任务函数\n * @private\n */\n _createTask(caller: Function, arg: any[], resolve: any, reject: any) {\n return () => {\n // 当前请求数量加一\n this._count++;\n // 实际上是在这里调用了异步任务,并将异步任务的返回(resolve和reject)抛给了上层\n caller(...arg)\n .then(resolve)\n .catch(reject)\n .finally(() => {\n console.log('finally');\n // 任务队列的消费区,利用Promise的finally方法,在异步任务结束后,取出下一个任务执行\n this._count--;\n if (this._pendingTaskQueue.length) {\n const task = this._pendingTaskQueue.shift();\n task();\n }\n });\n };\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ export declare class NumberMap<T> {
2
+ private _keys;
3
+ private _vals;
4
+ private _sorted;
5
+ count(): number;
6
+ values(): {
7
+ [key: number]: T;
8
+ };
9
+ valueArr(): T[];
10
+ adjustOrder(sourceIndex: number, targetIndex: number, moveCount: number): void;
11
+ put(key: number, value: T): void;
12
+ get(key: number): T | undefined;
13
+ has(key: number): boolean;
14
+ contain(value: T): boolean;
15
+ each(keyFrom: number, keyTo: number, fn: (t: T, k: number) => boolean | void): void;
16
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.NumberMap = void 0;
6
+
7
+ const util_1 = require("../tools/util"), indexFirst = (arr, elm) => {
8
+ let low = 0, high = arr.length - 1;
9
+ for (;low <= high; ) {
10
+ const i = Math.floor((low + high) / 2);
11
+ if (arr[i] === elm) return i;
12
+ arr[i] > elm ? high = i - 1 : low = i + 1;
13
+ }
14
+ return high < 0 ? 0 : high;
15
+ };
16
+
17
+ class NumberMap {
18
+ constructor() {
19
+ this._keys = [], this._vals = {}, this._sorted = !1;
20
+ }
21
+ count() {
22
+ return this._keys.length;
23
+ }
24
+ values() {
25
+ return this._vals;
26
+ }
27
+ valueArr() {
28
+ return Object.values(this._vals);
29
+ }
30
+ adjustOrder(sourceIndex, targetIndex, moveCount) {
31
+ const {_keys: keys} = this;
32
+ if (this._sorted || (keys.sort(((a, b) => a < b ? -1 : a > b ? 1 : 0)), this._sorted = !0),
33
+ sourceIndex > targetIndex) {
34
+ const sourceVals = [];
35
+ for (let i = indexFirst(keys, sourceIndex + moveCount - 1); i >= 0; i--) {
36
+ const key = keys[i];
37
+ if (key >= sourceIndex) sourceVals.push(this.get(key)); else if (targetIndex <= key && key < sourceIndex) this.put(key + moveCount, this.get(key)); else if (key < targetIndex) break;
38
+ }
39
+ for (let i = 0; i < moveCount; i++) this.put(targetIndex + i, sourceVals[moveCount - 1 - i]);
40
+ }
41
+ const {length: length} = keys;
42
+ if (sourceIndex < targetIndex) {
43
+ const sourceVals = [];
44
+ for (let i = indexFirst(keys, sourceIndex); i < length; i++) {
45
+ const key = keys[i];
46
+ if (key >= sourceIndex && key < sourceIndex + moveCount) sourceVals.push(this.get(key)); else if (sourceIndex + moveCount <= key && key <= targetIndex) this.put(key - moveCount, this.get(key)); else if (key > targetIndex) break;
47
+ }
48
+ for (let i = 0; i < moveCount; i++) this.put(targetIndex + i, sourceVals[i]);
49
+ }
50
+ }
51
+ put(key, value) {
52
+ key in this._vals || (this._keys.push(key), this._sorted = !1), this._vals[key] = value;
53
+ }
54
+ get(key) {
55
+ return this._vals[key];
56
+ }
57
+ has(key) {
58
+ return (0, util_1.isValid)(this._vals[key]);
59
+ }
60
+ contain(value) {
61
+ return Object.values(this._vals).indexOf(value) >= 0;
62
+ }
63
+ each(keyFrom, keyTo, fn) {
64
+ const {_keys: keys} = this, {length: length} = keys;
65
+ this._sorted || (keys.sort(((a, b) => a < b ? -1 : a > b ? 1 : 0)), this._sorted = !0);
66
+ for (let i = indexFirst(keys, keyFrom); i < length; i++) {
67
+ const key = keys[i];
68
+ if (keyFrom <= key && key <= keyTo) {
69
+ if (!1 === fn(this.get(key), key)) break;
70
+ } else if (keyTo < key) return;
71
+ }
72
+ }
73
+ }
74
+
75
+ exports.NumberMap = NumberMap;
76
+ //# sourceMappingURL=NumberMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tools/NumberMap.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAExC,MAAM,UAAU,GAAG,CAAC,GAAa,EAAE,GAAW,EAAU,EAAE;IACxD,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,OAAO,GAAG,IAAI,IAAI,EAAE;QAClB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACvC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAClB,OAAO,CAAC,CAAC;SACV;aAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE;YACvB,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;SACd;aAAM;YACL,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACb;KACF;IACD,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAa,SAAS;IAAtB;QACU,UAAK,GAAa,EAAE,CAAC;QACrB,UAAK,GAAyB,EAAE,CAAC;QACjC,YAAO,GAAG,KAAK,CAAC;IA4G1B,CAAC;IA3GC,KAAK;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,KAA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AAC,GAAG,CAAC,GAAG,CAAM,EAAE,GAAG,CAAC,CAAC;gBAC5C,IAAI,OAAO,KAAK,KAAK,EAAE;oBACrB,MAAM;iBACP;aACF;iBAAM,IAAI,KAAK,GAAG,GAAG,EAAE;gBACtB,OAAO;aACR;SACF;IACH,CAAC;CACF;AA/GD,8BA+GC","file":"NumberMap.js","sourcesContent":["import { isValid } from '../tools/util';\n\nconst indexFirst = (arr: number[], elm: number): number => {\n let low = 0;\n let high = arr.length - 1;\n while (low <= high) {\n const i = Math.floor((low + high) / 2);\n if (arr[i] === elm) {\n return i;\n } else if (arr[i] > elm) {\n high = i - 1;\n } else {\n low = i + 1;\n }\n }\n return high < 0 ? 0 : high;\n};\n\nexport class NumberMap<T> {\n private _keys: number[] = [];\n private _vals: { [key: number]: T } = {};\n private _sorted = false;\n count() {\n return this._keys.length;\n }\n values() {\n return this._vals;\n }\n valueArr() {\n return Object.values(this._vals);\n }\n /**\n * 将sourceIndex位置开始 往后moveCount个值 调整到targetIndex位置处\n * @param sourceIndex\n * @param targetIndex\n * @param moveCount\n */\n adjustOrder(sourceIndex: number, targetIndex: number, moveCount: number) {\n const { _keys: keys } = this;\n if (!this._sorted) {\n keys.sort((a, b) => {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n this._sorted = true;\n }\n if (sourceIndex > targetIndex) {\n const sourceVals = [];\n for (let i = indexFirst(keys, sourceIndex + moveCount - 1); i >= 0; i--) {\n const key = keys[i];\n if (key >= sourceIndex) {\n sourceVals.push(this.get(key));\n } else if (targetIndex <= key && key < sourceIndex) {\n this.put(key + moveCount, this.get(key));\n } else if (key < targetIndex) {\n break;\n }\n }\n for (let i = 0; i < moveCount; i++) {\n this.put(targetIndex + i, sourceVals[moveCount - 1 - i]);\n }\n }\n const { length } = keys;\n if (sourceIndex < targetIndex) {\n const sourceVals = [];\n for (let i = indexFirst(keys, sourceIndex); i < length; i++) {\n const key = keys[i];\n if (key >= sourceIndex && key < sourceIndex + moveCount) {\n sourceVals.push(this.get(key));\n } else if (sourceIndex + moveCount <= key && key <= targetIndex) {\n this.put(key - moveCount, this.get(key));\n } else if (key > targetIndex) {\n break;\n }\n }\n for (let i = 0; i < moveCount; i++) {\n this.put(targetIndex + i, sourceVals[i]);\n }\n }\n }\n put(key: number, value: T): void {\n if (!(key in this._vals)) {\n this._keys.push(key);\n this._sorted = false;\n }\n this._vals[key] = value;\n }\n get(key: number): T | undefined {\n return this._vals[key];\n }\n has(key: number): boolean {\n return isValid(this._vals[key]);\n }\n contain(value: T): boolean {\n return Object.values(this._vals).indexOf(value) >= 0;\n }\n each(keyFrom: number, keyTo: number, fn: (t: T, k: number) => boolean | void): void {\n const { _keys: keys } = this;\n const { length } = keys;\n if (!this._sorted) {\n keys.sort((a, b) => {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n this._sorted = true;\n }\n\n for (let i = indexFirst(keys, keyFrom); i < length; i++) {\n const key = keys[i];\n if (keyFrom <= key && key <= keyTo) {\n const callRes = fn(this.get(key) as T, key);\n if (callRes === false) {\n break;\n }\n } else if (keyTo < key) {\n return;\n }\n }\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { Bounds } from '@visactor/vutils';
2
+ import type { RectProps } from '../ts-types';
3
+ export declare class Rect implements RectProps {
4
+ bounds: Bounds;
5
+ constructor(left: number, top: number, width: number, height: number);
6
+ static bounds(left: number, top: number, right: number, bottom: number): Rect;
7
+ get left(): number;
8
+ set left(left: number);
9
+ get top(): number;
10
+ set top(top: number);
11
+ get right(): number;
12
+ set right(right: number);
13
+ get bottom(): number;
14
+ set bottom(bottom: number);
15
+ get width(): number;
16
+ set width(width: number);
17
+ get height(): number;
18
+ set height(height: number);
19
+ offsetLeft(offset: number): void;
20
+ offsetTop(offset: number): void;
21
+ copy(): Rect;
22
+ contains(another: Rect): boolean;
23
+ inPoint(x: number, y: number): boolean;
24
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.Rect = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils");
8
+
9
+ class Rect {
10
+ constructor(left, top, width, height) {
11
+ this.bounds = new vutils_1.Bounds, this.bounds.set(left, top, left + width, top + height);
12
+ }
13
+ static bounds(left, top, right, bottom) {
14
+ return new Rect(left, top, Math.round(right - left), Math.round(bottom - top));
15
+ }
16
+ get left() {
17
+ return this.bounds.x1;
18
+ }
19
+ set left(left) {
20
+ this.bounds.x1 = left;
21
+ }
22
+ get top() {
23
+ return this.bounds.y1;
24
+ }
25
+ set top(top) {
26
+ this.bounds.y1 = top;
27
+ }
28
+ get right() {
29
+ return this.bounds.x2;
30
+ }
31
+ set right(right) {
32
+ this.bounds.x2 = right;
33
+ }
34
+ get bottom() {
35
+ return this.bounds.y2;
36
+ }
37
+ set bottom(bottom) {
38
+ this.bounds.y2 = bottom;
39
+ }
40
+ get width() {
41
+ return this.bounds.width();
42
+ }
43
+ set width(width) {
44
+ this.bounds.x2 = this.bounds.x1 + width;
45
+ }
46
+ get height() {
47
+ return this.bounds.height();
48
+ }
49
+ set height(height) {
50
+ this.bounds.y2 = this.bounds.y1 + height;
51
+ }
52
+ offsetLeft(offset) {
53
+ this.bounds.translate(offset, 0);
54
+ }
55
+ offsetTop(offset) {
56
+ this.bounds.translate(0, offset);
57
+ }
58
+ copy() {
59
+ return new Rect(this.left, this.top, this.width, this.height);
60
+ }
61
+ contains(another) {
62
+ return this.bounds.encloses(another.bounds);
63
+ }
64
+ inPoint(x, y) {
65
+ return this.bounds.contains(x, y);
66
+ }
67
+ }
68
+
69
+ exports.Rect = Rect;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tools/Rect.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAG1C,MAAa,IAAI;IAEf,YAAY,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,MAAc;QAClE,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM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AAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC;IAC1C,CAAC;IACD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,CAAC,MAAc;QACvB,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,MAAc;QACvB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,SAAS,CAAC,MAAc;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,IAAI;QACF,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IACD,QAAQ,CAAC,OAAa;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,CAAC,CAAS,EAAE,CAAS;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;CACF;AA/DD,oBA+DC","file":"Rect.js","sourcesContent":["import { Bounds } from '@visactor/vutils';\nimport type { RectProps } from '../ts-types';\n\nexport class Rect implements RectProps {\n bounds: Bounds;\n constructor(left: number, top: number, width: number, height: number) {\n this.bounds = new Bounds();\n this.bounds.set(left, top, left + width, top + height);\n }\n\n static bounds(left: number, top: number, right: number, bottom: number): Rect {\n return new Rect(left, top, Math.round(right - left), Math.round(bottom - top));\n }\n\n get left(): number {\n return this.bounds.x1;\n }\n set left(left: number) {\n this.bounds.x1 = left;\n }\n get top(): number {\n return this.bounds.y1;\n }\n set top(top: number) {\n this.bounds.y1 = top;\n }\n get right(): number {\n return this.bounds.x2;\n }\n set right(right: number) {\n this.bounds.x2 = right;\n }\n get bottom(): number {\n return this.bounds.y2;\n }\n set bottom(bottom: number) {\n this.bounds.y2 = bottom;\n }\n get width(): number {\n return this.bounds.width();\n }\n set width(width: number) {\n this.bounds.x2 = this.bounds.x1 + width;\n }\n get height(): number {\n return this.bounds.height();\n }\n set height(height: number) {\n this.bounds.y2 = this.bounds.y1 + height;\n }\n\n offsetLeft(offset: number): void {\n this.bounds.translate(offset, 0);\n }\n offsetTop(offset: number): void {\n this.bounds.translate(0, offset);\n }\n copy(): Rect {\n return new Rect(this.left, this.top, this.width, this.height);\n }\n contains(another: Rect): boolean {\n return this.bounds.encloses(another.bounds);\n }\n inPoint(x: number, y: number): boolean {\n return this.bounds.contains(x, y);\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ type CalcContext = {
2
+ full: number;
3
+ };
4
+ export declare function toPx(value: string | number, context: CalcContext): number;
5
+ export {};
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.toPx = void 0;
6
+
7
+ const helper_1 = require("./helper"), TYPE_PAREN = 0, TYPE_UNIT = 1, TYPE_OPERATOR = 2, TYPE_NUMBER = 3, NODE_TYPE_UNIT = 10, NODE_TYPE_BINARY_EXPRESSION = 11, NODE_TYPE_NUMBER = 12, TABULATION = 9, CARRIAGE_RETURN = 13, LINE_FEED = 10, FORM_FEED = 12, SPACE = 32, PERCENT = 37, FULL_STOP = 46, DIGIT_0 = 48, DIGIT_9 = 57, LATIN_CAPITAL_A = 65, LATIN_CAPITAL_Z = 90, LATIN_SMALL_A = 97, LATIN_SMALL_Z = 122;
8
+
9
+ function isUpperLetter(cp) {
10
+ return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_Z;
11
+ }
12
+
13
+ function isLowerLetter(cp) {
14
+ return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_Z;
15
+ }
16
+
17
+ function isLetter(cp) {
18
+ return isLowerLetter(cp) || isUpperLetter(cp);
19
+ }
20
+
21
+ function isWhitespace(cp) {
22
+ return cp === TABULATION || cp === LINE_FEED || cp === FORM_FEED || cp === CARRIAGE_RETURN || cp === SPACE;
23
+ }
24
+
25
+ function isDigit(cp) {
26
+ return cp >= DIGIT_0 && cp <= DIGIT_9;
27
+ }
28
+
29
+ function isDot(cp) {
30
+ return cp === FULL_STOP;
31
+ }
32
+
33
+ function isUnit(cp) {
34
+ return isLetter(cp) || cp === PERCENT;
35
+ }
36
+
37
+ function createError(calc) {
38
+ return new Error(`calc parse error: ${calc}`);
39
+ }
40
+
41
+ function tokenize(calc) {
42
+ const exp = calc.replace(/calc\(/g, "(").trim(), tokens = [], len = exp.length;
43
+ for (let index = 0; index < len; index++) {
44
+ const c = exp[index], cp = c.charCodeAt(0);
45
+ if ("(" === c || ")" === c) tokens.push({
46
+ value: c,
47
+ type: TYPE_PAREN
48
+ }); else if ("*" === c || "/" === c) tokens.push({
49
+ value: c,
50
+ type: TYPE_OPERATOR
51
+ }); else if ("+" === c || "-" === c) index = parseSign(c, index + 1) - 1; else if (isDigit(cp) || isDot(cp)) index = parseNum(c, index + 1) - 1; else if (!isWhitespace(cp)) throw createError(calc);
52
+ }
53
+ function parseSign(sign, start) {
54
+ if (start < len) {
55
+ const c = exp[start], cp = c.charCodeAt(0);
56
+ if (isDigit(cp) || isDot(cp)) return parseNum(sign + c, start + 1);
57
+ }
58
+ return tokens.push({
59
+ value: sign,
60
+ type: TYPE_OPERATOR
61
+ }), start;
62
+ }
63
+ function parseNum(num, start) {
64
+ let index = start;
65
+ for (;index < len; index++) {
66
+ const c = exp[index], cp = c.charCodeAt(0);
67
+ if (isDigit(cp)) num += c; else {
68
+ if ("." !== c) {
69
+ if (isUnit(cp)) return parseUnit(num, c, index + 1);
70
+ break;
71
+ }
72
+ if (num.indexOf(".") >= 0) throw createError(calc);
73
+ num += c;
74
+ }
75
+ }
76
+ if ("." === num) throw createError(calc);
77
+ return tokens.push({
78
+ value: parseFloat(num),
79
+ type: TYPE_NUMBER
80
+ }), index;
81
+ }
82
+ function parseUnit(num, unit, start) {
83
+ let index = start;
84
+ for (;index < len; index++) {
85
+ const c = exp[index];
86
+ if (!isUnit(c.charCodeAt(0))) break;
87
+ unit += c;
88
+ }
89
+ return tokens.push({
90
+ value: parseFloat(num),
91
+ unit: unit,
92
+ type: TYPE_UNIT
93
+ }), index;
94
+ }
95
+ return tokens;
96
+ }
97
+
98
+ const PRECEDENCE = {
99
+ "*": 3,
100
+ "/": 3,
101
+ "+": 2,
102
+ "-": 2
103
+ };
104
+
105
+ function lex(tokens, calc) {
106
+ function buildBinaryExpNode(stack) {
107
+ const right = stack.pop(), op = stack.pop(), left = stack.pop();
108
+ if (!(left && left.nodeType && op && op.type === TYPE_OPERATOR && right && right.nodeType)) throw createError(calc);
109
+ return {
110
+ nodeType: NODE_TYPE_BINARY_EXPRESSION,
111
+ left: left,
112
+ op: op,
113
+ right: right
114
+ };
115
+ }
116
+ const stack = [];
117
+ for (;tokens.length; ) {
118
+ const token = tokens.shift();
119
+ if (token.type === TYPE_PAREN && "(" === token.value) {
120
+ let deep = 0;
121
+ const closeIndex = helper_1.array.findIndex(tokens, (t => {
122
+ if (t.type === TYPE_PAREN && "(" === t.value) deep++; else if (t.type === TYPE_PAREN && ")" === t.value) {
123
+ if (!deep) return !0;
124
+ deep--;
125
+ }
126
+ return !1;
127
+ }));
128
+ if (-1 === closeIndex) throw createError(calc);
129
+ stack.push(lex(tokens.splice(0, closeIndex), calc)), tokens.shift();
130
+ } else if (token.type === TYPE_OPERATOR) {
131
+ if (stack.length >= 3) {
132
+ const beforeOp = stack[stack.length - 2].value;
133
+ PRECEDENCE[token.value] <= PRECEDENCE[beforeOp] && stack.push(buildBinaryExpNode(stack));
134
+ }
135
+ stack.push(token);
136
+ } else if (token.type === TYPE_UNIT) {
137
+ const {value: num, unit: unit} = token;
138
+ stack.push({
139
+ nodeType: NODE_TYPE_UNIT,
140
+ value: num,
141
+ unit: unit
142
+ });
143
+ } else token.type === TYPE_NUMBER && stack.push({
144
+ nodeType: NODE_TYPE_NUMBER,
145
+ value: token.value
146
+ });
147
+ }
148
+ for (;stack.length > 1; ) stack.push(buildBinaryExpNode(stack));
149
+ return stack[0];
150
+ }
151
+
152
+ function parse(calcStr) {
153
+ return lex(tokenize(calcStr), calcStr);
154
+ }
155
+
156
+ function calcNode(node, context) {
157
+ if (node.nodeType === NODE_TYPE_BINARY_EXPRESSION) {
158
+ const left = calcNode(node.left, context), right = calcNode(node.right, context);
159
+ switch (node.op.value) {
160
+ case "+":
161
+ return left + right;
162
+
163
+ case "-":
164
+ return left - right;
165
+
166
+ case "*":
167
+ return left * right;
168
+
169
+ case "/":
170
+ return left / right;
171
+
172
+ default:
173
+ throw new Error(`calc error. unknown operator: ${node.op.value}`);
174
+ }
175
+ } else if (node.nodeType === NODE_TYPE_UNIT) switch (node.unit) {
176
+ case "%":
177
+ return node.value * context.full / 100;
178
+
179
+ case "px":
180
+ return node.value;
181
+
182
+ default:
183
+ throw new Error(`calc error. unknown unit: ${node.unit}`);
184
+ } else if (node.nodeType === NODE_TYPE_NUMBER) return node.value;
185
+ throw new Error("calc error.");
186
+ }
187
+
188
+ function toPxInternal(value, context) {
189
+ return calcNode(parse(value), context);
190
+ }
191
+
192
+ function toPx(value, context) {
193
+ return "string" == typeof value ? toPxInternal(value.trim(), context) : value - 0;
194
+ }
195
+
196
+ exports.toPx = toPx;
197
+ //# sourceMappingURL=calc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tools/calc.ts"],"names":[],"mappings":";;;AAMA,qCAAiC;AAEjC,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;A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CAAC,CAAC;AAChC,CAAC;AAOD,SAAgB,IAAI,CAAC,KAAsB,EAAE,OAAoB;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;KAC5C;IACD,OAAO,KAAK,GAAG,CAAC,CAAC;AACnB,CAAC;AALD,oBAKC","file":"calc.js","sourcesContent":["/* Adapted from cheetah-grid by yosuke ota\n *url:https://github.com/future-architect/cheetah-grid/blob/master/packages/cheetah-grid/src/js/internal/calc.ts\n *License: https://github.com/future-architect/cheetah-grid/blob/master/LICENSE\n * @license\n */\n\nimport { array } from './helper';\n\nconst TYPE_PAREN = 0;\nconst TYPE_UNIT = 1;\nconst TYPE_OPERATOR = 2;\nconst TYPE_NUMBER = 3;\n\nconst NODE_TYPE_UNIT = 10;\nconst NODE_TYPE_BINARY_EXPRESSION = 11;\nconst NODE_TYPE_NUMBER = 12;\n\ntype Ops = '-' | '+' | '*' | '/';\ntype ParenToken = {\n value: '(' | ')';\n type: typeof TYPE_PAREN;\n};\ntype UnitToken = {\n unit: string;\n value: number;\n type: typeof TYPE_UNIT;\n};\ntype OpToken = {\n value: Ops;\n type: typeof TYPE_OPERATOR;\n};\ntype NumToken = {\n value: number;\n type: typeof TYPE_NUMBER;\n};\ntype Token = ParenToken | UnitToken | OpToken | NumToken;\ntype UnitNode = {\n nodeType: typeof NODE_TYPE_UNIT;\n unit: string;\n value: number;\n};\ntype BinaryNode = {\n nodeType: typeof NODE_TYPE_BINARY_EXPRESSION;\n left: Node;\n op: OpToken;\n right: Node;\n};\ntype NumNode = {\n nodeType: typeof NODE_TYPE_NUMBER;\n value: number;\n};\ntype Node = UnitNode | BinaryNode | NumNode;\n\nconst TABULATION = 0x09;\nconst CARRIAGE_RETURN = 0x0d;\nconst LINE_FEED = 0x0a;\nconst FORM_FEED = 0x0c;\nconst SPACE = 0x20;\nconst PERCENT = 0x25;\nconst FULL_STOP = 0x2e;\nconst DIGIT_0 = 0x30;\nconst DIGIT_9 = 0x39;\nconst LATIN_CAPITAL_A = 0x41;\nconst LATIN_CAPITAL_Z = 0x5a;\nconst LATIN_SMALL_A = 0x61;\nconst LATIN_SMALL_Z = 0x7a;\nfunction isUpperLetter(cp: number): boolean {\n return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_Z;\n}\nfunction isLowerLetter(cp: number): boolean {\n return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_Z;\n}\nfunction isLetter(cp: number): boolean {\n return isLowerLetter(cp) || isUpperLetter(cp);\n}\nfunction isWhitespace(cp: number): boolean {\n return cp === TABULATION || cp === LINE_FEED || cp === FORM_FEED || cp === CARRIAGE_RETURN || cp === SPACE;\n}\nfunction isDigit(cp: number): boolean {\n return cp >= DIGIT_0 && cp <= DIGIT_9;\n}\nfunction isDot(cp: number): boolean {\n return cp === FULL_STOP;\n}\nfunction isUnit(cp: number): boolean {\n return isLetter(cp) || cp === PERCENT;\n}\n\nfunction createError(calc: string): Error {\n return new Error(`calc parse error: ${calc}`);\n}\n\n/**\n * tokenize\n * @param {string} calc calc expression\n * @returns {Array} tokens\n * @private\n */\nfunction tokenize(calc: string): Token[] {\n const exp = calc.replace(/calc\\(/g, '(').trim();\n\n const tokens: Token[] = [];\n const len = exp.length;\n for (let index = 0; index < len; index++) {\n const c = exp[index];\n const cp = c.charCodeAt(0);\n if (c === '(' || c === ')') {\n tokens.push({ value: c, type: TYPE_PAREN });\n } else if (c === '*' || c === '/') {\n tokens.push({ value: c, type: TYPE_OPERATOR });\n } else if (c === '+' || c === '-') {\n index = parseSign(c, index + 1) - 1;\n } else if (isDigit(cp) || isDot(cp)) {\n index = parseNum(c, index + 1) - 1;\n } else if (isWhitespace(cp)) {\n // skip\n } else {\n throw createError(calc);\n }\n }\n\n function parseSign(sign: '+' | '-', start: number): number {\n if (start < len) {\n const c = exp[start];\n const cp = c.charCodeAt(0);\n if (isDigit(cp) || isDot(cp)) {\n return parseNum(sign + c, start + 1);\n }\n }\n tokens.push({ value: sign, type: TYPE_OPERATOR });\n return start;\n }\n function parseNum(num: string, start: number): number {\n let index = start;\n for (; index < len; index++) {\n const c = exp[index];\n const cp = c.charCodeAt(0);\n if (isDigit(cp)) {\n num += c;\n } else if (c === '.') {\n if (num.indexOf('.') >= 0) {\n throw createError(calc);\n }\n num += c;\n } else if (isUnit(cp)) {\n return parseUnit(num, c, index + 1);\n } else {\n break;\n }\n }\n if (num === '.') {\n throw createError(calc);\n }\n tokens.push({ value: parseFloat(num), type: TYPE_NUMBER });\n return index;\n }\n function parseUnit(num: string, unit: string, start: number): number {\n let index = start;\n for (; index < len; index++) {\n const c = exp[index];\n const cp = c.charCodeAt(0);\n if (isUnit(cp)) {\n unit += c;\n } else {\n break;\n }\n }\n tokens.push({ value: parseFloat(num), unit, type: TYPE_UNIT });\n return index;\n }\n return tokens;\n}\n\nconst PRECEDENCE = {\n '*': 3,\n '/': 3,\n '+': 2,\n '-': 2\n};\n\nfunction lex(tokens: Token[], calc: string): Node {\n function buildBinaryExpNode(stack: (Node | OpToken)[]): BinaryNode {\n const right = stack.pop() as Node;\n const op = stack.pop() as OpToken;\n const left = stack.pop() as Node;\n\n if (!left || !left.nodeType || !op || op.type !== TYPE_OPERATOR || !right || !right.nodeType) {\n throw createError(calc);\n }\n return {\n nodeType: NODE_TYPE_BINARY_EXPRESSION,\n left,\n op,\n right\n };\n }\n\n const stack: (Node | OpToken)[] = [];\n\n while (tokens.length) {\n const token = tokens.shift() as Token;\n if (token.type === TYPE_PAREN && token.value === '(') {\n let deep = 0;\n const closeIndex = array.findIndex(tokens, t => {\n if (t.type === TYPE_PAREN && t.value === '(') {\n deep++;\n } else if (t.type === TYPE_PAREN && t.value === ')') {\n if (!deep) {\n return true;\n }\n deep--;\n }\n return false;\n });\n if (closeIndex === -1) {\n throw createError(calc);\n }\n\n stack.push(lex(tokens.splice(0, closeIndex), calc));\n tokens.shift();\n } else if (token.type === TYPE_OPERATOR) {\n if (stack.length >= 3) {\n const beforeOp = (stack[stack.length - 2] as OpToken).value;\n if (PRECEDENCE[token.value] <= PRECEDENCE[beforeOp]) {\n stack.push(buildBinaryExpNode(stack));\n }\n }\n stack.push(token);\n } else if (token.type === TYPE_UNIT) {\n const { value: num, unit } = token;\n stack.push({\n nodeType: NODE_TYPE_UNIT,\n value: num,\n unit\n });\n } else if (token.type === TYPE_NUMBER) {\n stack.push({\n nodeType: NODE_TYPE_NUMBER,\n value: token.value\n });\n }\n }\n while (stack.length > 1) {\n stack.push(buildBinaryExpNode(stack));\n }\n return stack[0] as Node;\n}\n\nfunction parse(calcStr: string): Node {\n const tokens = tokenize(calcStr);\n return lex(tokens, calcStr);\n}\n\nfunction calcNode(node: Node, context: CalcContext): number {\n if (node.nodeType === NODE_TYPE_BINARY_EXPRESSION) {\n const left = calcNode(node.left, context);\n const right = calcNode(node.right, context);\n\n switch (node.op.value) {\n case '+':\n return left + right;\n case '-':\n return left - right;\n case '*':\n return left * right;\n case '/':\n return left / right;\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`calc error. unknown operator: ${node.op.value}`);\n }\n } else if (node.nodeType === NODE_TYPE_UNIT) {\n switch (node.unit) {\n case '%':\n return (node.value * context.full) / 100;\n // case 'em':\n // return node.value * context.em;\n case 'px':\n return node.value;\n default:\n throw new Error(`calc error. unknown unit: ${node.unit}`);\n }\n } else if (node.nodeType === NODE_TYPE_NUMBER) {\n return node.value;\n }\n throw new Error('calc error.');\n}\n\nfunction toPxInternal(value: string, context: CalcContext): number {\n const ast = parse(value);\n return calcNode(ast, context);\n}\n\ntype CalcContext = {\n full: number;\n // em: number;\n};\n\nexport function toPx(value: string | number, context: CalcContext): number {\n if (typeof value === 'string') {\n return toPxInternal(value.trim(), context);\n }\n return value - 0;\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function debounce(func: Function, wait?: number, options?: any): (this: any, ...args: any) => any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.debounce = void 0;
6
+
7
+ const isx_1 = require("./isx");
8
+
9
+ function debounce(func, wait, options) {
10
+ let lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, maxing = !1, leading = !1, trailing = !0;
11
+ const useRAF = !wait && 0 !== wait && "function" == typeof requestAnimationFrame;
12
+ if ("function" != typeof func) throw new TypeError("Expected a function");
13
+ function invokeFunc(time) {
14
+ const args = lastArgs, thisArg = lastThis;
15
+ return lastThis = void 0, lastArgs = void 0, lastInvokeTime = time, result = func.apply(thisArg, args),
16
+ result;
17
+ }
18
+ function startTimer(pendingFunc, wait) {
19
+ return useRAF ? requestAnimationFrame(pendingFunc) : setTimeout(pendingFunc, wait);
20
+ }
21
+ function shouldInvoke(time) {
22
+ const timeSinceLastCall = time - lastCallTime;
23
+ return void 0 === lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && time - lastInvokeTime >= maxWait;
24
+ }
25
+ function timerExpired() {
26
+ const time = Date.now();
27
+ if (shouldInvoke(time)) return function(time) {
28
+ return timerId = void 0, trailing && lastArgs ? invokeFunc(time) : (lastThis = void 0,
29
+ lastArgs = void 0, result);
30
+ }(time);
31
+ timerId = startTimer(timerExpired, function(time) {
32
+ const timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait && -(time - lastCallTime);
33
+ return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
34
+ }(time));
35
+ }
36
+ return wait = +wait || 0, (0, isx_1.isObject)(options) && (leading = !!options.leading,
37
+ maxing = "maxWait" in options, maxing && (maxWait = Math.max(+options.maxWait || 0, wait)),
38
+ trailing = "trailing" in options ? !!options.trailing : trailing), function(...args) {
39
+ const time = Date.now(), isInvoking = shouldInvoke(time);
40
+ if (lastArgs = args, lastThis = this, lastCallTime = time, isInvoking) {
41
+ if (void 0 === timerId) return function(time) {
42
+ return lastInvokeTime = time, timerId = startTimer(timerExpired, wait), leading ? invokeFunc(time) : result;
43
+ }(lastCallTime);
44
+ if (maxing) return timerId = startTimer(timerExpired, wait), invokeFunc(lastCallTime);
45
+ }
46
+ return void 0 === timerId && (timerId = startTimer(timerExpired, wait)), result;
47
+ };
48
+ }
49
+
50
+ exports.debounce = debounce;
51
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tools/debounce.ts"],"names":[],"mappings":";;;AAAA,+BAAiC;AAEjC,SAAgB,QAAQ,CAAC,IAAc,EAAE,IAAa,EAAE,OAAa;IACnE,IAAI,QAAa,CAAC;IAClB,IAAI,QAAa,CAAC;IAClB,IAAI,OAAe,CAAC;IACpB,IAAI,MAAW,CAAC;IAChB,IAAI,OAA2B,CAAC;IAChC,IAAI,YAAoB,CAAC;IAGzB,IAAI,cAAc,GAAG,CAAC,CAAC;IAEvB,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,IAAI,QAAQ,GAAG,IAAI,CAAC;IAEpB,MAAM,MAAM,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,OAAO,qBAAqB,KAAK,UAAU,CAAC;IAElF,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC9B,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IAED,IAAI,GAAG,CAAE,IAAe,IAAI,CAAC,CAAC;IAE9B,IAAI,IAAA,cAAQ,EAAC,OAAO,CAAC,EAAE;QACrB,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAE5B,MAAM,GAAG,SAAS,IAAI,OAAO,CAAC;QAC9B,IAAI,MAAM,EAAE;YACV,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;SACjD;QAED,QAAQ,GAAG,UAAU,IAAI,OAAO,CAAC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O,GAAG,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;SAC1C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AA7JD,4BA6JC","file":"debounce.js","sourcesContent":["import { isObject } from './isx';\n\nexport function debounce(func: Function, wait?: number, options?: any) {\n let lastArgs: any;\n let lastThis: any;\n let maxWait: number; // 最长等待时间\n let result: any; // 存储 func 函数的返回值\n let timerId: number | undefined; // 定时器 id\n let lastCallTime: number; // 最近一次 执行 debounced 函数时的时间\n\n // 最近一次执行 func 时的时间戳\n let lastInvokeTime = 0;\n // options 是否 传入了 maxWait\n let maxing = false;\n // 是否在延迟开始前调用函数\n let leading = false;\n // 是否在延迟结束后调用函数\n let trailing = true;\n\n const useRAF = !wait && wait !== 0 && typeof requestAnimationFrame === 'function';\n\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n\n wait = +(wait as number) || 0;\n\n if (isObject(options)) {\n leading = !!options.leading;\n\n maxing = 'maxWait' in options;\n if (maxing) {\n maxWait = Math.max(+options.maxWait || 0, wait);\n }\n\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time: number) {\n const args = lastArgs;\n const thisArg = lastThis;\n\n lastThis = undefined;\n lastArgs = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n // 开启定时器\n function startTimer(pendingFunc: any, wait: number) {\n if (useRAF) {\n return requestAnimationFrame(pendingFunc);\n }\n return setTimeout(pendingFunc, wait);\n }\n\n // 清除定时器\n // function cancelTimer(id: number) {\n // if (useRAF) {\n // return cancelAnimationFrame(id);\n // }\n // clearTimeout(id);\n // }\n\n // 在延迟开始前调用\n function leadingEdge(time: number) {\n // 记录 函数被调用时 的时间戳\n lastInvokeTime = time;\n //@ts-ignore\n timerId = startTimer(timerExpired, wait);\n return leading ? invokeFunc(time) : result;\n }\n\n // 在延迟结束后调用\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // lastArgs 在 debounced 函数执行时赋值\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n\n // 重置参数和作用域\n lastThis = undefined;\n lastArgs = undefined;\n return result;\n }\n\n function remainingWait(time: number) {\n // 计算 time 与最近一次调用 debounced 函数的时间差\n const timeSinceLastCall = time - lastCallTime;\n // 计算 time 与最近一次调用 func 函数的时间差\n const timeSinceLastInvoke = time - lastInvokeTime;\n // 用 wait 减去已经等待的时间\n const timeWaiting = wait && -timeSinceLastCall;\n\n return maxing ? Math.min(timeWaiting as number, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n\n // 是否可以执行函数\n function shouldInvoke(time: number) {\n // 计算 time 与最近一次调用 debounced 函数的时间差\n const timeSinceLastCall = time - lastCallTime;\n // 计算 time 与最近一次调用 func 函数的时间差\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n return (\n // 是不是第一次执行 debouned 函数\n lastCallTime === undefined ||\n timeSinceLastCall >= (wait as number) ||\n timeSinceLastCall < 0 ||\n (maxing && timeSinceLastInvoke >= maxWait)\n );\n }\n\n // 封装执行函数,用于 wait 延迟结束后执行\n function timerExpired() {\n const time = Date.now();\n // 根据时间来判断是否可以执行 func 函数\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // 重新计算时间,重新建一个定时器\n // @ts-ignore\n timerId = startTimer(timerExpired, remainingWait(time));\n }\n\n function debounced(this: any, ...args: any) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n // 第一次执行时\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // @ts-ignore\n timerId = startTimer(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n\n // 因为 trailingEdge 函数内部会执行 timerId = undefined\n // trailingEdge 函数执行之后,又触发了 debounced\n if (timerId === undefined) {\n // @ts-ignore\n timerId = startTimer(timerExpired, wait);\n }\n\n return result;\n }\n\n return debounced;\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function createElement(tagName: string, classNames?: string[]): HTMLElement;